Skip to content
Snippets Groups Projects
Commit ade66878 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Do not print (in the lic generator) Enum const, that were just artificially defined.

parent e3cb8fe1
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
all:
cd src; make
cd src; make ; make test
.PHONY: diff test log
......
(** Time-stamp: <modified the 08/07/2008 (at 15:38) by Erwan Jahier> *)
(** Time-stamp: <modified the 08/07/2008 (at 17:36) by Erwan Jahier> *)
(* Call it LicDump? *)
......@@ -398,16 +398,17 @@ and (type_decl: Ident.long -> type_eff -> string) =
and (const_decl: Ident.long -> const_eff -> string) =
fun tname ceff ->
"const " ^ (long tname) ^
let str = "const " ^ (long tname) in
(match ceff with
| Extern_const_eff _ -> ":" ^ (string_of_type_eff (type_of_const_eff ceff))
| Enum_const_eff _ -> "" (* enum const are defined as extern const *)
| Extern_const_eff _ ->
str^":" ^ (string_of_type_eff (type_of_const_eff ceff))^ ";\n"
| Enum_const_eff _ -> "" (* do not print those const *)
| Struct_const_eff _ -> assert false
| Array_const_eff _
| Bool_const_eff _
| Int_const_eff _
| Real_const_eff _ -> " = " ^ (string_of_const_eff ceff)
) ^ ";\n"
| Real_const_eff _ -> str^" = " ^ (string_of_const_eff ceff)^ ";\n"
)
and (node_of_node_exp_eff: node_exp_eff -> string) =
fun neff ->
......
node plus(a: int ; b: int) returns (c, d, e, f: int);
let
c = Lustre::iplus(a, b);
d = a + b;
e = if(boolred<<0,1,2>>(true^2)) then a else b;
f = if(nor(c<b, Lustre::lte(c,b))) then a else b + if(boolred<<0,0,2>>([c<b, Lustre::lte(c,b)])) then a else b;
tel
let
c = Lustre::iplus(a, b);
d = a + b;
e = if(boolred<<0,1,2>>(true^2)) then a else b;
f = if(nor(c<b, Lustre::lte(c,b))) then a
else b + if(boolred<<0,0,2>>([c<b, Lustre::lte(c,b)])) then a
else b;
tel
......@@ -1338,12 +1338,6 @@ tel
Opening file /home/jahier/lus2lic/src/test/should_work/NONREG/enum.lus
type _enum::couleur = enum {enum::bleu, enum::blanc, enum::rouge};
type _enum::color = enum {enum::blue, enum::white, enum::redd};
const enum::bleu;
const enum::blanc;
const enum::redd;
const enum::rouge;
const enum::blue;
const enum::white;
node enum::boo(e:int) returns (c:_enum::couleur; c2:_enum::color);
let
c = ( if (e = 0) then bleu else ( if (e = 1) then blanc else rouge));
......@@ -3656,9 +3650,6 @@ const inter::n = -4;
const mainPack::N = 8;
type _mainPack::T = int^8;
type _mainPack::couleurs = enum {mainPack::bleu, mainPack::rose, mainPack::jaune};
const mainPack::bleu;
const mainPack::jaune;
const mainPack::rose;
const mainPack::X = 8;
type _inter::selType = struct {i : int; b : bool; r : real};
......@@ -3682,8 +3673,6 @@ let
tel
-- end of node mainPack::preced
type _inter::toto = enum {inter::X, inter::Y};
const inter::X;
const inter::Y;
----------------------------------------------------------------------
====> ../lus2lic -vl 2 --compile-all-items should_work/Pascal/pfs.lus
......@@ -3980,9 +3969,6 @@ type A_bool_10 = bool^10;
====> ../lus2lic -vl 2 --compile-all-items should_work/clock/when_enum.lus
Opening file /home/jahier/lus2lic/src/test/should_work/clock/when_enum.lus
type _when_enum::t = enum {when_enum::A, when_enum::B, when_enum::C};
const when_enum::A;
const when_enum::B;
const when_enum::C;
*** Error in file "should_work/clock/when_enum.lus", line 9, col 19 to 22, token 'when':
*** syntax error: clock expr expected
......@@ -4548,10 +4534,6 @@ type _decl::coord = struct {x : real; y : real};
type _decl::coord_tab = _decl::coord^1;
type _decl::couleur = enum {decl::bleu, decl::blanc, decl::rouge};
const decl::e = 8.500000;
const decl::blanc;
const decl::f;
const decl::bleu;
const decl::rouge;
const decl::a:int;
const decl::b:int;
const decl::c:int;
......@@ -4596,10 +4578,6 @@ type _declaration::coord = struct {x : real; y : real};
type _declaration::coord_tab = _declaration::coord^1;
type _declaration::couleur = enum {declaration::bleu, declaration::blanc, declaration::rouge};
const declaration::e = 8.500000;
const declaration::blanc;
const declaration::f;
const declaration::bleu;
const declaration::rouge;
const declaration::a:int;
const declaration::b:int;
const declaration::c:int;
......
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