|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GJVisitor<R,A>
All GJ visitors must implement this interface.
Method Summary | |
---|---|
R |
visit(AllocationExpression n,
A argu)
nodeToken -> "new" identifier -> Identifier() nodeToken1 -> "(" nodeToken2 -> ")" |
R |
visit(AndExpression n,
A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "&&" primaryExpression1 -> PrimaryExpression() |
R |
visit(ArrayAllocationExpression n,
A argu)
nodeToken -> "new" nodeToken1 -> "int" nodeToken2 -> "[" expression -> Expression() nodeToken3 -> "]" |
R |
visit(ArrayAssignmentStatement n,
A argu)
identifier -> Identifier() nodeToken -> "[" expression -> Expression() nodeToken1 -> "]" nodeToken2 -> "=" expression1 -> Expression() nodeToken3 -> ";" |
R |
visit(ArrayLength n,
A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "." nodeToken1 -> "length" |
R |
visit(ArrayLookup n,
A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "[" primaryExpression1 -> PrimaryExpression() nodeToken1 -> "]" |
R |
visit(ArrayType n,
A argu)
nodeToken -> "int" nodeToken1 -> "[" nodeToken2 -> "]" |
R |
visit(AssignmentStatement n,
A argu)
identifier -> Identifier() nodeToken -> "=" expression -> Expression() nodeToken1 -> ";" |
R |
visit(Block n,
A argu)
nodeToken -> "{" nodeListOptional -> ( Statement() )* nodeToken1 -> "}" |
R |
visit(BooleanType n,
A argu)
nodeToken -> "boolean" |
R |
visit(BracketExpression n,
A argu)
nodeToken -> "(" expression -> Expression() nodeToken1 -> ")" |
R |
visit(ClassDeclaration n,
A argu)
nodeToken -> "class" identifier -> Identifier() nodeToken1 -> "{" nodeListOptional -> ( VarDeclaration() )* nodeListOptional1 -> ( MethodDeclaration() )* nodeToken2 -> "}" |
R |
visit(ClassExtendsDeclaration n,
A argu)
nodeToken -> "class" identifier -> Identifier() nodeToken1 -> "extends" identifier1 -> Identifier() nodeToken2 -> "{" nodeListOptional -> ( VarDeclaration() )* nodeListOptional1 -> ( MethodDeclaration() )* nodeToken3 -> "}" |
R |
visit(CompareExpression n,
A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "<" primaryExpression1 -> PrimaryExpression() |
R |
visit(Expression n,
A argu)
nodeChoice -> AndExpression() | CompareExpression() | PlusExpression() | MinusExpression() | TimesExpression() | ArrayLookup() | ArrayLength() | MessageSend() | PrimaryExpression() |
R |
visit(ExpressionList n,
A argu)
expression -> Expression() nodeListOptional -> ( ExpressionRest() )* |
R |
visit(ExpressionRest n,
A argu)
nodeToken -> "," expression -> Expression() |
R |
visit(FalseLiteral n,
A argu)
nodeToken -> "false" |
R |
visit(FormalParameter n,
A argu)
type -> Type() identifier -> Identifier() |
R |
visit(FormalParameterList n,
A argu)
formalParameter -> FormalParameter() nodeListOptional -> ( FormalParameterRest() )* |
R |
visit(FormalParameterRest n,
A argu)
nodeToken -> "," formalParameter -> FormalParameter() |
R |
visit(Goal n,
A argu)
mainClass -> MainClass() nodeListOptional -> ( TypeDeclaration() )* nodeToken -> <EOF> |
R |
visit(Identifier n,
A argu)
nodeToken -> <IDENTIFIER> |
R |
visit(IfStatement n,
A argu)
nodeToken -> "if" nodeToken1 -> "(" expression -> Expression() nodeToken2 -> ")" statement -> Statement() nodeToken3 -> "else" statement1 -> Statement() |
R |
visit(IntegerLiteral n,
A argu)
nodeToken -> <INTEGER_LITERAL> |
R |
visit(IntegerType n,
A argu)
nodeToken -> "int" |
R |
visit(MainClass n,
A argu)
nodeToken -> "class" identifier -> Identifier() nodeToken1 -> "{" nodeToken2 -> "public" nodeToken3 -> "static" nodeToken4 -> "void" nodeToken5 -> "main" nodeToken6 -> "(" nodeToken7 -> "String" nodeToken8 -> "[" nodeToken9 -> "]" identifier1 -> Identifier() nodeToken10 -> ")" nodeToken11 -> "{" nodeListOptional -> ( VarDeclaration() )* nodeListOptional1 -> ( Statement() )* nodeToken12 -> "}" nodeToken13 -> "}" |
R |
visit(MessageSend n,
A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "." identifier -> Identifier() nodeToken1 -> "(" nodeOptional -> ( ExpressionList() )? nodeToken2 -> ")" |
R |
visit(MethodDeclaration n,
A argu)
nodeToken -> "public" type -> Type() identifier -> Identifier() nodeToken1 -> "(" nodeOptional -> ( FormalParameterList() )? nodeToken2 -> ")" nodeToken3 -> "{" nodeListOptional -> ( VarDeclaration() )* nodeListOptional1 -> ( Statement() )* nodeToken4 -> "return" expression -> Expression() nodeToken5 -> ";" nodeToken6 -> "}" |
R |
visit(MinusExpression n,
A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "-" primaryExpression1 -> PrimaryExpression() |
R |
visit(NodeList n,
A argu)
|
R |
visit(NodeListOptional n,
A argu)
|
R |
visit(NodeOptional n,
A argu)
|
R |
visit(NodeSequence n,
A argu)
|
R |
visit(NodeToken n,
A argu)
|
R |
visit(NotExpression n,
A argu)
nodeToken -> "!" expression -> Expression() |
R |
visit(PlusExpression n,
A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "+" primaryExpression1 -> PrimaryExpression() |
R |
visit(PrimaryExpression n,
A argu)
nodeChoice -> IntegerLiteral() | TrueLiteral() | FalseLiteral() | Identifier() | ThisExpression() | ArrayAllocationExpression() | AllocationExpression() | NotExpression() | BracketExpression() |
R |
visit(PrintStatement n,
A argu)
nodeToken -> "System.out.println" nodeToken1 -> "(" expression -> Expression() nodeToken2 -> ")" nodeToken3 -> ";" |
R |
visit(Statement n,
A argu)
nodeChoice -> Block() | AssignmentStatement() | ArrayAssignmentStatement() | IfStatement() | WhileStatement() | PrintStatement() |
R |
visit(ThisExpression n,
A argu)
nodeToken -> "this" |
R |
visit(TimesExpression n,
A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "*" primaryExpression1 -> PrimaryExpression() |
R |
visit(TrueLiteral n,
A argu)
nodeToken -> "true" |
R |
visit(Type n,
A argu)
nodeChoice -> ArrayType() | BooleanType() | IntegerType() | Identifier() |
R |
visit(TypeDeclaration n,
A argu)
nodeChoice -> ClassDeclaration() | ClassExtendsDeclaration() |
R |
visit(VarDeclaration n,
A argu)
type -> Type() identifier -> Identifier() nodeToken -> ";" |
R |
visit(WhileStatement n,
A argu)
nodeToken -> "while" nodeToken1 -> "(" expression -> Expression() nodeToken2 -> ")" statement -> Statement() |
Method Detail |
---|
R visit(NodeList n, A argu)
R visit(NodeListOptional n, A argu)
R visit(NodeOptional n, A argu)
R visit(NodeSequence n, A argu)
R visit(NodeToken n, A argu)
R visit(Goal n, A argu)
mainClass -> MainClass() nodeListOptional -> ( TypeDeclaration() )* nodeToken -> <EOF>
R visit(MainClass n, A argu)
nodeToken -> "class" identifier -> Identifier() nodeToken1 -> "{" nodeToken2 -> "public" nodeToken3 -> "static" nodeToken4 -> "void" nodeToken5 -> "main" nodeToken6 -> "(" nodeToken7 -> "String" nodeToken8 -> "[" nodeToken9 -> "]" identifier1 -> Identifier() nodeToken10 -> ")" nodeToken11 -> "{" nodeListOptional -> ( VarDeclaration() )* nodeListOptional1 -> ( Statement() )* nodeToken12 -> "}" nodeToken13 -> "}"
R visit(TypeDeclaration n, A argu)
nodeChoice -> ClassDeclaration() | ClassExtendsDeclaration()
R visit(ClassDeclaration n, A argu)
nodeToken -> "class" identifier -> Identifier() nodeToken1 -> "{" nodeListOptional -> ( VarDeclaration() )* nodeListOptional1 -> ( MethodDeclaration() )* nodeToken2 -> "}"
R visit(ClassExtendsDeclaration n, A argu)
nodeToken -> "class" identifier -> Identifier() nodeToken1 -> "extends" identifier1 -> Identifier() nodeToken2 -> "{" nodeListOptional -> ( VarDeclaration() )* nodeListOptional1 -> ( MethodDeclaration() )* nodeToken3 -> "}"
R visit(VarDeclaration n, A argu)
type -> Type() identifier -> Identifier() nodeToken -> ";"
R visit(MethodDeclaration n, A argu)
nodeToken -> "public" type -> Type() identifier -> Identifier() nodeToken1 -> "(" nodeOptional -> ( FormalParameterList() )? nodeToken2 -> ")" nodeToken3 -> "{" nodeListOptional -> ( VarDeclaration() )* nodeListOptional1 -> ( Statement() )* nodeToken4 -> "return" expression -> Expression() nodeToken5 -> ";" nodeToken6 -> "}"
R visit(FormalParameterList n, A argu)
formalParameter -> FormalParameter() nodeListOptional -> ( FormalParameterRest() )*
R visit(FormalParameter n, A argu)
type -> Type() identifier -> Identifier()
R visit(FormalParameterRest n, A argu)
nodeToken -> "," formalParameter -> FormalParameter()
R visit(Type n, A argu)
nodeChoice -> ArrayType() | BooleanType() | IntegerType() | Identifier()
R visit(ArrayType n, A argu)
nodeToken -> "int" nodeToken1 -> "[" nodeToken2 -> "]"
R visit(BooleanType n, A argu)
nodeToken -> "boolean"
R visit(IntegerType n, A argu)
nodeToken -> "int"
R visit(Statement n, A argu)
nodeChoice -> Block() | AssignmentStatement() | ArrayAssignmentStatement() | IfStatement() | WhileStatement() | PrintStatement()
R visit(Block n, A argu)
nodeToken -> "{" nodeListOptional -> ( Statement() )* nodeToken1 -> "}"
R visit(AssignmentStatement n, A argu)
identifier -> Identifier() nodeToken -> "=" expression -> Expression() nodeToken1 -> ";"
R visit(ArrayAssignmentStatement n, A argu)
identifier -> Identifier() nodeToken -> "[" expression -> Expression() nodeToken1 -> "]" nodeToken2 -> "=" expression1 -> Expression() nodeToken3 -> ";"
R visit(IfStatement n, A argu)
nodeToken -> "if" nodeToken1 -> "(" expression -> Expression() nodeToken2 -> ")" statement -> Statement() nodeToken3 -> "else" statement1 -> Statement()
R visit(WhileStatement n, A argu)
nodeToken -> "while" nodeToken1 -> "(" expression -> Expression() nodeToken2 -> ")" statement -> Statement()
R visit(PrintStatement n, A argu)
nodeToken -> "System.out.println" nodeToken1 -> "(" expression -> Expression() nodeToken2 -> ")" nodeToken3 -> ";"
R visit(Expression n, A argu)
nodeChoice -> AndExpression() | CompareExpression() | PlusExpression() | MinusExpression() | TimesExpression() | ArrayLookup() | ArrayLength() | MessageSend() | PrimaryExpression()
R visit(AndExpression n, A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "&&" primaryExpression1 -> PrimaryExpression()
R visit(CompareExpression n, A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "<" primaryExpression1 -> PrimaryExpression()
R visit(PlusExpression n, A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "+" primaryExpression1 -> PrimaryExpression()
R visit(MinusExpression n, A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "-" primaryExpression1 -> PrimaryExpression()
R visit(TimesExpression n, A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "*" primaryExpression1 -> PrimaryExpression()
R visit(ArrayLookup n, A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "[" primaryExpression1 -> PrimaryExpression() nodeToken1 -> "]"
R visit(ArrayLength n, A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "." nodeToken1 -> "length"
R visit(MessageSend n, A argu)
primaryExpression -> PrimaryExpression() nodeToken -> "." identifier -> Identifier() nodeToken1 -> "(" nodeOptional -> ( ExpressionList() )? nodeToken2 -> ")"
R visit(ExpressionList n, A argu)
expression -> Expression() nodeListOptional -> ( ExpressionRest() )*
R visit(ExpressionRest n, A argu)
nodeToken -> "," expression -> Expression()
R visit(PrimaryExpression n, A argu)
nodeChoice -> IntegerLiteral() | TrueLiteral() | FalseLiteral() | Identifier() | ThisExpression() | ArrayAllocationExpression() | AllocationExpression() | NotExpression() | BracketExpression()
R visit(IntegerLiteral n, A argu)
nodeToken -> <INTEGER_LITERAL>
R visit(TrueLiteral n, A argu)
nodeToken -> "true"
R visit(FalseLiteral n, A argu)
nodeToken -> "false"
R visit(Identifier n, A argu)
nodeToken -> <IDENTIFIER>
R visit(ThisExpression n, A argu)
nodeToken -> "this"
R visit(ArrayAllocationExpression n, A argu)
nodeToken -> "new" nodeToken1 -> "int" nodeToken2 -> "[" expression -> Expression() nodeToken3 -> "]"
R visit(AllocationExpression n, A argu)
nodeToken -> "new" identifier -> Identifier() nodeToken1 -> "(" nodeToken2 -> ")"
R visit(NotExpression n, A argu)
nodeToken -> "!" expression -> Expression()
R visit(BracketExpression n, A argu)
nodeToken -> "(" expression -> Expression() nodeToken1 -> ")"
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |