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 TypeMethodDescriptionvoid
cancel()
Attempts to cancel the scanner.char[]
Returns a list of additional (compiler specific) suffixes which can be placed on numbers.int
Returns the current nesting in code branches.org.eclipse.cdt.internal.core.parser.scanner.ILocationResolver
Returns the location resolver associated with this scanner.Returns a map fromString
toIMacroBinding
containing all the definitions that are defined at the current point in the process of scanning.boolean
Returnstrue
, whenever we are processing the outermost file of the translation unit.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 kindIToken.tSHIFTR
into two tokens of kindIToken.tGT_in_SHIFTR
.void
setTrackIncludeExport
(IncludeExportPatterns patterns) Turns on/off tracking if exported included files.void
When 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 fromString
toIMacroBinding
containing 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.tSHIFTR
into 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_START
and 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.
-