View Javadoc

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