01: //
02: // Generated by JTB 1.2.2
03: //
04:
05: package xtc.lang.javacc.syntaxtree;
06:
07: import java.util.*;
08:
09: /**
10: * Represents an optional grammar list, e.g. ( A )*.
11: */
12: @SuppressWarnings("unchecked")
13: public class NodeListOptional implements NodeListInterface {
14: public NodeListOptional() {
15: nodes = new Vector();
16: }
17:
18: public NodeListOptional(Node firstNode) {
19: nodes = new Vector();
20: addNode(firstNode);
21: }
22:
23: public void addNode(Node n) {
24: nodes.addElement(n);
25: }
26:
27: public Enumeration elements() {
28: return nodes.elements();
29: }
30:
31: public Node elementAt(int i) {
32: return (Node) nodes.elementAt(i);
33: }
34:
35: public int size() {
36: return nodes.size();
37: }
38:
39: public boolean present() {
40: return nodes.size() != 0;
41: }
42:
43: public void accept(xtc.lang.javacc.visitor.Visitor v) {
44: v.visit(this );
45: }
46:
47: public Object accept(xtc.lang.javacc.visitor.ObjectVisitor v,
48: Object argu) {
49: return v.visit(this , argu);
50: }
51:
52: public Vector nodes;
53: }
|