Class JavaPrinter
- java.lang.Object
-
- EDU.purdue.jtb.parser.visitor.DepthFirstVoidVisitor
-
- EDU.purdue.jtb.common.JavaPrinter
-
- All Implemented Interfaces:
IVoidVisitor
public class JavaPrinter extends DepthFirstVoidVisitor
TheJavaPrinter
visitor reprints (with indentation) JavaCC grammar Java specific productions. CODEJAVANotes :
- it merely adds spaces and new lines (LS) to the default visitor between identifiers/keywords/punctuation
- so methods have been copied from the default visitor, variables have been inlined, and for index-loops have been refactored to for-each loops
- sb.append(spc.spc), sb.append(' ') and sb.append(LS) are done at the highest (calling) level (except for Modifiers() and VariableModifiers() which prints the last space if not empty)
- sb.append(spc.spc) is done after sb.append(LS)
- sb.append(' ') is not merged with printing punctuation / operators (to prepare evolutions for other formatting preferences), but is indeed merged with printing keywords
Visitor maintains state (for a grammar), and not supposed to be run in parallel threads (on the same grammar).
TODO extract / refactor methods for custom formatting
TESTCASE some to add
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class EDU.purdue.jtb.parser.visitor.DepthFirstVoidVisitor
DepthFirstVoidVisitor.ShouldNotOccurException
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JavaPrinter(JTBOptions aJopt, java.lang.StringBuilder aSb, Spacing aSPC)
Constructor with a given buffer and indentation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
oneNewLine(INode n)
Prints into the current buffer a node class comment and a new line.protected void
oneNewLine(INode n, java.lang.String str)
Prints into the current buffer a node class comment, an extra given comment, and a new line.protected void
twoNewLines(INode n)
Prints twice into the current buffer a node class comment and a new line.protected void
twoNewLines(INode n, java.lang.String str)
Prints twice into the current buffer a node class comment, an extra given comment, and a new line.void
visit(AdditiveExpression n)
Visits aAdditiveExpression
node, whose children are the following :void
visit(AllocationExpression n)
Visits aAllocationExpression
node, whose child is the following :void
visit(AndExpression n)
Visits aAndExpression
node, whose children are the following :void
visit(AnnotationTypeBody n)
Visits aAnnotationTypeBody
node, whose children are the following :void
visit(AnnotationTypeDeclaration n)
Visits aAnnotationTypeDeclaration
node, whose children are the following :void
visit(AnnotationTypeMemberDeclaration n)
Visits aAnnotationTypeMemberDeclaration
node, whose child is the following :void
visit(ArgumentList n)
Visits aArgumentList
node, whose children are the following :void
visit(ArrayInitializer n)
Visits aArrayInitializer
node, whose children are the following :void
visit(AssertStatement n)
Visits aAssertStatement
node, whose children are the following :void
visit(Block n)
Visits aBlock
node, whose children are the following :void
visit(BooleanLiteral n)
Visits aBooleanLiteral
node, whose child is the following :void
visit(BreakStatement n)
Visits aBreakStatement
node, whose children are the following :void
visit(CastLookahead n)
Visits aCastLookahead
node, whose child is the following :void
visit(ClassOrInterfaceBody n)
Visits aClassOrInterfaceBody
node, whose children are the following :void
visit(ClassOrInterfaceDeclaration n)
Visits aClassOrInterfaceDeclaration
node, whose children are the following :void
visit(CompilationUnit n)
Visits aCompilationUnit
node, whose children are the following :void
visit(ConditionalAndExpression n)
Visits aConditionalAndExpression
node, whose children are the following :void
visit(ConditionalExpression n)
Visits aConditionalExpression
node, whose children are the following :void
visit(ConditionalOrExpression n)
Visits aConditionalOrExpression
node, whose children are the following :void
visit(ConstructorDeclaration n)
Visits aConstructorDeclaration
node, whose children are the following :void
visit(ContinueStatement n)
Visits aContinueStatement
node, whose children are the following :void
visit(DoStatement n)
Visits aDoStatement
node, whose children are the following :void
visit(EnumBody n)
Visits aEnumBody
node, whose children are the following :void
visit(EnumDeclaration n)
Visits aEnumDeclaration
node, whose children are the following :void
visit(EqualityExpression n)
Visits aEqualityExpression
node, whose children are the following :void
visit(ExclusiveOrExpression n)
Visits aExclusiveOrExpression
node, whose children are the following :void
visit(ExplicitConstructorInvocation n)
Visits aExplicitConstructorInvocation
node, whose child is the following :void
visit(Expression n)
Visits aExpression
node, whose children are the following :void
visit(ExtendsList n)
Visits aExtendsList
node, whose children are the following :void
visit(FieldDeclaration n)
Visits aFieldDeclaration
node, whose children are the following :void
visit(FormalParameter n)
Visits aFormalParameter
node, whose children are the following :void
visit(FormalParameters n)
Visits aFormalParameters
node, whose children are the following :void
visit(ForStatement n)
Visits aForStatement
node, whose children are the following :void
visit(IfStatement n)
Visits aIfStatement
node, whose children are the following :void
visit(ImplementsList n)
Visits aImplementsList
node, whose children are the following :void
visit(ImportDeclaration n)
Visits aImportDeclaration
node, whose children are the following :void
visit(InclusiveOrExpression n)
Visits aInclusiveOrExpression
node, whose children are the following :void
visit(Initializer n)
Visits aInitializer
node, whose children are the following :void
visit(InstanceOfExpression n)
Visits aInstanceOfExpression
node, whose children are the following :void
visit(IntegerLiteral n)
Visits aIntegerLiteral
node, whose child is the following :void
visit(LabeledStatement n)
Visits aLabeledStatement
node, whose children are the following :void
visit(Literal n)
Visits aLiteral
node, whose child is the following :void
visit(LocalVariableDeclaration n)
Visits aLocalVariableDeclaration
node, whose children are the following :void
visit(MemberValue n)
Visits aMemberValue
node, whose child is the following :void
visit(MemberValueArrayInitializer n)
Visits aMemberValueArrayInitializer
node, whose children are the following :void
visit(MemberValuePair n)
Visits aMemberValuePair
node, whose children are the following :void
visit(MemberValuePairs n)
Visits aMemberValuePairs
node, whose children are the following :void
visit(MethodDeclaration n)
Visits aMethodDeclaration
node, whose children are the following :void
visit(Modifiers n)
Visits aModifiers
node, whose child is the following :void
visit(MultiplicativeExpression n)
Visits aMultiplicativeExpression
node, whose children are the following :void
visit(NameList n)
Visits aNameList
node, whose children are the following :void
visit(NullLiteral n)
Visits aNullLiteral
node, whose child is the following :void
visit(PackageDeclaration n)
Visits aPackageDeclaration
node, whose children are the following :void
visit(RelationalExpression n)
Visits aRelationalExpression
node, whose children are the following :void
visit(ReturnStatement n)
Visits aReturnStatement
node, whose children are the following :void
visit(ShiftExpression n)
Visits aShiftExpression
node, whose children are the following :void
visit(Statement n)
Visits aStatement
node, whose child is the following :void
visit(StatementExpression n)
Visits aStatementExpression
node, whose child is the following :void
visit(StatementExpressionList n)
Visits aStatementExpressionList
node, whose children are the following :void
visit(StringLiteral n)
Visits aStringLiteral
node, whose child is the following :void
visit(SwitchLabel n)
Visits aSwitchLabel
node, whose child is the following :void
visit(SwitchStatement n)
Visits aSwitchStatement
node, whose children are the following :void
visit(SynchronizedStatement n)
Visits aSynchronizedStatement
node, whose children are the following :void
visit(ThrowStatement n)
Visits aThrowStatement
node, whose children are the following :void
visit(TryStatement n)
Visits aTryStatement
node, whose children are the following :void
visit(TypeArgument n)
Visits aTypeArgument
node, whose child is the following :void
visit(TypeArguments n)
Visits aTypeArguments
node, whose children are the following :void
visit(TypeBound n)
Visits aTypeBound
node, whose children are the following :void
visit(TypeParameter n)
Visits aTypeParameter
node, whose children are the following :void
visit(TypeParameters n)
Visits aTypeParameters
node, whose children are the following :void
visit(VariableDeclarator n)
Visits aVariableDeclarator
node, whose children are the following :void
visit(VariableModifiers n)
Visits aVariableModifiers
node, whose child is the following :void
visit(WhileStatement n)
Visits aWhileStatement
node, whose children are the following :void
visit(WildcardBounds n)
Visits aWildcardBounds
node, whose child is the following :void
visit(Token n)
Visits a Token.-
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
-
-
-
-
Field Detail
-
sb
protected java.lang.StringBuilder sb
The buffer to print into
-
spc
protected Spacing spc
The indentation object
-
JNCDCP
public java.lang.String JNCDCP
The node class comment prefix
-
-
Constructor Detail
-
JavaPrinter
protected JavaPrinter(JTBOptions aJopt, java.lang.StringBuilder aSb, Spacing aSPC)
Constructor with a given buffer and indentation.- Parameters:
aJopt
- - the JTB optionsaSb
- - the buffer to print into (will be allocated if null)aSPC
- - the Spacing indentation object (will be allocated and set to a default if null)
-
-
Method Detail
-
visit
public void visit(Token n)
Visits a Token.- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
oneNewLine
protected void oneNewLine(INode n)
Prints into the current buffer a node class comment and a new line.- Parameters:
n
- - the node for the node class comment
-
oneNewLine
protected void oneNewLine(INode n, java.lang.String str)
Prints into the current buffer a node class comment, an extra given comment, and a new line.- Parameters:
n
- - the node for the node class commentstr
- - the extra comment
-
twoNewLines
protected void twoNewLines(INode n)
Prints twice into the current buffer a node class comment and a new line.- Parameters:
n
- - the node for the node class comment
-
twoNewLines
protected void twoNewLines(INode n, java.lang.String str)
Prints twice into the current buffer a node class comment, an extra given comment, and a new line.- Parameters:
n
- - the node for the node class commentstr
- - the extra comment
-
visit
public void visit(CompilationUnit n)
Visits aCompilationUnit
node, whose children are the following :f0 -> [ PackageDeclaration() ]
f1 -> ( ImportDeclaration() )*
f2 -> ( TypeDeclaration() )*
s: 1761039264- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(PackageDeclaration n)
Visits aPackageDeclaration
node, whose children are the following :f0 -> "package"
f1 -> Name()
f2 -> ";"
s: -2133750237- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ImportDeclaration n)
Visits aImportDeclaration
node, whose children are the following :f0 -> "import"
f1 -> [ "static" ]
f2 -> Name()
f3 -> [ #0 "." #1 "*" ]
f4 -> ";"
s: -1592912780- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(Modifiers n)
Visits aModifiers
node, whose child is the following :f0 -> ( ( %00 "public"
.. .. . | %01 "static"
.. .. . | %02 "protected"
.. .. . | %03 "private"
.. .. . | %04 "final"
.. .. . | %05 "abstract"
.. .. . | %06 "synchronized"
.. .. . | %07 "native"
.. .. . | %08 "transient"
.. .. . | %09 "volatile"
.. .. . | %10 "strictfp"
.. .. . | %11 Annotation() ) )*
s: -2047145049- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ClassOrInterfaceDeclaration n)
Visits aClassOrInterfaceDeclaration
node, whose children are the following :f0 -> ( %0 "class"
.. .. | %1 "interface" )
f1 -> < IDENTIFIER >
f2 -> [ TypeParameters() ]
f3 -> [ ExtendsList() ]
f4 -> [ ImplementsList() ]
f5 -> ClassOrInterfaceBody()
s: 37426766- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ExtendsList n)
Visits aExtendsList
node, whose children are the following :f0 -> "extends"
f1 -> ClassOrInterfaceType()
f2 -> ( #0 "," #1 ClassOrInterfaceType() )*
s: 24279225- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ImplementsList n)
Visits aImplementsList
node, whose children are the following :f0 -> "implements"
f1 -> ClassOrInterfaceType()
f2 -> ( #0 "," #1 ClassOrInterfaceType() )*
s: 1830366786- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(EnumDeclaration n)
Visits aEnumDeclaration
node, whose children are the following :f0 -> "enum"
f1 -> < IDENTIFIER >
f2 -> [ ImplementsList() ]
f3 -> EnumBody()
s: 359041865- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(EnumBody n)
Visits aEnumBody
node, whose children are the following :f0 -> "{"
f1 -> [ #0 EnumConstant()
.. .. . #1 ( $0 "," $1 EnumConstant() )* ]
f2 -> [ "," ]
f3 -> [ #0 ";"
.. .. . #1 ( ClassOrInterfaceBodyDeclaration() )* ]
f4 -> "}"
s: -1338633176- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(TypeParameters n)
Visits aTypeParameters
node, whose children are the following :f0 -> "<"
f1 -> TypeParameter()
f2 -> ( #0 "," #1 TypeParameter() )*
f3 -> ">"
s: 1962566888- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(TypeParameter n)
Visits aTypeParameter
node, whose children are the following :f0 -> < IDENTIFIER > //cp Expansion expLvl==0
f1 -> [ TypeBound() ] //cp ExpansionChoices only f0
s: 1306471903- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(TypeBound n)
Visits aTypeBound
node, whose children are the following :f0 -> "extends"
f1 -> ClassOrInterfaceType()
f2 -> ( #0 "&" #1 ClassOrInterfaceType() )*
s: -2080520397- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ClassOrInterfaceBody n)
Visits aClassOrInterfaceBody
node, whose children are the following :f0 -> "{"
f1 -> ( ClassOrInterfaceBodyDeclaration() )*
f2 -> "}"
s: 1154515364- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(FieldDeclaration n)
Visits aFieldDeclaration
node, whose children are the following :f0 -> Type()
f1 -> VariableDeclarator()
f2 -> ( #0 "," #1 VariableDeclarator() )*
f3 -> ";"
s: 1567612384- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(VariableDeclarator n)
Visits aVariableDeclarator
node, whose children are the following :f0 -> VariableDeclaratorId()
f1 -> [ #0 "=" #1 VariableInitializer() ]
s: -484955779- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ArrayInitializer n)
Visits aArrayInitializer
node, whose children are the following :f0 -> "{"
f1 -> [ #0 VariableInitializer()
.. .. . #1 ( $0 "," $1 VariableInitializer() )* ]
f2 -> [ "," ]
f3 -> "}"
s: -251326055- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(MethodDeclaration n)
Visits aMethodDeclaration
node, whose children are the following :f0 -> [ TypeParameters() ]
f1 -> ResultType()
f2 -> MethodDeclarator()
f3 -> [ #0 "throws" #1 NameList() ]
f4 -> ( %0 Block()
.. .. | %1 ";" )
s: -418256626- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(FormalParameters n)
Visits aFormalParameters
node, whose children are the following :f0 -> "("
f1 -> [ #0 FormalParameter()
.. .. . #1 ( $0 "," $1 FormalParameter() )* ]
f2 -> ")"
s: -97312104- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(FormalParameter n)
Visits aFormalParameter
node, whose children are the following :f0 -> Modifiers()
f1 -> Type()
f2 -> [ "..." ]
f3 -> VariableDeclaratorId()
s: -1358852705- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ConstructorDeclaration n)
Visits aConstructorDeclaration
node, whose children are the following :f0 -> [ TypeParameters() ]
f1 -> < IDENTIFIER >
f2 -> FormalParameters()
f3 -> [ #0 "throws" #1 NameList() ]
f4 -> "{"
f5 -> [ ExplicitConstructorInvocation() ]
f6 -> ( BlockStatement() )*
f7 -> "}"
s: 1258397065- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ExplicitConstructorInvocation n)
Visits aExplicitConstructorInvocation
node, whose child is the following :f0 -> ( %0 #0 [ $0 "<" $1 ReferenceType()
.. .. . .. .. . $2 ( ?0 "," ?1 ReferenceType() )*
.. .. . .. .. . $3 ">" ]
.. .. . .. #1 ( &0 $0 "this" $1 Arguments() $2 ";"
.. .. . .. .. | &1 $0 "super" $1 Arguments() $2 ";" )
.. .. | %1 ( #0 PrimaryExpression() #1 "." #2 "super" #3 Arguments() #4 ";" ) )
s: -492225557- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(Initializer n)
Visits aInitializer
node, whose children are the following :f0 -> [ "static" ]
f1 -> Block()
s: -423135641- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(TypeArguments n)
Visits aTypeArguments
node, whose children are the following :f0 -> "<"
f1 -> TypeArgument()
f2 -> ( #0 "," #1 TypeArgument() )*
f3 -> ">"
s: 131755052- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(TypeArgument n)
Visits aTypeArgument
node, whose child is the following :f0 -> . %0 ReferenceType()
.. .. | %1 #0 "?"
.. .. . .. #1 [ WildcardBounds() ]
s: 36461692- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(WildcardBounds n)
Visits aWildcardBounds
node, whose child is the following :f0 -> . %0 #0 "extends" #1 ReferenceType()
.. .. | %1 #0 "super" #1 ReferenceType()
s: 122808000- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(NameList n)
Visits aNameList
node, whose children are the following :f0 -> Name()
f1 -> ( #0 "," #1 Name() )*
s: -1147957113- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(Expression n)
Visits aExpression
node, whose children are the following :f0 -> ConditionalExpression()
f1 -> [ #0 AssignmentOperator() #1 Expression() ]
s: -1186270200- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ConditionalExpression n)
Visits aConditionalExpression
node, whose children are the following :f0 -> ConditionalOrExpression()
f1 -> [ #0 "?" #1 Expression() #2 ":" #3 Expression() ]
s: -1150694214- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ConditionalOrExpression n)
Visits aConditionalOrExpression
node, whose children are the following :f0 -> ConditionalAndExpression()
f1 -> ( #0 "||" #1 ConditionalAndExpression() )*
s: -1592298777- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ConditionalAndExpression n)
Visits aConditionalAndExpression
node, whose children are the following :f0 -> InclusiveOrExpression()
f1 -> ( #0 "&&" #1 InclusiveOrExpression() )*
s: -1425815203- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(InclusiveOrExpression n)
Visits aInclusiveOrExpression
node, whose children are the following :f0 -> ExclusiveOrExpression()
f1 -> ( #0 "|" #1 ExclusiveOrExpression() )*
s: 963402497- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ExclusiveOrExpression n)
Visits aExclusiveOrExpression
node, whose children are the following :f0 -> AndExpression()
f1 -> ( #0 "^" #1 AndExpression() )*
s: -1241708769- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(AndExpression n)
Visits aAndExpression
node, whose children are the following :f0 -> EqualityExpression()
f1 -> ( #0 "&" #1 EqualityExpression() )*
s: -629554573- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(EqualityExpression n)
Visits aEqualityExpression
node, whose children are the following :f0 -> InstanceOfExpression()
f1 -> ( #0 ( %0 "=="
.. .. . .. | %1 "!=" )
.. .. . #1 InstanceOfExpression() )*
s: 1053085061- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(InstanceOfExpression n)
Visits aInstanceOfExpression
node, whose children are the following :f0 -> RelationalExpression()
f1 -> [ #0 "instanceof" #1 Type() ]
s: 933354553- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(RelationalExpression n)
Visits aRelationalExpression
node, whose children are the following :f0 -> ShiftExpression()
f1 -> ( #0 ( %0 "<"
.. .. . .. | %1 ">"
.. .. . .. | %2 "<="
.. .. . .. | %3 ">=" )
.. .. . #1 ShiftExpression() )*
s: 1473482530- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ShiftExpression n)
Visits aShiftExpression
node, whose children are the following :f0 -> AdditiveExpression()
f1 -> ( #0 ( %0 "<<"
.. .. . .. | %1 RUnsignedShift()
.. .. . .. | %2 RSignedShift() )
.. .. . #1 AdditiveExpression() )*
s: 1210478291- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(AdditiveExpression n)
Visits aAdditiveExpression
node, whose children are the following :f0 -> MultiplicativeExpression()
f1 -> ( #0 ( %0 "+"
.. .. . .. | %1 "-" )
.. .. . #1 MultiplicativeExpression() )*
s: -1807059397- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(MultiplicativeExpression n)
Visits aMultiplicativeExpression
node, whose children are the following :f0 -> UnaryExpression()
f1 -> ( #0 ( %0 "*"
.. .. . .. | %1 "/"
.. .. . .. | %2 "%" )
.. .. . #1 UnaryExpression() )*
s: 853643830- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(CastLookahead n)
Visits aCastLookahead
node, whose child is the following :f0 -> . %0 #0 "(" #1 PrimitiveType()
.. .. | %1 #0 "(" #1 Type() #2 "[" #3 "]"
.. .. | %2 #0 "(" #1 Type() #2 ")"
.. .. . .. #3 ( &0 "~"
.. .. . .. .. | &1 "!"
.. .. . .. .. | &2 "("
.. .. . .. .. | &3 < IDENTIFIER >
.. .. . .. .. | &4 "this"
.. .. . .. .. | &5 "super"
.. .. . .. .. | &6 "new"
.. .. . .. .. | &7 Literal() )
s: 611584359- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(Literal n)
Visits aLiteral
node, whose child is the following :f0 -> . %0 < INTEGER_LITERAL >
.. .. | %1 < FLOATING_POINT_LITERAL >
.. .. | %2 < CHARACTER_LITERAL >
.. .. | %3 < STRING_LITERAL >
.. .. | %4 BooleanLiteral()
.. .. | %5 NullLiteral()
s: 454259936- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(IntegerLiteral n)
Visits aIntegerLiteral
node, whose child is the following :f0 -> < INTEGER_LITERAL >
s: -1048223857- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(BooleanLiteral n)
Visits aBooleanLiteral
node, whose child is the following :f0 -> . %0 "true"
.. .. | %1 "false"
s: -1365265107- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(StringLiteral n)
Visits aStringLiteral
node, whose child is the following :f0 -> < STRING_LITERAL >
s: 241433948- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(NullLiteral n)
Visits aNullLiteral
node, whose child is the following :f0 -> "null"
s: -1703344686- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ArgumentList n)
Visits aArgumentList
node, whose children are the following :f0 -> Expression()
f1 -> ( #0 "," #1 Expression() )*
s: -662366547- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(AllocationExpression n)
Visits aAllocationExpression
node, whose child is the following :f0 -> . %0 #0 "new" #1 PrimitiveType() #2 ArrayDimsAndInits()
.. .. | %1 #0 "new" #1 ClassOrInterfaceType()
.. .. . .. #2 [ &0 EmptyTypeArguments()
.. .. . .. .. | &1 TypeArguments() ]
.. .. . .. #3 ( &0 ArrayDimsAndInits()
.. .. . .. .. | &1 $0 Arguments()
.. .. . .. .. . .. $1 [ ClassOrInterfaceBody() ] )
s: 1688598744- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(AssertStatement n)
Visits aAssertStatement
node, whose children are the following :f0 -> "assert"
f1 -> Expression()
f2 -> [ #0 ":" #1 Expression() ]
f3 -> ";"
s: -579866328- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(LabeledStatement n)
Visits aLabeledStatement
node, whose children are the following :f0 -> < IDENTIFIER >
f1 -> ":"
f2 -> Statement()
s: -1956923191- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(Block n)
Visits aBlock
node, whose children are the following :f0 -> "{"
f1 -> ( BlockStatement() )*
f2 -> "}"
s: -47169424- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(LocalVariableDeclaration n)
Visits aLocalVariableDeclaration
node, whose children are the following :f0 -> VariableModifiers()
f1 -> Type()
f2 -> VariableDeclarator()
f3 -> ( #0 "," #1 VariableDeclarator() )*
s: 225808290- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(VariableModifiers n)
Visits aVariableModifiers
node, whose child is the following :f0 -> ( ( %0 "final"
.. .. . | %1 Annotation() ) )*
s: 2076055340- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(StatementExpression n)
Visits aStatementExpression
node, whose child is the following :f0 -> . %0 PreIncrementExpression()
.. .. | %1 PreDecrementExpression()
.. .. | %2 #0 PrimaryExpression()
.. .. . .. #1 [ &0 "++"
.. .. . .. .. | &1 "--"
.. .. . .. .. | &2 $0 AssignmentOperator() $1 Expression() ]
s: 757890000- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(SwitchStatement n)
Visits aSwitchStatement
node, whose children are the following :f0 -> "switch"
f1 -> "("
f2 -> Expression()
f3 -> ")"
f4 -> "{"
f5 -> ( #0 SwitchLabel()
.. .. . #1 ( BlockStatement() )* )*
f6 -> "}"
s: 645895087- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(SwitchLabel n)
Visits aSwitchLabel
node, whose child is the following :f0 -> . %0 #0 "case" #1 Expression() #2 ":"
.. .. | %1 #0 "default" #1 ":"
s: 63513165- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(IfStatement n)
Visits aIfStatement
node, whose children are the following :f0 -> "if"
f1 -> "("
f2 -> Expression()
f3 -> ")"
f4 -> Statement()
f5 -> [ #0 "else" #1 Statement() ]
s: -1906079982- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(WhileStatement n)
Visits aWhileStatement
node, whose children are the following :f0 -> "while"
f1 -> "("
f2 -> Expression()
f3 -> ")"
f4 -> Statement()
s: 503551312- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(DoStatement n)
Visits aDoStatement
node, whose children are the following :f0 -> "do"
f1 -> Statement()
f2 -> "while"
f3 -> "("
f4 -> Expression()
f5 -> ")"
f6 -> ";"
s: 1162769715- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ForStatement n)
Visits aForStatement
node, whose children are the following :f0 -> "for"
f1 -> "("
f2 -> ( %0 #0 VariableModifiers() #1 Type() #2 < IDENTIFIER > #3 ":" #4 Expression()
.. .. | %1 #0 [ ForInit() ]
.. .. . .. #1 ";"
.. .. . .. #2 [ Expression() ]
.. .. . .. #3 ";"
.. .. . .. #4 [ ForUpdate() ] )
f3 -> ")"
f4 -> Statement()
s: 755358653- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(Statement n)
Visits aStatement
node, whose child is the following :f0 -> . %00 LabeledStatement()
.. .. | %01 AssertStatement()
.. .. | %02 Block()
.. .. | %03 EmptyStatement()
.. .. | %04 #0 StatementExpression() #1 ";"
.. .. | %05 SwitchStatement()
.. .. | %06 IfStatement()
.. .. | %07 WhileStatement()
.. .. | %08 DoStatement()
.. .. | %09 ForStatement()
.. .. | %10 BreakStatement()
.. .. | %11 ContinueStatement()
.. .. | %12 ReturnStatement()
.. .. | %13 ThrowStatement()
.. .. | %14 SynchronizedStatement()
.. .. | %15 TryStatement()
s: 1394695492- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(StatementExpressionList n)
Visits aStatementExpressionList
node, whose children are the following :f0 -> StatementExpression()
f1 -> ( #0 "," #1 StatementExpression() )*
s: 186773841- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(BreakStatement n)
Visits aBreakStatement
node, whose children are the following :f0 -> "break"
f1 -> [ < IDENTIFIER > ]
f2 -> ";"
s: 2096828507- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ContinueStatement n)
Visits aContinueStatement
node, whose children are the following :f0 -> "continue"
f1 -> [ < IDENTIFIER > ]
f2 -> ";"
s: -1991535243- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ReturnStatement n)
Visits aReturnStatement
node, whose children are the following :f0 -> "return"
f1 -> [ Expression() ]
f2 -> ";"
s: -1971167888- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(ThrowStatement n)
Visits aThrowStatement
node, whose children are the following :f0 -> "throw"
f1 -> Expression()
f2 -> ";"
s: 568421270- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(SynchronizedStatement n)
Visits aSynchronizedStatement
node, whose children are the following :f0 -> "synchronized"
f1 -> "("
f2 -> Expression()
f3 -> ")"
f4 -> Block()
s: 2040551171- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(TryStatement n)
Visits aTryStatement
node, whose children are the following :f0 -> "try"
f1 -> Block()
f2 -> ( #0 "catch" #1 "(" #2 FormalParameter() #3 ")" #4 Block() )*
f3 -> [ #0 "finally" #1 Block() ]
s: 1108527850- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(MemberValuePairs n)
Visits aMemberValuePairs
node, whose children are the following :f0 -> MemberValuePair()
f1 -> ( #0 "," #1 MemberValuePair() )*
s: -113472239- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(MemberValuePair n)
Visits aMemberValuePair
node, whose children are the following :f0 -> < IDENTIFIER >
f1 -> "="
f2 -> MemberValue()
s: -476335468- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(MemberValue n)
Visits aMemberValue
node, whose child is the following :f0 -> . %0 Annotation()
.. .. | %1 MemberValueArrayInitializer()
.. .. | %2 ConditionalExpression()
s: -1120846693- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(MemberValueArrayInitializer n)
Visits aMemberValueArrayInitializer
node, whose children are the following :f0 -> "{"
f1 -> MemberValue()
f2 -> ( #0 "," #1 MemberValue() )*
f3 -> [ "," ]
f4 -> "}"
s: 111140055- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(AnnotationTypeDeclaration n)
Visits aAnnotationTypeDeclaration
node, whose children are the following :f0 -> "@"
f1 -> "interface"
f2 -> < IDENTIFIER >
f3 -> AnnotationTypeBody()
s: 383718196- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(AnnotationTypeBody n)
Visits aAnnotationTypeBody
node, whose children are the following :f0 -> "{"
f1 -> ( AnnotationTypeMemberDeclaration() )*
f2 -> "}"
s: -667465535- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
visit
public void visit(AnnotationTypeMemberDeclaration n)
Visits aAnnotationTypeMemberDeclaration
node, whose child is the following :f0 -> . %0 #0 Modifiers()
.. .. . .. #1 ( &0 $0 Type() $1 < IDENTIFIER > $2 "(" $3 ")"
.. .. . .. .. . .. $4 [ DefaultValue() ]
.. .. . .. .. . .. $5 ";"
.. .. . .. .. | &1 ClassOrInterfaceDeclaration()
.. .. . .. .. | &2 EnumDeclaration()
.. .. . .. .. | &3 AnnotationTypeDeclaration()
.. .. . .. .. | &4 FieldDeclaration() )
.. .. | %1 ";"
s: -1120210008- Specified by:
visit
in interfaceIVoidVisitor
- Overrides:
visit
in classDepthFirstVoidVisitor
- Parameters:
n
- - the node to visit
-
-