com.sonar.sslr.api
Class LexerOutput

java.lang.Object
  extended by com.sonar.sslr.api.LexerOutput

public class LexerOutput
extends Object


Constructor Summary
LexerOutput(List<Token> tokens)
           
LexerOutput(Preprocessor... preprocessors)
           
 
Method Summary
 void addAllTokens(List<Token> allNewtokens)
          Add a list of tokens to the list without notifying preprocessors.
 void addCommentToken(Token token)
           
 void addPreprocessingToken(Token token)
           
 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
 Token get(int i)
           
 Comments getComments()
           
 Map<Integer,Token> getCommentTokens()
           
 File getFile()
           
 String getFileAbsolutePath()
           
 String getFileName()
           
 Token getFirstToken()
           
 Token getLastToken()
           
 List<Token> getPreprocessingTokens()
           
 List<Token> getTokens()
           
 void pushBackTokenAndProcess(Token token, Preprocessor 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, Preprocessor 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LexerOutput

public LexerOutput(Preprocessor... preprocessors)

LexerOutput

public LexerOutput(List<Token> tokens)
Method Detail

getTokens

public List<Token> getTokens()

getPreprocessingTokens

public List<Token> getPreprocessingTokens()

getLastToken

public Token getLastToken()

getFirstToken

public Token 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 -

pushBackTokenAndProcess

public void pushBackTokenAndProcess(Token token,
                                    Preprocessor 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. With this method all other preprocessors will be notified to optionnally consumed this token.


pushBackTokensAndProcess

public void pushBackTokensAndProcess(List<Token> tokens,
                                     Preprocessor 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. With this method all other preprocessors will be notified to optionally consumed those tokens.


addPreprocessingToken

public void addPreprocessingToken(Token token)

addToken

public void addToken(Token token)
Add a token to the list without notifying preprocessors.

Parameters:
token -

addAllTokens

public void addAllTokens(List<Token> allNewtokens)
Add a list of tokens to the list without notifying preprocessors.

Parameters:
token -

setFile

public void setFile(File file)

getFile

public File getFile()

getFileName

public String getFileName()

getFileAbsolutePath

public String getFileAbsolutePath()

size

public int size()

getComments

public Comments getComments()

addCommentToken

public void addCommentToken(Token token)

getCommentTokens

public Map<Integer,Token> getCommentTokens()

get

public Token get(int i)

toString

public String toString()
Overrides:
toString in class Object

setTokens

public void setTokens(List<Token> tokens)


Copyright © 2011 SonarSource. All Rights Reserved.