Package org.eclipse.cdt.core.parser
Interface IScanner
public interface IScanner
Interface between the parser and the preprocessor.
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Attempts to cancel the scanner.char[]Returns a list of additional (compiler specific) suffixes which can be placed on numbers.intReturns the current nesting in code branches.org.eclipse.cdt.internal.core.parser.scanner.ILocationResolverReturns the location resolver associated with this scanner.Returns a map fromStringtoIMacroBindingcontaining all the definitions that are defined at the current point in the process of scanning.booleanReturnstrue, whenever we are processing the outermost file of the translation unit.Returns next token for the parser.voidsetComputeImageLocations(boolean val) Turns on/off creation of image locations.voidsetContentAssistMode(int offset) Puts the scanner into content assist mode.voidsetProcessInactiveCode(boolean val) Toggles generation of tokens for inactive code branches.default voidsetScanComments(boolean val) Deprecated.Has no effect.voidsetSplitShiftROperator(boolean val) Instructs the scanner to split tokens of kindIToken.tSHIFTRinto two tokens of kindIToken.tGT_in_SHIFTR.voidsetTrackIncludeExport(IncludeExportPatterns patterns) Turns on/off tracking if exported included files.voidWhen in inactive code, skips all tokens up to the end of the inactive code section.
-
Method Details
-
getMacroDefinitions
Map<String,IMacroBinding> getMacroDefinitions()Returns a map fromStringtoIMacroBindingcontaining all the definitions that are defined at the current point in the process of scanning. -
nextToken
Returns next token for the parser. String literals are concatenated.- Throws:
EndOfFileException- when the end of the translation unit has been reached.OffsetLimitReachedException- seeLexer.
-
isOnTopContext
boolean isOnTopContext()Returnstrue, whenever we are processing the outermost file of the translation unit. -
cancel
void cancel()Attempts to cancel the scanner. -
getLocationResolver
org.eclipse.cdt.internal.core.parser.scanner.ILocationResolver getLocationResolver()Returns the location resolver associated with this scanner.- Restriction:
- This method is not intended to be referenced by clients.
-
setContentAssistMode
void setContentAssistMode(int offset) Puts the scanner into content assist mode.- Restriction:
- This method is not intended to be referenced by clients.
-
setSplitShiftROperator
void setSplitShiftROperator(boolean val) Instructs the scanner to split tokens of kindIToken.tSHIFTRinto two tokens of kindIToken.tGT_in_SHIFTR.- Restriction:
- This method is not intended to be referenced by clients.
-
setComputeImageLocations
void setComputeImageLocations(boolean val) Turns on/off creation of image locations.- Since:
- 5.0
- See Also:
- Restriction:
- This method is not intended to be referenced by clients.
-
setTrackIncludeExport
Turns on/off tracking if exported included files.- Parameters:
patterns- if notnull, include export tracking is enabled, otherwise it is disabled- Since:
- 5.5
- See Also:
- Restriction:
- This method is not intended to be referenced by clients.
-
setProcessInactiveCode
void setProcessInactiveCode(boolean val) Toggles generation of tokens for inactive code branches. When turned on, each inactive code branch is preceded by a token of kindIToken.tINACTIVE_CODE_STARTand succeeded by one of kindIToken.tINACTIVE_CODE_END.- Restriction:
- This method is not intended to be referenced by clients.
-
skipInactiveCode
When in inactive code, skips all tokens up to the end of the inactive code section.Note, token after calling this method may be another token of type
IToken.tINACTIVE_CODE_START.- Throws:
OffsetLimitReachedException- Restriction:
- This method is not intended to be referenced by clients.
-
getCodeBranchNesting
int getCodeBranchNesting()Returns the current nesting in code branches.- See Also:
- Restriction:
- This method is not intended to be referenced by clients.
-
getAdditionalNumericLiteralSuffixes
char[] getAdditionalNumericLiteralSuffixes()Returns a list of additional (compiler specific) suffixes which can be placed on numbers. e.g. 'u' 'l' -> 1l or 1u.- Restriction:
- This method is not intended to be referenced by clients.
-
setScanComments
Deprecated.Has no effect.- Restriction:
- This method is not intended to be referenced by clients.
-