📄 leaf.java
字号:
package ast;
/**
* an Leaf-Object contains a declaration.
*/
public class Leaf implements ast.IJSubNode {
private ast.declaration.JSubObject decl;
private IJSubNode parent = null;
/**
* consturct leaf-account with any Declaration.
*
* @param decl that Declaration in that Symboltabel
*/
public Leaf (ast.declaration.JSubObject decl) {
this.decl = decl;
}
public String toString () {
return decl.toString ();
}
public String toString (String prefix) {
return prefix+decl.toString ();
}
public void setParent(IJSubNode n) {
parent = n;
}
public IJSubNode getParent() {
return parent;
}
public void addChild(IJSubNode n) {}
public IJSubNode getChild(int i) {
return null;
}
public java.util.Enumeration elements () {
return null;
}
public int getNumChildren() {
return 0;
}
public void dump(String prefix) {
System.out.print (prefix);
decl.dump (prefix);
}
/**
* the Codegenerator get the assignment to the store.
*/
public String getLoadString () {
return decl.getLoadString ();
}
/**
* the Codegenerator get the assignment to the saving.
*/
public String getStoreString () {
return decl.getStoreString ();
}
public ast.declaration.JSubObject getDeclaration () {
return decl;
}
public void codegen () {
codegen.WriteCode.genLoad (decl);
}
public int getDepth () {
return 0;
}
public String getXMLType () {
return decl.getXMLType ();
}
public void genXML (java.io.PrintStream p, String prefix) {
decl.genXML (p, prefix);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -