package lustre-v6

  1. Overview
  2. Docs

(Raw) Abstract syntax tree of source Lustre Core programs.

type clock_exp =
  1. | Base
  2. | NamedClock of Lv6Id.clk Lxm.srcflagged

type_exp is used to type flow, parameters, constants.

and type_exp_core =
  1. | Bool_type_exp
  2. | Int_type_exp
  3. | Real_type_exp
  4. | Named_type_exp of Lv6Id.idref
  5. | Array_type_exp of type_exp * val_exp
and node_info = {
  1. name : Lv6Id.t;
  2. static_params : static_param Lxm.srcflagged list;
  3. vars : node_vars option;
  4. loc_consts : (Lxm.t * const_info) list;
  5. def : node_def;
  6. has_mem : bool;
  7. is_safe : bool;
}
and static_param =
  1. | StaticParamType of Lv6Id.t
  2. | StaticParamConst of Lv6Id.t * type_exp
  3. | StaticParamNode of Lv6Id.t * var_info Lxm.srcflagged list * var_info Lxm.srcflagged list * has_mem_flag * is_safe_flag
and node_vars = {
  1. inlist : Lv6Id.t list;
  2. outlist : Lv6Id.t list;
  3. loclist : Lv6Id.t list option;
  4. vartable : var_info_table;
}
and var_info_table = (Lv6Id.t, var_info Lxm.srcflagged) Hashtbl.t
and var_info = {
  1. var_nature : var_nature;
  2. var_name : Lv6Id.t;
  3. var_number : int;
  4. var_type : type_exp;
  5. var_clock : clock_exp;
}
and var_nature =
  1. | VarInput
  2. | VarOutput
  3. | VarLocal
and node_def =
  1. | Extern
  2. | Abstract
  3. | Body of node_body
  4. | Alias of by_pos_op Lxm.srcflagged
and node_body = {
  1. asserts : val_exp Lxm.srcflagged list;
  2. eqs : eq_info Lxm.srcflagged list;
}
and has_mem_flag = bool
and is_safe_flag = bool
and eq_info = left_part list * val_exp
and left_part =
  1. | LeftVar of Lv6Id.t Lxm.srcflagged
  2. | LeftField of left_part * Lv6Id.t Lxm.srcflagged
  3. | LeftArray of left_part * val_exp Lxm.srcflagged
  4. | LeftSlice of left_part * slice_info Lxm.srcflagged
and slice_info = {
  1. si_first : val_exp;
  2. si_last : val_exp;
  3. si_step : val_exp option;
}
and by_pos_op =
  1. | Predef_n of AstPredef.op Lxm.srcflagged
  2. | CALL_n of node_exp Lxm.srcflagged
  3. | IDENT_n of Lv6Id.idref
  4. | PRE_n
  5. | ARROW_n
  6. | FBY_n
  7. | CURRENT_n
  8. | WHEN_n of clock_exp
  9. | TUPLE_n
  10. | WITH_n of val_exp * val_exp * val_exp
  11. | CONCAT_n
  12. | HAT_n
  13. | ARRAY_n
  14. | STRUCT_ACCESS_n of Lv6Id.t
  15. | ARRAY_ACCES_n of val_exp
  16. | ARRAY_SLICE_n of slice_info
and val_exp =
  1. | CallByPos of by_pos_op Lxm.srcflagged * operands
  2. | CallByName of by_name_op Lxm.srcflagged * (Lv6Id.t Lxm.srcflagged * val_exp) list
  3. | Merge_n of val_exp Lxm.srcflagged * (Lv6Id.idref Lxm.srcflagged * val_exp) list
  4. | Merge_bool_n of val_exp Lxm.srcflagged * val_exp * val_exp
and operands =
  1. | Oper of val_exp list
and by_name_op =
  1. | STRUCT_n of Lv6Id.idref
  2. | STRUCT_WITH_n of Lv6Id.idref * Lv6Id.idref
  3. | STRUCT_anonymous_n
and node_exp = Lv6Id.idref * static_arg Lxm.srcflagged list
and static_arg =
  1. | StaticArgLv6Id of Lv6Id.idref
  2. | StaticArgConst of val_exp
  3. | StaticArgType of type_exp
  4. | StaticArgNode of by_pos_op

Params statiques effectifs :

  • val_exp (pour les constantes)
  • type_exp (pour les types)
  • node_exp (pour les node)
  • ident : a résoudre, peut etre const, type ou node

constant

and const_info =
  1. | ExternalConst of Lv6Id.t * type_exp * val_exp option
  2. | EnumConst of Lv6Id.t * type_exp
  3. | DefinedConst of Lv6Id.t * type_exp option * val_exp

Type

type field_info = {
  1. fd_name : Lv6Id.t;
  2. fd_type : type_exp;
  3. fd_value : val_exp option;
}
type struct_type_info = {
  1. st_name : Lv6Id.t;
  2. st_flist : Lv6Id.t list;
  3. st_ftable : (Lv6Id.t, field_info Lxm.srcflagged) Hashtbl.t;
}
type type_info =
  1. | ExternalType of Lv6Id.t
  2. | AliasedType of Lv6Id.t * type_exp
  3. | EnumType of Lv6Id.t * Lv6Id.t Lxm.srcflagged list
  4. | StructType of struct_type_info
  5. | ArrayType of Lv6Id.t * type_exp * val_exp

Operator

type item_ident =
  1. | ConstItem of Lv6Id.t
  2. | TypeItem of Lv6Id.t
  3. | NodeItem of Lv6Id.t * static_param Lxm.srcflagged list
type item_info =
  1. | ConstInfo of const_info
  2. | TypeInfo of type_info
  3. | NodeInfo of node_info
val string_of_type_exp : type_exp -> string
val string_of_var_nature : var_nature -> string
val lxm_of_val_exp : val_exp -> Lxm.t
OCaml

Innovation. Community. Security.