jellyj.parser
Class JellyJParser


public class JellyJParser
implements JellyJParserConstants


Field Summary
 (package private) SymbolclassName_d
          Name of the class (and of its superclass) being parsed.
 (package private) IntegerStreamcounter_d
          A counter used to keep track of the different scopes within a method.
 (package private) final static StringDEFAULT_PACKAGE
          The name of the default package
 (package private) final static StringDEFAULT_SUPER
          The name of the default super class
 (package private) Vectorerrors_d
          A String vector containing all the errors found during parsing.
 (package private) BlockNodefieldInit_d
          During parsing, non-static initializers are collected and at the end added to each constructor.
 (package private) VectorforwardTypes_d
          Keep track of references to forward types.
 (package private) JellyJImportManagerimportMgr_d
          This is the compiler's import manager.
 (package private) ASCII_UCodeESC_CharStreamjj_input_stream
           
 Tokenjj_nt
           
 (package private) IntegerStacklabels_d
          A stack used to match labels in break and continue statements with their corresponding labeled nodes.
 booleanlookingAhead
           
 (package private) SymbolmethodName_d
          The name of the method being parsed.
 (package private) MethodDeclarationNodemethodNode_d
          A pointer to the method declaration node of the method being parsed.
 (package private) SymbolpackName_d
          Symbol of the package that corresponds to the class being defined or a default if no package declaration parsed.
 (package private) CompilationUnitNoderoot_d
          The pointer to the AST root node.
 (package private) IntegerStackscopes_d
          A stack used together with the counter to keep track of the scopes within a method.
 (package private) BlockNodestaticInit_d
          During parsing, static initializers are collected and at the end added to .
 (package private) SymbolsuperName_d
           
 (package private) SymbolTablesymbolTable_d
          This is the compiler's symbol table.
 Tokentoken
           
 JellyJParserTokenManagertoken_source
           

Constructor Summary
JellyJParser(InputStream stream, JellyJImportManager importMgr, SymbolTable symbolTable, Vector errors)
          The main constructor.
JellyJParser(java.io.InputStream stream)
           
JellyJParser(JellyJParserTokenManager tm)
           

Method Summary
 final ExpressionNodeAdditiveExp()
           
 final ExpressionNodeAllocationExp()
           
 final ExpressionNodeAndExp()
           
 final VectorArgumentList()
           
 final VectorArguments()
           
 final VectorArrayDimensions()
           
 final ExpressionNodeAssignment()
           
 final ExpressionNodeAssignmentAttempt()
           
 final StatementExpNodeAssignmentAttemptExp()
           
 final voidAssignmentAttemptLookahead()
           
 final intAssignmentOperator()
           
 final BlockNodeBlock(boolean newScope)
           
 final StatementNodeBlockStatement(boolean newScope)
           
 final ExpressionNodeBooleanLiteral()
           
 final BreakStatementNodeBreakStatement()
           
 final ExpressionNodeCastExp()
           
 final voidCastLookahead()
           
 final LocalVarDeclarationNodeCatchParameter()
           
 final ClassBodyDeclarationNodeClassBodyDeclaration()
           
 final ClassDeclarationNodeClassDeclaration()
           
 final CompilationUnitNodeCompilationUnit()
          *************************************** THE JELLYJ LANGUAGE GRAMMAR STARTS HERE *
 final ExpressionNodeConditionalAndExp()
           
 final ExpressionNodeConditionalExp()
           
 final ExpressionNodeConditionalOrExp()
           
 final ConstructorDeclarationNodeConstructorDeclaration()
           
 final ConstructorInvocationNodeConstructorInvocation()
           
 final StatementNodeContinueStatement()
           
 final voiddisable_tracing()
           
 final LabeledStatementNodeDoStatement()
           
 final StatementNodeEmptyStatement()
           
 final voidenable_tracing()
           
 final ExpressionNodeEqualityExp()
           
 final ExpressionNodeExclusiveOrExp()
           
 final ExpressionNodeExpression()
           
 final FieldDeclarationNodeFieldDeclaration()
           
 final StatementNodeForInit()
           
 final FormalParameterNodeFormalParameter()
           
 final VectorFormalParameters()
           
 final LabeledStatementNodeForStatement()
           
 final StatementExpListNodeForUpdate()
           
 final ParseExceptiongenerateParseException()
           
 final TokengetNextToken()
           
 final TokengetToken(int index)
           
 final IfStatementNodeIfStatement()
           
 final ExpressionNodeInclusiveOrExp()
           
 final ExpressionNodeInstanceOfExp()
           
 final InterfaceDeclarationNodeInterfaceDeclaration()
           
 final ClassBodyDeclarationNodeInterfaceMemberDeclaration()
           
 final LabeledStatementNodeLabeledStatement()
           
 final ExpressionNodeLiteral()
           
 final StatementNodeLocalVarDeclaration()
           
 final MethodDeclarationNodeMethodDeclaration()
           
 final voidMethodDeclarationLookahead()
           
 final voidMethodDeclarator(MethodDeclarationNode node)
           
 final ExpressionNodeMultiplicativeExp()
           
 final SymbolName()
           
 final ExpressionNodeNullLiteral()
           
 CompilationUnitNodeparseProgram()
          This method is called to start parsing a file.
 final ExpressionNodePostfixExp()
           
 final ExpressionNodePreDecrementExp()
           
 final ExpressionNodePreIncrementExp()
           
 final ExpressionNodePrimaryExp()
           
 final ExpressionNodePrimarySuffix(ExpressionNode left)
           
 final TypePrimitiveTypeExp()
           
 voidrecordSourceCoord(SyntaxTreeNode node, Token token)
          Sets source coordinates for error reporting.
 voidReInit(java.io.InputStream stream)
           
 voidReInit(JellyJParserTokenManager tm)
           
 final ExpressionNodeRelationalExp()
           
 final SymbolResolvedName()
           
 final VectorResolvedNameList()
           
 final TypeResultTypeExp()
           
 final ReturnStatementNodeReturnStatement()
           
 final ExpressionNodeShiftExp()
           
 final StatementNodeStatement(boolean newScope)
           
 final StatementExpNodeStatementExp()
           
 final StatementExpListNodeStatementExpList()
           
 final StaticInitializerNodeStaticInitializer()
           
 final SwitchLabelNodeSwitchLabel()
           
 final LabeledStatementNodeSwitchStatement()
           
 final SynchronizedStatementNodeSynchronizedStatement()
           
 final ThrowStatementNodeThrowStatement()
           
 final TryStatementNodeTryStatement()
           
 final TypeDeclarationNodeTypeDeclaration()
           
 final TypeTypeExp()
           
 final ExpressionNodeUnaryExp()
           
 final ExpressionNodeUnaryExpressionNotPlusMinus()
           
 final ExpressionNodeUnaryMinusExp()
           
 final ExpressionNodeUnaryNegExp()
           
 final ExpressionNodeUnaryNotExp()
           
 final ExpressionNodeUnaryPlusExp()
           
 final VariableDeclaratorNodeVariableDeclarator(boolean fieldFlag)
           
 final SymbolVariableDeclaratorId()
           
 final ExpressionNodeVariableInitializer()
           
 final LabeledStatementNodeWhileStatement()
           

Field Detail

className_d

Symbol className_d
Name of the class (and of its superclass) being parsed.

counter_d

IntegerStream counter_d
A counter used to keep track of the different scopes within a method.

DEFAULT_PACKAGE

final static String DEFAULT_PACKAGE
The name of the default package

DEFAULT_SUPER

final static String DEFAULT_SUPER
The name of the default super class

errors_d

Vector errors_d
A String vector containing all the errors found during parsing.

fieldInit_d

BlockNode fieldInit_d
During parsing, non-static initializers are collected and at the end added to each constructor.

forwardTypes_d

Vector forwardTypes_d
Keep track of references to forward types.

importMgr_d

JellyJImportManager importMgr_d
This is the compiler's import manager.

jj_input_stream

ASCII_UCodeESC_CharStream jj_input_stream

jj_nt

public Token jj_nt

labels_d

IntegerStack labels_d
A stack used to match labels in break and continue statements with their corresponding labeled nodes.

lookingAhead

public boolean lookingAhead

methodName_d

Symbol methodName_d
The name of the method being parsed.

methodNode_d

MethodDeclarationNode methodNode_d
A pointer to the method declaration node of the method being parsed. This is used to create new MethodExpNodes.

packName_d

Symbol packName_d
Symbol of the package that corresponds to the class being defined or a default if no package declaration parsed.

root_d

CompilationUnitNode root_d
The pointer to the AST root node.

scopes_d

IntegerStack scopes_d
A stack used together with the counter to keep track of the scopes within a method.

staticInit_d

BlockNode staticInit_d
During parsing, static initializers are collected and at the end added to .

superName_d

Symbol superName_d

symbolTable_d

SymbolTable symbolTable_d
This is the compiler's symbol table.

token

public Token token

token_source

public JellyJParserTokenManager token_source
Constructor Detail

JellyJParser

public JellyJParser(InputStream stream, JellyJImportManager importMgr, SymbolTable symbolTable, Vector errors)
The main constructor.

JellyJParser

public JellyJParser(java.io.InputStream stream)

JellyJParser

public JellyJParser(JellyJParserTokenManager tm)
Method Detail

AdditiveExp

public final ExpressionNode AdditiveExp()
throws ParseException

AllocationExp

public final ExpressionNode AllocationExp()
throws ParseException

AndExp

public final ExpressionNode AndExp()
throws ParseException

ArgumentList

public final Vector ArgumentList()
throws ParseException

Arguments

public final Vector Arguments()
throws ParseException

ArrayDimensions

public final Vector ArrayDimensions()
throws ParseException

Assignment

public final ExpressionNode Assignment()
throws ParseException

AssignmentAttempt

public final ExpressionNode AssignmentAttempt()
throws ParseException

AssignmentAttemptExp

public final StatementExpNode AssignmentAttemptExp()
throws ParseException

AssignmentAttemptLookahead

public final void AssignmentAttemptLookahead()
throws ParseException

AssignmentOperator

public final int AssignmentOperator()
throws ParseException

Block

public final BlockNode Block(boolean newScope)
throws ParseException

BlockStatement

public final StatementNode BlockStatement(boolean newScope)
throws ParseException

BooleanLiteral

public final ExpressionNode BooleanLiteral()
throws ParseException

BreakStatement

public final BreakStatementNode BreakStatement()
throws ParseException

CastExp

public final ExpressionNode CastExp()
throws ParseException

CastLookahead

public final void CastLookahead()
throws ParseException

CatchParameter

public final LocalVarDeclarationNode CatchParameter()
throws ParseException

ClassBodyDeclaration

public final ClassBodyDeclarationNode ClassBodyDeclaration()
throws ParseException

ClassDeclaration

public final ClassDeclarationNode ClassDeclaration()
throws ParseException

CompilationUnit

public final CompilationUnitNode CompilationUnit()
throws ParseException
*************************************** THE JELLYJ LANGUAGE GRAMMAR STARTS HERE *

ConditionalAndExp

public final ExpressionNode ConditionalAndExp()
throws ParseException

ConditionalExp

public final ExpressionNode ConditionalExp()
throws ParseException

ConditionalOrExp

public final ExpressionNode ConditionalOrExp()
throws ParseException

ConstructorDeclaration

public final ConstructorDeclarationNode ConstructorDeclaration()
throws ParseException

ConstructorInvocation

public final ConstructorInvocationNode ConstructorInvocation()
throws ParseException

ContinueStatement

public final StatementNode ContinueStatement()
throws ParseException

disable_tracing

public final void disable_tracing()

DoStatement

public final LabeledStatementNode DoStatement()
throws ParseException

EmptyStatement

public final StatementNode EmptyStatement()
throws ParseException

enable_tracing

public final void enable_tracing()

EqualityExp

public final ExpressionNode EqualityExp()
throws ParseException

ExclusiveOrExp

public final ExpressionNode ExclusiveOrExp()
throws ParseException

Expression

public final ExpressionNode Expression()
throws ParseException

FieldDeclaration

public final FieldDeclarationNode FieldDeclaration()
throws ParseException

ForInit

public final StatementNode ForInit()
throws ParseException

FormalParameter

public final FormalParameterNode FormalParameter()
throws ParseException

FormalParameters

public final Vector FormalParameters()
throws ParseException

ForStatement

public final LabeledStatementNode ForStatement()
throws ParseException

ForUpdate

public final StatementExpListNode ForUpdate()
throws ParseException

generateParseException

public final ParseException generateParseException()

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

IfStatement

public final IfStatementNode IfStatement()
throws ParseException

InclusiveOrExp

public final ExpressionNode InclusiveOrExp()
throws ParseException

InstanceOfExp

public final ExpressionNode InstanceOfExp()
throws ParseException

InterfaceDeclaration

public final InterfaceDeclarationNode InterfaceDeclaration()
throws ParseException

InterfaceMemberDeclaration

public final ClassBodyDeclarationNode InterfaceMemberDeclaration()
throws ParseException

LabeledStatement

public final LabeledStatementNode LabeledStatement()
throws ParseException

Literal

public final ExpressionNode Literal()
throws ParseException

LocalVarDeclaration

public final StatementNode LocalVarDeclaration()
throws ParseException

MethodDeclaration

public final MethodDeclarationNode MethodDeclaration()
throws ParseException

MethodDeclarationLookahead

public final void MethodDeclarationLookahead()
throws ParseException

MethodDeclarator

public final void MethodDeclarator(MethodDeclarationNode node)
throws ParseException

MultiplicativeExp

public final ExpressionNode MultiplicativeExp()
throws ParseException

Name

public final Symbol Name()
throws ParseException

NullLiteral

public final ExpressionNode NullLiteral()
throws ParseException

parseProgram

public CompilationUnitNode parseProgram()
throws ParseException
This method is called to start parsing a file.

PostfixExp

public final ExpressionNode PostfixExp()
throws ParseException

PreDecrementExp

public final ExpressionNode PreDecrementExp()
throws ParseException

PreIncrementExp

public final ExpressionNode PreIncrementExp()
throws ParseException

PrimaryExp

public final ExpressionNode PrimaryExp()
throws ParseException

PrimarySuffix

public final ExpressionNode PrimarySuffix(ExpressionNode left)
throws ParseException

PrimitiveTypeExp

public final Type PrimitiveTypeExp()
throws ParseException

recordSourceCoord

public void recordSourceCoord(SyntaxTreeNode node, Token token)
Sets source coordinates for error reporting.

ReInit

public void ReInit(java.io.InputStream stream)

ReInit

public void ReInit(JellyJParserTokenManager tm)

RelationalExp

public final ExpressionNode RelationalExp()
throws ParseException

ResolvedName

public final Symbol ResolvedName()
throws ParseException

ResolvedNameList

public final Vector ResolvedNameList()
throws ParseException

ResultTypeExp

public final Type ResultTypeExp()
throws ParseException

ReturnStatement

public final ReturnStatementNode ReturnStatement()
throws ParseException

ShiftExp

public final ExpressionNode ShiftExp()
throws ParseException

Statement

public final StatementNode Statement(boolean newScope)
throws ParseException

StatementExp

public final StatementExpNode StatementExp()
throws ParseException

StatementExpList

public final StatementExpListNode StatementExpList()
throws ParseException

StaticInitializer

public final StaticInitializerNode StaticInitializer()
throws ParseException

SwitchLabel

public final SwitchLabelNode SwitchLabel()
throws ParseException

SwitchStatement

public final LabeledStatementNode SwitchStatement()
throws ParseException

SynchronizedStatement

public final SynchronizedStatementNode SynchronizedStatement()
throws ParseException

ThrowStatement

public final ThrowStatementNode ThrowStatement()
throws ParseException

TryStatement

public final TryStatementNode TryStatement()
throws ParseException

TypeDeclaration

public final TypeDeclarationNode TypeDeclaration()
throws ParseException

TypeExp

public final Type TypeExp()
throws ParseException

UnaryExp

public final ExpressionNode UnaryExp()
throws ParseException

UnaryExpressionNotPlusMinus

public final ExpressionNode UnaryExpressionNotPlusMinus()
throws ParseException

UnaryMinusExp

public final ExpressionNode UnaryMinusExp()
throws ParseException

UnaryNegExp

public final ExpressionNode UnaryNegExp()
throws ParseException

UnaryNotExp

public final ExpressionNode UnaryNotExp()
throws ParseException

UnaryPlusExp

public final ExpressionNode UnaryPlusExp()
throws ParseException

VariableDeclarator

public final VariableDeclaratorNode VariableDeclarator(boolean fieldFlag)
throws ParseException

VariableDeclaratorId

public final Symbol VariableDeclaratorId()
throws ParseException

VariableInitializer

public final ExpressionNode VariableInitializer()
throws ParseException

WhileStatement

public final LabeledStatementNode WhileStatement()
throws ParseException

Association Links

to Class java.lang.String

The name of the default package

to Class java.lang.String

The name of the default super class

to Class jellyj.util.Symbol

Symbol of the package that corresponds to the class being defined or a default if no package declaration parsed.

to Class jellyj.util.Symbol

Name of the class (and of its superclass) being parsed.

to Class jellyj.util.Symbol

to Class jellyj.util.SymbolTable

This is the compiler's symbol table.

to Class jellyj.parser.JellyJImportManager

This is the compiler's import manager.

to Class jellyj.util.Symbol

The name of the method being parsed.

to Class jellyj.syntaxtree.MethodDeclarationNode

A pointer to the method declaration node of the method being parsed. This is used to create new MethodExpNodes.

to Class jellyj.syntaxtree.BlockNode

During parsing, non-static initializers are collected and at the end added to each constructor.

to Class jellyj.syntaxtree.BlockNode

During parsing, static initializers are collected and at the end added to .

to Class java.util.Vector

A String vector containing all the errors found during parsing.

to Class jellyj.util.IntegerStream

A counter used to keep track of the different scopes within a method.

to Class jellyj.util.IntegerStack

A stack used together with the counter to keep track of the scopes within a method.

to Class jellyj.util.IntegerStack

A stack used to match labels in break and continue statements with their corresponding labeled nodes.

to Class java.util.Vector

Keep track of references to forward types.

to Class jellyj.syntaxtree.CompilationUnitNode

The pointer to the AST root node.

to Class jellyj.parser.JellyJParserTokenManager

to Class jellyj.parser.ASCII_UCodeESC_CharStream

to Class jellyj.parser.Token

to Class jellyj.parser.Token

to Class jellyj.parser.JJJellyJParserCalls

to Class java.util.Vector