Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2014-12-12

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

All times shown according to UTC.

Time Nick Message
00:35 ronsavage joined #marpa
05:59 jeffreykegler joined #marpa
08:16 lwa joined #marpa
09:38 pczarn joined #marpa
11:39 flaviu joined #marpa
11:57 koo6 joined #marpa
11:58 slothmachine joined #marpa
13:01 lwa joined #marpa
16:45 jeffreykegler joined #marpa
19:30 jdurand_ joined #marpa
19:32 jdurand_ Just wanted to share another technique for external lexers for those wanting to use the parse()'s Marpa::R2 method. This method, as far as I know, is a direct "success or failure", not allowing to pause on lexemes in particular, allowing only standard "recognizer options"
19:33 jdurand_ Now, nothing prevent, in the actions, to fake a lexeme as a value -; If you arrange your lexeme values to be let's say unblessed arrays, and G1 rules to be blessed arrays, it is easy in any action to distinguish between a lexeme and "not a lexeme"
19:33 jdurand_ I will take the example of a vicous rule in the SQL grammar: the Unicode Delimited Identifier
19:34 jdurand_ Its syntax is: U&"something" UESCAPE 'character'
19:34 jdurand_ and of course, the parsing of "something" depends on the value of 'character' that is AFTER IN THE GRAMMAR! -; Grrr....
19:35 jdurand_ So the idea, still using the parse() method, is to have a specific action on the Unicode Delimited Identifier that re-execute a sub-grammar generated on-the-fly, where "something" will have the 'character' dependency
19:36 jdurand_ All in all, this gives what I put in the pastebin. The XML node having the "text" attribute is generated usinga sub-grammar in the ACTION, not during the lexing
19:37 jdurand_ The only side-effect of course is that error reporting will not be as accurate nor immediate as in the lexing, but that can probably be corrected on-the-fly as well -;
19:38 jdurand_ http://fpaste.scsys.co.uk/452147
19:43 jdurand_ The code doing the sub-grammar in the action: https://github.com/jddurand/MarpaX-Languages-SQL2003-AST/blob/master/lib/MarpaX/Languages/SQL2003/AST/Actions.pm - srcoll a little and you'll get a big perl's string containing the grammar - easy to find
19:55 ronsavage joined #marpa
20:06 ronsavage jurand: Cyclic re-generation of a sub-grammar. Another great tool for our toolboxes.
20:54 koo6 joined #marpa
22:49 ronsavage joined #marpa
23:22 jeffreykegler joined #marpa
23:47 jeffreykegler re http://irclog.perlgeek.de/marpa/2014-12-12#i_9797833 -- nice
23:49 jeffreykegler In the past we've had to choose between syntax-driven parsing and procedural parsing.
23:50 jeffreykegler With Marpa's ability to stop and restart, you can have it both ways.

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