All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] Automatic generation of SmPL rules by a script rule
@ 2018-01-06 16:57 SF Markus Elfring
  2018-01-06 17:01 ` Julia Lawall
  0 siblings, 1 reply; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-06 16:57 UTC (permalink / raw)
  To: cocci

Hello,

Is it possible to generate additional rules for a specific execution environment
of the semantic patch language by an advanced script rule?

Can a special rule generation be avoided from external software tools?

Regards,
Markus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cocci] Automatic generation of SmPL rules by a script rule
  2018-01-06 16:57 [Cocci] Automatic generation of SmPL rules by a script rule SF Markus Elfring
@ 2018-01-06 17:01 ` Julia Lawall
  2018-01-06 17:18   ` SF Markus Elfring
  0 siblings, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2018-01-06 17:01 UTC (permalink / raw)
  To: cocci



On Sat, 6 Jan 2018, SF Markus Elfring wrote:

> Hello,
>
> Is it possible to generate additional rules for a specific execution environment
> of the semantic patch language by an advanced script rule?
>
> Can a special rule generation be avoided from external software tools?

The simplest thing would be to just print the rule you want in a
python/ocaml script rule.  Some support was added at one point for
generating rules based on matches from other rules, but that code has not
been maintained, and I don't think it is likely to be updated in the
future.

julia

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cocci] Automatic generation of SmPL rules by a script rule
  2018-01-06 17:01 ` Julia Lawall
@ 2018-01-06 17:18   ` SF Markus Elfring
  2018-01-06 17:26     ` Julia Lawall
  0 siblings, 1 reply; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-06 17:18 UTC (permalink / raw)
  To: cocci

> The simplest thing would be to just print the rule you want in a
> python/ocaml script rule.

I would like to adjust a SmPL execution environment for special use cases somehow.
How would ?printing? be useful here?


> Some support was added at one point for generating rules based on matches
> from other rules,

Such information sounds promising.


> but that code has not been maintained, and I don't think it is likely
> to be updated in the future.

I am curious if there are still any chances to revive corresponding approaches.


Is it safer therefore to generate advanced SmPL script files by external
software tools (at the moment)?

Regards,
Markus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cocci] Automatic generation of SmPL rules by a script rule
  2018-01-06 17:18   ` SF Markus Elfring
@ 2018-01-06 17:26     ` Julia Lawall
  2018-01-06 17:45       ` SF Markus Elfring
  0 siblings, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2018-01-06 17:26 UTC (permalink / raw)
  To: cocci



On Sat, 6 Jan 2018, SF Markus Elfring wrote:

> > The simplest thing would be to just print the rule you want in a
> > python/ocaml script rule.
>
> I would like to adjust a SmPL execution environment for special use cases somehow.
> How would ?printing? be useful here?

Well, I was thinking that you could eg make a script like:

@script:ocaml@
e << r.e;
@@

Printf.printf "@@\n";
Printf.printf "expression f;\n";
Printf.printf "@@\n\n";
Printf.printf "-f(%s);\n" e

But I'm not sure that the parser of script code would be happy with a @ in
the script code, so you would have to do some trick to get around that.

>
>
> > Some support was added at one point for generating rules based on matches
> > from other rules,
>
> Such information sounds promising.
>
>
> > but that code has not been maintained, and I don't think it is likely
> > to be updated in the future.
>
> I am curious if there are still any chances to revive corresponding
> approaches.

I'm not interested in spending time on it in the foreseeable future.  If
anyone else wants to, the code is there...  Maybe you put something like
generated in the header of the semantic patch rule, like you might put
script:ocaml.

julia

>
>
> Is it safer therefore to generate advanced SmPL script files by external
> software tools (at the moment)?
>
> Regards,
> Markus
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cocci] Automatic generation of SmPL rules by a script rule
  2018-01-06 17:26     ` Julia Lawall
@ 2018-01-06 17:45       ` SF Markus Elfring
  2018-01-06 17:59         ` Julia Lawall
  0 siblings, 1 reply; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-06 17:45 UTC (permalink / raw)
  To: cocci

> Well, I was thinking that you could eg make a script like:
> 
> @script:ocaml@
> e << r.e;
> @@
> 
> Printf.printf "@@\n";
> Printf.printf "expression f;\n";
> Printf.printf "@@\n\n";
> Printf.printf "-f(%s);\n" e

I would prefer to use the available programming languages directly
instead of starting the spatch program for such file generation.


> But I'm not sure that the parser of script code would be happy with a @ in
> the script code, so you would have to do some trick to get around that.

Would you like to continue the clarification for the topic ?Configuration
or escaping of @ characters for embedded programming language scripts??
https://github.com/coccinelle/coccinelle/issues/36


> I'm not interested in spending time on it in the foreseeable future.

But I imagine that I would like to show related update suggestions
around SmPL scripts because of other approaches then.
Will alternatives become useful?


> If anyone else wants to, the code is there...

Would you like to point any specific source files out for the current
intermediate development status?

Regards,
Markus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cocci] Automatic generation of SmPL rules by a script rule
  2018-01-06 17:45       ` SF Markus Elfring
@ 2018-01-06 17:59         ` Julia Lawall
  0 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2018-01-06 17:59 UTC (permalink / raw)
  To: cocci



On Sat, 6 Jan 2018, SF Markus Elfring wrote:

> > Well, I was thinking that you could eg make a script like:
> >
> > @script:ocaml@
> > e << r.e;
> > @@
> >
> > Printf.printf "@@\n";
> > Printf.printf "expression f;\n";
> > Printf.printf "@@\n\n";
> > Printf.printf "-f(%s);\n" e
>
> I would prefer to use the available programming languages directly
> instead of starting the spatch program for such file generation.
>
>
> > But I'm not sure that the parser of script code would be happy with a @ in
> > the script code, so you would have to do some trick to get around that.
>
> Would you like to continue the clarification for the topic ?Configuration
> or escaping of @ characters for embedded programming language scripts??
> https://github.com/coccinelle/coccinelle/issues/36
>
>
> > I'm not interested in spending time on it in the foreseeable future.
>
> But I imagine that I would like to show related update suggestions
> around SmPL scripts because of other approaches then.
> Will alternatives become useful?
>
>
> > If anyone else wants to, the code is there...
>
> Would you like to point any specific source files out for the current
> intermediate development status?

Files that contain the word Generated.  The file
parsing_c/unparse_hrule.ml.

julia

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-01-06 17:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-06 16:57 [Cocci] Automatic generation of SmPL rules by a script rule SF Markus Elfring
2018-01-06 17:01 ` Julia Lawall
2018-01-06 17:18   ` SF Markus Elfring
2018-01-06 17:26     ` Julia Lawall
2018-01-06 17:45       ` SF Markus Elfring
2018-01-06 17:59         ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.