minijava.parser
Class MJParser

java.lang.Object
  extended by minijava.parser.MJParser
All Implemented Interfaces:
MJParserConstants

public class MJParser
extends java.lang.Object
implements MJParserConstants


Field Summary
 Token jj_nt
          Next token.
 Token token
          Current token.
 MJParserTokenManager token_source
          Generated Token Manager.
 
Fields inherited from interface minijava.parser.MJParserConstants
AND, ASSIGN, BOOLEAN, CLASS, DEFAULT, DIGIT, DOT, ELSE, EOF, EXTENDS, FALSE, FORMAL_COMMENT, IDENTIFIER, IF, INTEGER, INTEGER_LITERAL, INTERFACE, LBRACE, LENGTH, LETTER, LPAREN, LSQPAREN, LT, MAIN, MINUS, MULTI_LINE_COMMENT, NEW, NOT, PLUS, PRINT, PUBLIC, RBRACE, RETURN, RPAREN, RSQPAREN, SEMICOLON, SINGLE_LINE_COMMENT, STATIC, STRING, THIS, tokenImage, TRUE, VOID, WHILE
 
Constructor Summary
MJParser(java.io.InputStream stream)
          Constructor with InputStream.
MJParser(java.io.InputStream stream, java.lang.String encoding)
          Constructor with InputStream and supplied encoding
MJParser(MJParserTokenManager tm)
          Constructor with generated Token Manager.
MJParser(java.io.Reader stream)
          Constructor.
 
Method Summary
 AllocationExpression AllocationExpression()
           
 AndExpression AndExpression()
           
 ArrayAllocationExpression ArrayAllocationExpression()
           
 ArrayAssignmentStatement ArrayAssignmentStatement()
           
 ArrayLength ArrayLength()
           
 ArrayLookup ArrayLookup()
           
 ArrayType ArrayType()
           
 AssignmentStatement AssignmentStatement()
           
 Block Block()
           
 BooleanType BooleanType()
           
 BracketExpression BracketExpression()
           
 ClassDeclaration ClassDeclaration()
           
 ClassExtendsDeclaration ClassExtendsDeclaration()
           
 CompareExpression CompareExpression()
           
 void disable_tracing()
          Disable tracing.
 void enable_tracing()
          Enable tracing.
 Expression Expression()
           
 ExpressionList ExpressionList()
           
 ExpressionRest ExpressionRest()
           
 FalseLiteral FalseLiteral()
           
 FormalParameter FormalParameter()
           
 FormalParameterList FormalParameterList()
           
 FormalParameterRest FormalParameterRest()
           
 ParseException generateParseException()
          Generate ParseException.
 Token getNextToken()
          Get the next Token.
 Token getToken(int index)
          Get the specific Token.
 Goal Goal()
           
 Identifier Identifier()
           
 IfStatement IfStatement()
           
 IntegerLiteral IntegerLiteral()
           
 IntegerType IntegerType()
           
 MainClass MainClass()
           
 MessageSend MessageSend()
           
 MethodDeclaration MethodDeclaration()
           
 MinusExpression MinusExpression()
           
 NotExpression NotExpression()
           
 PlusExpression PlusExpression()
           
 PrimaryExpression PrimaryExpression()
           
 PrintStatement PrintStatement()
           
 void ReInit(java.io.InputStream stream)
          Reinitialise.
 void ReInit(java.io.InputStream stream, java.lang.String encoding)
          Reinitialise.
 void ReInit(MJParserTokenManager tm)
          Reinitialise.
 void ReInit(java.io.Reader stream)
          Reinitialise.
 Statement Statement()
           
 ThisExpression ThisExpression()
           
 TimesExpression TimesExpression()
           
 TrueLiteral TrueLiteral()
           
 Type Type()
           
 TypeDeclaration TypeDeclaration()
           
 VarDeclaration VarDeclaration()
           
 WhileStatement WhileStatement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public MJParserTokenManager token_source
Generated Token Manager.


token

public Token token
Current token.


jj_nt

public Token jj_nt
Next token.

Constructor Detail

MJParser

public MJParser(java.io.InputStream stream)
Constructor with InputStream.


MJParser

public MJParser(java.io.InputStream stream,
                java.lang.String encoding)
Constructor with InputStream and supplied encoding


MJParser

public MJParser(java.io.Reader stream)
Constructor.


MJParser

public MJParser(MJParserTokenManager tm)
Constructor with generated Token Manager.

Method Detail

Goal

public final Goal Goal()
                throws ParseException
Throws:
ParseException

MainClass

public final MainClass MainClass()
                          throws ParseException
Throws:
ParseException

TypeDeclaration

public final TypeDeclaration TypeDeclaration()
                                      throws ParseException
Throws:
ParseException

ClassDeclaration

public final ClassDeclaration ClassDeclaration()
                                        throws ParseException
Throws:
ParseException

ClassExtendsDeclaration

public final ClassExtendsDeclaration ClassExtendsDeclaration()
                                                      throws ParseException
Throws:
ParseException

VarDeclaration

public final VarDeclaration VarDeclaration()
                                    throws ParseException
Throws:
ParseException

MethodDeclaration

public final MethodDeclaration MethodDeclaration()
                                          throws ParseException
Throws:
ParseException

FormalParameterList

public final FormalParameterList FormalParameterList()
                                              throws ParseException
Throws:
ParseException

FormalParameter

public final FormalParameter FormalParameter()
                                      throws ParseException
Throws:
ParseException

FormalParameterRest

public final FormalParameterRest FormalParameterRest()
                                              throws ParseException
Throws:
ParseException

Type

public final Type Type()
                throws ParseException
Throws:
ParseException

ArrayType

public final ArrayType ArrayType()
                          throws ParseException
Throws:
ParseException

BooleanType

public final BooleanType BooleanType()
                              throws ParseException
Throws:
ParseException

IntegerType

public final IntegerType IntegerType()
                              throws ParseException
Throws:
ParseException

Statement

public final Statement Statement()
                          throws ParseException
Throws:
ParseException

Block

public final Block Block()
                  throws ParseException
Throws:
ParseException

AssignmentStatement

public final AssignmentStatement AssignmentStatement()
                                              throws ParseException
Throws:
ParseException

ArrayAssignmentStatement

public final ArrayAssignmentStatement ArrayAssignmentStatement()
                                                        throws ParseException
Throws:
ParseException

IfStatement

public final IfStatement IfStatement()
                              throws ParseException
Throws:
ParseException

WhileStatement

public final WhileStatement WhileStatement()
                                    throws ParseException
Throws:
ParseException

PrintStatement

public final PrintStatement PrintStatement()
                                    throws ParseException
Throws:
ParseException

Expression

public final Expression Expression()
                            throws ParseException
Throws:
ParseException

AndExpression

public final AndExpression AndExpression()
                                  throws ParseException
Throws:
ParseException

CompareExpression

public final CompareExpression CompareExpression()
                                          throws ParseException
Throws:
ParseException

PlusExpression

public final PlusExpression PlusExpression()
                                    throws ParseException
Throws:
ParseException

MinusExpression

public final MinusExpression MinusExpression()
                                      throws ParseException
Throws:
ParseException

TimesExpression

public final TimesExpression TimesExpression()
                                      throws ParseException
Throws:
ParseException

ArrayLookup

public final ArrayLookup ArrayLookup()
                              throws ParseException
Throws:
ParseException

ArrayLength

public final ArrayLength ArrayLength()
                              throws ParseException
Throws:
ParseException

MessageSend

public final MessageSend MessageSend()
                              throws ParseException
Throws:
ParseException

ExpressionList

public final ExpressionList ExpressionList()
                                    throws ParseException
Throws:
ParseException

ExpressionRest

public final ExpressionRest ExpressionRest()
                                    throws ParseException
Throws:
ParseException

PrimaryExpression

public final PrimaryExpression PrimaryExpression()
                                          throws ParseException
Throws:
ParseException

IntegerLiteral

public final IntegerLiteral IntegerLiteral()
                                    throws ParseException
Throws:
ParseException

TrueLiteral

public final TrueLiteral TrueLiteral()
                              throws ParseException
Throws:
ParseException

FalseLiteral

public final FalseLiteral FalseLiteral()
                                throws ParseException
Throws:
ParseException

Identifier

public final Identifier Identifier()
                            throws ParseException
Throws:
ParseException

ThisExpression

public final ThisExpression ThisExpression()
                                    throws ParseException
Throws:
ParseException

ArrayAllocationExpression

public final ArrayAllocationExpression ArrayAllocationExpression()
                                                          throws ParseException
Throws:
ParseException

AllocationExpression

public final AllocationExpression AllocationExpression()
                                                throws ParseException
Throws:
ParseException

NotExpression

public final NotExpression NotExpression()
                                  throws ParseException
Throws:
ParseException

BracketExpression

public final BracketExpression BracketExpression()
                                          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(MJParserTokenManager 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.