public interface IScanner
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Attempts to cancel the scanner.
|
char[] |
getAdditionalNumericLiteralSuffixes()
Returns a list of additional (compiler specific) suffixes which can
be placed on numbers.
|
int |
getCodeBranchNesting()
Returns the current nesting in code branches.
|
org.eclipse.cdt.internal.core.parser.scanner.ILocationResolver |
getLocationResolver()
Returns the location resolver associated with this scanner.
|
Map<String,IMacroBinding> |
getMacroDefinitions()
Returns a map from
String to IMacroBinding containing
all the definitions that are defined at the current point in the
process of scanning. |
boolean |
isOnTopContext()
Returns
true , whenever we are processing the outermost file of the translation unit. |
IToken |
nextToken()
Returns next token for the parser.
|
void |
setComputeImageLocations(boolean val)
Turns on/off creation of image locations.
|
void |
setContentAssistMode(int offset)
Puts the scanner into content assist mode.
|
void |
setProcessInactiveCode(boolean val)
Toggles generation of tokens for inactive code branches.
|
default void |
setScanComments(boolean val)
Deprecated.
Has no effect.
|
void |
setSplitShiftROperator(boolean val)
Instructs the scanner to split tokens of kind
IToken.tSHIFTR into two tokens of
kind IToken.tGT_in_SHIFTR . |
void |
setTrackIncludeExport(IncludeExportPatterns patterns)
Turns on/off tracking if exported included files.
|
void |
skipInactiveCode()
When in inactive code, skips all tokens up to the end of the inactive code section.
|
Map<String,IMacroBinding> getMacroDefinitions()
String
to IMacroBinding
containing
all the definitions that are defined at the current point in the
process of scanning.IToken nextToken() throws EndOfFileException
EndOfFileException
- when the end of the translation unit has been reached.OffsetLimitReachedException
- see Lexer
.boolean isOnTopContext()
true
, whenever we are processing the outermost file of the translation unit.void cancel()
org.eclipse.cdt.internal.core.parser.scanner.ILocationResolver getLocationResolver()
void setContentAssistMode(int offset)
void setSplitShiftROperator(boolean val)
IToken.tSHIFTR
into two tokens of
kind IToken.tGT_in_SHIFTR
.void setComputeImageLocations(boolean val)
IASTName.getImageLocation()
void setTrackIncludeExport(IncludeExportPatterns patterns)
patterns
- if not null
, include export tracking is enabled, otherwise it is disabledIASTPreprocessorIncludeStatement.isIncludedFileExported()
,
IncludeExportPatterns
void setProcessInactiveCode(boolean val)
IToken.tINACTIVE_CODE_START
and
succeeded by one of kind IToken.tINACTIVE_CODE_END
.void skipInactiveCode() throws OffsetLimitReachedException
Note, token after calling this method may be another token of type
IToken.tINACTIVE_CODE_START
.
OffsetLimitReachedException
int getCodeBranchNesting()
IInactiveCodeToken.getOldNesting()
,
IInactiveCodeToken.getNewNesting()
char[] getAdditionalNumericLiteralSuffixes()
@Deprecated default void setScanComments(boolean val)
Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.