From 77474c7a38106a1f0d3873090fc4d660dea02f78 Mon Sep 17 00:00:00 2001 From: Mamadou Ndiaye <ndiaye@malaval.imag.fr> Date: Fri, 10 Jul 2015 15:48:59 +0200 Subject: [PATCH] extention keywords Scade and inserting " assert false " for point does not work. --- src/astPredef.ml | 4 ++-- src/l2lCheckKcgKeyWord.ml | 4 +++- src/licDump.ml | 8 +++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/astPredef.ml b/src/astPredef.ml index 39392df4..41942ad6 100644 --- a/src/astPredef.ml +++ b/src/astPredef.ml @@ -93,7 +93,7 @@ let op2string = function | AND_n -> "and" | OR_n -> "or" | XOR_n -> "xor" - | IMPL_n -> "=>" + | IMPL_n -> if Lv6MainArgs.global_opt.Lv6MainArgs.kcg then assert false else "=>" | EQ_n -> "=" | NEQ_n -> "<>" | LT_n | ILT_n | RLT_n -> "<" @@ -108,7 +108,7 @@ let op2string = function | UMINUS_n -> "-" | MINUS_n -> "-" | PLUS_n -> "+" - | SLASH_n -> "/" + | SLASH_n -> if Lv6MainArgs.global_opt.Lv6MainArgs.kcg then "div" else "/" | TIMES_n -> "*" | IUMINUS_n -> "-" | IMINUS_n -> "-" diff --git a/src/l2lCheckKcgKeyWord.ml b/src/l2lCheckKcgKeyWord.ml index 388eda8c..ef90150d 100644 --- a/src/l2lCheckKcgKeyWord.ml +++ b/src/l2lCheckKcgKeyWord.ml @@ -15,7 +15,9 @@ module StringSet = let compare = compare end) -let kcg_kw_list = ["state";"clock";"initial"] +let kcg_kw_list = ["state";"clock";"initial";"abstract"; "activate";"and";"assume";"automaton";"bool";"case"; "char"; "const";"default";"div"; "do";"else"; "elsif"; "emit"; "end"; "enum"; "every";"false"; "fby"; "final"; "flatten"; "fold"; "foldi"; "foldw";" foldwi"; "function"; +"guarantee";"group";"if";"imported";"initial";"int";"is";"last";"let";"make";"map";"mapfold";"mapi"; "mapw";"mapwi";"match";"merge";"mod";"node";"not";"numeric";"of";"onreset";"open";"or";"package";"parameter";"pre";"private";"probe";"public";"real";"restart";"resume";"returns";"reverse";"sensor";"sig";"specialize";"synchro";"tel";"then";"times";"transpose";"true";"unless";"until";"var";"when";"where";"with";"xor"] + let kcg_kw = StringSet.of_list kcg_kw_list let (check_var_info : Lic.var_info -> unit) = diff --git a/src/licDump.ml b/src/licDump.ml index e50746be..8b148904 100644 --- a/src/licDump.ml +++ b/src/licDump.ml @@ -263,7 +263,7 @@ and string_of_node_key_rec (no_prefix:bool) (nkey: node_key) = then Lv6Id.no_pack_string_of_long ik else Lv6Id.string_of_long ik | (ik, salst) -> - (*if global_opt.kcg then ((* recursive nodes have been unfold *) + if global_opt.kcg then ((* recursive nodes have been unfold *) (*assert (List.mem ik ["map"]);*) (* not yet working : - cas des noeuds itérés prédéfinis @@ -288,7 +288,7 @@ and string_of_node_key_rec (no_prefix:bool) (nkey: node_key) = (FreshName.node_key nkey name) ) - else *) + else let astrings = List.map static_arg2string_bis salst in let name = sprintf "%s_%s" (Lv6Id.no_pack_string_of_long ik) (String.concat "_" astrings) in (FreshName.node_key nkey name) @@ -500,7 +500,9 @@ and (string_of_by_pos_op_eff: Lic.by_pos_op srcflagged -> Lic.val_exp list -> st | WHEN clk, vel -> (tuple vel) ^ (string_of_clock clk) | CURRENT Some _,_ -> (* transform to merge in kcg mode *) - "current " ^ tuple_par (if global_opt.ec then List.tl vel else vel) + if global_opt.kcg then assert false + else + "current " ^ tuple_par (if global_opt.ec then List.tl vel else vel) | CURRENT None,_ -> "current " ^ tuple_par vel | TUPLE,_ -> (tuple vel) | CONCAT, [ve1; ve2] -> -- GitLab