Class ClassesFinder

  • All Implemented Interfaces:
    IVoidVisitor

    public class ClassesFinder
    extends DepthFirstVoidVisitor
    The ClassesFinder visitor creates a list of UserClassInfo 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
    • 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 a JavaCCInput 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 interface IVoidVisitor
        Overrides:
        visit in class DepthFirstVoidVisitor
        Parameters:
        n - - the node to visit
      • visit

        public void visit​(JavaCodeProduction n)
        Visits a JavaCodeProduction 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 interface IVoidVisitor
        Overrides:
        visit in class DepthFirstVoidVisitor
        Parameters:
        n - - the node to visit
      • visit

        public void visit​(BNFProduction n)
        Visits a BNFProduction 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 interface IVoidVisitor
        Overrides:
        visit in class DepthFirstVoidVisitor
        Parameters:
        n - - the node to visit
      • visit

        public void visit​(RegularExprProduction n)
        Visits a RegularExprProduction 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 interface IVoidVisitor
        Overrides:
        visit in class DepthFirstVoidVisitor
        Parameters:
        n - - the node to visit
      • visit

        public void visit​(Expansion n)
        Visits a Expansion node, whose children are the following :

        f0 -> ( #0 "LOOKAHEAD" #1 "(" #2 LocalLookahead() #3 ")" )?
        f1 -> ( ExpansionUnit() )+
        s: -2134365682

        Specified by:
        visit in interface IVoidVisitor
        Overrides:
        visit in class DepthFirstVoidVisitor
        Parameters:
        n - - the node to visit
      • visit

        public void visit​(LocalLookahead n)
        Visits a LocalLookahead node, whose children are the following :

        f0 -> [ IntegerLiteral() ]
        f1 -> [ "," ]
        f2 -> [ ExpansionChoices() ]
        f3 -> [ "," ]
        f4 -> [ #0 "{"
        .. .. . #1 [ Expression() ]
        .. .. . #2 "}" ]
        s: -1879920786

        Specified by:
        visit in interface IVoidVisitor
        Overrides:
        visit in class DepthFirstVoidVisitor
        Parameters:
        n - - the node to visit
      • visit

        public void visit​(ExpansionUnit n)
        Visits a ExpansionUnit 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 interface IVoidVisitor
        Overrides:
        visit in class DepthFirstVoidVisitor
        Parameters:
        n - - the node to visit
      • visit

        public void visit​(ExpansionUnitTCF n)
        Visits a ExpansionUnitTCF 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 interface IVoidVisitor
        Overrides:
        visit in class DepthFirstVoidVisitor
        Parameters:
        n - - the node to visit
      • visit

        public void visit​(RegularExpression n)
        Visits a RegularExpression 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 interface IVoidVisitor
        Overrides:
        visit in class DepthFirstVoidVisitor
        Parameters:
        n - - the node to visit