Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2014-02-05

| Channels | #marpa index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
02:22 jeffreykegler joined #marpa
02:47 ilbot3 joined #marpa
02:47 Topic for #marpa is now Logs: http://irclog.perlgeek.de/marpa/today Nopaste: http://scsys.co.uk:8002/marpa Current: https://metacpan.org/pod/Marpa::R2 Source: https://github.com/jeffreykegler/Marpa--R2
04:50 ronsavage joined #marpa
16:32 lucs Can it make sense to have an L0 rule with an empty RHS?
16:46 lucs Also, playing with "nulled lexemes" (which, according to the docs, can't happen, but I don't quite understand why):
16:46 shadowpaste "lucs" at 70.81.138.180 pasted "Nulled lexeme (or something) problem" (51 lines) at http://scsys.co.uk:8002/300021
16:47 * lucs goes to buy food -- back later...
16:51 jeffreykegler joined #marpa
16:54 jeffreykegler lucs: re http://irclog.perlgeek.de/marpa/2014-02-05#i_8236470.  Briefly, lexemes can *never* be zero length.
16:56 jeffreykegler I allow L0 rules that might be zero-length (for example, "baZ ~ [Z]*") on the idea that it might be convenient to write them that way.  But no zero-length lexeme will ever be accepted as a result of them.
16:57 jeffreykegler I could have caught potentially zero-length L0 rules and treated them as fatal errors, and perhaps that would have been better, but now the need for backward compatibility has set in.
16:57 jeffreykegler Re: why?
16:58 jeffreykegler Nulled symbols have long been a problem for parsers in the Earley family -- literally for decades.
17:00 jeffreykegler Aycock&Horspool published a solution in 2002 which Marpa uses.  They figured out a way to rewrite the grammar to eliminate them, which still allows you to translate back to the original grammar easily.
17:01 jeffreykegler Nulled lexemes would re-introduce this problem.  They will never be allowed.
17:04 jeffreykegler If you think out the conceptual issues, you might see nulled lexemes are "fraught" with them.  At any given point, which null lexemes should you recognize?  And how many of them?  A parser could guess what you really mean here, but to my mind it is just as well to force you to be explicit on this issue.
17:10 shadowpaste "jeffreykegler" at 108.70.209.173 pasted "Nulled "pseudo-lexeme" trick" (51 lines) at http://scsys.co.uk:8002/300030
17:13 jeffreykegler lucs: By the way, it is quite possible to have a G1 symbol which is nulled in one rule, and which derives a lexeme is another rule, and that has the desired effect.  I changed your script to use this trick, and have just pasted the result.
17:40 lucs jeffreykegler: Wow. Great explanation, and cool example. Thanks!
18:55 jdurand joined #marpa
19:00 jdurand Re http://irclog.perlgeek.de/marpa/2014-02-05#i_8236676 - I believe that [\s\S] to detect EOF is an example of the usage of zero-lenght lexeme?
19:01 jdurand More generally, as an end-user, I see L0, ..., Ln like nothing else but full grammars of their own isn't it
19:07 jdurand Re. Ah, oups. [\s\S] is != but a nullable rule - ok, please forget what I said
21:10 ronsavage joined #marpa
21:49 jeffreykegler joined #marpa
22:47 ronsavage jeffreykegler: I've used your nulled pseudo-lexeme trick as another item in the Marpa Papers FAQ (under the heading: 'Can a lexeme have length == 0?'): http://savage.net.au/Perl-modules/html/marpa.papers/chapter3.html
22:48 jeffreykegler ronsavage: Thanks.
23:07 lucs ronsavage: By the way, pastes in http://scsys.co.uk:8002/ may not last very long, you may want to point your article example somewhere more permanent (not sure where...).
23:08 jdurand yep, was to write the same thing, lucs, you won -;
23:08 lucs Everybody wins :)

| Channels | #marpa index | Today | | Search | Google Search | Plain-Text | summary