View Javadoc

1   /*
2    * Copyright 2002-2006 The Apache Software Foundation.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  /* Generated By:JJTree: Do not edit this line. Node.java */
17  
18  package org.apache.commons.jexl.parser;
19  
20  /***
21   * All AST nodes must implement this interface. It provides basic machinery for
22   * constructing the parent and child relationships between nodes.
23   */
24  public interface Node {
25  
26      /***
27       * This method is called after the node has been made the current node. It
28       * indicates that child nodes can now be added to it.
29       */
30       void jjtOpen();
31  
32      /***
33       * This method is called after all the child nodes have been added.
34       */
35       void jjtClose();
36  
37      /***
38       * This pair of methods are used to inform the node of its parent.
39       * @param n the parent node.
40       */
41       void jjtSetParent(Node n);
42  
43       /***
44        * Gets the parent node.
45        * @return the parent to this node.
46        */
47       Node jjtGetParent();
48  
49      /***
50       * This method tells the node to add its argument to the node's list of
51       * children.
52       * @param n the child node to add
53       * @param i the index to add it at.
54       */
55       void jjtAddChild(Node n, int i);
56  
57      /***
58       * This method returns a child node. The children are numbered from zero,
59       * left to right.
60       * @param i the index of the child to get.
61       * @return the child at the given index.
62       */
63       Node jjtGetChild(int i);
64  
65      /*** 
66       * Gets the number of children the node has.
67       * @return the number of children the node has. 
68       */
69       int jjtGetNumChildren();
70  
71      /***
72       *  Accept the visitor.
73       *  @param data arbitrary data.
74       *  @param visitor the visitor.
75       *  @return the result of the visit. 
76       */
77       Object jjtAccept(ParserVisitor visitor, Object data);
78  }