Package org.javacc.parser
Class JavaCCParser
- java.lang.Object
-
- org.javacc.parser.JavaCCGlobals
-
- org.javacc.parser.JavaCCParserInternals
-
- org.javacc.parser.JavaCCParser
-
- All Implemented Interfaces:
JavaCCParserConstants
public class JavaCCParser extends JavaCCParserInternals implements JavaCCParserConstants
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JavaCCParser.ModifierSet
Class to hold modifiers.
-
Field Summary
Fields Modifier and Type Field Description Token
jj_nt
Next token.Token
token
Current token.JavaCCParserTokenManager
token_source
Generated Token Manager.-
Fields inherited from class org.javacc.parser.JavaCCGlobals
bnfproductions, ccol, cline, cu_from_insertion_point_2, cu_name, cu_to_insertion_point_1, cu_to_insertion_point_2, fileName, jj2index, jjtreeGenerated, lexstate_I2S, lexstate_S2I, lookaheadNeeded, maskindex, maskVals, named_tokens_table, names_of_tokens, ordered_named_tokens, origFileName, otherLanguageDeclTokenBeg, otherLanguageDeclTokenEnd, production_table, rexprlist, rexps_of_tokens, simple_tokens_table, token_mgr_decls, tokenCount, toolName, toolNames
-
Fields inherited from interface org.javacc.parser.JavaCCParserConstants
_CPPCODE, _DCL_PARSER_BEGIN, _DCL_PARSER_END, _DEF_PARSER_BEGIN, _DEF_PARSER_END, _DEFAULT, _EOF, _IGNORE_CASE, _INC_PARSER_BEGIN, _INC_PARSER_END, _JAVACODE, _LOOKAHEAD, _MORE, _PARSER_BEGIN, _PARSER_END, _SKIP, _SPECIAL_TOKEN, _TOKEN, _TOKEN_MGR_DECLS, ABSTRACT, ACT_TOK, AFTER_EGEN, ANDASSIGN, ASSERT, ASSIGN, BANG, BIT_AND, BIT_OR, BOOLEAN, BREAK, BYTE, CASE, CATCH, CHAR, CHARACTER_LITERAL, CLASS, COLON, COMMA, CONST, CONTINUE, DECIMAL_EXPONENT, DECIMAL_FLOATING_POINT_LITERAL, DECIMAL_LITERAL, DECR, DEFAULT, DO, DOT, DOUBLE, DOUBLECOLON, ELSE, ENUM, EOF, EQ, EXTENDS, FALSE, FINAL, FINALLY, FLOAT, FLOATING_POINT_LITERAL, FOR, FORMAL_COMMENT, GE, GOTO, GT, HEX_LITERAL, HEXADECIMAL_EXPONENT, HEXADECIMAL_FLOATING_POINT_LITERAL, HOOK, IDENTIFIER, IF, IMPLEMENTS, IMPORT, IN_FORMAL_COMMENT, IN_MULTI_LINE_COMMENT, IN_SINGLE_LINE_COMMENT, INCR, INSTANCEOF, INT, INTEGER_LITERAL, INTERFACE, LANGLE, LBRACE, LBRACKET, LE, LETTER, LONG, LPAREN, LT, MINUS, MINUSASSIGN, MULTI_LINE_COMMENT, NATIVE, NE, NEW, NULL, OCTAL_LITERAL, ORASSIGN, PACKAGE, PART_LETTER, PLUS, PLUSASSIGN, PRIVATE, PROTECTED, PUBLIC, RANGLE, RBRACE, RBRACKET, REM, REMASSIGN, RETURN, RPAREN, RSIGNEDSHIFT, RUNSIGNEDSHIFT, SC_AND, SC_OR, SEMICOLON, SHORT, SINGLE_LINE_COMMENT, SLASH, SLASHASSIGN, STAR, STARASSIGN, STATIC, STRICTFP, STRING_LITERAL, SUPER, SWITCH, SYNCHRONIZED, TEMPLATE, THIS, THROW, THROWS, TILDE, tokenImage, TRANSIENT, TRUE, TRY, TYPENAME, VOID, VOLATILE, WHILE, XOR, XORASSIGN
-
-
Constructor Summary
Constructors Constructor Description JavaCCParser(java.io.InputStream stream)
Constructor with InputStream.JavaCCParser(java.io.InputStream stream, java.lang.String encoding)
Constructor with InputStream and supplied encodingJavaCCParser(java.io.Reader stream)
Constructor.JavaCCParser(JavaCCParserTokenManager tm)
Constructor with generated Token Manager.
-
Method Summary
-
Methods inherited from class org.javacc.parser.JavaCCParserInternals
add_inline_regexpr, add_token_manager_decls, addcuname, addproduction, addregexpr, character_descriptor_assign, character_descriptor_assign, compare, hexchar, hexval, initialize, insertionpointerrors, makeTryBlock, production_addexpansion, reInit, remove_escapes_and_quotes, set_initial_cu_token, setinsertionpoint
-
Methods inherited from class org.javacc.parser.JavaCCGlobals
add_escapes, addUnicodeEscapes, bannerLine, createOutputDir, getIdString, getIdString, getToolNames, isGeneratedBy, printLeadingComments, printLeadingComments, printToken, printToken, printTokenList, printTokenOnly, printTokenOnly, printTokenSetup, printTrailingComments, printTrailingComments, staticOpt
-
-
-
-
Field Detail
-
token_source
public JavaCCParserTokenManager token_source
Generated Token Manager.
-
token
public Token token
Current token.
-
jj_nt
public Token jj_nt
Next token.
-
-
Constructor Detail
-
JavaCCParser
public JavaCCParser(java.io.InputStream stream)
Constructor with InputStream.
-
JavaCCParser
public JavaCCParser(java.io.InputStream stream, java.lang.String encoding)
Constructor with InputStream and supplied encoding
-
JavaCCParser
public JavaCCParser(java.io.Reader stream)
Constructor.
-
JavaCCParser
public JavaCCParser(JavaCCParserTokenManager tm)
Constructor with generated Token Manager.
-
-
Method Detail
-
isJavaLanguage
protected static boolean isJavaLanguage()
-
isCppLanguage
protected static boolean isCppLanguage()
-
javacc_input
public final void javacc_input() throws ParseException
THE JAVACC GRAMMAR SPECIFICATION STARTS HERE *- Throws:
ParseException
-
javacc_options
public final void javacc_options() throws ParseException
- Throws:
ParseException
-
option_binding
public final void option_binding() throws ParseException
- Throws:
ParseException
-
StringList
public final java.util.List<java.lang.String> StringList() throws ParseException
- Throws:
ParseException
-
production
public final void production() throws ParseException
- Throws:
ParseException
-
javacode_production
public final void javacode_production() throws ParseException
- Throws:
ParseException
-
cppcode_production
public final void cppcode_production() throws ParseException
- Throws:
ParseException
-
bnf_production
public final void bnf_production() throws ParseException
- Throws:
ParseException
-
AccessModifier
public final void AccessModifier(NormalProduction p) throws ParseException
- Throws:
ParseException
-
regular_expr_production
public final void regular_expr_production() throws ParseException
- Throws:
ParseException
-
token_manager_decls
public final void token_manager_decls() throws ParseException
- Throws:
ParseException
-
regexpr_kind
public final void regexpr_kind(TokenProduction p) throws ParseException
- Throws:
ParseException
-
regexpr_spec
public final void regexpr_spec(TokenProduction p) throws ParseException
- Throws:
ParseException
-
expansion_choices
public final void expansion_choices(Container c1) throws ParseException
- Throws:
ParseException
-
expansion
public final void expansion(Container c1) throws ParseException
- Throws:
ParseException
-
local_lookahead
public final Lookahead local_lookahead() throws ParseException
- Throws:
ParseException
-
expansion_unit
public final void expansion_unit(Container c) throws ParseException
- Throws:
ParseException
-
regular_expression
public final void regular_expression(Container c) throws ParseException
- Throws:
ParseException
-
complex_regular_expression_choices
public final void complex_regular_expression_choices(Container c1) throws ParseException
- Throws:
ParseException
-
complex_regular_expression
public final void complex_regular_expression(Container c1) throws ParseException
- Throws:
ParseException
-
complex_regular_expression_unit
public final void complex_regular_expression_unit(Container c) throws ParseException
- Throws:
ParseException
-
character_list
public final void character_list(Container c1) throws ParseException
- Throws:
ParseException
-
character_descriptor
public final void character_descriptor(Container c) throws ParseException
- Throws:
ParseException
-
identifier
public final java.lang.String identifier() throws ParseException
- Throws:
ParseException
-
JavaIdentifier
public final Token JavaIdentifier() throws ParseException
THE JAVA GRAMMAR SPECIFICATION STARTS HERE *- Throws:
ParseException
-
CompilationUnit
public final void CompilationUnit() throws ParseException
- Throws:
ParseException
-
PackageDeclaration
public final void PackageDeclaration() throws ParseException
- Throws:
ParseException
-
ImportDeclaration
public final void ImportDeclaration() throws ParseException
- Throws:
ParseException
-
Modifiers
public final int Modifiers() throws ParseException
- Throws:
ParseException
-
TypeDeclaration
public final void TypeDeclaration() throws ParseException
- Throws:
ParseException
-
ClassOrInterfaceDeclaration
public final void ClassOrInterfaceDeclaration(int modifiers, java.util.List tokens) throws ParseException
- Throws:
ParseException
-
ExtendsList
public final void ExtendsList(boolean isInterface) throws ParseException
- Throws:
ParseException
-
ImplementsList
public final void ImplementsList(boolean isInterface) throws ParseException
- Throws:
ParseException
-
EnumDeclaration
public final void EnumDeclaration(int modifiers) throws ParseException
- Throws:
ParseException
-
EnumBody
public final void EnumBody() throws ParseException
- Throws:
ParseException
-
EnumConstant
public final void EnumConstant() throws ParseException
- Throws:
ParseException
-
TypeParameters
public final void TypeParameters() throws ParseException
- Throws:
ParseException
-
TypeParameter
public final void TypeParameter() throws ParseException
- Throws:
ParseException
-
TypeBound
public final void TypeBound() throws ParseException
- Throws:
ParseException
-
ClassOrInterfaceBody
public final void ClassOrInterfaceBody(boolean isInterface, java.util.List tokens) throws ParseException
- Throws:
ParseException
-
ClassOrInterfaceBodyDeclaration
public final void ClassOrInterfaceBodyDeclaration(boolean isInterface) throws ParseException
- Throws:
ParseException
-
FieldDeclaration
public final void FieldDeclaration(int modifiers) throws ParseException
- Throws:
ParseException
-
VariableDeclarator
public final void VariableDeclarator() throws ParseException
- Throws:
ParseException
-
VariableDeclaratorId
public final void VariableDeclaratorId() throws ParseException
- Throws:
ParseException
-
VariableInitializer
public final void VariableInitializer() throws ParseException
- Throws:
ParseException
-
ArrayInitializer
public final void ArrayInitializer() throws ParseException
- Throws:
ParseException
-
MethodDeclaration
public final void MethodDeclaration(int modifiers) throws ParseException
- Throws:
ParseException
-
MethodDeclarator
public final void MethodDeclarator() throws ParseException
- Throws:
ParseException
-
FormalParameters
public final void FormalParameters(java.util.List tokens) throws ParseException
- Throws:
ParseException
-
FormalParameter
public final void FormalParameter() throws ParseException
- Throws:
ParseException
-
ConstructorDeclaration
public final void ConstructorDeclaration() throws ParseException
- Throws:
ParseException
-
ExplicitConstructorInvocation
public final void ExplicitConstructorInvocation() throws ParseException
- Throws:
ParseException
-
Initializer
public final void Initializer() throws ParseException
- Throws:
ParseException
-
Type
public final void Type() throws ParseException
- Throws:
ParseException
-
ReferenceType
public final void ReferenceType() throws ParseException
- Throws:
ParseException
-
Template
public final void Template() throws ParseException
- Throws:
ParseException
-
TemplateBase
public final void TemplateBase() throws ParseException
- Throws:
ParseException
-
TemplatePack
public final void TemplatePack() throws ParseException
- Throws:
ParseException
-
ClassOrInterfaceType
public final void ClassOrInterfaceType() throws ParseException
- Throws:
ParseException
-
TypeArguments
public final void TypeArguments(java.util.List tokens) throws ParseException
- Throws:
ParseException
-
TypeArgument
public final void TypeArgument() throws ParseException
- Throws:
ParseException
-
WildcardBounds
public final void WildcardBounds() throws ParseException
- Throws:
ParseException
-
PrimitiveType
public final void PrimitiveType() throws ParseException
- Throws:
ParseException
-
ResultType
public final void ResultType(java.util.List tokens) throws ParseException
- Throws:
ParseException
-
Name
public final void Name(java.util.List tokens) throws ParseException
- Throws:
ParseException
-
NameList
public final void NameList() throws ParseException
- Throws:
ParseException
-
Expression
public final void Expression(java.util.List tokens) throws ParseException
- Throws:
ParseException
-
AssignmentOperator
public final void AssignmentOperator() throws ParseException
- Throws:
ParseException
-
ConditionalExpression
public final void ConditionalExpression() throws ParseException
- Throws:
ParseException
-
ConditionalOrExpression
public final void ConditionalOrExpression() throws ParseException
- Throws:
ParseException
-
ConditionalAndExpression
public final void ConditionalAndExpression() throws ParseException
- Throws:
ParseException
-
InclusiveOrExpression
public final void InclusiveOrExpression() throws ParseException
- Throws:
ParseException
-
ExclusiveOrExpression
public final void ExclusiveOrExpression() throws ParseException
- Throws:
ParseException
-
AndExpression
public final void AndExpression() throws ParseException
- Throws:
ParseException
-
EqualityExpression
public final void EqualityExpression() throws ParseException
- Throws:
ParseException
-
InstanceOfExpression
public final void InstanceOfExpression() throws ParseException
- Throws:
ParseException
-
RelationalExpression
public final void RelationalExpression() throws ParseException
- Throws:
ParseException
-
ShiftExpression
public final void ShiftExpression() throws ParseException
- Throws:
ParseException
-
AdditiveExpression
public final void AdditiveExpression() throws ParseException
- Throws:
ParseException
-
MultiplicativeExpression
public final void MultiplicativeExpression() throws ParseException
- Throws:
ParseException
-
UnaryExpression
public final void UnaryExpression() throws ParseException
- Throws:
ParseException
-
PreIncrementExpression
public final void PreIncrementExpression() throws ParseException
- Throws:
ParseException
-
PreDecrementExpression
public final void PreDecrementExpression() throws ParseException
- Throws:
ParseException
-
UnaryExpressionNotPlusMinus
public final void UnaryExpressionNotPlusMinus() throws ParseException
- Throws:
ParseException
-
CastLookahead
public final void CastLookahead() throws ParseException
- Throws:
ParseException
-
PostfixExpression
public final void PostfixExpression() throws ParseException
- Throws:
ParseException
-
CastExpression
public final void CastExpression() throws ParseException
- Throws:
ParseException
-
PrimaryExpression
public final void PrimaryExpression() throws ParseException
- Throws:
ParseException
-
MemberSelector
public final void MemberSelector() throws ParseException
- Throws:
ParseException
-
PrimaryPrefix
public final void PrimaryPrefix() throws ParseException
- Throws:
ParseException
-
PrimarySuffix
public final void PrimarySuffix() throws ParseException
- Throws:
ParseException
-
Literal
public final void Literal() throws ParseException
- Throws:
ParseException
-
IntegerLiteral
public final int IntegerLiteral() throws ParseException
- Throws:
ParseException
-
BooleanLiteral
public final boolean BooleanLiteral() throws ParseException
- Throws:
ParseException
-
StringLiteral
public final java.lang.String StringLiteral() throws ParseException
- Throws:
ParseException
-
NullLiteral
public final void NullLiteral() throws ParseException
- Throws:
ParseException
-
Arguments
public final void Arguments(java.util.List tokens) throws ParseException
- Throws:
ParseException
-
ArgumentList
public final void ArgumentList() throws ParseException
- Throws:
ParseException
-
AllocationExpression
public final void AllocationExpression() throws ParseException
- Throws:
ParseException
-
ArrayDimsAndInits
public final void ArrayDimsAndInits() throws ParseException
- Throws:
ParseException
-
Statement
public final void Statement() throws ParseException
- Throws:
ParseException
-
AssertStatement
public final void AssertStatement() throws ParseException
- Throws:
ParseException
-
LabeledStatement
public final void LabeledStatement() throws ParseException
- Throws:
ParseException
-
Block
public final void Block(java.util.List tokens) throws ParseException
- Throws:
ParseException
-
BlockStatement
public final void BlockStatement() throws ParseException
- Throws:
ParseException
-
LocalVariableDeclaration
public final void LocalVariableDeclaration() throws ParseException
- Throws:
ParseException
-
EmptyStatement
public final void EmptyStatement() throws ParseException
- Throws:
ParseException
-
StatementExpression
public final void StatementExpression() throws ParseException
- Throws:
ParseException
-
SwitchStatement
public final void SwitchStatement() throws ParseException
- Throws:
ParseException
-
SwitchLabel
public final void SwitchLabel() throws ParseException
- Throws:
ParseException
-
IfStatement
public final void IfStatement() throws ParseException
- Throws:
ParseException
-
WhileStatement
public final void WhileStatement() throws ParseException
- Throws:
ParseException
-
DoStatement
public final void DoStatement() throws ParseException
- Throws:
ParseException
-
ForStatement
public final void ForStatement() throws ParseException
- Throws:
ParseException
-
ForInit
public final void ForInit() throws ParseException
- Throws:
ParseException
-
StatementExpressionList
public final void StatementExpressionList() throws ParseException
- Throws:
ParseException
-
ForUpdate
public final void ForUpdate() throws ParseException
- Throws:
ParseException
-
BreakStatement
public final void BreakStatement() throws ParseException
- Throws:
ParseException
-
ContinueStatement
public final void ContinueStatement() throws ParseException
- Throws:
ParseException
-
ReturnStatement
public final void ReturnStatement() throws ParseException
- Throws:
ParseException
-
ThrowStatement
public final void ThrowStatement() throws ParseException
- Throws:
ParseException
-
SynchronizedStatement
public final void SynchronizedStatement() throws ParseException
- Throws:
ParseException
-
TryStatement
public final void TryStatement() throws ParseException
- Throws:
ParseException
-
RUNSIGNEDSHIFT
public final void RUNSIGNEDSHIFT() throws ParseException
- Throws:
ParseException
-
RSIGNEDSHIFT
public final void RSIGNEDSHIFT() throws ParseException
- Throws:
ParseException
-
Annotation
public final void Annotation() throws ParseException
- Throws:
ParseException
-
NormalAnnotation
public final void NormalAnnotation() throws ParseException
- Throws:
ParseException
-
MarkerAnnotation
public final void MarkerAnnotation() throws ParseException
- Throws:
ParseException
-
SingleMemberAnnotation
public final void SingleMemberAnnotation() throws ParseException
- Throws:
ParseException
-
MemberValuePairs
public final void MemberValuePairs() throws ParseException
- Throws:
ParseException
-
MemberValuePair
public final void MemberValuePair() throws ParseException
- Throws:
ParseException
-
MemberValue
public final void MemberValue() throws ParseException
- Throws:
ParseException
-
MemberValueArrayInitializer
public final void MemberValueArrayInitializer() throws ParseException
- Throws:
ParseException
-
AnnotationTypeDeclaration
public final void AnnotationTypeDeclaration(int modifiers) throws ParseException
- Throws:
ParseException
-
AnnotationTypeBody
public final void AnnotationTypeBody() throws ParseException
- Throws:
ParseException
-
AnnotationTypeMemberDeclaration
public final void AnnotationTypeMemberDeclaration() throws ParseException
- Throws:
ParseException
-
DefaultValue
public final void DefaultValue() throws ParseException
- Throws:
ParseException
-
ReInit
public void ReInit(java.io.InputStream stream)
Reinitialise.
-
ReInit
public void ReInit(java.io.InputStream stream, java.lang.String encoding)
Reinitialise.
-
ReInit
public void ReInit(java.io.Reader stream)
Reinitialise.
-
ReInit
public void ReInit(JavaCCParserTokenManager tm)
Reinitialise.
-
getNextToken
public final Token getNextToken()
Get the next Token.
-
getToken
public final Token getToken(int index)
Get the specific Token.
-
generateParseException
public ParseException generateParseException()
Generate ParseException.
-
enable_tracing
public final void enable_tracing()
Enable tracing.
-
disable_tracing
public final void disable_tracing()
Disable tracing.
-
-