Clock annotation in Hept AST
This commit is contained in:
parent
9998d7ea39
commit
9a69c30dc5
|
@ -1,4 +1,4 @@
|
||||||
(**************************************************************************)
|
(**************************************************************************)
|
||||||
(* *)
|
(* *)
|
||||||
(* Heptagon *)
|
(* Heptagon *)
|
||||||
(* *)
|
(* *)
|
||||||
|
@ -28,6 +28,7 @@ type iterator_type =
|
||||||
type exp = {
|
type exp = {
|
||||||
e_desc : desc;
|
e_desc : desc;
|
||||||
e_ty : ty;
|
e_ty : ty;
|
||||||
|
e_ct_annot : ct;
|
||||||
e_loc : location }
|
e_loc : location }
|
||||||
|
|
||||||
and desc =
|
and desc =
|
||||||
|
@ -179,8 +180,8 @@ and interface_desc =
|
||||||
| Isignature of signature
|
| Isignature of signature
|
||||||
|
|
||||||
(* Helper functions to create AST. *)
|
(* Helper functions to create AST. *)
|
||||||
let mk_exp desc ty =
|
let mk_exp desc ?(ct_annot = Clocks.invalid_clock) ty =
|
||||||
{ e_desc = desc; e_ty = ty; e_loc = no_location; }
|
{ e_desc = desc; e_ty = ty; e_ct_annot = ct_annot; e_loc = no_location; }
|
||||||
|
|
||||||
let mk_op ?(params=[]) ?(unsafe=false) op =
|
let mk_op ?(params=[]) ?(unsafe=false) op =
|
||||||
{ a_op = op; a_params = params; a_unsafe = unsafe }
|
{ a_op = op; a_params = params; a_unsafe = unsafe }
|
||||||
|
|
|
@ -59,6 +59,7 @@ type ty =
|
||||||
|
|
||||||
and exp =
|
and exp =
|
||||||
{ e_desc : edesc;
|
{ e_desc : edesc;
|
||||||
|
e_ct_annot : Clocks.ct;
|
||||||
e_loc : location }
|
e_loc : location }
|
||||||
|
|
||||||
and edesc =
|
and edesc =
|
||||||
|
@ -206,8 +207,8 @@ and interface_desc =
|
||||||
|
|
||||||
(* {3 Helper functions to create AST} *)
|
(* {3 Helper functions to create AST} *)
|
||||||
|
|
||||||
let mk_exp desc loc =
|
let mk_exp desc ?(ct_annot = Clocks.invalid_clock) loc =
|
||||||
{ e_desc = desc; e_loc = loc }
|
{ e_desc = desc; e_ct_annot = ct_annot; e_loc = loc }
|
||||||
|
|
||||||
let mk_app op params =
|
let mk_app op params =
|
||||||
{ a_op = op; a_params = params }
|
{ a_op = op; a_params = params }
|
||||||
|
|
|
@ -222,6 +222,7 @@ let rec translate_exp env e =
|
||||||
try
|
try
|
||||||
{ Heptagon.e_desc = translate_desc e.e_loc env e.e_desc;
|
{ Heptagon.e_desc = translate_desc e.e_loc env e.e_desc;
|
||||||
Heptagon.e_ty = Types.invalid_type;
|
Heptagon.e_ty = Types.invalid_type;
|
||||||
|
Heptagon.e_ct_annot = e.e_ct_annot;
|
||||||
Heptagon.e_loc = e.e_loc }
|
Heptagon.e_loc = e.e_loc }
|
||||||
with ScopingError(error) -> message e.e_loc error
|
with ScopingError(error) -> message e.e_loc error
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ let rec translate_pat map = function
|
||||||
List.fold_right (fun pat acc -> (translate_pat map pat) @ acc)
|
List.fold_right (fun pat acc -> (translate_pat map pat) @ acc)
|
||||||
pat_list []
|
pat_list []
|
||||||
|
|
||||||
let translate_var_dec l = (*TODO bug map unused ?*)
|
let translate_var_dec l =
|
||||||
let one_var { Minils.v_ident = x; Minils.v_type = t; v_loc = loc } =
|
let one_var { Minils.v_ident = x; Minils.v_type = t; v_loc = loc } =
|
||||||
mk_var_dec ~loc:loc x t
|
mk_var_dec ~loc:loc x t
|
||||||
in
|
in
|
||||||
|
|
|
@ -12,23 +12,7 @@ open Compiler_utils
|
||||||
open Compiler_options
|
open Compiler_options
|
||||||
|
|
||||||
let pp p = if !verbose then Mls_printer.print stdout p
|
let pp p = if !verbose then Mls_printer.print stdout p
|
||||||
(*
|
|
||||||
let parse parsing_fun lexing_fun lexbuf =
|
|
||||||
try
|
|
||||||
parsing_fun lexing_fun lexbuf
|
|
||||||
with
|
|
||||||
| Mls_lexer.Lexical_error(err, loc) ->
|
|
||||||
lexical_error err loc
|
|
||||||
| Mls_parser.Error ->
|
|
||||||
let pos1 = Lexing.lexeme_start_p lexbuf
|
|
||||||
and pos2 = Lexing.lexeme_end_p lexbuf in
|
|
||||||
let l = Loc(pos1,pos2) in
|
|
||||||
syntax_error l
|
|
||||||
|
|
||||||
let parse_implementation prog_name lexbuf =
|
|
||||||
let p = parse Mls_parser.program Mls_lexer.token lexbuf in
|
|
||||||
{ p with Mls_parsetree.p_modname = prog_name }
|
|
||||||
*)
|
|
||||||
let compile pp p =
|
let compile pp p =
|
||||||
(* Clocking *)
|
(* Clocking *)
|
||||||
let p = pass "Clocking" true Clocking.program p pp in
|
let p = pass "Clocking" true Clocking.program p pp in
|
||||||
|
|
|
@ -39,10 +39,10 @@ and tdesc =
|
||||||
| Type_struct of structure
|
| Type_struct of structure
|
||||||
|
|
||||||
and exp = {
|
and exp = {
|
||||||
e_desc: edesc;
|
e_desc : edesc;
|
||||||
mutable e_ck: ck;
|
mutable e_ck: ck;
|
||||||
mutable e_ty: ty;
|
mutable e_ty: ty;
|
||||||
e_loc: location }
|
e_loc : location }
|
||||||
|
|
||||||
and edesc =
|
and edesc =
|
||||||
| Econst of static_exp
|
| Econst of static_exp
|
||||||
|
|
4
todo.txt
4
todo.txt
|
@ -7,4 +7,8 @@ Plus ou moins ordonné du plus urgent au moins urgent.
|
||||||
|
|
||||||
*- Compléter la passe "static.ml" pour gérer l'ensemble des opérateurs de pervasives
|
*- Compléter la passe "static.ml" pour gérer l'ensemble des opérateurs de pervasives
|
||||||
|
|
||||||
|
*- Permettre les déclarations des types et des noeuds et des constantes dans un ordre quelconque.
|
||||||
|
|
||||||
|
*- Permettre la définition de constantes locales.
|
||||||
|
|
||||||
*- Optimiser le reset en utilisant un memcopy ?
|
*- Optimiser le reset en utilisant un memcopy ?
|
||||||
|
|
Loading…
Reference in New Issue