01: //
02: // Generated by JTB 1.2.1
03: //
04:
05: package oscript.syntaxtree;
06:
07: import java.util.*;
08:
09: /**
10: * Represents a grammar list, e.g. ( A )+
11: */
12: public class NodeList implements NodeListInterface {
13: public NodeList() {
14: nodes = new Vector();
15: }
16:
17: public NodeList(Node firstNode) {
18: nodes = new Vector();
19: addNode(firstNode);
20: }
21:
22: public void addNode(Node n) {
23: nodes.addElement(n);
24: }
25:
26: public Enumeration elements() {
27: return nodes.elements();
28: }
29:
30: public Node elementAt(int i) {
31: return (Node) nodes.elementAt(i);
32: }
33:
34: public int size() {
35: return nodes.size();
36: }
37:
38: public void accept(oscript.visitor.Visitor v) {
39: v.visit(this );
40: }
41:
42: public Object accept(oscript.visitor.ObjectVisitor v, Object argu) {
43: return v.visit(this , argu);
44: }
45:
46: public Vector nodes;
47: }
|