kesterel2lustre

compile Kernel Esterel to Lustre
git clone https://a3nm.net/git/kesterel2lustre/
Log | Files | Refs | README

lustre.hs (782B)


      1 module Lustre where
      2 
      3 -- a lustre node, carrying annotation e
      4 -- annotations will be rendered as comments in the produced code and can be used
      5 -- for debugging
      6 data Node e = Node Name e [Input] [Output] [Variable] [Decl] deriving (Show)
      7 -- node name
      8 type Name = String
      9 -- boolean local variable
     10 type Variable = Name
     11 -- boolean argument
     12 type Input = Name
     13 -- boolean output
     14 type Output = Name
     15 
     16 -- a declaration mapping LValues to the result of an expression
     17 data Decl = Decl [LValue] Expr deriving (Show)
     18 -- lvalue
     19 type LValue = Name
     20 data Expr =
     21     False
     22   | True
     23   | Var Name
     24   | Unop Unop Expr
     25   | Binop Binop Expr Expr
     26   | Call Name [Name]
     27   deriving (Show)
     28 -- binary operations
     29 data Binop = Or | And | Fby deriving (Show)
     30 -- unary operations
     31 data Unop = Not | Pre deriving (Show)