Revision 66359a5e
Added by Pierre-Loïc Garoche about 7 years ago
src/machine_code.ml | ||
---|---|---|
178 | 178 |
var_dec_clock = dummy_clock_dec; |
179 | 179 |
var_dec_const = false; |
180 | 180 |
var_dec_value = None; |
181 |
var_parent_nodeid = None; |
|
181 | 182 |
var_type = typ; |
182 | 183 |
var_clock = Clocks.new_ck Clocks.Cvar true; |
183 | 184 |
var_loc = Location.dummy_loc |
... | ... | |
218 | 219 |
|
219 | 220 |
let arrow_machine = |
220 | 221 |
let state = "_first" in |
221 |
let var_state = dummy_var_decl state (Types.new_ty Types.Tbool) in
|
|
222 |
let var_state = dummy_var_decl state Type_predef.type_bool(* (Types.new_ty Types.Tbool) *) in
|
|
222 | 223 |
let var_input1 = List.nth arrow_desc.node_inputs 0 in |
223 | 224 |
let var_input2 = List.nth arrow_desc.node_inputs 1 in |
224 | 225 |
let var_output = List.nth arrow_desc.node_outputs 0 in |
... | ... | |
622 | 623 |
mktyp loc Tydec_bool, |
623 | 624 |
mkclock loc Ckdec_any, |
624 | 625 |
false, (* not a constant *) |
625 |
None (* no default value *) |
|
626 |
None, (* no default value *) |
|
627 |
Some nd.node_id |
|
626 | 628 |
) |
627 | 629 |
in |
628 |
assert_var.var_type <- Types.new_ty (Types.Tbool);
|
|
630 |
assert_var.var_type <- Type_predef.type_bool (* Types.new_ty (Types.Tbool) *);
|
|
629 | 631 |
let eq = mkeq loc ([var_id], expr) in |
630 | 632 |
(i+1, assert_var::vars, eq::eqlist, {expr with expr_desc = Expr_ident var_id}::assertlist) |
631 | 633 |
) (1, [], [], []) exprl |
Also available in: Unified diff
[general] large modification: added machine types, a second typing phase dealing with machine types (eg uint8)
typing was transformed as a functor and parametrized by basic types (int/real/bool)
it can also be applied multiple times on the same program