X-Git-Url: https://git.hcoop.net/bpt/coccinelle.git/blobdiff_plain/113803cf8147c1b5332cc7d9ac43febcc197e4f0..0708f913629519b5dbc99f68b6f3ea5ab068230c:/docs/grammar/cocci_syntax.tex

diff --git a/docs/grammar/cocci_syntax.tex b/docs/grammar/cocci_syntax.tex
index ed2b3fd..8dafbd9 100644
--- a/docs/grammar/cocci_syntax.tex
+++ b/docs/grammar/cocci_syntax.tex
@@ -22,7 +22,7 @@
 %
 \ifhevea % For HTML generation
 \lstdefinelanguage{Cocci}{
-morekeywords={idexpression,expression,statement,identifier,
+morekeywords={idexpression,expression,statement,identifier,type,
 parameter,list,when,strict,any,forall,local,position,typedef},
 keywordstyle=\color{OliveGreen}\bfseries,
 sensitive=false,
@@ -38,7 +38,7 @@ moredelim=[il][\color{Plum}]{@M}}
 
 \else % For DVI/PS/PDF generation
 \lstdefinelanguage{Cocci}{
-morekeywords={idexpression,expression,statement,identifier,
+morekeywords={idexpression,expression,statement,identifier,type,
 parameter,list,when,strict,any,forall,local,position,typedef},
 keywordstyle=\color{OliveGreen}\bfseries,
 sensitive=false,
@@ -474,6 +474,47 @@ some constraints on the use of these annotations:
   occur on a line with any marking.
 \end{itemize}
 
+Each element of a disjunction must be a proper term like an
+expression, a statement, an identifier or a declaration. Thus, the
+rule on the left below is not a syntaxically correct SmPL rule. One may
+use the rule on the right instead.
+
+\begin{center}
+  \begin{tabular}{l@{\hspace{5cm}}r}
+\begin{lstlisting}[language=Cocci]
+@@
+type T;
+T b;
+@@
+
+(
+ writeb(...,
+|
+ readb(
+)
+@--(T)
+ b)
+\end{lstlisting}
+    &
+\begin{lstlisting}[language=Cocci]
+@@
+type T;
+T b;
+@@
+
+(
+read
+|
+write
+)
+ (...,
+@-- (T)
+  b)
+\end{lstlisting}
+    \\
+  \end{tabular}
+\end{center}
+
 \section{Types}
 \label{types}
 
@@ -798,6 +839,7 @@ in a concise way.
 \end{grammar}
 
 \include{examples}
+\include{tips}
 \end{document}
 
 %%% Local Variables:
