Parse
Class MiniJava
java.lang.Object
Parse.MiniJava
- All Implemented Interfaces:
- MiniJavaConstants
public class MiniJava
- extends java.lang.Object
- implements MiniJavaConstants
Fields inherited from interface Parse.MiniJavaConstants |
ADD, AND, ASSIGN, BOOLEAN, BREAK, CHAR, CLASS, COLON, COMMA, CONTINUE, DEC, DECR, DEFAULT, DIGIT, DIV, DO, DOT, ELSE, EOF, EQ, EXTENDS, FALSE, FOR, FORMAL_COMMENT, GE, GT, HEX, ID, IF, IN_FORMAL_COMMENT, IN_MULTI_LINE_COMMENT, IN_SINGLE_LINE_COMMENT, INCR, INT, LBRACE, LBRACK, LE, LETTER, LPAREN, LT, MUL, MULTI_LINE_COMMENT, NATIVE, NE, NEW, NOT, NULL, OCT, OR, PUBLIC, QUESTION, RBRACE, RBRACK, RETURN, RPAREN, SEMICOLON, SINGLE_LINE_COMMENT, STATIC, STRING, SUB, SUPER, THIS, THROWS, tokenImage, TRUE, VOID, WHILE |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
token_source
public MiniJavaTokenManager token_source
token
public Token token
jj_nt
public Token jj_nt
lookingAhead
public boolean lookingAhead
MiniJava
public MiniJava(java.io.InputStream stream)
MiniJava
public MiniJava(java.io.InputStream stream,
java.lang.String encoding)
MiniJava
public MiniJava(java.io.Reader stream)
MiniJava
public MiniJava(MiniJavaTokenManager tm)
main
public static void main(java.lang.String[] args)
throws java.io.IOException
- Throws:
java.io.IOException
Literal
public final MiniJava.Exp Literal()
throws ParseException
- The MiniJava language grammar starts here *
- Throws:
ParseException
Type
public final MiniJava.Type Type()
throws ParseException
- Throws:
ParseException
ArrayType
public final MiniJava.Type ArrayType(MiniJava.Type e)
throws ParseException
- Throws:
ParseException
PrimitiveType
public final MiniJava.Type PrimitiveType()
throws ParseException
- Throws:
ParseException
ClassType
public final MiniJava.Type.Class ClassType()
throws ParseException
- Throws:
ParseException
Name
public final MiniJava.Name Name()
throws ParseException
- Throws:
ParseException
SimpleName
public final MiniJava.Name SimpleName()
throws ParseException
- Throws:
ParseException
QualifiedName
public final MiniJava.Name QualifiedName(MiniJava.Name n)
throws ParseException
- Throws:
ParseException
CompilationUnit
public final MiniJava.Unit CompilationUnit()
throws ParseException
- Throws:
ParseException
TypeDeclaration
public final MiniJava.Dec.Class TypeDeclaration()
throws ParseException
- Throws:
ParseException
Modifiers
public final java.util.List<MiniJava.Modifier> Modifiers()
throws ParseException
- Throws:
ParseException
Modifier
public final MiniJava.Modifier Modifier()
throws ParseException
- Throws:
ParseException
ClassDeclaration
public final MiniJava.Dec.Class ClassDeclaration()
throws ParseException
- Throws:
ParseException
Super
public final MiniJava.Type.Class Super()
throws ParseException
- Throws:
ParseException
ClassBody
public final void ClassBody(MiniJava.Dec.Class d)
throws ParseException
- Throws:
ParseException
ClassMemberDeclaration
public final void ClassMemberDeclaration(MiniJava.Dec.Class d)
throws ParseException
- Throws:
ParseException
FieldDeclaration
public final void FieldDeclaration(MiniJava.Dec.Class c)
throws ParseException
- Throws:
ParseException
Field
public final void Field(MiniJava.Dec.Class c,
java.util.List<MiniJava.Modifier> m,
MiniJava.Type t)
throws ParseException
- Throws:
ParseException
MethodDeclaration
public final void MethodDeclaration(MiniJava.Dec.Class c)
throws ParseException
- Throws:
ParseException
MethodHeader
public final MiniJava.Dec.Method MethodHeader()
throws ParseException
- Throws:
ParseException
MethodBody
public final void MethodBody(MiniJava.Dec.Method m)
throws ParseException
- Throws:
ParseException
FormalParameterList
public final void FormalParameterList(MiniJava.Dec.Method d)
throws ParseException
- Throws:
ParseException
FormalParameter
public final MiniJava.Dec.Formal FormalParameter()
throws ParseException
- Throws:
ParseException
Throws
public final void Throws()
throws ParseException
- Throws:
ParseException
Block
public final MiniJava.Stm.Block Block()
throws ParseException
- Throws:
ParseException
BlockStatement
public final void BlockStatement(MiniJava.Stm.Block b)
throws ParseException
- Throws:
ParseException
LocalVariableDeclarationStatement
public final void LocalVariableDeclarationStatement(java.util.List<MiniJava.Stm> l)
throws ParseException
- Throws:
ParseException
LocalVariableDeclaration
public final void LocalVariableDeclaration(java.util.List<MiniJava.Stm> l)
throws ParseException
- Throws:
ParseException
VariableDeclarator
public final MiniJava.Dec.Var VariableDeclarator(MiniJava.Type t)
throws ParseException
- Throws:
ParseException
Statement
public final MiniJava.Stm Statement()
throws ParseException
- Throws:
ParseException
ExpressionStatement
public final MiniJava.Stm ExpressionStatement()
throws ParseException
- Throws:
ParseException
StatementExpression
public final MiniJava.Exp StatementExpression()
throws ParseException
- Throws:
ParseException
IfStatement
public final MiniJava.Stm IfStatement()
throws ParseException
- Throws:
ParseException
WhileStatement
public final MiniJava.Stm WhileStatement()
throws ParseException
- Throws:
ParseException
DoWhileStatement
public final MiniJava.Stm DoWhileStatement()
throws ParseException
- Throws:
ParseException
ReturnStatement
public final MiniJava.Stm.Return ReturnStatement()
throws ParseException
- Throws:
ParseException
BreakStatement
public final MiniJava.Stm.Break BreakStatement()
throws ParseException
- Throws:
ParseException
ContinueStatement
public final MiniJava.Stm.Continue ContinueStatement()
throws ParseException
- Throws:
ParseException
ForStatement
public final MiniJava.Stm.For ForStatement()
throws ParseException
- Throws:
ParseException
ForInit
public final java.util.List<MiniJava.Stm> ForInit()
throws ParseException
- Throws:
ParseException
ForUpdate
public final java.util.List<MiniJava.Stm> ForUpdate()
throws ParseException
- Throws:
ParseException
StatementExpressionList
public final void StatementExpressionList(java.util.List<MiniJava.Stm> l)
throws ParseException
- Throws:
ParseException
Expression
public final MiniJava.Exp Expression()
throws ParseException
- Throws:
ParseException
ConditionalExpression
public final MiniJava.Exp ConditionalExpression()
throws ParseException
- Throws:
ParseException
ConditionalOrExpression
public final MiniJava.Exp ConditionalOrExpression()
throws ParseException
- Throws:
ParseException
ConditionalAndExpression
public final MiniJava.Exp ConditionalAndExpression()
throws ParseException
- Throws:
ParseException
EqualityExpression
public final MiniJava.Exp EqualityExpression()
throws ParseException
- Throws:
ParseException
RelationalExpression
public final MiniJava.Exp RelationalExpression()
throws ParseException
- Throws:
ParseException
AdditiveExpression
public final MiniJava.Exp AdditiveExpression()
throws ParseException
- Throws:
ParseException
MultiplicativeExpression
public final MiniJava.Exp MultiplicativeExpression()
throws ParseException
- Throws:
ParseException
PrefixExpression
public final MiniJava.Exp PrefixExpression()
throws ParseException
- Throws:
ParseException
PrefixOp
public final Token PrefixOp()
throws ParseException
- Throws:
ParseException
PostfixExpression
public final MiniJava.Exp PostfixExpression()
throws ParseException
- Throws:
ParseException
Primary
public final MiniJava.Exp Primary()
throws ParseException
- Throws:
ParseException
Identifier
public final MiniJava.Exp.Id Identifier()
throws ParseException
- Throws:
ParseException
Selector
public final MiniJava.Exp Selector(MiniJava.Exp e)
throws ParseException
- Throws:
ParseException
ArrayAccess
public final MiniJava.Exp ArrayAccess(MiniJava.Exp e)
throws ParseException
- Throws:
ParseException
ArgumentList
public final void ArgumentList(MiniJava.Exp.Call c)
throws ParseException
- Throws:
ParseException
ThisExp
public final MiniJava.Exp ThisExp()
throws ParseException
- Throws:
ParseException
SuperExp
public final MiniJava.Exp SuperExp()
throws ParseException
- Throws:
ParseException
ClassInstanceCreationExpression
public final MiniJava.Exp ClassInstanceCreationExpression()
throws ParseException
- Throws:
ParseException
ArrayCreationExpression
public final MiniJava.Exp ArrayCreationExpression()
throws ParseException
- Throws:
ParseException
ReInit
public void ReInit(java.io.InputStream stream)
ReInit
public void ReInit(java.io.InputStream stream,
java.lang.String encoding)
ReInit
public void ReInit(java.io.Reader stream)
ReInit
public void ReInit(MiniJavaTokenManager 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()