|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.krep.compiler.lustre.Expression
de.cau.cs.kieler.krep.compiler.lustre.WhenExpression
public class WhenExpression
Implementation of the when operator.
Field Summary |
---|
Fields inherited from class de.cau.cs.kieler.krep.compiler.lustre.Expression |
---|
STAGE_CURRENT, STAGE_INIT, STAGE_NEW, STAGE_WHEN |
Constructor Summary | |
---|---|
WhenExpression(String name,
Expression e,
VarAccessExpression c)
generate new when operator. |
Method Summary | |
---|---|
Equation |
declock(String basename,
int stage,
String c,
LinkedList<Equation> aux,
Program prog)
remove all clock operators inside. |
Expression |
extractPre(HashMap<String,Expression> eqs)
|
Expression |
getExpression()
|
ClockList |
inferClock(HashMap<String,Variable> env)
Compute clock on which this expression runs. |
protected void |
inferType()
compute types and set type member recursively in all sub-expressions. |
boolean |
isAtom()
|
Expression |
liftClock()
|
void |
propagateClock(ClockList l)
Propagate to each expression, on which clock it runs. |
Expression |
propagatePre(HashMap<String,Expression> eqs)
make sure only simple variables are inside of pre operators. |
boolean |
sameClock(WhenExpression w)
|
void |
setExpression(Expression e)
|
String |
toString()
|
Methods inherited from class de.cau.cs.kieler.krep.compiler.lustre.Expression |
---|
addClock, getClock, getInit, getName, getType, setClock, setInit, setName, setType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WhenExpression(String name, Expression e, VarAccessExpression c)
name
- of the expressione
- expressionc
- clock on which the expression runsMethod Detail |
---|
public String toString()
toString
in class Object
public boolean isAtom()
isAtom
in class Expression
protected void inferType() throws TypeException
Expression
inferType
in class Expression
TypeException
- thrown if any type problem occurspublic Expression propagatePre(HashMap<String,Expression> eqs)
Expression
propagatePre
in class Expression
eqs
- additionally added equations
public ClockList inferClock(HashMap<String,Variable> env) throws ClockException
Expression
inferClock
in class Expression
env
- list of all defined variables
ClockException
- thrown if any clock error occurspublic void propagateClock(ClockList l)
Expression
propagateClock
in class Expression
l
- clock-vector for the expressionpublic Equation declock(String basename, int stage, String c, LinkedList<Equation> aux, Program prog)
Expression
declock
in class Expression
basename
- name of the expression, used for auxiliary expressionsstage
- indicate what clock operators have already been in this equation: 0: on top level
1: beyond current 2: beyond when 3: beyond ->c
- clockaux
- additional equationsprog
- program that contains the expression
public Expression liftClock()
liftClock
in class Expression
public void setExpression(Expression e)
e
- new expression for the whenpublic Expression getExpression()
public boolean sameClock(WhenExpression w)
w
- another when operator
public Expression extractPre(HashMap<String,Expression> eqs)
extractPre
in class Expression
eqs
- add auxiliary equations
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |