Skip to content
Snippets Groups Projects
Commit b3567b30 authored by pascal's avatar pascal
Browse files

...

parent 60851a10
No related branches found
No related tags found
No related merge requests found
...@@ -20,3 +20,24 @@ En cours : ...@@ -20,3 +20,24 @@ En cours :
dump du LicPrg : elle n'est plus faite au fur et à mesure dump du LicPrg : elle n'est plus faite au fur et à mesure
dans LasyCompiler dans LasyCompiler
ETAT COURANT
19/07
- completement séparé la compil de l'affichage, du coup
on a débranché l'ancien source_to_source
- l'ajout d'alias sur type array est fait par une passe source 2 source :
ca fait un exemple de traitement s2s simple,
c'est plus propre qu'avant ou c'etait fait par effet de bord
a l'affichage
--> consequence co-latterale : les clashs sur nom de type introduit
sont gérés de manière plus "smart"
==> reste a faire :
refaire les traitements source_to_source !!
--node titi = map<<+,4>>; node myplus<<type t>>(x, y : t) returns (o : t);
let
o = x + y;
tel
node titi<<type t>> = map<<myplus<<t>>,4>>;
node toto(x,y: int^4) returns (o: int^4); node toto(x,y: int^4) returns (o: int^4);
let let
(* o = map<<+, 4>>(x,y); *) (* o = map<<+, 4>>(x,y); *)
o = titi(x,y); o = titi<<int>>(x,y);
tel tel
node tutu(x,y: real^4) returns (o: real^4); node tutu(x,y: real^4) returns (o: real^4);
let let
o = titi(x,y); o = titi<<real>>(x,y);
tel tel
map2.lus 0 → 100644
node titi = map<<+,4>>;
node toto(x,y: int^4) returns (o: int^4);
let
(* o = map<<+, 4>>(x,y); *)
o = titi(x,y);
tel
node tutu(x,y: real^4) returns (o: real^4);
let
o = titi(x,y);
tel
...@@ -467,13 +467,15 @@ let (var_are_compatible : var_info -> var_info -> bool) = ...@@ -467,13 +467,15 @@ let (var_are_compatible : var_info -> var_info -> bool) =
(clock_are_equals (snd v1.var_clock_eff) (snd v2.var_clock_eff)) (clock_are_equals (snd v1.var_clock_eff) (snd v2.var_clock_eff))
let ident_of_type = function let ident_of_type = function
| Bool_type_eff -> Ident.long_of_string "bool" | Bool_type_eff -> Ident.out_of_pack "bool"
| Int_type_eff -> Ident.long_of_string "int" | Int_type_eff -> Ident.out_of_pack "int"
| Real_type_eff -> Ident.long_of_string "real" | Real_type_eff -> Ident.out_of_pack "real"
| External_type_eff id | External_type_eff id
| Abstract_type_eff (id, _) | Abstract_type_eff (id, _)
| Enum_type_eff (id, _) | Enum_type_eff (id, _)
| Struct_type_eff (id, _) -> id | Struct_type_eff (id, _) -> id
| Any -> Ident.out_of_pack "any"
| Overload -> Ident.out_of_pack "anynum"
| _ -> assert false | _ -> assert false
......
...@@ -67,9 +67,14 @@ let (pack_name_to_string : pack_name -> string) = ...@@ -67,9 +67,14 @@ let (pack_name_to_string : pack_name -> string) =
let (string_of_long : long -> string) = let (string_of_long : long -> string) =
fun (pn, id) -> fun (pn, id) ->
if !Global.ec then pn ^"__"^ id else let sep =
if !Global.lv4 then pn ^"__"^ id else pn ^"::"^ id if !Global.ec || !Global.lv4 then "__" else "::"
in
match pn with
| "" -> id
| _ -> Printf.sprintf "%s%s%s" pn sep id
let (string_of_long2 : long -> string) = let (string_of_long2 : long -> string) =
fun (pn, id) -> fun (pn, id) ->
pn ^"::"^ id pn ^"::"^ id
...@@ -115,6 +120,8 @@ let idref_of_string s = ( ...@@ -115,6 +120,8 @@ let idref_of_string s = (
| _ -> raise (Failure ("idref_of_string: \""^s^"\" not a proper ident")) | _ -> raise (Failure ("idref_of_string: \""^s^"\" not a proper ident"))
) )
let out_of_pack s = ("", s)
let (long_of_string : string -> long) = let (long_of_string : string -> long) =
fun s -> fun s ->
match (Str.split (Str.regexp "::") s) with match (Str.split (Str.regexp "::") s) with
......
...@@ -22,6 +22,9 @@ val long_of_string : string -> long ...@@ -22,6 +22,9 @@ val long_of_string : string -> long
val make_long : pack_name -> t -> long val make_long : pack_name -> t -> long
(* lift simple string to long WITH EMPTY PACK *)
val out_of_pack : string -> long
val set_dft_pack_name : pack_name -> unit val set_dft_pack_name : pack_name -> unit
(* TODO: a renommer et a abstraire ?? (* TODO: a renommer et a abstraire ??
......
...@@ -1142,6 +1142,8 @@ and (make_alias_node : node_exp -> node_key -> local_env -> id_solver -> ...@@ -1142,6 +1142,8 @@ and (make_alias_node : node_exp -> node_key -> local_env -> id_solver ->
in in
alias_node alias_node
(*
OBSOLETE
and gen_code (provide_flag:bool) (current_env:Eff.node_env) (nexp: Eff.node_exp) : unit = and gen_code (provide_flag:bool) (current_env:Eff.node_env) (nexp: Eff.node_exp) : unit =
let nk = nexp.node_key_eff in let nk = nexp.node_key_eff in
...@@ -1195,6 +1197,7 @@ and gen_code (provide_flag:bool) (current_env:Eff.node_env) (nexp: Eff.node_exp) ...@@ -1195,6 +1197,7 @@ and gen_code (provide_flag:bool) (current_env:Eff.node_env) (nexp: Eff.node_exp)
(* output_string !Global.oc str *) (* output_string !Global.oc str *)
() ()
) )
*)
(** builds a [node_key] and calls [node_check] *) (** builds a [node_key] and calls [node_check] *)
and (solve_node_idref : t -> SymbolTab.t -> bool -> Ident.pack_name -> Ident.idref -> and (solve_node_idref : t -> SymbolTab.t -> bool -> Ident.pack_name -> Ident.idref ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment