[Cocci] grep tokens
Julia Lawall
julia at diku.dk
Thu Jun 3 06:53:45 CEST 2010
On Thu, 3 Jun 2010, Wolfram Sang wrote:
> Hi,
>
> I just ran this spatch (still using v0.2.2):
>
> @@
> struct of_device *ofdev;
> @@
>
> - ofdev->node
> + ofdev->dev.of_node
>
> It worked (simple as it is) but took surprsingly long. I then used -parse_cocci
> which gave me:
>
> @@
> rule starting on line 1
> @@
>
>
> (
> -rule starting on line 1:ofdev
> >>> rule starting on line 1:ofdev->dev.of_node
> -->-node
> |
> -rule starting on line 1:ofdev
> >>> rule starting on line 1:ofdev->dev.of_node
> -[-rule starting on line 1:_E2_0-]-.-node
> )
> grep tokens
> .node ->node
>
> Now I wondered if 'struct of_device' could not be recognized as a grep-token?
I guess you are not using glimpse (which indeed has some restrictions on
its use). The code for calculating the grep tokens in the case of
-use_glimpse is more clever, and indeed includes of_device (glimpse only
works on individual words, but grep could include the struct as well).
I don't think there is any particular reason for the grep version to be
different form the glimpse one, so I will try to fix it.
julia
More information about the Cocci
mailing list