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

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

public class Variable
extends Object

A Variable declaration in CEQ. A variable has a name, a type and a scope, i.e., input output, local or temporary. A variable also has a register id.

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

Nested Class Summary
static class Variable.Kind
           
 
Constructor Summary
Variable(String n, Variable.Kind kind, Type t)
          generate new Variable declaration.
Variable(Variable var, Variable.Kind kind)
          Create Variable with the same information as an existing Lustre Variable.
 
Method Summary
 int getId()
           
 Variable.Kind getKind()
           
 String getName()
           
 Type getType()
           
 boolean isInput()
           
 boolean isLocal()
           
 boolean isOutput()
           
 boolean isTemp()
           
 String toKlp(String clock)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Variable

public Variable(String n,
                Variable.Kind kind,
                Type t)
generate new Variable declaration.

Parameters:
n - name of the variable
kind - kind of the variable
t - type of the variable

Variable

public Variable(Variable var,
                Variable.Kind kind)
Create Variable with the same information as an existing Lustre Variable.

Parameters:
var - Lustre variable
kind - io kind
Method Detail

getKind

public Variable.Kind getKind()
Returns:
variable kind, ie, input, output, local or temp

getType

public Type getType()
Returns:
type of the variable

toString

public String toString()
Overrides:
toString in class Object

getName

public String getName()
Returns:
name of the variable

isInput

public boolean isInput()
Returns:
true if the variable is an input

isOutput

public boolean isOutput()
Returns:
true if the variable is an output

isLocal

public boolean isLocal()
Returns:
true if the variable is local

isTemp

public boolean isTemp()
Returns:
true if the variable is only temporary defined

toKlp

public String toKlp(String clock)
Parameters:
clock - clock on which the variable runs
Returns:
KLP assembler to initialize variable

getId

public int getId()
Returns:
register id of this variable