public class LexerOutput extends Object
Constructor and Description |
---|
LexerOutput(List<Token> tokens) |
LexerOutput(Preprocessor2... preprocessors) |
Modifier and Type | Method and Description |
---|---|
void |
addAllTokens(List<Token> allNewtokens)
Add a list of tokens to the list without notifying preprocessors.
|
void |
addToken(Token token)
Add a token to the list without notifying preprocessors.
|
void |
addTokenAndProcess(TokenType tokenType,
String value,
int linePosition,
int columnPosition)
Add a new token and notify the preprocessors
|
void |
addTokenAndProcess(TokenType tokenType,
String value,
String originalValue,
int linePosition,
int columnPosition)
Add a new token and notify the preprocessors
|
void |
addTrivia(Trivia trivia) |
Token |
get(int i) |
Comments |
getComments() |
Comments |
getComments(CommentAnalyser commentAnalyser) |
Collection<Token> |
getCommentTokens() |
File |
getFile() |
String |
getFileAbsolutePath() |
String |
getFileName() |
Token |
getFirstToken() |
Token |
getLastToken() |
List<Token> |
getTokens() |
void |
pushBackTokenAndProcess(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.
|
void |
pushBackTokensAndProcess(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.
|
void |
removeLastTokens(int numberOfTokensToRemove) |
void |
setFile(File file) |
void |
setTokens(List<Token> tokens) |
int |
size() |
String |
toString() |
public LexerOutput(Preprocessor2... preprocessors)
public Token getLastToken()
public Token getFirstToken()
public void removeLastTokens(int numberOfTokensToRemove)
public void addTokenAndProcess(TokenType tokenType, String value, int linePosition, int columnPosition)
tokenType
- value
- linePosition
- columnPosition
- public void addTokenAndProcess(TokenType tokenType, String value, String originalValue, int linePosition, int columnPosition)
tokenType
- value
- originalValue
- linePosition
- columnPosition
- public void pushBackTokenAndProcess(Token token, Preprocessor2 preprocessorToExclude)
public void pushBackTokensAndProcess(List<Token> tokens, Preprocessor2 preprocessorToExclude)
public void addTrivia(Trivia trivia)
public void addToken(Token token)
token
- public void addAllTokens(List<Token> allNewtokens)
token
- public void setFile(File file)
public File getFile()
public String getFileName()
public String getFileAbsolutePath()
public int size()
public Comments getComments()
public Comments getComments(CommentAnalyser commentAnalyser)
public Collection<Token> getCommentTokens()
public Token get(int i)
Copyright © 2009–2017 SonarSource. All rights reserved.