Package com.sonar.sslr.api
Class LexerOutput
java.lang.Object
com.sonar.sslr.api.LexerOutput
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllTokens(List<Token> allNewtokens) Add a list of tokens to the list without notifying preprocessors.voidAdd a token to the list without notifying preprocessors.voidaddTokenAndProcess(TokenType tokenType, String value, int linePosition, int columnPosition) Add a new token and notify the preprocessorsvoidaddTokenAndProcess(TokenType tokenType, String value, String originalValue, int linePosition, int columnPosition) Add a new token and notify the preprocessorsvoidget(int i) getComments(CommentAnalyser commentAnalyser) getFile()voidpushBackTokenAndProcess(Token token, Preprocessor2 preprocessorToExclude) This method must be called by a preprocessor when a token has been temporary consumed by this preprocessor but finally must be pushed back to the LexerOutput.voidpushBackTokensAndProcess(List<Token> tokens, Preprocessor2 preprocessorToExclude) This method must be called by a preprocessor when some tokens have been temporary consumed by this preprocessor but finally must be pushed back to the LexerOutput.voidremoveLastTokens(int numberOfTokensToRemove) voidvoidintsize()toString()
-
Constructor Details
-
LexerOutput
-
LexerOutput
-
-
Method Details
-
getTokens
-
getLastToken
-
getFirstToken
-
removeLastTokens
public void removeLastTokens(int numberOfTokensToRemove) -
addTokenAndProcess
public void addTokenAndProcess(TokenType tokenType, String value, int linePosition, int columnPosition) Add a new token and notify the preprocessors- Parameters:
tokenType-value-linePosition-columnPosition-
-
addTokenAndProcess
public void addTokenAndProcess(TokenType tokenType, String value, String originalValue, int linePosition, int columnPosition) Add a new token and notify the preprocessors- Parameters:
tokenType-value-originalValue-linePosition-columnPosition-
-
pushBackTokenAndProcess
This method must be called by a preprocessor when a token has been temporary consumed by this preprocessor but finally must be pushed back to the LexerOutput. With this method all other preprocessors will be notified to optionally consumed this token. -
pushBackTokensAndProcess
This method must be called by a preprocessor when some tokens have been temporary consumed by this preprocessor but finally must be pushed back to the LexerOutput. With this method all other preprocessors will be notified to optionally consumed those tokens. -
addTrivia
-
addToken
Add a token to the list without notifying preprocessors.- Parameters:
token-
-
addAllTokens
Add a list of tokens to the list without notifying preprocessors.- Parameters:
token-
-
setFile
-
getFile
-
getFileName
-
getFileAbsolutePath
-
size
public int size() -
getComments
-
getComments
-
getCommentTokens
-
get
-
toString
-
setTokens
-