cpptools.preprocessor
Class PreProcessor

java.lang.Object
  extended by cppast.ParserTokenManager
      extended by cpptools.preprocessor.PreProcessor
All Implemented Interfaces:
ParserConstants, TokenProvider

public final class PreProcessor
extends ParserTokenManager
implements TokenProvider

Adapts the two token management systems.

Author:
Mathieu Champlon

Field Summary
 
Fields inherited from class cppast.ParserTokenManager
curChar, debugStream, input_stream, jjstrLiteralImages, lexStateNames
 
Fields inherited from interface cppast.ParserConstants
_CHAR, _DEFAULT, AMPERSAND, AND, ARROWSTAR, ASSIGNEQUAL, AUTO, BITWISEANDEQUAL, BITWISEOR, BITWISEOREQUAL, BITWISEXOR, BITWISEXOREQUAL, BOOL, BREAK, C_STYLE_COMMENT, CASE, CATCH, CHAR, CHARACTER, CLASS, COLON, COMMA, CONST, CONTINUE, CPP_STYLE_COMMENT, DECIMALINT, DECIMALLONG, DEFAULT, DELETE, DIVIDE, DIVIDEEQUAL, DO, DOT, DOTSTAR, DOUBLE, ELLIPSIS, ELSE, ENUM, EOF, EQUAL, EXPLICIT, EXTERN, FALSETOK, FLOAT, FLOATONE, FLOATTWO, FOR, FRIEND, GOTO, GREATERTHAN, GREATERTHANOREQUALTO, HEXADECIMALINT, HEXADECIMALLONG, ID, IF, INLINE, INT, LCURLYBRACE, LESSTHAN, LESSTHANOREQUALTO, LONG, LPARENTHESIS, LSQUAREBRACKET, MINUS, MINUSEQUAL, MINUSMINUS, MOD, MODEQUAL, MUTABLE, NAMESPACE, NEW, NOT, NOTEQUAL, OCTALINT, OCTALLONG, OPERATOR, OR, PLUS, PLUSEQUAL, PLUSPLUS, POINTERTO, PREPROCESSOR, PRIVATE, PROTECTED, PUBLIC, QUESTIONMARK, RCURLYBRACE, REDECLARED, REGISTER, RETURN, RPARENTHESIS, RSQUAREBRACKET, SCOPE, SEMICOLON, SHIFTLEFT, SHIFTLEFTEQUAL, SHIFTRIGHT, SHIFTRIGHTEQUAL, SHORT, SIGNED, SIZEOF, STAR, STATIC, STRING, STRUCT, SWITCH, TEMPLATE, THIS, THROW, TILDE, TIMESEQUAL, tokenImage, TRUETOK, TRY, TYPEDEF, TYPEID, TYPENAME, UNION, UNSIGNED, UNSIGNED_DECIMALINT, UNSIGNED_DECIMALLONG, UNSIGNED_HEXADECIMALINT, UNSIGNED_HEXADECIMALLONG, UNSIGNED_OCTALINT, UNSIGNED_OCTALLONG, USING, VIRTUAL, VOID, VOLATILE, WCHAR_T, WHILE
 
Constructor Summary
PreProcessor()
          Create an adapter.
 
Method Summary
 void addDefine(java.lang.String name, java.lang.String value)
          Add a define.
 void addMacro(java.lang.String name, java.lang.String value)
          Add a macro.
 Token getNextToken()
          
 Token next()
          Retrieve the next available token.
 void reset(java.io.Reader reader)
          Set a new input.
 
Methods inherited from class cppast.ParserTokenManager
jjFillToken, ReInit, ReInit, setDebugStream, SwitchTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreProcessor

public PreProcessor()
Create an adapter.

Method Detail

reset

public void reset(java.io.Reader reader)
Set a new input.

Parameters:
reader - the input reader

next

public Token next()
Retrieve the next available token.

Specified by:
next in interface TokenProvider
Returns:
the next token

getNextToken

public Token getNextToken()

Overrides:
getNextToken in class ParserTokenManager

addDefine

public void addDefine(java.lang.String name,
                      java.lang.String value)
Add a define.

Parameters:
name - the name of the symbol
value - the value of the symbol

addMacro

public void addMacro(java.lang.String name,
                     java.lang.String value)
Add a macro.

Parameters:
name - the name of the symbol
value - the value of the symbol


Copyright © 2006-2007 null. All Rights Reserved.