ijsubnode.java
来自「一个JAVA编写的简单编译器」· Java 代码 · 共 70 行
JAVA
70 行
package ast;
/**
* IJSubNode set the interface for all nodes of ast
*/
public interface IJSubNode {
// predecessor
void setParent(IJSubNode n);
IJSubNode getParent();
// successor
/**
* a successor (=node) attached
*/
void addChild(IJSubNode n);
/**
* param i ,Index of nodes 0, 1, 2, 3, ...
*/
IJSubNode getChild(int i);
/**
* number of predecessor sorted.
*
*/
int getNumChildren();
/**
* a enumerate successor fetched.
*
*/
java.util.Enumeration elements ();
/**
* code generation for the node.
*
*/
void codegen ();
int getDepth ();
// output ast
String toString(String prefix);
/**
* output with indent
*
* param prefix the String for indent the output
*/
void dump(String prefix);
/**
* select the XML-Text for one node
*/
String getXMLType ();
/**
* XML-output the nodes
*/
void genXML (java.io.PrintStream p, String prefix);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?