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