Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
verimag
synchrone
lustre-v6
Commits
fe00e975
Commit
fe00e975
authored
Jun 12, 2020
by
erwan
Browse files
Doc: Rewrite the reference manual to use only the yacc2latex-generated rules
parent
59dd5c86
Pipeline
#45281
passed with stages
in 5 minutes and 34 seconds
Changes
9
Pipelines
2
Expand all
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
fe00e975
image
:
ocaml/opam2:ubuntu
image
:
ocaml/opam2:ubuntu
-18.04
variables
:
GIT_STRATEGY
:
clone
...
...
lib/lv6parser.mly
View file @
fe00e975
...
...
@@ -154,6 +154,8 @@ A lustre file is either an old-fashioned list of item decl,
or
a
list
of
pack
/
model
declaration
*/
/*
ebnf
:
group
=
ProgramRules
*/
program
:
IncludeList
PackBody
TK_EOF
{
AstV6
.
PRPackBody
(
List
.
rev
$
1
,
$
2
)
...
...
@@ -164,6 +166,7 @@ program: IncludeList PackBody TK_EOF
}
;
/*
ebnf
:
group
=
PackageRules
*/
PackList
:
OnePack
{
[
$
1
]
}
|
PackList
OnePack
...
...
@@ -179,6 +182,8 @@ OnePack: /* ebnf:print=short */
{
AstV6
.
NSPack
$
1
}
;
/*
ebnf
:
group
=
ProgramRules
*/
Include
:
TK_INCLUDE
TK_STRING
{
(
Lxm
.
str
$
2
)
}
;
...
...
@@ -195,6 +200,7 @@ Pour les provides, on rend des decls, bien
que
syntaxiquement
,
on
n'autorise
pas
n'importe
quoi
...
*/
/*
ebnf
:
group
=
ModelRules
*/
Provides
:
/*
nada
*/
{
None
}
...
...
@@ -247,13 +253,17 @@ Provide:
{
Lxm
.
flagit
(
TypeInfo
(
snd
$
2
))
(
fst
$
2
)
}
;
/*
ebnf
:
group
=
ConstRules
*/
ConstDefOpt
:
/*
ebnf
:
print
=
expand
*/
{
None
}
|
TK_EQ
Expression
{
Some
$
2
}
;
;
/*
ebnf
:
group
=
ModelRules
*/
ModelDecl
:
TK_MODEL
Lv6Id
Uses
...
...
@@ -275,6 +285,7 @@ ModelDecl:
}
;
/*
ebnf
:
group
=
PackageRules
*/
PackDecl
:
TK_PACKAGE
Lv6Id
...
...
@@ -339,6 +350,7 @@ PackEq:
{
it
=
pa
;
src
=
$
2
}
}
;
/*
ebnf
:
group
=
ProgramRules
*/
/*
PackBody
:
les
informations
collectes
dans
les
tables
...
...
@@ -380,8 +392,9 @@ OneDecl: /* ebnf:print=short */
;
/*
Lv6Idifiers
and
lists
*/
/*
ebnf
:
group
=
IdentVIRules
*/
Lv6IdRef
:
/*
ebnf
:
print
=
ignore
*/
Lv6IdRef
:
/*
ebnf
print
=
ignore
*/
/*
simple
or
long
...
*/
TK_IDENT
{
idref_of_lxm
$
1
}
...
...
@@ -390,8 +403,9 @@ Lv6IdRef: /* ebnf:print=ignore */
;
/*
Lv6Idifiers
and
lists
*/
/*
ebnf
:
group
=
IdentRules
*/
Lv6Id
:
/*
ebnf
:
print
=
ignore
*/
Lv6Id
:
/*
ebnf
print
=
ignore
*/
TK_IDENT
Pragma
{
(
Lv6parserUtils
.
make_ident
$
1
$
2
)
}
;
...
...
@@ -404,6 +418,8 @@ Lv6IdList: /* ebnf:print=expand */
{
$
3
::$
1
}
;
/*
ebnf
:
group
=
NodesRules
*/
TypedLv6IdsList
:
TypedLv6Ids
{
[
$
1
]
}
|
TypedLv6IdsList
TK_SEMICOL
TypedLv6Ids
...
...
@@ -437,6 +453,7 @@ TypedValuedLv6Id :
/*
constantes
*/
/*
ebnf
:
group
=
ConstantDeclRules
*/
ConstDecl
:
TK_CONST
ConstDeclList
{
treat_const_decl_list
$
2
}
...
...
@@ -451,7 +468,7 @@ ConstDeclList:
/*
Retourne
une
liste
(
lxm
,
const_info
)
*/
OneConstDecl
:
/*
Les
listes
d'idents
en
partie
gauche
sont
accept
é
es
/*
Les
listes
d'idents
en
partie
gauche
sont
acceptes
pour
les
constantes
externes
:
*/
Lv6Id
TK_COLON
Type
{
(
make_external_const_list
[
$
1
]
$
3
)
}
...
...
@@ -466,6 +483,7 @@ OneConstDecl:
/*
types
*/
/*
ebnf
:
group
=
TypeDeclRules
*/
TypeDecl
:
TK_TYPE
TypeDeclList
{
List
.
iter
treat_type_decl
(
List
.
rev
$
2
)
}
...
...
@@ -509,6 +527,7 @@ OptStruct: /* ebnf:print=expand */
;
/*
ebnf
:
group
=
SimpleTypeRules
*/
/*
Notation
de
type
"immdiat"
*/
Type
:
/*
prdfini
*/
...
...
@@ -524,6 +543,7 @@ Type:
/*
extern
nodes
*/
/*
ebnf
:
group
=
ExtNodesRules
*/
ExtNodeDecl
:
TK_EXTERN
TK_FUNCTION
Lv6Id
Params
TK_RETURNS
Params
OptSemicol
...
...
@@ -537,10 +557,11 @@ ExtNodeDecl:
;
/*
noeuds
*/
/*
ebnf
:
group
=
NodesRules
*/
NodeDecl
:
LocalNode
{};
LocalNode
:
LocalNode
:
TK_NODE
Lv6Id
StaticParams
Params
TK_RETURNS
Params
OptSemicol
LocalDecls
Body
OptEndNode
{
treat_node_decl
false
true
$
2
$
3
$
4
$
6
$
8
(
fst
$
9
)
(
snd
$
9
)
}
...
...
@@ -573,6 +594,7 @@ NodeProfileOpt :
Some
(
invars
,
outvars
)
}
;
/*
ebnf
:
group
=
StaticRules
*/
StaticParams
:
/*
rien
*/
{
[]
}
...
...
@@ -657,6 +679,7 @@ OptEndNode: /* ebnf:print=expand */
/*
params
de
sortie
:
type
:
sx_Param
list
=
(((
Lxm
.
t
list
)
*
type_exp
)
list
*
AstCore
.
clock_exp
)
list
*/
/*
ebnf
:
group
=
NodesRules
*/
Params
:
/*
rien
*/
...
...
@@ -668,9 +691,10 @@ Params:
{
(
List
.
rev
$
2
)
}
;
/*
D
é
clarations
ocales
(
2010
/
07
/
02
)
/*
Dclarations
l
ocales
(
2010
/
07
/
02
)
concret
:
liste
de
var
(
s
)
ou
const
abstrait
:
couple
liste
de
vars
*
list
de
consts
*/
LocalDecls
:
/*
nada
*/
...
...
@@ -697,8 +721,8 @@ OneLocalDecl:
{
([]
,
$
1
)
}
;
/*
D
é
claration
de
constantes
locale
(
2010
/
07
/
02
)
uniquement
des
constantes
d
é
finies
/*
Dclaration
de
constantes
locale
(
2010
/
07
/
02
)
uniquement
des
constantes
dfinies
*/
LocalConsts
:
TK_CONST
ConstDeclList
...
...
@@ -749,6 +773,8 @@ VarDecl:
/*
Retourne
un
couple
(
assertions
list
,
equations
list
)
*/
/*
ebnf
:
group
=
BodyRules
*/
Body
:
TK_LET
TK_TEL
{
([]
,
[]
)
}
...
...
@@ -772,6 +798,7 @@ Equation: TK_ASSERT Expression TK_SEMICOL
/*
partie
gauche
d'equation
*/
/*
ebnf
:
group
=
LeftRules
*/
Left
:
LeftItemList
/*
WARNING
!
il
faut
remettre
la
liste
l'endroit
*/
...
...
@@ -810,6 +837,7 @@ TableLeftItem:
/*
partie
droite
d'equation
(
expression
)
*/
/*
ebnf
:
group
=
ExpressionRules
*/
Expression
:
/*
zroaires
*/
Constant
{
$
1
}
...
...
@@ -884,6 +912,16 @@ Expression:
{
make_merge_op
$
2
$
3
}
;
/*
WARNING
!
:
les
listes
sont
cres
l'envers
*/
ExpressionList
:
/*
empty
*/
{
[]
}
|
Expression
{
[
$
1
]
}
|
ExpressionList
TK_COMA
Expression
{
$
3
::$
1
}
;
/*
ebnf
:
group
=
MergeRules
*/
MergeCaseList
:
|
MergeCase
{
[
$
1
]
}
...
...
@@ -900,6 +938,7 @@ MergeCase:
{
(
Bool
false
,
$
2
,$
4
)
}
;
/*
ebnf
:
group
=
ExpressionRules
*/
ClockExpr
:
Lv6IdRef
TK_OPEN_PAR
Lv6Id
TK_CLOSE_PAR
{
(
make_clock_exp
$
1
.
it
$
3
)
}
...
...
@@ -909,6 +948,8 @@ ClockExpr:
{
(
make_clock_exp
(
Lv6Id
.
idref_of_string
"Lustre::false"
)
$
3
)
}
;
/*
ebnf
:
group
=
PredefRules
*/
PredefOp
:
/*
ebnf
:
print
=
short
*/
TK_NOT
{
make_predef_posop
$
1
NOT_n
}
|
TK_FBY
{
{
src
=$
1
;
it
=
FBY_n
}
}
...
...
@@ -943,7 +984,9 @@ PredefOp: /* ebnf:print=short */
/*
Appel
fonctionnel
par
position
(
classique
)
*/
/*
NB
On
a
2
rgles
cause
des
appels
chantillonns
*/
*/
/*
ebnf
:
group
=
ExpressionRules
*/
CallByPosExpression
:
/*
EffectiveNode
TK_OPEN_PAR
Expression
TK_CLOSE_PAR
...
...
@@ -955,6 +998,7 @@ CallByPosExpression:
;
/*
Effective
node
:
une
constrcution
qui
designe
un
noeud
*/
/*
ebnf
:
group
=
StaticRules
*/
EffectiveNode
:
/*
Juste
un
nom
*/
...
...
@@ -1143,6 +1187,8 @@ SimpleExpList: SimpleExp
Actuellement
,
uniquement
pour
les
structures
,
donc
pas
de
soucis
d'chantillonnage
*/
/*
ebnf
:
group
=
ExpressionByNamesRules
*/
CallByNameExpression
:
/*
WARNING
!
il
faut
remettre
la
liste
l'endroit
*/
|
Lv6IdRef
TK_OPEN_BRACE
CallByNameParamList
OptSemicol
TK_CLOSE_BRACE
...
...
@@ -1179,16 +1225,7 @@ CallByNameParam:
{
({
it
=
Lxm
.
id
$
1
;
src
=$
1
}
,
$
3
)
}
;
/*
WARNING
!
:
les
listes
sont
cres
l'envers
*/
ExpressionList
:
/*
empty
*/
{
[]
}
|
Expression
{
[
$
1
]
}
|
ExpressionList
TK_COMA
Expression
{
$
3
::$
1
}
;
/*
ebnf
:
group
=
ConstantRules
*/
Constant
:
/*
ebnf
:
print
=
short
*/
TK_TRUE
{
(
leafexp_predef
$
1
TRUE_n
)
}
...
...
@@ -1200,6 +1237,7 @@ Constant: /* ebnf:print=short */
{
(
leafexp_predef
$
1
((
RCONST_n
(
Lxm
.
id
$
1
))))
}
;
IntConst
:
/*
ebnf
:
print
=
ignore
*/
TK_ICONST
{
$
1
}
...
...
@@ -1210,6 +1248,7 @@ RealConst: /* ebnf:print=ignore */
{
$
1
}
;
/*
ebnf
:
group
=
LeftRules
*/
Select
:
Expression
TK_CDOTS
Expression
Step
{
{
it
=
{
si_first
=
$
1
;
si_last
=
$
3
;
si_step
=
$
4
};
src
=
$
2
}
}
...
...
@@ -1233,6 +1272,7 @@ OptSemicol : /* ebnf:print=expand */
{}
;
/*
ebnf
:
group
=
IdentRules
*/
Pragma
:
/*
e
.
g
.,
%
ASSUME
:
toto
%
*/
{
[]
}
/*
produces
3
shift
reduce
conflicts
!
*/
|
TK_PCENT
TK_IDENT
TK_COLON
TK_IDENT
TK_PCENT
Pragma
...
...
lv6-ref-man/Makefile
View file @
fe00e975
...
...
@@ -80,9 +80,9 @@ h:$(SRCS)
#------------------------------
#------------------------------
$(MAIN).pdf
:
$(PARSER) $(SRCS) $(LUS2TEX) $(SUMMARY) $(FIGS) $(OBJPDF)/version.tex
(
cd
objpdf
;
pdflatex ../
$(MAIN)
.tex
;
bibtex
$(MAIN)
)
(
cd
objpdf
;
pdflatex ../
$(MAIN)
.tex
)
mv
objpdf/
$(MAIN)
.pdf .
cp
$(MAIN)
.pdf /import/www/DIST-TOOLS/SYNCHRONE/lustre-v6/doc
||
true
s
cp
$(MAIN)
.pdf
jahier@pressembois.imag.fr:
/import/www/DIST-TOOLS/SYNCHRONE/lustre-v6/doc
||
true
#------------------------------
# Special : fig 2 latex 2 pdf
...
...
@@ -142,16 +142,16 @@ LUSTRE_DIR_bad=../test/should_fail
# Generic rule for .lus.tex targets
# - All lus files must be in some subdir of LUSTRE_DIR
$(OBJPDF)/%-bad.lus.tex
:
$(LUSTRE_DIR_bad)/*/%.lus
utils/lus2tex
$<
>
$@
utils/lus2tex
$<
small
>
$@
$(OBJPDF)/%.lus.tex
:
$(LUSTRE_DIR)/%.lus
utils/lus2tex
$<
>
$@
utils/lus2tex
$<
small
>
$@
$(OBJPDF)/%.lus.github.tex
:
$(GITHUB_DIR)/%.lus
utils/lus2tex
$<
>
$@
utils/lus2tex
$<
scriptsize
>
$@
$(OBJPDF)/%-broken.lus.tex
:
$(LUSTRE_DIR)/broken/%.lus
utils/lus2tex
$<
>
$@
utils/lus2tex
$<
small
>
$@
lus2tex
:
$(LUS2TEX)
...
...
lv6-ref-man/lustokens
View file @
fe00e975
...
...
@@ -98,4 +98,3 @@ TK_USES uses
TK_STRUCT struct
TK_PCENT %
TK_STRING "\"<string>\""
TK_SLICE_START XXXDELETE_ME
lv6-ref-man/lv6-ref-man.tex
View file @
fe00e975
This diff is collapsed.
Click to expand it.
lv6-ref-man/preambule.tex
View file @
fe00e975
...
...
@@ -122,13 +122,7 @@
Last update:
\today
}
%\newcommand{\sx}[1]{{\bf \mbox{\it \hyperlink{#1}{#1} }}}
\newcommand
{
\sx
}
[1]
{{
\bf
$
\langle
$
\mbox
{
\it
\hyperlink
{
#1
}{
#1
}$
\rangle
$}}}
\newcommand
{
\sxDef
}
[1]
{{
\bf
$
\langle
$
\mbox
{
\it
\hypertarget
{
#1
}{
#1
}$
\rangle
$}}}
%\newcommand{\sx}[1]{$\langle$\mbox{\it\kwdd{#1}}$\rangle$}
%% \newcommand{\lx}[1]{``\mbox{\tt #1}''}
...
...
@@ -137,7 +131,7 @@ Last update: \today}
\newcommand
{
\myor
}{
\\
&$
|
$&}
\newcommand
{
\sor
}{$
\;
|
\;
$}
\newcommand
{
\mysp
}{
\hspace*
{
8mm
}}
\newcommand
{
\prag
}{
\sx
{$
\cal
P
$}}
\newcommand
{
\prag
}{{$
\cal
P
$}}
\newcommand
{
\conc
}
[1]
{
#1
}
\newcommand
{
\abst
}
[1]
{
#1
}
...
...
lv6-ref-man/utils/lus2tex
View file @
fe00e975
...
...
@@ -5,14 +5,14 @@
FILE
=
$1
SIZE
=
$2
/bin/echo
"
% Automatically generated by
$0
% from file
$@
% the
`
date
`
\b
egin{minipage}{
\t
extwidth}
\b
egin{
small
}
\b
egin{
$2
}
\b
egin{alltt}
"
...
...
@@ -60,7 +60,7 @@ cat $FILE \
echo
"
\e
nd{alltt}
\e
nd{
small
}
/bin/
echo
"
\e
nd{alltt}
\e
nd{
$2
}
\e
nd{minipage}
"
\ No newline at end of file
test/lus2lic.sum
View file @
fe00e975
==> lus2lic0.sum <==
Test run by jahier on
Tue Mar
1
7
1
5:59:19
Test run by jahier on
Fri Jun
1
2
1
1:28:54
Native configuration is x86_64-pc-linux-gnu
=== lus2lic0 tests ===
...
...
@@ -66,7 +66,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte
XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus
==> lus2lic1.sum <==
Test run by jahier on
Tue Mar
1
7
1
5:59:20
Test run by jahier on
Fri Jun
1
2
1
1:28:55
Native configuration is x86_64-pc-linux-gnu
=== lus2lic1 tests ===
...
...
@@ -413,7 +413,7 @@ PASS: ./lus2lic {-2c multipar.lus -n multipar}
PASS: sh multipar.sh
==> lus2lic2.sum <==
Test run by jahier on
Tue Mar
1
7
1
5:59:54
Test run by jahier on
Fri Jun
1
2
1
1:29:19
Native configuration is x86_64-pc-linux-gnu
=== lus2lic2 tests ===
...
...
@@ -753,7 +753,7 @@ PASS: sh zzz2.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus {}
==> lus2lic3.sum <==
Test run by jahier on
Tue Mar
1
7
1
6:00:36
Test run by jahier on
Fri Jun
1
2
1
1:29:48
Native configuration is x86_64-pc-linux-gnu
=== lus2lic3 tests ===
...
...
@@ -1267,7 +1267,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
==> lus2lic4.sum <==
Test run by jahier on
Tue Mar
1
7
1
6:01:24
Test run by jahier on
Fri Jun
1
2
1
1:30:31
Native configuration is x86_64-pc-linux-gnu
=== lus2lic4 tests ===
...
...
@@ -1759,7 +1759,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {}
# of expected failures 54
==> lus2lic1.sum <==
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus 4
2945
{}
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus 4
6317
{}
=== lus2lic1 Summary ===
...
...
@@ -1788,13 +1788,13 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus 42945
===============================
# Total number of failures: 10
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in
3
4 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in
4
2 seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 4
8
seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 2
7
seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in
2
4 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 2
9
seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 4
3
seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 2
3
seconds
* Ref time:
9
1.
35
user
25.60
system
2:31.55
elapsed 7
7
%CPU (0avgtext+0avgdata
283744
maxresident)k
8
inputs+14
9864
outputs (0major+
11398400
minor)pagefaults 0swaps
7
1.
69
user
16.57
system
1:59.66
elapsed 7
3
%CPU (0avgtext+0avgdata
42220
maxresident)k
16
inputs+14
7896
outputs (0major+
8462673
minor)pagefaults 0swaps
* Quick time (-j 4):
103.77user 26.30system 1:25.06
elapsed 1
52
%CPU (0avgtext+0avgdata
283
24
0
maxresident)k
10496
inputs+1
47536
outputs (
7
major+
11271430
minor)pagefaults 0swaps
91.89user 18.09system 0:57.95
elapsed 1
89
%CPU (0avgtext+0avgdata
421
24maxresident)k
80
inputs+1
39528
outputs (
0
major+
8011124
minor)pagefaults 0swaps
test/should_work/type_decl.lus
View file @
fe00e975
type
alias
=
int
;
type
pair
=
struct
{
a
:
int
;
b
:
int
};
type
pair
=
struct
{
a
:
alias
;
b
:
int
};
type
color
=
enum
{
blue
,
white
,
black
};
node
type_decl
(
i1
,
i2
:
int
)
returns
(
x
:
pair
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment