View Javadoc
1   //
2   // Generated by JTB 1.3.2
3   //
4   
5   package com.randomnoun.common.jexl.visitor;
6   import com.randomnoun.common.jexl.ast.*;
7   import java.util.*;
8   
9   /**
10   * Provides default methods which visit each node in the tree in depth-first
11   * order.  Your visitors may extend this class.
12   */
13  public class GJVoidDepthFirst<A> implements GJVoidVisitor<A> {
14     //
15     // Auto class visitors--probably don't need to be overridden.
16     //
17     public void visit(NodeList n, A argu) {
18        int _count=0;
19        for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
20           e.nextElement().accept(this,argu);
21           _count++;
22        }
23     }
24  
25     public void visit(NodeListOptional n, A argu) {
26        if ( n.present() ) {
27           int _count=0;
28           for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
29              e.nextElement().accept(this,argu);
30              _count++;
31           }
32        }
33     }
34  
35     public void visit(NodeOptional n, A argu) {
36        if ( n.present() )
37           n.node.accept(this,argu);
38     }
39  
40     public void visit(NodeSequence n, A argu) {
41        int _count=0;
42        for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
43           e.nextElement().accept(this,argu);
44           _count++;
45        }
46     }
47  
48     public void visit(NodeToken n, A argu) {}
49  
50     //
51     // User-generated visitor methods below
52     //
53  
54     /**
55      * <PRE>
56      * expression -> Expression()
57      * nodeToken -> &lt;EOF&gt;
58      * </PRE>
59      */
60     public void visit(TopLevelExpression n, A argu) {
61        n.expression.accept(this, argu);
62        n.nodeToken.accept(this, argu);
63     }
64  
65     /**
66      * <PRE>
67      * conditionalAndExpression -> ConditionalAndExpression()
68      * nodeListOptional -> ( "||" ConditionalAndExpression() )*
69      * </PRE>
70      */
71     public void visit(Expression n, A argu) {
72        n.conditionalAndExpression.accept(this, argu);
73        n.nodeListOptional.accept(this, argu);
74     }
75  
76     /**
77      * <PRE>
78      * equalityExpression -> EqualityExpression()
79      * nodeListOptional -> ( "&&" EqualityExpression() )*
80      * </PRE>
81      */
82     public void visit(ConditionalAndExpression n, A argu) {
83        n.equalityExpression.accept(this, argu);
84        n.nodeListOptional.accept(this, argu);
85     }
86  
87     /**
88      * <PRE>
89      * relationalExpression -> RelationalExpression()
90      * nodeListOptional -> ( ( "==" | "!=" ) RelationalExpression() )*
91      * </PRE>
92      */
93     public void visit(EqualityExpression n, A argu) {
94        n.relationalExpression.accept(this, argu);
95        n.nodeListOptional.accept(this, argu);
96     }
97  
98     /**
99      * <PRE>
100     * additiveExpression -> AdditiveExpression()
101     * nodeListOptional -> ( ( "&lt;" | "&gt;" | "&lt;=" | "&gt;=" ) 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 -> &lt;IDENTIFIER&gt;
156     * nodeListOptional -> ( "." &lt;IDENTIFIER&gt; )*
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 -> &lt;IDENTIFIER&gt;
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 -> &lt;INTEGER_LITERAL&gt;
202     *       | &lt;FLOATING_POINT_LITERAL&gt;
203     *       | &lt;CHARACTER_LITERAL&gt;
204     *       | &lt;STRING_LITERAL&gt;
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 }