hepts: enum types & alias

The graphical simulator hepts now support type aliasing.
This commit is contained in:
Gwenaël Delaval 2016-01-18 17:24:51 +01:00
parent 2aed0f6537
commit e9540a2159

View file

@ -269,15 +269,20 @@ let create_input v_name v_ty n (table:GPack.table) =
| Tid{ qual = Pervasives; name = "bool" } -> | Tid{ qual = Pervasives; name = "bool" } ->
new boolean_input table n new boolean_input table n
| Tid(name) -> | Tid(name) ->
begin try let rec input name =
let ty = find_type name in let _ = check_type name in
begin match ty with begin try
| Tenum(clist) -> new enum_input name.qual clist table n let ty = find_type name in
| _ -> new entry_input "" table n begin
end match ty with
with Not_found -> | Tenum(clist) -> new enum_input name.qual clist table n
new entry_input "" table n | Talias(Tid name) -> input name
end | _ -> new entry_input "" table n
end
with Not_found ->
new entry_input "" table n
end in
input name
| _ -> failwith("Arrays and tuples not yet implemented") | _ -> failwith("Arrays and tuples not yet implemented")
let create_output v_name _v_ty n (table:GPack.table) = let create_output v_name _v_ty n (table:GPack.table) =