01: /* Generated By:JJTree: Do not edit this line. Node.java */
02:
03: package org.openrdf.query.parser.sparql.ast;
04:
05: import org.openrdf.query.parser.sparql.ast.Node;
06: import org.openrdf.query.parser.sparql.ast.SyntaxTreeBuilderVisitor;
07: import org.openrdf.query.parser.sparql.ast.VisitorException;
08:
09: /*
10: * All AST nodes must implement this interface. It provides basic machinery for
11: * constructing the parent and child relationships between nodes.
12: */
13:
14: public interface Node {
15:
16: /**
17: * This method is called after the node has been made the current node. It
18: * indicates that child nodes can now be added to it.
19: */
20: public void jjtOpen();
21:
22: /**
23: * This method is called after all the child nodes have been added.
24: */
25: public void jjtClose();
26:
27: /**
28: * This pair of methods are used to inform the node of its parent.
29: */
30: public void jjtSetParent(Node n);
31:
32: public Node jjtGetParent();
33:
34: /**
35: * This method tells the node to add its argument to the node's list of
36: * children.
37: */
38: public void jjtAddChild(Node n, int i);
39:
40: /**
41: * Adds the supplied node as the last child node to this node.
42: */
43: public void jjtAppendChild(Node n);
44:
45: /**
46: * Adds the supplied node as the <tt>i</tt>'th child node to this node.
47: */
48: public void jjtInsertChild(Node n, int i);
49:
50: /**
51: * Replaces a child node with a new node.
52: */
53: public void jjtReplaceChild(Node oldNode, Node newNode);
54:
55: /**
56: * This method returns a child node. The children are numbered from zero,
57: * left to right.
58: */
59: public Node jjtGetChild(int i);
60:
61: /** Return the number of children the node has. */
62: public int jjtGetNumChildren();
63:
64: /**
65: * Accept the visitor.
66: */
67: public Object jjtAccept(SyntaxTreeBuilderVisitor visitor,
68: Object data) throws VisitorException;
69: }
|