|
||||||||||
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.Expression
public abstract class Expression
Abstract superclass for all ceq Expressions. Note that every sub-expression should have a unique name.
Constructor Summary | |
---|---|
protected |
Expression(String n,
Program p)
Generate new named expression, the actual expression is defined by the actual subclass. |
Method Summary | |
---|---|
abstract Expression |
flatten(String n,
HashMap<String,Variable> vars,
LinkedList<Expression> es)
extract sub-expressions from operations. |
abstract List<Variable> |
getDeps()
compute List of all variables, on which current value the expression depends. |
String |
getName()
Get unique name of the expression. |
Program |
getProg()
|
abstract Type |
getType()
Return the inferred type of the expression. |
Variable |
getVar(String n)
Generate new variable. |
Variable |
getVar(String n,
Variable.Kind k,
Type t)
Generate new, unique variable. |
abstract List<String> |
getVars()
compute list of all variables that syntactically occur in the expression. |
abstract boolean |
isAtom()
compute whether this is an atomic expression. |
abstract Expression |
padDelay(HashMap<String,Integer> delay,
int n)
add additional pre operators, to use all variables with the right tick. |
abstract ConstExpression |
propagateConst(HashMap<String,ConstExpression> con)
Propagate constant values, ie, replace all occurrences of a variable by a constant. |
abstract Expression |
replace(String var,
Expression expr)
Replace each occurrence of a variable by an expression. |
abstract void |
replaceVar(HashMap<String,Variable> equiv)
Replace a variable by another one. |
protected void |
setName(String n)
Set the unique name of the expression. |
protected void |
setProg(Program p)
|
abstract Expression |
staticEval()
Perform static evaluation, remove operations on constant values by the result of the operation. |
abstract LinkedList<AbstractInstruction> |
toKlp(Variable to)
compute instructions to execute this expression on the KLP. |
abstract String |
toString()
Show the expression in Lustre syntax. |
abstract int |
wcrt()
Compute upper bound for the reaction time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected Expression(String n, Program p)
n
- name of the expression.p
- the program that contains the expressionMethod Detail |
---|
public Program getProg()
protected void setProg(Program p)
p
- program that contains the expressionpublic abstract Type getType()
public abstract List<String> getVars()
public abstract List<Variable> getDeps()
public abstract String toString()
toString
in class Object
public abstract Expression flatten(String n, HashMap<String,Variable> vars, LinkedList<Expression> es)
n
- name of the expressionvars
- holds additionally added variableses
- additionally added expression
public abstract Expression padDelay(HashMap<String,Integer> delay, int n)
delay
- : delay for all variablesn
- : delay of the output
public abstract boolean isAtom()
public abstract LinkedList<AbstractInstruction> toKlp(Variable to)
to
- Register to store the result
public String getName()
public abstract ConstExpression propagateConst(HashMap<String,ConstExpression> con)
con
- mapping variable to constant values, if they can be evaluated
public abstract Expression staticEval()
public abstract void replaceVar(HashMap<String,Variable> equiv)
equiv
- list of equivalent variables.public abstract int wcrt()
public abstract Expression replace(String var, Expression expr)
var
- name of the expression to replaceexpr
- expression by which the variable is replaced.
protected void setName(String n)
n
- the name to setpublic Variable getVar(String n)
n
- name of the variable
public Variable getVar(String n, Variable.Kind k, Type t)
n
- name of the variablek
- io kind of the variablet
- type of the variable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |