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

Fixing and updating the lv6 manual.

parent d290481f
No related branches found
No related tags found
No related merge requests found
...@@ -31,13 +31,14 @@ FIGS=\ ...@@ -31,13 +31,14 @@ FIGS=\
# targets: lus 2 latex # targets: lus 2 latex
LUS2TEX= \ LUS2TEX= \
$(OBJPDF)/is_stable.lus.tex \ $(OBJPDF)/is_stable.lus.tex \
$(OBJPDF)/struct.lus.tex \ $(OBJPDF)/struct0.lus.tex \
$(OBJPDF)/consensus2.lus.tex \ $(OBJPDF)/consensus2.lus.tex \
$(OBJPDF)/count.lus.tex \ $(OBJPDF)/count.lus.tex \
$(OBJPDF)/EDGE.lus.tex \ $(OBJPDF)/EDGE.lus.tex \
$(OBJPDF)/STABLE.lus.tex \ $(OBJPDF)/STABLE.lus.tex \
$(OBJPDF)/TIME_STABLE.lus.tex \ $(OBJPDF)/TIME_STABLE.lus.tex \
$(OBJPDF)/TIME_STABLE1.lus.tex \ $(OBJPDF)/TIME_STABLE1.lus.tex \
$(OBJPDF)/complex.lus.tex \
$(OBJPDF)/COUNTER.lus.tex \ $(OBJPDF)/COUNTER.lus.tex \
$(OBJPDF)/SWITCH.lus.tex \ $(OBJPDF)/SWITCH.lus.tex \
$(OBJPDF)/SWITCH1.lus.tex \ $(OBJPDF)/SWITCH1.lus.tex \
...@@ -108,8 +109,19 @@ clean: ...@@ -108,8 +109,19 @@ clean:
#------------------------------ #------------------------------
# Special : mly 2 latex # Special : mly 2 latex
#------------------------------ #------------------------------
$(PARSER): ../src/lv6parser.mly lustokens
mly2bnf ../src/lv6parser.mly -t lustokens | grep -v XXX > $@ BIN=/usr/local/tools/lustre/misc/bin
./$(OBJPDF)/lv6parser.tex: ./$(OBJPDF)/rules
cat $< | $(BIN)/rules2tex -t lustokens > $@
./$(OBJPDF)/rules : ../src/lv6parser.mly
$(BIN)/yacc2rules ../src/lv6parser.mly > $@
./$(OBJPDF)/cleanyacc : $(LUTINSRC)/lutParser.mly
cat $< | sed -e "s/lus//g" -e "s/TK_EOF//" > $@
rere: rere:
touch ../src/lv6parser.mly touch ../src/lv6parser.mly
...@@ -139,7 +151,7 @@ $(OBJPDF)/%.lus.tex : $(LUSTRE_DIR)/%.lus ...@@ -139,7 +151,7 @@ $(OBJPDF)/%.lus.tex : $(LUSTRE_DIR)/%.lus
$(OBJPDF)/%-broken.lus.tex : $(LUSTRE_DIR)/broken/%.lus $(OBJPDF)/%-broken.lus.tex : $(LUSTRE_DIR)/broken/%.lus
utils/lus2tex $< > $@ utils/lus2tex $< > $@
lus2tex: $(EXEMPLES) lus2tex: $(LUS2TEX)
# obsolete # obsolete
#lus2tex: #lus2tex:
......
...@@ -81,7 +81,11 @@ TK_IF if ...@@ -81,7 +81,11 @@ TK_IF if
TK_WITH with TK_WITH with
TK_THEN then TK_THEN then
TK_ELSE else TK_ELSE else
TK_MERGE merge
TK_UNSAFE unsafe
TK_SAFE safe
TK_INCLUDE include TK_INCLUDE include
TK_PROVIDES provides TK_PROVIDES provides
TK_MODEL model TK_MODEL model
......
...@@ -42,6 +42,7 @@ read directly this chapter. ...@@ -42,6 +42,7 @@ read directly this chapter.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{An Overview of the Lustre Language} \chapter{An Overview of the Lustre Language}
...@@ -631,6 +632,35 @@ that}. ...@@ -631,6 +632,35 @@ that}.
%%% Include yacc syntax
%\newcommand{\bnftoken}[1]{{\color{blue2}\bfseries\ttfamily #1}}
%\newcommand{\bnftoken}[1]{{\color{blue2}\bfseries\ttfamily #1}}
%\newcommand{\bnftoken}[1]{{\bfseries\ttfamily #1}}
%\newcommand {\bnftoken}[1]{\mbox{\texttt{\textbf{#1}}}}
%\newcommand{\bnfrightident}[1]{{\color{black}\itshape #1}}
%\newcommand{\bnfrightident}[1]{\mbox{\color{black}\itshape \hyperlink{ebnf#1}{#1}}}
%\newcommand{\bnfleftident}[1]{{\color{black}\itshape #1}}
\newcommand{\bnfleftident}[1]{{\color{black}\itshape \hypertarget{ebnf#1}{#1}}}
\newcommand{\bnfdef}{\mbox{\color{red}$::=$}}
\renewcommand{\bnfor}{\mbox{\color{red3}$|$}}
\newcommand{\bnfopt}[1]{\mbox{\color{red3}$\lbrack$} #1 \mbox{\color{red3}$\rbrack$}}
\newcommand{\bnflist}[1]{\mbox{\color{red3}$\lbrace$} #1 \mbox{\color{red3}$\rbrace$}}
\newcommand{\bnfgroup}[1]{\mbox{\color{red3}$($} #1 \mbox{\color{red3}$)$}}
%special lexical notations
\newcommand{\tkspecial}[1]{\mbox{\color{purple}\itshape #1}}
\newcommand{\tkident}{\tkspecial{ident}}
\newcommand{\tklongident}{\tkspecial{long\_ident}}
\newcommand{\tkreal}{\tkspecial{floating}}
\newcommand{\tkint}{\tkspecial{integer}}
\input{lv6parser}
\begin{itemize} \begin{itemize}
\item \item
One-line comments start with \key{--} and stop at the the end of the One-line comments start with \key{--} and stop at the the end of the
...@@ -1142,7 +1172,7 @@ for their declaration and used is provided in Section~\ref{syntax}. ...@@ -1142,7 +1172,7 @@ for their declaration and used is provided in Section~\ref{syntax}.
\paragraph{Enumerations.} \paragraph{Enumerations.}
\todo Enumerations are similar to enumerations in other languages.
\begin{example}[Enumerations] \begin{example}[Enumerations]
...@@ -1155,7 +1185,7 @@ The declaration of a structured type is (semantically) equivalent to ...@@ -1155,7 +1185,7 @@ The declaration of a structured type is (semantically) equivalent to
the declaration of an abstract type, a collection of field-access the declaration of an abstract type, a collection of field-access
functions, and a constructor function. functions, and a constructor function.
\todo
\begin{example}[Records] \begin{example}[Records]
...@@ -1173,7 +1203,7 @@ functions, and a constructor function. ...@@ -1173,7 +1203,7 @@ functions, and a constructor function.
\paragraph{Arrays.} \paragraph{Arrays.}
\todo Here are a few examples of array declarations and definitions.
\begin{example}[Arrays] \begin{example}[Arrays]
\begin{alltt} \begin{alltt}
...@@ -1973,34 +2003,6 @@ y & 1 & 2 & 1 & 1 & 3 & 2\\ ...@@ -1973,34 +2003,6 @@ y & 1 & 2 & 1 & 1 & 3 & 2\\
\section{The syntax rules (automatically generated)} \section{The syntax rules (automatically generated)}
%%% Include yacc syntax
%\newcommand{\bnftoken}[1]{{\color{blue2}\bfseries\ttfamily #1}}
%\newcommand{\bnftoken}[1]{{\color{blue2}\bfseries\ttfamily #1}}
%\newcommand{\bnftoken}[1]{{\bfseries\ttfamily #1}}
\newcommand {\bnftoken}[1]{\mbox{\texttt{\textbf{#1}}}}
%\newcommand{\bnfrightident}[1]{{\color{black}\itshape #1}}
\newcommand{\bnfrightident}[1]{\mbox{\color{black}\itshape \hyperlink{ebnf#1}{#1}}}
%\newcommand{\bnfleftident}[1]{{\color{black}\itshape #1}}
\newcommand{\bnfleftident}[1]{{\color{black}\itshape \hypertarget{ebnf#1}{#1}}}
\newcommand{\bnfdef}{\mbox{\color{red}$::=$}}
\renewcommand{\bnfor}{\mbox{\color{red3}$|$}}
\newcommand{\bnfopt}[1]{\mbox{\color{red3}$\lbrack$} #1 \mbox{\color{red3}$\rbrack$}}
\newcommand{\bnflist}[1]{\mbox{\color{red3}$\lbrace$} #1 \mbox{\color{red3}$\rbrace$}}
\newcommand{\bnfgroup}[1]{\mbox{\color{red3}$($} #1 \mbox{\color{red3}$)$}}
%special lexical notations
\newcommand{\tkspecial}[1]{\mbox{\color{purple}\itshape #1}}
\newcommand{\tkident}{\tkspecial{ident}}
\newcommand{\tklongident}{\tkspecial{long\_ident}}
\newcommand{\tkreal}{\tkspecial{floating}}
\newcommand{\tkint}{\tkspecial{integer}}
\input{parser}
Lexical rules: Lexical rules:
\begin{itemize} \begin{itemize}
...@@ -2024,12 +2026,11 @@ is an two identifiers separated by a double colon (\bnfleftident{Ident}\bnftoken ...@@ -2024,12 +2026,11 @@ is an two identifiers separated by a double colon (\bnfleftident{Ident}\bnftoken
Lustre V1, v2, v3, ..., v6 Lustre V1, v2, v3, ..., v6
\section{The Lustre V4 features not supported in Lustre V6} \section{Some Lustre V4 features not supported in Lustre V6}
- recursive arrays slices : use iterators instead
- arrays
- include
- autre ???
\begin{alltt} \begin{alltt}
[int, real] -> use structures instead [int, real] -> use structures instead
......
type color1 = enum { blue, white, black }; type color1 = enum { blue, white, black };
type color2 = enum { green, orange, yellow }; type color2 = enum { green, orange, yellow };
node enum0(x: color1) returns (y: color2); node enum0(x: color1) returns (y: color2);
let let
y = if x = blue then green else if x = white then orange else yellow; y = if x = blue then green else if x = white then orange else yellow;
......
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