X-Git-Url: https://git.hcoop.net/bpt/coccinelle.git/blobdiff_plain/abad11c5570b7b9bbae5ff92b3050cf68fe3fd14..1b9ae60616d2f065ce16fe26385b684e13b40284:/docs/manual/cocci_syntax.tex diff --git a/docs/manual/cocci_syntax.tex b/docs/manual/cocci_syntax.tex index 82311bc..0a91dff 100644 --- a/docs/manual/cocci_syntax.tex +++ b/docs/manual/cocci_syntax.tex @@ -229,6 +229,15 @@ This makes it possible to get eg the starting and ending position of {\tt f(...)}, by writing {\tt f(...)@E@p}, for expression metavariable {\tt E} and position metavariable {\tt p}. +Other kinds of metavariables can also be attached using \texttt{@} to any +token. In this case, the metavariable floats up to the enclosing +appropriate expression. For example, {\tt 3 +@E 4}, where {\tt E} is an +expression metavariable binds {\tt E} to {\tt 3 + 4}. A particular case is +{\tt Ps@Es}, where {\tt Ps} is a parameter list and {\tt Es} is an +expression list. This pattern matches a parameter list, and then matches +{\tt Es} to the list of expressions, ie a possible argument list, +represented by the names of the parameters. + \begin{grammar} \RULE{\rt{ids}} \CASE{\NT{COMMA\_LIST}\mth{(}\NT{pmid}\mth{)}}