de.cau.cs.kieler.krep.compiler.lustre
Class Variable

java.lang.Object
  extended by de.cau.cs.kieler.krep.compiler.lustre.Variable

public class Variable
extends Object

A Lustre variable. This is used both for declaration and access of a variable.

Rating yellow
(2010-02-05) review by cmot, msp, tam

Constructor Summary
Variable(String n, Type t)
           
Variable(String n, Type t, String clk)
           
 
Method Summary
 boolean equals(Object obj)
           
static Variable get(String name)
           
 ClockList getClock()
           
 String getName()
           
static Variable getTemp(String prefix, Type type, String clock)
           
 Type getType()
           
 int hashCode()
           
 void setClock(String clk)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Variable

public Variable(String n,
                Type t)
Parameters:
n - name of the variable
t - type of the variable This assumes that the variable runs on the base clock.

Variable

public Variable(String n,
                Type t,
                String clk)
Parameters:
n - name of the variable
t - type of the variable
clk - clock on which this variable runs
Method Detail

setClock

public void setClock(String clk)
Parameters:
clk - on which the variable shall run

toString

public String toString()
Overrides:
toString in class Object

getName

public String getName()
Returns:
name of the variable

getType

public Type getType()
Returns:
infered type of the variable

getClock

public ClockList getClock()
Returns:
clocks on which the variable runs.

getTemp

public static Variable getTemp(String prefix,
                               Type type,
                               String clock)
Parameters:
prefix - prefix of the temporary variable
type - type of the variable
clock - clock on whoch the vriable runs
Returns:
a new variable with a unique name

get

public static Variable get(String name)
Parameters:
name - name of the variable
Returns:
unique variable with that name

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object