* [cocci] Collateral evolution because of context-dependent grammar of SmPL?
@ 2022-03-12 13:38 Markus Elfring
2022-03-12 13:52 ` Julia Lawall
0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2022-03-12 13:38 UTC (permalink / raw)
To: cocci
Hello,
I have taken another look at details from the grammar of the semantic patch language
(Coccinelle software).
I interpret the SmPL script programming structure in the way that optional header
information can be specified before the main data processing part.
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/5479fc964d209209e84ddd5caf3f395667721e7c/docs/manual/cocci_syntax.tex#L31
https://github.com/coccinelle/coccinelle/blob/ae337fce1512ff15aabc3ad5b6d2e537f97ab62a/docs/manual/cocci_syntax.tex#L31
The main part usually contains some SmPL rules.
Each SmPL rule is split into two sections.
1. The beginning and end of the metavariable declaration block is denoted by
a pair of @ characters.
Additional settings can be specified also within the first pair of @ characters.
2. Code from supported scripting and programming languages can be specified for
desired analyses and transformations.
@ operators can be applied for the combination of metavariables
as they would be needed for selected data processing tasks.
I got the impression that such characteristics result in the classification
that the grammar of the semantic patch language is context-dependent.
Something was achieved by the application of the software tool “Menhir”.
http://gallium.inria.fr/~fpottier/menhir/
This parser generator for the OCaml programming language is using the technique “LR(1)”.
The Chomsky–Schützenberger hierarchy denotes some computational properties
for such language categories.
https://en.wikipedia.org/wiki/Context-sensitive_language#Computational_properties
Advices were published that context-dependent grammars should safely be handled
by more sophisticated parsing technologies.
https://en.wikipedia.org/wiki/Comparison_of_parser_generators#Context-sensitive_grammars
How do you think about to clarify corresponding design challenges any further?
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [cocci] Collateral evolution because of context-dependent grammar of SmPL?
2022-03-12 13:38 [cocci] Collateral evolution because of context-dependent grammar of SmPL? Markus Elfring
@ 2022-03-12 13:52 ` Julia Lawall
2022-03-12 15:18 ` Markus Elfring
0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2022-03-12 13:52 UTC (permalink / raw)
To: Markus Elfring; +Cc: cocci
[-- Attachment #1: Type: text/plain, Size: 2086 bytes --]
On Sat, 12 Mar 2022, Markus Elfring wrote:
> Hello,
>
> I have taken another look at details from the grammar of the semantic patch language
> (Coccinelle software).
> I interpret the SmPL script programming structure in the way that optional header
> information can be specified before the main data processing part.
> https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/5479fc964d209209e84ddd5caf3f395667721e7c/docs/manual/cocci_syntax.tex#L31
> https://github.com/coccinelle/coccinelle/blob/ae337fce1512ff15aabc3ad5b6d2e537f97ab62a/docs/manual/cocci_syntax.tex#L31
>
> The main part usually contains some SmPL rules.
> Each SmPL rule is split into two sections.
>
> 1. The beginning and end of the metavariable declaration block is denoted by
> a pair of @ characters.
> Additional settings can be specified also within the first pair of @ characters.
>
> 2. Code from supported scripting and programming languages can be specified for
> desired analyses and transformations.
> @ operators can be applied for the combination of metavariables
> as they would be needed for selected data processing tasks.
>
>
> I got the impression that such characteristics result in the classification
> that the grammar of the semantic patch language is context-dependent.
>
> Something was achieved by the application of the software tool “Menhir”.
> http://gallium.inria.fr/~fpottier/menhir/
>
> This parser generator for the OCaml programming language is using the technique “LR(1)”.
>
> The Chomsky–Schützenberger hierarchy denotes some computational properties
> for such language categories.
> https://en.wikipedia.org/wiki/Context-sensitive_language#Computational_properties
>
> Advices were published that context-dependent grammars should safely be handled
> by more sophisticated parsing technologies.
> https://en.wikipedia.org/wiki/Comparison_of_parser_generators#Context-sensitive_grammars
>
> How do you think about to clarify corresponding design challenges any further?
The parser has different entry points according to the context.
julia
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [cocci] Collateral evolution because of context-dependent grammar of SmPL?
2022-03-12 13:52 ` Julia Lawall
@ 2022-03-12 15:18 ` Markus Elfring
0 siblings, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2022-03-12 15:18 UTC (permalink / raw)
To: Julia Lawall; +Cc: cocci
>> Advices were published that context-dependent grammars should safely be handled
>> by more sophisticated parsing technologies.
>> https://en.wikipedia.org/wiki/Comparison_of_parser_generators#Context-sensitive_grammars
>>
>> How do you think about to clarify corresponding design challenges any further?
> The parser has different entry points according to the context.
Would you like to share any more background information for such entry points?
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-12 15:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-12 13:38 [cocci] Collateral evolution because of context-dependent grammar of SmPL? Markus Elfring
2022-03-12 13:52 ` Julia Lawall
2022-03-12 15:18 ` Markus Elfring
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.