edu.rice.cs.javalanglevels.parser
Class JExprParser
java.lang.Object
edu.rice.cs.javalanglevels.parser.JExprParser
- All Implemented Interfaces:
- JExprParserConstants
public class JExprParser
- extends Object
- implements JExprParserConstants
| Fields inherited from interface edu.rice.cs.javalanglevels.parser.JExprParserConstants |
_DEFAULT, ABSTRACT, ANDASSIGN, ASSIGN, BANG, BIT_AND, BIT_OR, BOOLEAN, BREAK, BYTE, CASE, CATCH, CHAR, CHARACTER_LITERAL, CLASS, COLON, COMMA, CONST, CONTINUE, DECIMAL_LITERAL, DECR, DEFAULT, DIGIT, DO, DOT, DOUBLE, DOUBLE_FLOATING_POINT_LITERAL, ELSE, EOF, EQ, EXPONENT, EXTENDS, FALSE, FINAL, FINALLY, FLOAT, FLOATING_POINT_LITERAL, FOR, FORMAL_COMMENT, GE, GOTO, GT, HEX_LITERAL, HOOK, IDENTIFIER, IF, IMPLEMENTS, IMPORT, IN_FORMAL_COMMENT, IN_MULTI_LINE_COMMENT, IN_SINGLE_LINE_COMMENT, INCR, INSTANCEOF, INT, INTERFACE, LBRACE, LBRACKET, LE, LETTER, LONG, LONG_DECIMAL_LITERAL, LONG_HEX_LITERAL, LONG_OCTAL_LITERAL, LPAREN, LSHIFT, LSHIFTASSIGN, LT, MINUS, MINUSASSIGN, MULTI_LINE_COMMENT, NATIVE, NE, NEW, NULL, OCTAL_LITERAL, ORASSIGN, OTHER, PACKAGE, PLUS, PLUSASSIGN, PRIVATE, PROTECTED, PUBLIC, RBRACE, RBRACKET, REM, REMASSIGN, RETURN, RPAREN, RSIGNEDSHIFT, RSIGNEDSHIFTASSIGN, RSSHIFT1, RSSHIFT2, RUNSIGNEDSHIFT, RUNSIGNEDSHIFTASSIGN, RUSHIFT1, RUSHIFT2, RUSHIFT3, SC_AND, SC_OR, SEMICOLON, SHORT, SINGLE_LINE_COMMENT, SLASH, SLASHASSIGN, STAR, STARASSIGN, STATIC, STRICTFP, STRING_LITERAL, SUPER, SWITCH, SYNCHRONIZED, THIS, THROW, THROWS, TILDE, tokenImage, TRANSIENT, TRUE, TRY, VOID, VOLATILE, WHILE, XOR, XORASSIGN |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NO_TYPE
public static final ClassOrInterfaceType NO_TYPE
token_source
public JExprParserTokenManager token_source
token
public Token token
jj_nt
public Token jj_nt
lookingAhead
public boolean lookingAhead
JExprParser
public JExprParser(File file)
throws FileNotFoundException
- Throws:
FileNotFoundException
JExprParser
public JExprParser(InputStream stream)
JExprParser
public JExprParser(InputStream stream,
String encoding)
JExprParser
public JExprParser(Reader stream)
JExprParser
public JExprParser(JExprParserTokenManager tm)
main
public static void main(String[] args)
SourceFile
public final SourceFile SourceFile()
throws ParseException
- THE JAVA LANGUAGE GRAMMAR STARTS HERE *
- Throws:
ParseException
MethodDefLookahead
public final void MethodDefLookahead()
throws ParseException
- Throws:
ParseException
ConstructorDefLookahead
public final void ConstructorDefLookahead()
throws ParseException
- Throws:
ParseException
VariableDeclarationLookahead
public final void VariableDeclarationLookahead()
throws ParseException
- Throws:
ParseException
PackageStatement
public final PackageStatement PackageStatement()
throws ParseException
- Throws:
ParseException
ImportStatement
public final ImportStatement ImportStatement()
throws ParseException
- Throws:
ParseException
CompoundWord
public final CompoundWord CompoundWord()
throws ParseException
- Throws:
ParseException
ModifiersAndVisibility
public final ModifiersAndVisibility ModifiersAndVisibility()
throws ParseException
- Throws:
ParseException
ClassDef
public final ClassDef ClassDef()
throws ParseException
- Throws:
ParseException
UnmodifiedClassDef
public final edu.rice.cs.javalanglevels.parser.UnmodifiedClassDef UnmodifiedClassDef()
throws ParseException
- Throws:
ParseException
InnerClassDef
public final InnerClassDef InnerClassDef()
throws ParseException
- Throws:
ParseException
InterfaceDef
public final InterfaceDef InterfaceDef()
throws ParseException
- Throws:
ParseException
UnmodifiedInterfaceDef
public final edu.rice.cs.javalanglevels.parser.UnmodifiedInterfaceDef UnmodifiedInterfaceDef()
throws ParseException
- Throws:
ParseException
InnerInterfaceDef
public final InnerInterfaceDef InnerInterfaceDef()
throws ParseException
- Throws:
ParseException
BracedBody
public final BracedBody BracedBody()
throws ParseException
- Throws:
ParseException
UnbracedBody
public final UnbracedBody UnbracedBody()
throws ParseException
- Throws:
ParseException
BodyItem
public final BodyItemI BodyItem()
throws ParseException
- Throws:
ParseException
MethodDef
public final MethodDef MethodDef()
throws ParseException
- Throws:
ParseException
ConcreteMethodBody
public final BracedBody ConcreteMethodBody()
throws ParseException
- Throws:
ParseException
AbstractMethodBody
public final void AbstractMethodBody()
throws ParseException
- Throws:
ParseException
VariableDeclaration
public final VariableDeclaration VariableDeclaration()
throws ParseException
- Throws:
ParseException
NameList
public final ReferenceType[] NameList()
throws ParseException
- Throws:
ParseException
ReturnType
public final ReturnTypeI ReturnType()
throws ParseException
- Throws:
ParseException
FormalParameters
public final FormalParameter[] FormalParameters()
throws ParseException
- Throws:
ParseException
FormalParameter
public final FormalParameter FormalParameter()
throws ParseException
- Throws:
ParseException
ConstructorDef
public final ConstructorDef ConstructorDef()
throws ParseException
- Throws:
ParseException
Initializer
public final Initializer Initializer()
throws ParseException
- Throws:
ParseException
Type
public final Type Type()
throws ParseException
- Throws:
ParseException
PrimitiveType
public final PrimitiveType PrimitiveType()
throws ParseException
- Throws:
ParseException
ReferenceType
public final ReferenceType ReferenceType()
throws ParseException
- Throws:
ParseException
ArrayType
public final ArrayType ArrayType()
throws ParseException
- Throws:
ParseException
TypeVariable
public final TypeVariable TypeVariable()
throws ParseException
- Throws:
ParseException
ClassOrInterfaceType
public final ReferenceType ClassOrInterfaceType()
throws ParseException
- have to break out each period inside the name.
- Throws:
ParseException
TypeArguments
public final Type[] TypeArguments()
throws ParseException
- Throws:
ParseException
TypeParameters
public final TypeParameter[] TypeParameters()
throws ParseException
- Throws:
ParseException
RightAngledBracket
public final Token RightAngledBracket()
throws ParseException
- Throws:
ParseException
TypeFormalParameter
public final TypeParameter TypeFormalParameter()
throws ParseException
- Throws:
ParseException
Statement
public final Statement Statement()
throws ParseException
- Throws:
ParseException
LabeledStatement
public final LabeledStatement LabeledStatement()
throws ParseException
- Throws:
ParseException
Block
public final Block Block()
throws ParseException
- Throws:
ParseException
ExpressionStatement
public final ExpressionStatement ExpressionStatement()
throws ParseException
- Throws:
ParseException
SwitchStatement
public final Statement SwitchStatement()
throws ParseException
- Throws:
ParseException
SwitchCase
public final SwitchCase SwitchCase()
throws ParseException
- Throws:
ParseException
IfStatement
public final Statement IfStatement()
throws ParseException
- Throws:
ParseException
WhileStatement
public final WhileStatement WhileStatement()
throws ParseException
- Throws:
ParseException
DoStatement
public final Statement DoStatement()
throws ParseException
- Throws:
ParseException
ForStatement
public final ForStatement ForStatement()
throws ParseException
- Throws:
ParseException
ForInit
public final ForInitI ForInit()
throws ParseException
- Throws:
ParseException
ForCondition
public final ForConditionI ForCondition()
throws ParseException
- Throws:
ParseException
BreakStatement
public final BreakStatement BreakStatement()
throws ParseException
- Throws:
ParseException
ContinueStatement
public final ContinueStatement ContinueStatement()
throws ParseException
- Throws:
ParseException
ReturnStatement
public final ReturnStatement ReturnStatement()
throws ParseException
- Throws:
ParseException
ThrowStatement
public final ThrowStatement ThrowStatement()
throws ParseException
- Throws:
ParseException
SynchronizedStatement
public final SynchronizedStatement SynchronizedStatement()
throws ParseException
- Throws:
ParseException
TryStatement
public final TryCatchStatement TryStatement()
throws ParseException
- Throws:
ParseException
EmptyStatement
public final EmptyStatement EmptyStatement()
throws ParseException
- Throws:
ParseException
VariableDeclaratorList
public final LinkedList<VariableDeclarator> VariableDeclaratorList()
throws ParseException
- Recognizes: Type (identifier [, initializer ] )+.
- Throws:
ParseException
VariableDeclarator
public final VariableDeclarator VariableDeclarator(Type givenType)
throws ParseException
- Recognizes an identifier with any number of possible brackets.
Figures out the real type by dealing with the fact
that [] can be either after type or after identifier!
Very strange syntax indeed.
TODO: Make sure FormalParameter (or anything else that can't have
initialized variable declarators to check for this).
- Parameters:
givenType - The type that was recognized before this identifier
- Returns:
- The pair of type and identifier. The type encompasses
all levels of array []s needed (from both after the type and
after the identifier).
- Throws:
ParseException
VariableInitializer
public final VariableInitializerI VariableInitializer()
throws ParseException
- Throws:
ParseException
ArrayInitializer
public final ArrayInitializer ArrayInitializer()
throws ParseException
- Throws:
ParseException
NonEmptyExpressionLookahead
public final void NonEmptyExpressionLookahead()
throws ParseException
- Throws:
ParseException
Expression
public final Expression Expression()
throws ParseException
- Throws:
ParseException
NoOpExpression
public final Expression NoOpExpression()
throws ParseException
- Throws:
ParseException
AssignmentExpression
public final Expression AssignmentExpression()
throws ParseException
- Throws:
ParseException
ConditionalExpression
public final Expression ConditionalExpression()
throws ParseException
- Throws:
ParseException
OrExpression
public final Expression OrExpression()
throws ParseException
- Throws:
ParseException
AndExpression
public final Expression AndExpression()
throws ParseException
- Throws:
ParseException
BitwiseOrExpression
public final Expression BitwiseOrExpression()
throws ParseException
- Throws:
ParseException
BitwiseXorExpression
public final Expression BitwiseXorExpression()
throws ParseException
- Throws:
ParseException
BitwiseAndExpression
public final Expression BitwiseAndExpression()
throws ParseException
- Throws:
ParseException
EqualityExpression
public final Expression EqualityExpression()
throws ParseException
- Throws:
ParseException
ComparisonExpression
public final Expression ComparisonExpression()
throws ParseException
- Throws:
ParseException
ShiftBinaryExpression
public final Expression ShiftBinaryExpression()
throws ParseException
- Throws:
ParseException
AdditiveExpression
public final Expression AdditiveExpression()
throws ParseException
- Throws:
ParseException
MultiplicativeExpression
public final Expression MultiplicativeExpression()
throws ParseException
- Throws:
ParseException
UnaryExpression
public final Expression UnaryExpression()
throws ParseException
- Throws:
ParseException
UnaryExpressionNotPlusMinus
public final Expression UnaryExpressionNotPlusMinus()
throws ParseException
- Throws:
ParseException
CastLookahead
public final void CastLookahead()
throws ParseException
- Throws:
ParseException
CastExpression
public final Expression CastExpression()
throws ParseException
- Throws:
ParseException
PostfixIncrementExpression
public final Expression PostfixIncrementExpression()
throws ParseException
- Throws:
ParseException
Primary
public final Primary Primary()
throws ParseException
- Throws:
ParseException
PrimaryPrefix
public final Primary PrimaryPrefix()
throws ParseException
- Throws:
ParseException
PrimarySuffix
public final Primary PrimarySuffix(Primary prefix)
throws ParseException
- Throws:
ParseException
LexicalLiteral
public final LexicalLiteral LexicalLiteral()
throws ParseException
- Throws:
ParseException
SimpleInstantiation
public final Instantiation SimpleInstantiation()
throws ParseException
- Differentiates between array allocations and anonymous inner class definitions
- Throws:
ParseException
SimpleArrayInstantiationTail
public final ArrayInstantiation SimpleArrayInstantiationTail(Type elementType)
throws ParseException
- Throws:
ParseException
ComplexInstantiation
public final Instantiation ComplexInstantiation(Primary prefix)
throws ParseException
- Differentiates between array allocations and anonymous inner class definitions
- Parameters:
prefix - The Primary before the new. (e.g. a.new Foo())
- Throws:
ParseException
ComplexArrayInstantiationTail
public final ArrayInstantiation ComplexArrayInstantiationTail(Primary prefix,
Type elementType)
throws ParseException
- Throws:
ParseException
IntegerLiteral
public final LexicalLiteral IntegerLiteral()
throws ParseException
- Throws:
ParseException
FloatLiteral
public final LexicalLiteral FloatLiteral()
throws ParseException
- Throws:
ParseException
BooleanLiteral
public final BooleanLiteral BooleanLiteral()
throws ParseException
- Throws:
ParseException
Word
public final Word Word()
throws ParseException
- Throws:
ParseException
RightShiftOp
public final Token RightShiftOp()
throws ParseException
- Throws:
ParseException
ParenthesizedExpressionList
public final ParenthesizedExpressionList ParenthesizedExpressionList()
throws ParseException
- Throws:
ParseException
UnparenthesizedExpressionList
public final UnparenthesizedExpressionList UnparenthesizedExpressionList()
throws ParseException
- Throws:
ParseException
ReInit
public void ReInit(InputStream stream)
ReInit
public void ReInit(InputStream stream,
String encoding)
ReInit
public void ReInit(Reader stream)
ReInit
public void ReInit(JExprParserTokenManager tm)
getNextToken
public final Token getNextToken()
getToken
public final Token getToken(int index)
generateParseException
public ParseException generateParseException()
enable_tracing
public final void enable_tracing()
disable_tracing
public final void disable_tracing()