|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.krep.compiler.ceq.Program
public class Program
CEQ program, eg, a set of CEQ equation and Safe State Machines plus information on inputs and outputs.
Constructor Summary | |
---|---|
Program(String n)
generate empty program. |
|
Program(String n,
Program p)
generate program from an existing one. |
Method Summary | |
---|---|
void |
addEq(Equation eq)
|
void |
addInput(Variable v)
|
void |
addLocal(Variable v)
|
void |
addOutput(Variable v)
|
void |
addVar(String n,
Variable variable)
Add additional variable to the program. |
void |
addVar(Variable v)
|
void |
destroyTemp(String prefix)
Remove temporary variables. |
void |
flatten()
replace complex expression by temporary computations. |
protected DepGraph |
getDepGraph()
|
protected LinkedList<Equation> |
getEqs()
|
LinkedList<Variable> |
getInputs()
|
String |
getLabel()
Generate a unique label. |
protected LinkedList<Variable> |
getLocals()
|
int |
getMax()
|
String |
getName()
|
LinkedList<Variable> |
getOutputs()
|
protected LinkedList<Automaton> |
getSsms()
|
Variable |
getTemp(String prefix,
Type type)
|
Variable |
getVar(String n)
Generate new variable. |
Variable |
getVar(String n,
Variable.Kind kind,
Type type)
Generate new, unique variable. |
protected HashMap<String,Variable> |
getVars()
|
void |
init()
initialize program. |
void |
propagateConst()
propagate constant values. |
void |
removeEquiv()
remove equivalent equations. |
void |
replace(HashMap<String,Variable> equiv)
|
protected void |
setDepGraph(DepGraph dG)
|
protected void |
setEqs(LinkedList<Equation> equations)
|
protected void |
setInputs(LinkedList<Variable> i)
|
protected void |
setLocals(LinkedList<Variable> loc)
|
void |
setName(String n)
|
protected void |
setOutputs(LinkedList<Variable> outs)
|
protected void |
setSsms(LinkedList<Automaton> s)
|
protected void |
setVars(HashMap<String,Variable> v)
|
void |
simplify()
simplify all equations by replacing variables that are only read once. |
void |
staticEval()
perform static evaluation. |
String |
toLustre()
|
String |
toString()
|
int |
wcrt()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Program(String n)
n
- of the main nodepublic Program(String n, Program p)
n
- name of the new programp
- program to copy.Method Detail |
---|
public void init()
public void flatten()
public String toString()
toString
in class Object
public String toLustre()
public void setName(String n)
n
- of the programpublic void propagateConst()
public void staticEval()
public String getName()
public LinkedList<Variable> getOutputs()
public LinkedList<Variable> getInputs()
public void addVar(Variable v)
v
- additional variablepublic void addEq(Equation eq)
eq
- additional equationpublic void removeEquiv()
public void replace(HashMap<String,Variable> equiv)
equiv
- list of quivalent variables.public int wcrt()
public void addLocal(Variable v)
v
- new local variablepublic void addOutput(Variable v)
v
- new output variablepublic void addInput(Variable v)
v
- new input variablepublic void simplify()
protected void setDepGraph(DepGraph dG)
dG
- the dependency graphprotected DepGraph getDepGraph()
protected void setSsms(LinkedList<Automaton> s)
s
- the Safe State Machinesprotected LinkedList<Automaton> getSsms()
protected void setEqs(LinkedList<Equation> equations)
equations
- the CEQ equationsprotected LinkedList<Equation> getEqs()
protected void setLocals(LinkedList<Variable> loc)
loc
- the new local variablesprotected LinkedList<Variable> getLocals()
protected void setOutputs(LinkedList<Variable> outs)
outs
- the outputs to setprotected void setInputs(LinkedList<Variable> i)
i
- the inputs to setprotected void setVars(HashMap<String,Variable> v)
v
- the new variables of the programprotected HashMap<String,Variable> getVars()
public Variable getVar(String n)
n
- name of the variable
public Variable getVar(String n, Variable.Kind kind, Type type)
n
- name of the variablekind
- io kind of the variabletype
- type of the variable
public Variable getTemp(String prefix, Type type)
prefix
- of the temporary variabletype
- of the new variable
public void destroyTemp(String prefix)
prefix
- prefix of the variables to resetpublic int getMax()
public void addVar(String n, Variable variable)
n
- name of the variablevariable
- the additional variable.public String getLabel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |