Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lustre-v6
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
verimag
synchrone
lustre-v6
Commits
3fa6378d
Commit
3fa6378d
authored
16 years ago
by
Erwan Jahier
Browse files
Options
Downloads
Patches
Plain Diff
Add a header at top of generated files saying when, by who, how the file was generated.
parent
bb580520
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/Makefile
+1
-1
1 addition, 1 deletion
src/Makefile
src/main.ml
+37
-1
37 additions, 1 deletion
src/main.ml
src/test/Makefile
+5
-4
5 additions, 4 deletions
src/test/Makefile
src/test/test.res.exp
+503
-13
503 additions, 13 deletions
src/test/test.res.exp
with
546 additions
and
19 deletions
src/Makefile
+
1
−
1
View file @
3fa6378d
...
...
@@ -2,7 +2,7 @@
OCAMLMAKEFILE
=
./OCamlMakefile
RESULT
=
lus2lic
LIBS
=
str
LIBS
=
str
unix
OCAMLC
=
ocamlc
ifndef
SOURCES
...
...
This diff is collapsed.
Click to expand it.
src/main.ml
+
37
−
1
View file @
3fa6378d
(** Time-stamp: <modified the 05/02/2009 (at 1
4:56
) by Erwan Jahier> *)
(** Time-stamp: <modified the 05/02/2009 (at 1
5:30
) by Erwan Jahier> *)
(** Here follows a description of the different modules used by this lus2lic compiler.
...
...
@@ -248,6 +248,41 @@ let (get_source_list : string list -> SyntaxTree.pack_or_model list) =
|
Unpacked
pack
->
[
pack
]
let
dump_entete
oc
=
let
time
=
Unix
.
localtime
(
Unix
.
time
()
)
in
let
sys_call
,
_
=
Array
.
fold_left
(
fun
(
acc
,
i
)
x
->
if
70
<
i
+
(
String
.
length
x
)
then
acc
^
"
\n
--
\t\t
"
^
x
,
String
.
length
(
"
\n
--
\t\t
"
^
x
)
else
acc
^
" "
^
x
,
(
i
+
1
+
(
String
.
length
x
))
)
(
""
,
0
)
Sys
.
argv
and
date
=
(
(
string_of_int
time
.
Unix
.
tm_mday
)
^
"/"
^
(
string_of_int
(
time
.
Unix
.
tm_mon
+
1
))
^
"/"
^
(
string_of_int
(
1900
+
time
.
Unix
.
tm_year
))
)
and
time_str
=
(
(
string_of_int
time
.
Unix
.
tm_hour
)
^
":"
^
(
if
time
.
Unix
.
tm_min
<
10
then
"0"
else
""
)
^
(
string_of_int
time
.
Unix
.
tm_min
)
^
":"
^
(
if
time
.
Unix
.
tm_sec
<
10
then
"0"
else
""
)
^
(
string_of_int
time
.
Unix
.
tm_sec
)
)
(* and user = Unix.getlogin () *)
and
hostname
=
Unix
.
gethostname
()
in
output_string
oc
(
"-- This file was generated by lus2lic version "
^
Version
.
str
^
".
\n
--
\t
"
^
sys_call
^
"
-- on "
^
hostname
^
(* "by "^ user ^ *)
" the "
^
date
^
" at "
^
time_str
^
"
\n\n
"
);
flush
oc
let
my_exit
i
=
close_out
!
Global
.
oc
;
...
...
@@ -272,6 +307,7 @@ let main = (
Some
(
Ident
.
idref_of_string
!
Global
.
main_node
)
in
if
!
Global
.
outfile
<>
""
then
Global
.
oc
:=
open_out
!
Global
.
outfile
;
dump_entete
!
Global
.
oc
;
Compile
.
doit
nsl
main_node
;
LicDump
.
dump_type_alias
!
Global
.
oc
;
close_out
!
Global
.
oc
...
...
This diff is collapsed.
Click to expand it.
src/test/Makefile
+
5
−
4
View file @
3fa6378d
...
...
@@ -52,9 +52,10 @@ help:
version
:
$(
LC0
)
--version
FILTER
=
grep
-v
"file was generated by"
|
grep
-v
" on "
do_not_exist
:
$(
LC
)
do_not_exist.lus
>>
test_ko.res 2>&1
||
true
$(
LC
)
do_not_exist.lus
|
$(
FILTER
)
>>
test_ko.res 2>&1
||
true
same_file
:
$(
LC
)
should_work/NONREG/ex.lus should_work/NONREG/ex.lus
>>
test_ok.res 2>&1
...
...
@@ -62,13 +63,13 @@ same_file:
test
:
begin unit help version do_not_exist same_file
for
d
in
${
OK_LUS
};
do
\
echo
-e
"
\n
$(
NL
)
====>
$(
LC
)
$$
d"
>>
test_ok.res
;
\
$(
LC
)
$$
d
>>
test_ok.res 2>&1
;
\
$(
LC
)
$$
d
>>
test_ok.res 2>&1
;
\
done
;
\
for
d
in
${
KO_LUS
};
do
\
echo
-e
"
\n
$(
NL
)
====>
$(
LC
)
$$
d"
>>
test_ko.res
;
\
$(
LC
)
$$
d
>>
test_ko.res 2>&1
;
\
$(
LC
)
$$
d
>>
test_ko.res 2>&1
;
\
done
;
\
rm
-f
test.res
;
cat
test_ok.res test_ko.res
>
test.res
;
\
rm
-f
test.res
;
cat
test_ok.res test_ko.res
|
$(
FILTER
)
>
test.res
;
\
diff
-u
test.res.exp test.res
>
test.diff
||
\
(
cat
test.diff
;
echo
"cf test.diff"
;
exit
1
)
utest
:
...
...
This diff is collapsed.
Click to expand it.
src/test/test.res.exp
+
503
−
13
View file @
3fa6378d
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment