GJNoArguDepthFirst.java
//
// Generated by JTB 1.3.2
//
package net.metanotion.simpletemplate.parser.visitor;
import net.metanotion.simpletemplate.parser.syntaxtree.*;
import java.util.*;
/**
* Provides default methods which visit each node in the tree in depth-first
* order. Your visitors may extend this class.
*/
public class GJNoArguDepthFirst<R> implements GJNoArguVisitor<R> {
//
// Auto class visitors--probably don't need to be overridden.
//
public R visit(NodeList n) {
R _ret=null;
int _count=0;
for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
e.nextElement().accept(this);
_count++;
}
return _ret;
}
public R visit(NodeListOptional n) {
if ( n.present() ) {
R _ret=null;
int _count=0;
for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
e.nextElement().accept(this);
_count++;
}
return _ret;
}
else
return null;
}
public R visit(NodeOptional n) {
if ( n.present() )
return n.node.accept(this);
else
return null;
}
public R visit(NodeSequence n) {
R _ret=null;
int _count=0;
for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
e.nextElement().accept(this);
_count++;
}
return _ret;
}
public R visit(NodeToken n) { return null; }
//
// User-generated visitor methods below
//
/**
* <PRE>
* f0 -> ( HtmlBlock() )*
* f1 -> <EOF>
* </PRE>
*/
public R visit(Template n) {
R _ret=null;
n.f0.accept(this);
n.f1.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> <HTML>
* | <HTML_OTHER>
* | ES()
* | <BEGIN_SSI> SSD() <END_SSI>
* </PRE>
*/
public R visit(HtmlBlock n) {
R _ret=null;
n.f0.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> <BEGIN_CALL>
* f1 -> [ ExprSeq() ]
* f2 -> <END_CALL>
* </PRE>
*/
public R visit(ES n) {
R _ret=null;
n.f0.accept(this);
n.f1.accept(this);
n.f2.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> Expression()
* f1 -> ( <OP_SEMI> Expression() )*
* </PRE>
*/
public R visit(ExprSeq n) {
R _ret=null;
n.f0.accept(this);
n.f1.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> Apply()
* | JSObj()
* | JSArr()
* | Tuple()
* | Lambda()
* | Let()
* | Literal()
* | Lift()
* </PRE>
*/
public R visit(Expression n) {
R _ret=null;
n.f0.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> <ID>
* f1 -> ( <OP_DOT> <ID> )*
* f2 -> [ Expression() ]
* </PRE>
*/
public R visit(Apply n) {
R _ret=null;
n.f0.accept(this);
n.f1.accept(this);
n.f2.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> <L_CURLY>
* f1 -> [ WithParams() ]
* f2 -> <R_CURLY>
* </PRE>
*/
public R visit(JSObj n) {
R _ret=null;
n.f0.accept(this);
n.f1.accept(this);
n.f2.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> <L_BRACE>
* f1 -> [ Params() ]
* f2 -> <R_BRACE>
* </PRE>
*/
public R visit(JSArr n) {
R _ret=null;
n.f0.accept(this);
n.f1.accept(this);
n.f2.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> <L_PAREN>
* f1 -> [ Params() ]
* f2 -> <R_PAREN>
* f3 -> [ Expression() ]
* </PRE>
*/
public R visit(Tuple n) {
R _ret=null;
n.f0.accept(this);
n.f1.accept(this);
n.f2.accept(this);
n.f3.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> <OP_LAMBDA>
* f1 -> <L_PAREN>
* f2 -> ExprSeq()
* f3 -> <R_PAREN>
* f4 -> [ Expression() ]
* </PRE>
*/
public R visit(Lambda n) {
R _ret=null;
n.f0.accept(this);
n.f1.accept(this);
n.f2.accept(this);
n.f3.accept(this);
n.f4.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> <KW_LET>
* f1 -> JSObj()
* f2 -> <L_PAREN>
* f3 -> ExprSeq()
* f4 -> <R_PAREN>
* f5 -> [ Expression() ]
* </PRE>
*/
public R visit(Let n) {
R _ret=null;
n.f0.accept(this);
n.f1.accept(this);
n.f2.accept(this);
n.f3.accept(this);
n.f4.accept(this);
n.f5.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> <OP_LIFT>
* f1 -> [ Expression() ]
* </PRE>
*/
public R visit(Lift n) {
R _ret=null;
n.f0.accept(this);
n.f1.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> <DECIMAL_LITERAL>
* | <HEX_LITERAL>
* | <FLOAT_LITERAL>
* | <STRING_LITERAL>
* | <SQSTRING_LITERAL>
* | <BOOLEAN_LITERAL>
* </PRE>
*/
public R visit(Literal n) {
R _ret=null;
n.f0.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> Expression()
* f1 -> ( <OP_COMMA> Expression() )*
* </PRE>
*/
public R visit(Params n) {
R _ret=null;
n.f0.accept(this);
n.f1.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> WithParam()
* f1 -> ( <OP_COMMA> WithParam() )*
* </PRE>
*/
public R visit(WithParams n) {
R _ret=null;
n.f0.accept(this);
n.f1.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> <ID>
* | <STRING_LITERAL>
* | <SQSTRING_LITERAL>
* </PRE>
*/
public R visit(Key n) {
R _ret=null;
n.f0.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> Key()
* f1 -> <OP_WITH>
* f2 -> Expression()
* </PRE>
*/
public R visit(WithParam n) {
R _ret=null;
n.f0.accept(this);
n.f1.accept(this);
n.f2.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> Directive()
* f1 -> <SSIID>
* f2 -> <SOP_EQ>
* f3 -> <SSI_STRING_LITERAL>
* </PRE>
*/
public R visit(SSD n) {
R _ret=null;
n.f0.accept(this);
n.f1.accept(this);
n.f2.accept(this);
n.f3.accept(this);
return _ret;
}
/**
* <PRE>
* f0 -> <KW_INC>
* | <KW_ECHO>
* | <KW_CONFIG>
* | <KW_EXEC>
* | <KW_SET>
* | <KW_IF>
* | <KW_ELIF>
* | <KW_ELSE>
* | <KW_ENDIF>
* </PRE>
*/
public R visit(Directive n) {
R _ret=null;
n.f0.accept(this);
return _ret;
}
}