moduleimplementation.java
来自「plugin for eclipse」· Java 代码 · 共 100 行
JAVA
100 行
/*
* Created on May 16, 2005
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package isis.anp.nesc.ot;
import isis.anp.common.TNode;
import isis.anp.nesc.ot.scope.Scope;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* @author sallai
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class ModuleImplementation {
TNode defNode;
ArrayList declarations = new ArrayList();
Scope scope;
Module module;
public TNode getDefNode() {
return defNode;
}
public void setDefNode(TNode defNode) {
this.defNode = defNode;
}
public void addDeclaration(Declaration decl) {
declarations.add(decl);
if(decl!=null) {
decl.setParent(this);
}
}
public void addDeclarations(List decls) {
Iterator i = decls.iterator();
while (i.hasNext()) {
Declaration decl = (Declaration) i.next();
this.addDeclaration(decl);
}
}
public void outline(Outline o) {
o.addTabs();
o.append("implementation {\n");
Iterator i = declarations.iterator();
while (i.hasNext()) {
Declaration d = (Declaration) i.next();
o.incTabs();
d.outline(o);
o.decTabs();
if(!(d instanceof FunctionDefinition)) {
o.append(";");
}
o.append("\n");
}
o.addTabs();
o.append("}\n");
}
/**
* @return Returns the declarations.
*/
public ArrayList getDeclarations() {
return declarations;
}
/**
* @return Returns the scope.
*/
public Scope getScope() {
return scope;
}
/**
* @param scope The scope to set.
*/
public void setScope(Scope scope) {
this.scope = scope;
}
/**
* @param module
*/
public void setModule(Module module) {
this.module = module;
}
/**
* @return Returns the module.
*/
public Module getModule() {
return module;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?