Thank you.
It reminds me that I have not read perl code since Perl4.
I believe it will take me a while to decipher that.
> One thing to note is that it is *not* operator precedence -- the rule
> have precedence, and the operators play no special role.
So, in essence the rewrite generates an ambiguous grammar which the
engine has no problems with, parsing them all in parallel, right ?
And at the end the rule priorities are then used to collapse
ambiguity, by keeping only the highest priority at each node ?!
And I further guess that the only ambiguities which survive to the
parse forest are those which have the same highest priority at a node.
> It's not dissimilar to rewrites you'll see elsewhere, but I might be
> its inventor, if only because nobody previously had a parser that
> could be expected to parse the rewritten rules.
>
> On Fri, Mar 6, 2015 at 11:22 AM, Andreas Kupries
> <
andreas...@gmail.com> wrote:
>>
>>
>> On Thu, Mar 5, 2015 at 4:51 PM, Jeffrey Kegler
>> <
jeffre...@jeffreykegler.com> wrote:
>>>
>>> Quantified rules are semantic sugar for BNF, and you can write BNF rules
>>> and have access to all the symbols in them, including those you think of as
>>> separators. I say "think of", because if separators are given a semantics,
>>> they are (conceptually) more than just separators. Sequences can be written
>>> as recursions -- internally, that is what Marpa::R2 actually does.
>>
>>
>> Is there any documentation around on how Marpa::R2 rewrites the sugar into
>> basic BNF ?
>>
>> Ok, I know how it can be done for the quantified rules, via left recursion
>> and additional non-terminals. However for the priority rules I am still not
>> fully clear how these would be done.
>>
>> If there is no documentation, then is the rewrite engine in some
>> central/singular place in the sources, or is its activity distributed
>> through it, and where would I have to look ?
--
Andreas Kupries
Senior Tcl Developer
Code to Cloud: Smarter, Safer, Faster™
F:
778.786.1133
andr...@activestate.com,
http://www.activestate.com
Learn about Stackato for Private PaaS:
http://www.activestate.com/stackato