On Sun, 2 Aug 2020, Markus Elfring wrote:

> >> How do you distinguish between metavariables and other SmPL variables then?
> >
> > Metavariables don't have "name" in their declaration.  There is a sentence
> > about that in the documentation.
> >
> > The {\bf name} modifier specifies that instead of declaring a metavariable
> > to match over some kind, the identifiers are to be considered as elements
> > of that kind when they appear in the code.
>
> See also:
> https://github.com/coccinelle/coccinelle/blob/e06b9156dfa02a28cf3cbf0913a10513f3d163ab/docs/manual/cocci_syntax.tex#L458
>
>
> > "instead of declaring a metavariable" says that the thing that is declared
> > is not a metavariable.
>
> It seems that we stumble on different interpretations also around a wording
> like “to match over some kind”.
>
> * Which is the category of SmPL identifiers which contain the key word “name”
>   in their data type (or “kind” if you would like to prevent to denote them
>   as metavariables)?

The ones that have "name" in the BNF.

>
> * How do you think about to add square brackets to a line in the TeX SmPL 
> grammar?
>   
> https://github.com/coccinelle/coccinelle/blob/e06b9156dfa02a28cf3cbf0913a10513f3d163ab/docs/manual/cocci_syntax.tex#L245
>
>   \CASE{attribute \opt{name} \NT{ids} ;}

No, there will be a separate entry for attribute name;.  Putting \opt{}
would lead to the confusion that you are falling into.  They are different
things.

>
> >> Should software users get informed about unused items in consistent ways?
> >> https://github.com/coccinelle/coccinelle/blob/04f36d537b9f6c0c127d05184cccd21f1a46b952/parsing_cocci/check_meta.ml#L711
>
> Do you care if a SmPL name variable would accidentally not be used
> (like in the script 
> “https://github.com/coccinelle/coccinelle/blob/04f36d537b9f6c0c127d05184cccd21f1a46b952/tests/metaattr.cocci#L2”)?

It actually is used, to help parsing the .c file.  This information will
be added to the documentation shortly.

julia
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to