1 /* Copyright (C) 2004-2007  The Chemistry Development Kit (CDK) project
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
16  * (or see http://www.gnu.org/copyleft/lesser.html)
17  */
18 package org.openscience.cdk.smiles.smarts.parser;
19 
20 /**
21  * All AST nodes must implement this interface.  It provides basic
22  * machinery for constructing the parent and child relationships
23  * between nodes.
24  *
25  * Automatically generated by JJTree
26  *
27  * @author Dazhi Jiao
28  * @cdk.created 2007-04-24
29  * @cdk.module smarts
30  * @cdk.githash
31  * @cdk.keyword SMARTS AST
32  */
33 @Deprecated
34 public interface Node {
35 
36     /** This method is called after the node has been made the current
37       node.  It indicates that child nodes can now be added to it. */
jjtOpen()38     void jjtOpen();
39 
40     /** This method is called after all the child nodes have been
41       added. */
jjtClose()42     void jjtClose();
43 
44     /** This pair of methods are used to inform the node of its
45       parent. */
jjtSetParent(Node n)46     void jjtSetParent(Node n);
47 
jjtGetParent()48     Node jjtGetParent();
49 
50     /** This method tells the node to add its argument to the node's
51       list of children.  */
jjtAddChild(Node n, int i)52     void jjtAddChild(Node n, int i);
53 
54     /** This method returns a child node.  The children are numbered
55        from zero, left to right. */
jjtGetChild(int i)56     Node jjtGetChild(int i);
57 
58     /** Return the number of children the node has. */
jjtGetNumChildren()59     int jjtGetNumChildren();
60 
61     /** Accept the visitor. **/
jjtAccept(SMARTSParserVisitor visitor, Object data)62     Object jjtAccept(SMARTSParserVisitor visitor, Object data);
63 
64     /**
65      * Removes a child from this node
66      * @param i
67      */
jjtRemoveChild(int i)68     void jjtRemoveChild(int i);
69 }
70