From 31e8df195d50d931a41c45f4b3b450c4c5136b34 Mon Sep 17 00:00:00 2001
From: Erwan Jahier <jahier@imag.fr>
Date: Wed, 13 Jan 2010 17:32:45 +0100
Subject: [PATCH] Output "real" instead of "int2real" when generating ec + fix
 some minor issues in the manual.

---
 lv6-ref-man/lv6-ref-man.tex           | 18 ++++++++++++++++--
 release-lv6/Makefile                  | 19 ++++++++++++-------
 src/Makefile                          |  3 ++-
 src/licDump.ml                        |  9 +++++----
 src/test/should_work/NONREG/merge.lus |  4 ++--
 src/test/test.res.exp                 |  2 +-
 src/utils/get_sha_1                   |  2 +-
 7 files changed, 39 insertions(+), 18 deletions(-)

diff --git a/lv6-ref-man/lv6-ref-man.tex b/lv6-ref-man/lv6-ref-man.tex
index 28d3ce7c..eacc5df4 100644
--- a/lv6-ref-man/lv6-ref-man.tex
+++ b/lv6-ref-man/lv6-ref-man.tex
@@ -790,6 +790,8 @@ set of equations defining the outputs.
 \end{example}
 
 
+XXX definir extern 
+
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{Equations}
@@ -1116,7 +1118,7 @@ functions, and a constructor function.
 \kwd{type} matrix_3_3 = int ^ 3 ^ 3 ; \coment{-- to define a type matrix of integers}
 \kwd{const} m1 = 0 ^ 3 ^ 3;           \coment{-- a constant of type matrix_3_3}
 \kwd{const} m2 = [1,2,3] ^ 3;         \coment{-- another constant}
-\kwd{const} sm1 = m1[2]               \coment{-- a constant of type int^3 (\evalto [1,2,3])}
+\kwd{const} sm1 = m2[2]               \coment{-- a constant of type int^3 (\evalto [1,2,3])}
 \end{alltt}
 \end{example}
 
@@ -1835,12 +1837,24 @@ a model can have as parameters a type, a constant, or a node.
 \end{example}
 
 
+\begin{tabular}{|l||l|l|l|l|l|l|}
+\hline
+clk & Pile & Pile & Face & Tranche & Pile & Face \\
+\hline
+i1 &1 & 2 & & & 3 & \\
+i2 & & & 1 & & & 2 \\
+i3 & & & & 1 & &\\
+\hline
+y & 1 & 2 & 1 & 1 & 3 & 2\\
+\hline
+\end{tabular}
+
 \cleardoublepage
 
 \section{A complete example}
 \label{exemples}
 
-
+	
 \todo add a complete Lustre V6 commented exemple.... 
 
 
diff --git a/release-lv6/Makefile b/release-lv6/Makefile
index f0babc70..a30a0391 100644
--- a/release-lv6/Makefile
+++ b/release-lv6/Makefile
@@ -1,17 +1,16 @@
 
 
 LIC2CDIR=~/lic2loc
-LUS2LICDIR=~/lus2lic/
+LUS2LICDIR=~/lus2lic
 LUS2LIC=$(LUS2LICDIR)/src/lus2lic
 
 VERSION=R0.$(shell $(LUS2LIC) -version  | cut -d "." -f 2)
 
-RELNAME_PREFIX=lv6-alpha-$(VERSION)-
+RELNAME_PREFIX=lv6-alpha-$(VERSION)
 RELNAME=$(RELNAME_PREFIX)$(shell date +%d-%m-%y)-$(shell uname)
 
 
-
-all: dir doc lus2lic lic2c test_files
+all: dir doc lus2lic test_files
 
 dir:
 	rm -rf $(RELNAME)  || true
@@ -23,21 +22,21 @@ doc:
 	cp ~/slides/lv6/*.pdf  $(RELNAME)/doc
 
 lus2lic:
-	cd $(LUS2LICDIR)/src ; make clean ; make nc
+	cd $(LUS2LICDIR)/src ; make
 	cp $(LUS2LIC) $(RELNAME)/bin/
 
 lic2c:
-	cd $(LIC2CDIR)/src/ ; make clean ; make nc
+	cd $(LIC2CDIR)/src/ ; make clean ; make 
 	cp $(LIC2CDIR)/src/lic2c $(RELNAME)/bin/
 
 test_files:
 	for f in $(shell find $(LUS2LICDIR)/src/test/should_work -name \*.lus); do \
 		 ($(RELNAME)/bin/lus2lic $$f -o /tmp/xx.lus || (echo "*** lus2lic $$f failed" ; exit 1)) && \
-		 ($(RELNAME)/bin/lic2c --out-format loc  /tmp/xx.lus > /dev/null || (echo "*** lic2c $$f failed" ; exit 1)) && \
 		echo "cp $$f $(RELNAME)/test/" && \
 		cp $$f $(RELNAME)/test/; \
 	done
 
+#		 ($(RELNAME)/bin/lic2c --out-format loc  /tmp/xx.lus > /dev/null || (echo "*** lic2c $$f failed" ; exit 1)) && \
 $(RELNAME).tgz:
 	tar cvfz  $(RELNAME).tgz $(RELNAME) 
 
@@ -45,5 +44,11 @@ www:  $(RELNAME).tgz
 	cp $(RELNAME).tgz ~/SYNCHRONE/lustre-v6/
 
 
+verimag:
+	cp $(RELNAME).tgz /usr/local/tools/lustre-v6
+	cd /usr/local/tools/lustre-v6 
+	tar xvfz $(RELNAME).tgz
+	echo "Changer le lien symbolique /usr/local/tools/lustre-v6/current ?"
+
 clean:
 	rm -rf $(RELNAME_PREFIX)*-*
\ No newline at end of file
diff --git a/src/Makefile b/src/Makefile
index cb0d3a1d..250c7c3d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -149,7 +149,8 @@ dot2ps:
 	dot -Tps lus2lic.dot > lus2lic.dot.ps 
 # Specific rule (version)
 
-.PHONY: version.ml
+.PRECIOUS: version.ml
+
 version.ml: 
 	echo "(* Automatically generated from src/Makefile *) " > version.ml
 	echo "let tool = \"lus2lic\"" >> version.ml
diff --git a/src/licDump.ml b/src/licDump.ml
index 0ecb34c3..020a74bf 100644
--- a/src/licDump.ml
+++ b/src/licDump.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 26/05/2009 (at 16:39) by Erwan Jahier> *)
+(** Time-stamp: <modified the 13/01/2010 (at 17:00) by Erwan Jahier> *)
 
 open Printf
 open Lxm
@@ -660,9 +660,10 @@ and string_of_clock (ck : Eff.clock) =
            *)
           (*     | ClockVar i -> "_clock_var_" ^ (string_of_int i) *)
 
-and op2string = Predef.op2string
-
-
+and op2string op = 
+  (* Une verrue pour compatible avec les outils qui mangent du ec...  *)
+  if !Global.ec && op = Predef.REAL2INT_n then "real"  else 
+    Predef.op2string op
 
 (*---------------------------------------------------------------------
 Formatage standard des erreurs de compil
diff --git a/src/test/should_work/NONREG/merge.lus b/src/test/should_work/NONREG/merge.lus
index 0c1f6c80..ffe738b7 100644
--- a/src/test/should_work/NONREG/merge.lus
+++ b/src/test/should_work/NONREG/merge.lus
@@ -1,7 +1,7 @@
 type trival = enum { Pile, Face, Tranche }; ---
 node merge_node(clk: trival; ---
-   i1 when Pile(clk); i2 when Face(clk); 
-   i3 when Tranche(clk)) 
+   i1 :  int when Pile(clk) ; i2 :  int when Face(clk); 
+   i3:  int when Tranche(clk)) 
 returns (y: int); ---
 let
     y = merge clk
diff --git a/src/test/test.res.exp b/src/test/test.res.exp
index 31bb2c43..674bfec4 100644
--- a/src/test/test.res.exp
+++ b/src/test/test.res.exp
@@ -3427,7 +3427,7 @@ tel
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 should_work/NONREG/merge.lus
 Opening file should_work/NONREG/merge.lus
-*** Error in file "should_work/NONREG/merge.lus", line 3, col 7 to 10, token 'when':
+*** Error in file "should_work/NONREG/merge.lus", line 7, col 15 to 17, token 'clk':
 *** syntax error
 
 
diff --git a/src/utils/get_sha_1 b/src/utils/get_sha_1
index e334b8e6..eb9154a1 100755
--- a/src/utils/get_sha_1
+++ b/src/utils/get_sha_1
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-git log | grep commit | head -n 1  | cut -d " " -f 2
+git log | grep commit | head -n 1  | cut -d " " -f 2 
 
-- 
GitLab