X-Git-Url: https://git.hcoop.net/bpt/coccinelle.git/blobdiff_plain/97111a47d707638a835d7498276ac6768a052ee8..17ba07880e1838028b4516ba7a2db2147b3aa1c9:/docs/manual/cocci_syntax.tex

diff --git a/docs/manual/cocci_syntax.tex b/docs/manual/cocci_syntax.tex
index ca65f89..82311bc 100644
--- a/docs/manual/cocci_syntax.tex
+++ b/docs/manual/cocci_syntax.tex
@@ -217,6 +217,17 @@ considered C identifiers when encountered in the body of the rule.
 Identifiers in the body of the rule that are not declared explicitly are
 by default considered symbols, thus symbol declarations are optional.
 
+A position metavariable is used by attaching it using \texttt{@} to any
+token, including another metavariable.  Its value is the position (file,
+line number, etc.) of the code matched by the token.  It is also possible
+to attach expression, declaration, type, initialiser, and statement
+metavariables in this manner.  In that case, the metavariable is bound to
+the closest enclosing expression, declaration, etc.  If such a metavariable
+is itself followed by a position metavariable, the position metavariable
+applies to the metavariable that it follows, and not to the attached token.
+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}.
 
 \begin{grammar}
   \RULE{\rt{ids}}
