Thank you very much. Saved now.
On Fri, Mar 6, 2015 at 5:10 PM, Jeffrey Kegler <jeffreykeg...@jeffreykegler.com> wrote: > Andreas: Your example is in this Github gist: > https://gist.github.com/jeffreykegler/1dd56ce50c1dd2395856 > > On Fri, Mar 6, 2015 at 2:44 PM, Andreas Kupries > <andre...@activestate.com> wrote: >> That should really help with understanding this. Thanks. >> >> On Fri, Mar 6, 2015 at 2:38 PM, Jeffrey Kegler >> <jeffreykeg...@jeffreykegler.com> wrote: >>> Andreas: Actually, it occurs to me that I can work up an example from >>> Marpa's internal trace mechanisms, showing the internal rules. I'm >>> away from my development environment now, but I'll do that in a bit. >>> >>> On Fri, Mar 6, 2015 at 12:30 PM, Andreas Kupries >>> <andre...@activestate.com> wrote: >>>> On Fri, Mar 6, 2015 at 12:08 PM, Jeffrey Kegler >>>> <jeffreykeg...@jeffreykegler.com> wrote: >>>>> No. Sorry if I was not clear. >>>> >>>> No problem. >>>> >>>>> >>>>> The rewrite for precedenced rules removes the ambiguity of the pure >>>>> BNF in the SLIF DSL, and in this way is very much like the one you see >>>>> described elsewhere, particularly for dealing with expressions using >>>>> top-down parsers. You add a new symbol for the expression at each >>>>> level of precedence, and the rewritten BNF will be unambiguous. >>>> >>>> Ok. Guess I have to google then for bnf rewriting. >>>> Thanks for your time. >>>> >>>>> >>>>> On Fri, Mar 6, 2015 at 11:50 AM, Andreas Kupries >>>>> <andre...@activestate.com> wrote: >>>>>> On Fri, Mar 6, 2015 at 11:33 AM, Jeffrey Kegler >>>>>> <jeffreykeg...@jeffreykegler.com> wrote: >>>>>>> For the precedenced rules, you create new symbols for each precedence, >>>>>>> proceeding with associativity in the obvious way. Much of it is done >>>>>>> in this routine: >>>>>>> https://github.com/jeffreykegler/Marpa--R2/blob/master/cpan/lib/Marpa/R2/MetaAST.pm#L568 >>>>>> >>>>>> 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.kupr...@gmail.com> wrote: >>>>>>>> >>>>>>>> >>>>>>>> On Thu, Mar 5, 2015 at 4:51 PM, Jeffrey Kegler >>>>>>>> <jeffreykeg...@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 >>>>>> andre...@activestate.com, http://www.activestate.com >>>>>> Learn about Stackato for Private PaaS: >>>>>> http://www.activestate.com/stackato >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "marpa parser" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>>> an email to marpa-parser+unsubscr...@googlegroups.com. >>>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google Groups >>>>> "marpa parser" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send an >>>>> email to marpa-parser+unsubscr...@googlegroups.com. >>>>> For more options, visit https://groups.google.com/d/optout. >>>> >>>> >>>> >>>> -- >>>> Andreas Kupries >>>> Senior Tcl Developer >>>> Code to Cloud: Smarter, Safer, Faster™ >>>> F: 778.786.1133 >>>> andre...@activestate.com, http://www.activestate.com >>>> Learn about Stackato for Private PaaS: http://www.activestate.com/stackato >>>> >>>> -- >>>> You received this message because you are subscribed to the Google Groups >>>> "marpa parser" group. >>>> To unsubscribe from this group and stop receiving emails from it, send an >>>> email to marpa-parser+unsubscr...@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "marpa parser" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to marpa-parser+unsubscr...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >> >> >> >> -- >> Andreas Kupries >> Senior Tcl Developer >> Code to Cloud: Smarter, Safer, Faster™ >> F: 778.786.1133 >> andre...@activestate.com, http://www.activestate.com >> Learn about Stackato for Private PaaS: http://www.activestate.com/stackato >> >> -- >> You received this message because you are subscribed to the Google Groups >> "marpa parser" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to marpa-parser+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "marpa parser" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to marpa-parser+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Andreas Kupries Senior Tcl Developer Code to Cloud: Smarter, Safer, Faster™ F: 778.786.1133 andre...@activestate.com, http://www.activestate.com Learn about Stackato for Private PaaS: http://www.activestate.com/stackato -- You received this message because you are subscribed to the Google Groups "marpa parser" group. To unsubscribe from this group and stop receiving emails from it, send an email to marpa-parser+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.