Package com.javacc.preprocessor
Class PreprocessorParser
- java.lang.Object
-
- com.javacc.preprocessor.PreprocessorParser
-
- All Implemented Interfaces:
PreprocessorConstants
public class PreprocessorParser extends Object implements PreprocessorConstants
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.javacc.preprocessor.PreprocessorConstants
PreprocessorConstants.LexicalState, PreprocessorConstants.TokenType
-
-
Field Summary
Fields Modifier and Type Field Description PreprocessorLexertoken_sourceGenerated Lexer.-
Fields inherited from interface com.javacc.preprocessor.PreprocessorConstants
BUF_SIZE
-
-
Constructor Summary
Constructors Constructor Description PreprocessorParser(PreprocessorLexer lexer)Constructor with user supplied Lexer.PreprocessorParser(InputStream stream)PreprocessorParser(Reader reader)PreprocessorParser(CharSequence content)PreprocessorParser(CharSequence content, Map<String,String> definedSymbols)PreprocessorParser(String inputSource, CharSequence content)PreprocessorParser(String inputSource, Path path)PreprocessorParser(Path path)PreprocessorParser(Path path, Map<String,String> definedSymbols, boolean csharpMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSymbols(Map<String,String> symbols)voidcancel()BitSetgetLineMarkers()TokengetNextToken()TokengetToken(int index)booleanisCancelled()booleanisParserTolerant()booleanisTreeBuildingEnabled()com.javacc.preprocessor.PreprocessorParser.ExpressionPP_AndExpression()voidPP_Block()voidPP_Content()voidPP_DefStatement()com.javacc.preprocessor.PreprocessorParser.ExpressionPP_Expression()voidPP_IfBlock()com.javacc.preprocessor.PreprocessorParser.ExpressionPP_NotExpression()com.javacc.preprocessor.PreprocessorParser.ExpressionPP_OrExpression()com.javacc.preprocessor.PreprocessorParser.ExpressionPP_Parentheses()com.javacc.preprocessor.PreprocessorParser.ExpressionPP_PrimaryExpression()BitSetPP_Root()voidPP_UndefStatement()voidsetInputSource(String inputSource)voidsetParserTolerant(boolean tolerantParsing)voidsetSymbol(String symbol, String value)voidunsetSymbol(String symbol)
-
-
-
Field Detail
-
token_source
public PreprocessorLexer token_source
Generated Lexer.
-
-
Constructor Detail
-
PreprocessorParser
public PreprocessorParser(Path path, Map<String,String> definedSymbols, boolean csharpMode) throws IOException
- Throws:
IOException
-
PreprocessorParser
public PreprocessorParser(CharSequence content, Map<String,String> definedSymbols) throws IOException
- Throws:
IOException
-
PreprocessorParser
public PreprocessorParser(String inputSource, CharSequence content)
-
PreprocessorParser
public PreprocessorParser(CharSequence content)
-
PreprocessorParser
public PreprocessorParser(String inputSource, Path path) throws IOException
- Parameters:
inputSource- just the name of the input source (typically the filename) that will be used in error messages and so on.path- The location (typically the filename) from which to get the input to parse- Throws:
IOException
-
PreprocessorParser
public PreprocessorParser(Path path) throws IOException
- Parameters:
path- The location (typically the filename) from which to get the input to parse- Throws:
IOException
-
PreprocessorParser
public PreprocessorParser(InputStream stream)
-
PreprocessorParser
public PreprocessorParser(Reader reader)
-
PreprocessorParser
public PreprocessorParser(PreprocessorLexer lexer)
Constructor with user supplied Lexer.
-
-
Method Detail
-
getLineMarkers
public BitSet getLineMarkers()
-
unsetSymbol
public void unsetSymbol(String symbol)
-
cancel
public void cancel()
-
isCancelled
public boolean isCancelled()
-
setInputSource
public void setInputSource(String inputSource)
-
getNextToken
public final Token getNextToken()
- Returns:
- the next Token off the stream. This is the same as #getToken(1)
-
getToken
public final Token getToken(int index)
- Parameters:
index- how many tokens to look ahead- Returns:
- the specific regular (i.e. parsed) Token index ahead/behind in the stream. If we are in a lookahead, it looks ahead from the currentLookaheadToken Otherwise, it is the lastConsumedToken. If you pass in a negative number it goes backward.
-
PP_Root
public final BitSet PP_Root() throws ParseException
- Throws:
ParseException
-
PP_Block
public final void PP_Block() throws ParseException- Throws:
ParseException
-
PP_Content
public final void PP_Content() throws ParseException- Throws:
ParseException
-
PP_IfBlock
public final void PP_IfBlock() throws ParseException- Throws:
ParseException
-
PP_DefStatement
public final void PP_DefStatement() throws ParseException- Throws:
ParseException
-
PP_UndefStatement
public final void PP_UndefStatement() throws ParseException- Throws:
ParseException
-
PP_Expression
public final com.javacc.preprocessor.PreprocessorParser.Expression PP_Expression() throws ParseException- Throws:
ParseException
-
PP_OrExpression
public final com.javacc.preprocessor.PreprocessorParser.Expression PP_OrExpression() throws ParseException- Throws:
ParseException
-
PP_AndExpression
public final com.javacc.preprocessor.PreprocessorParser.Expression PP_AndExpression() throws ParseException- Throws:
ParseException
-
PP_NotExpression
public final com.javacc.preprocessor.PreprocessorParser.Expression PP_NotExpression() throws ParseException- Throws:
ParseException
-
PP_Parentheses
public final com.javacc.preprocessor.PreprocessorParser.Expression PP_Parentheses() throws ParseException- Throws:
ParseException
-
PP_PrimaryExpression
public final com.javacc.preprocessor.PreprocessorParser.Expression PP_PrimaryExpression() throws ParseException- Throws:
ParseException
-
isParserTolerant
public boolean isParserTolerant()
-
setParserTolerant
public void setParserTolerant(boolean tolerantParsing)
-
isTreeBuildingEnabled
public boolean isTreeBuildingEnabled()
-
-