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

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

public class Lustre
extends Object

Container class to hold parsed lustre or ec file. Contains methods for type and clock inference.

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

Constructor Summary
Lustre(InputStream in)
          parse input stream which is expected to be a Lustre file.
 
Method Summary
 void addEq(String s, Expression e)
           
 Program getCEQ()
          Transform Lustre program into simplified ceq.
 void setInputs(LinkedList<Variable> in)
           
 void setLocals(LinkedList<Variable> loc)
           
 void setName(String n)
           
 void setOutputs(LinkedList<Variable> out)
           
 String toLustre()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lustre

public Lustre(InputStream in)
       throws IOException,
              ClockException,
              TypeException
parse input stream which is expected to be a Lustre file.

Parameters:
in - the Lustre program
Throws:
IOException - thrown when the input stream cannot be read
ClockException - thrown when errors with the clock calculus
TypeException - thrown when errors are detected in the type inference
Method Detail

getCEQ

public Program getCEQ()
Transform Lustre program into simplified ceq.

Returns:
the simplified program

addEq

public void addEq(String s,
                  Expression e)
Parameters:
s - name of the additional equation
e - expression to compute the value

setInputs

public void setInputs(LinkedList<Variable> in)
Parameters:
in - new input list

setOutputs

public void setOutputs(LinkedList<Variable> out)
Parameters:
out - new output list

setLocals

public void setLocals(LinkedList<Variable> loc)
Parameters:
loc - list of local variables

toLustre

public String toLustre()
Returns:
write program in Lustre syntax

setName

public void setName(String n)
Parameters:
n - name of the program