Class ClassesFinder
- java.lang.Object
-
- EDU.purdue.jtb.parser.visitor.DepthFirstVoidVisitor
-
- EDU.purdue.jtb.analyse.ClassesFinder
-
- All Implemented Interfaces:
IVoidVisitor
public class ClassesFinder extends DepthFirstVoidVisitor
TheClassesFinder
visitor creates a list ofUserClassInfo
objects describing every class to be generated.This visitor is supposed to be run once and not supposed to be run in parallel threads (on the same grammar).
Programming note: we do not continue down the tree once a new field has been added to curClass, as we only worry about top-level expansions.
TESTCASE some to add
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class EDU.purdue.jtb.parser.visitor.DepthFirstVoidVisitor
DepthFirstVoidVisitor.ShouldNotOccurException
-
-
Constructor Summary
Constructors Constructor Description ClassesFinder(GlobalDataBuilder aGdbv)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<UserClassInfo>
getClasses()
Getter for the class list.void
visit(BNFProduction n)
Visits aBNFProduction
node, whose children are the following :void
visit(Expansion n)
Visits aExpansion
node, whose children are the following :void
visit(ExpansionChoices n)
Visits aExpansionChoices
node, whose children are the following :void
visit(ExpansionUnit n)
Visits aExpansionUnit
node, whose child is the following :void
visit(ExpansionUnitTCF n)
Visits aExpansionUnitTCF
node, whose children are the following :void
visit(IdentifierAsString n)
Visits aIdentifierAsString
node, whose child is the following :void
visit(JavaCCInput n)
Visits aJavaCCInput
node, whose children are the following :void
visit(JavaCodeProduction n)
Visits aJavaCodeProduction
node, whose children are the following :void
visit(LocalLookahead n)
Visits aLocalLookahead
node, whose children are the following :void
visit(RegularExpression n)
Visits aRegularExpression
node, whose child is the following :void
visit(RegularExprProduction n)
Visits aRegularExprProduction
node, whose children are the following :void
visit(TokenManagerDecls n)
Visits aTokenManagerDecls
node, whose children are the following :-
Methods inherited from class EDU.purdue.jtb.parser.visitor.DepthFirstVoidVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
-
-
-
Constructor Detail
-
ClassesFinder
public ClassesFinder(GlobalDataBuilder aGdbv)
Constructor.- Parameters:
aGdbv
- - theGlobalDataBuilder
visitor
-
-
Method Detail
-
getClasses
public java.util.List<UserClassInfo> getClasses()
Getter for the class list.- Returns:
- the class list
-
visit
public void visit(JavaCCInput n)
Visits aJavaCCInput
node, whose children are the following :f0 -> JavaCCOptions()
f1 -> "PARSER_BEGIN"
f2 -> "("
f3 -> IdentifierAsString()
f4 -> ")"
f5 -> CompilationUnit()
f6 -> "PARSER_END"
f7 -> "("
f8 -> IdentifierAsString()
f9 -> ")"
f10 -> ( Production() )+
f11 -> < EOF >
s: 1465207473- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(JavaCodeProduction n)
Visits aJavaCodeProduction
node, whose children are the following :f0 -> "JAVACODE"
f1 -> AccessModifier()
f2 -> ResultType()
f3 -> IdentifierAsString()
f4 -> FormalParameters()
f5 -> [ #0 "throws" #1 Name()
.. .. . #2 ( $0 "," $1 Name() )* ]
f6 -> [ "%" ]
f7 -> Block()
s: -763138104- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(BNFProduction n)
Visits aBNFProduction
node, whose children are the following :f0 -> AccessModifier()
f1 -> ResultType()
f2 -> IdentifierAsString()
f3 -> FormalParameters()
f4 -> [ #0 "throws" #1 Name()
.. .. . #2 ( $0 "," $1 Name() )* ]
f5 -> [ "!" ]
f6 -> ":"
f7 -> Block()
f8 -> "{"
f9 -> ExpansionChoices()
f10 -> "}"
s: 1323482450- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(RegularExprProduction n)
Visits aRegularExprProduction
node, whose children are the following :f0 -> [ %0 #0 "<" #1 "*" #2 ">"
.. .. | %1 #0 "<" #1 < IDENTIFIER >
.. .. . .. #2 ( $0 "," $1 < IDENTIFIER > )*
.. .. . .. #3 ">" ]
f1 -> RegExprKind()
f2 -> [ #0 "[" #1 "IGNORE_CASE" #2 "]" ]
f3 -> ":"
f4 -> "{"
f5 -> RegExprSpec()
f6 -> ( #0 "|" #1 RegExprSpec() )*
f7 -> "}"
s: 484788342- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(TokenManagerDecls n)
Visits aTokenManagerDecls
node, whose children are the following :f0 -> "TOKEN_MGR_DECLS"
f1 -> ":"
f2 -> ClassOrInterfaceBody()
s: -1566997219- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ExpansionChoices n)
Visits aExpansionChoices
node, whose children are the following :f0 -> Expansion()
f1 -> ( #0 "|" #1 Expansion() )*
s: -1726831935- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(Expansion n)
Visits aExpansion
node, whose children are the following :f0 -> ( #0 "LOOKAHEAD" #1 "(" #2 LocalLookahead() #3 ")" )?
f1 -> ( ExpansionUnit() )+
s: -2134365682- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(LocalLookahead n)
Visits aLocalLookahead
node, whose children are the following :f0 -> [ IntegerLiteral() ]
f1 -> [ "," ]
f2 -> [ ExpansionChoices() ]
f3 -> [ "," ]
f4 -> [ #0 "{"
.. .. . #1 [ Expression() ]
.. .. . #2 "}" ]
s: -1879920786- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ExpansionUnit n)
Visits aExpansionUnit
node, whose child is the following :f0 -> . %0 #0 "LOOKAHEAD" #1 "(" #2 LocalLookahead() #3 ")"
.. .. | %1 Block()
.. .. | %2 #0 "[" #1 ExpansionChoices() #2 "]"
.. .. | %3 ExpansionUnitTCF()
.. .. | %4 #0 [ $0 PrimaryExpression() $1 "=" ]
.. .. . .. #1 ( &0 $0 IdentifierAsString() $1 Arguments()
.. .. . .. .. . .. $2 [ "!" ]
.. .. . .. .. | &1 $0 RegularExpression()
.. .. . .. .. . .. $1 [ ?0 "." ?1 < IDENTIFIER > ]
.. .. . .. .. . .. $2 [ "!" ] )
.. .. | %5 #0 "(" #1 ExpansionChoices() #2 ")"
.. .. . .. #3 ( &0 "+"
.. .. . .. .. | &1 "*"
.. .. . .. .. | &2 "?" )?
s: 1116287061- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ExpansionUnitTCF n)
Visits aExpansionUnitTCF
node, whose children are the following :f0 -> "try"
f1 -> "{"
f2 -> ExpansionChoices()
f3 -> "}"
f4 -> ( #0 "catch" #1 "("
.. .. . #2 ( Annotation() )*
.. .. . #3 [ "final" ]
.. .. . #4 Name() #5 < IDENTIFIER > #6 ")" #7 Block() )*
f5 -> [ #0 "finally" #1 Block() ]
s: 1601707097- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(RegularExpression n)
Visits aRegularExpression
node, whose child is the following :f0 -> . %0 StringLiteral()
.. .. | %1 #0 "<"
.. .. . .. #1 [ $0 [ "#" ]
.. .. . .. .. . $1 IdentifierAsString() $2 ":" ]
.. .. . .. #2 ComplexRegularExpressionChoices() #3 ">"
.. .. | %2 #0 "<" #1 IdentifierAsString() #2 ">"
.. .. | %3 #0 "<" #1 "EOF" #2 ">"
s: 1719627151- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(IdentifierAsString n)
Visits aIdentifierAsString
node, whose child is the following :f0 -> < IDENTIFIER >
s: -1580059612- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
-