001// 002// Generated by JTB 1.3.2 003// 004 005package com.randomnoun.common.jexl.visitor; 006import com.randomnoun.common.jexl.ast.*; 007import java.util.*; 008 009/** 010 * Provides default methods which visit each node in the tree in depth-first 011 * order. Your visitors may extend this class. 012 */ 013public class GJVoidDepthFirst<A> implements GJVoidVisitor<A> { 014 // 015 // Auto class visitors--probably don't need to be overridden. 016 // 017 public void visit(NodeList n, A argu) { 018 int _count=0; 019 for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) { 020 e.nextElement().accept(this,argu); 021 _count++; 022 } 023 } 024 025 public void visit(NodeListOptional n, A argu) { 026 if ( n.present() ) { 027 int _count=0; 028 for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) { 029 e.nextElement().accept(this,argu); 030 _count++; 031 } 032 } 033 } 034 035 public void visit(NodeOptional n, A argu) { 036 if ( n.present() ) 037 n.node.accept(this,argu); 038 } 039 040 public void visit(NodeSequence n, A argu) { 041 int _count=0; 042 for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) { 043 e.nextElement().accept(this,argu); 044 _count++; 045 } 046 } 047 048 public void visit(NodeToken n, A argu) {} 049 050 // 051 // User-generated visitor methods below 052 // 053 054 /** 055 * <PRE> 056 * expression -> Expression() 057 * nodeToken -> <EOF> 058 * </PRE> 059 */ 060 public void visit(TopLevelExpression n, A argu) { 061 n.expression.accept(this, argu); 062 n.nodeToken.accept(this, argu); 063 } 064 065 /** 066 * <PRE> 067 * conditionalAndExpression -> ConditionalAndExpression() 068 * nodeListOptional -> ( "||" ConditionalAndExpression() )* 069 * </PRE> 070 */ 071 public void visit(Expression n, A argu) { 072 n.conditionalAndExpression.accept(this, argu); 073 n.nodeListOptional.accept(this, argu); 074 } 075 076 /** 077 * <PRE> 078 * equalityExpression -> EqualityExpression() 079 * nodeListOptional -> ( "&&" EqualityExpression() )* 080 * </PRE> 081 */ 082 public void visit(ConditionalAndExpression n, A argu) { 083 n.equalityExpression.accept(this, argu); 084 n.nodeListOptional.accept(this, argu); 085 } 086 087 /** 088 * <PRE> 089 * relationalExpression -> RelationalExpression() 090 * nodeListOptional -> ( ( "==" | "!=" ) RelationalExpression() )* 091 * </PRE> 092 */ 093 public void visit(EqualityExpression n, A argu) { 094 n.relationalExpression.accept(this, argu); 095 n.nodeListOptional.accept(this, argu); 096 } 097 098 /** 099 * <PRE> 100 * additiveExpression -> AdditiveExpression() 101 * nodeListOptional -> ( ( "<" | ">" | "<=" | ">=" ) AdditiveExpression() )* 102 * </PRE> 103 */ 104 public void visit(RelationalExpression n, A argu) { 105 n.additiveExpression.accept(this, argu); 106 n.nodeListOptional.accept(this, argu); 107 } 108 109 /** 110 * <PRE> 111 * multiplicativeExpression -> MultiplicativeExpression() 112 * nodeListOptional -> ( ( "+" | "-" ) MultiplicativeExpression() )* 113 * </PRE> 114 */ 115 public void visit(AdditiveExpression n, A argu) { 116 n.multiplicativeExpression.accept(this, argu); 117 n.nodeListOptional.accept(this, argu); 118 } 119 120 /** 121 * <PRE> 122 * unaryExpression -> UnaryExpression() 123 * nodeListOptional -> ( ( "*" | "/" | "%" ) UnaryExpression() )* 124 * </PRE> 125 */ 126 public void visit(MultiplicativeExpression n, A argu) { 127 n.unaryExpression.accept(this, argu); 128 n.nodeListOptional.accept(this, argu); 129 } 130 131 /** 132 * <PRE> 133 * nodeChoice -> ( "~" | "!" | "-" ) UnaryExpression() 134 * | PrimaryExpression() 135 * </PRE> 136 */ 137 public void visit(UnaryExpression n, A argu) { 138 n.nodeChoice.accept(this, argu); 139 } 140 141 /** 142 * <PRE> 143 * nodeChoice -> FunctionCall() 144 * | Name() 145 * | Literal() 146 * | "(" Expression() ")" 147 * </PRE> 148 */ 149 public void visit(PrimaryExpression n, A argu) { 150 n.nodeChoice.accept(this, argu); 151 } 152 153 /** 154 * <PRE> 155 * nodeToken -> <IDENTIFIER> 156 * nodeListOptional -> ( "." <IDENTIFIER> )* 157 * </PRE> 158 */ 159 public void visit(Name n, A argu) { 160 n.nodeToken.accept(this, argu); 161 n.nodeListOptional.accept(this, argu); 162 } 163 164 /** 165 * <PRE> 166 * nodeToken -> <IDENTIFIER> 167 * arguments -> Arguments() 168 * </PRE> 169 */ 170 public void visit(FunctionCall n, A argu) { 171 n.nodeToken.accept(this, argu); 172 n.arguments.accept(this, argu); 173 } 174 175 /** 176 * <PRE> 177 * nodeToken -> "(" 178 * nodeOptional -> [ ArgumentList() ] 179 * nodeToken1 -> ")" 180 * </PRE> 181 */ 182 public void visit(Arguments n, A argu) { 183 n.nodeToken.accept(this, argu); 184 n.nodeOptional.accept(this, argu); 185 n.nodeToken1.accept(this, argu); 186 } 187 188 /** 189 * <PRE> 190 * expression -> Expression() 191 * nodeListOptional -> ( "," Expression() )* 192 * </PRE> 193 */ 194 public void visit(ArgumentList n, A argu) { 195 n.expression.accept(this, argu); 196 n.nodeListOptional.accept(this, argu); 197 } 198 199 /** 200 * <PRE> 201 * nodeChoice -> <INTEGER_LITERAL> 202 * | <FLOATING_POINT_LITERAL> 203 * | <CHARACTER_LITERAL> 204 * | <STRING_LITERAL> 205 * | BooleanLiteral() 206 * | NullLiteral() 207 * </PRE> 208 */ 209 public void visit(Literal n, A argu) { 210 n.nodeChoice.accept(this, argu); 211 } 212 213 /** 214 * <PRE> 215 * nodeChoice -> "true" 216 * | "false" 217 * </PRE> 218 */ 219 public void visit(BooleanLiteral n, A argu) { 220 n.nodeChoice.accept(this, argu); 221 } 222 223 /** 224 * <PRE> 225 * nodeToken -> "null" 226 * </PRE> 227 */ 228 public void visit(NullLiteral n, A argu) { 229 n.nodeToken.accept(this, argu); 230 } 231 232}