Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2016-01-14

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

All times shown according to UTC.

Time Nick Message
00:29 Idiosyncrat joined #marpa
00:33 Idiosyncrat joined #marpa
00:36 Idiosyncrat choroba: re lookahead
00:36 Idiosyncrat There are a few ways to tackle that.
00:37 Idiosyncrat If you use events and go to external scanning, you can do arbitrary processing and reading of tokens, including whatever lookahead you like, but ...
00:38 Idiosyncrat that's inelegant and the swithing back & forth between C & Perl code can be expensive, so make it a last resort in favor of these other choices:
00:40 Idiosyncrat 1.) Pre-lexeme events are close to lookahead -- they look for token and pause *before* reading it: http://search.cpan.org/~jkegl/Marpa-R2-2.102000/pod/Event.pod#Pre-lexeme_events
00:42 Idiosyncrat 2.) You can also use lexeme priorities: http://search.cpan.org/~jkegl/Marpa-R2-3.000000/pod/Scanless/DSL.pod#priority
00:43 Idiosyncrat For example is you look for bare strings and quoted strings, but give quoted strings a higher priority, you can simplify the syntax of the bare strings ...
00:43 Idiosyncrat because it's now OK if a bare string looks like a quoted string.
00:44 Idiosyncrat 3.) Exploit context --
00:45 Idiosyncrat here, for example, you might just look for a quote, where <Quoted String> ::= <Quote> <Rest of Quoted>
00:46 Idiosyncrat <Rest of Quoted> will *only* be matched if you've seen a quote.
00:46 Idiosyncrat and then you can have
00:46 Idiosyncrat <String> ::= <Bare String> | <Quoted String>
00:47 Idiosyncrat <Bare String> will always be recognized in preference to <Quote>, because it will always be longer.
00:48 Idiosyncrat With this bag of tools, you have quite a few approaches to the problem.
00:51 Idiosyncrat Also in the Marpa FAQ: http://savage.net.au/Perl-modules/html/marpa.faq/faq.html#q108
00:52 Idiosyncrat Parsing C-style comments is similar to parsing strings, except messier ...
00:52 Idiosyncrat The FAQ Q108 points to one solution.
00:56 Idiosyncrat Jean-Damien: in your various modules there must be several good examples of string parsing, aren't there?
02:32 Idiosyncrat ronsavage: and actually didn't you do some tutorials on event-driven parsing in Marpa that are relevant to choroba's concerns?
02:39 Idiosyncrat choroba: to clarify http://irclog.perlgeek.de/marpa/2016-01-14#i_11884813
02:40 Idiosyncrat Assuming that both <Bare String> and <Quote> are lexemes, and using LATM ...
02:46 Idiosyncrat <Bare String> should always be longer, so you'll need to make sure it never matches input that starts with a <Quote>
02:48 ilbot3 joined #marpa
02:48 Topic for #marpa is now Start here: http://savage.net.au/Marpa.html - Pastebin: http://scsys.co.uk:8002/marpa - Jeffrey's Marpa site: http://jeffreykegler.github.io/Marpa-web-site/ - IRC log: http://irclog.perlgeek.de/marpa/today
03:41 ronsavage joined #marpa
04:10 Idiosyncrat joined #marpa
04:37 ronsavage choroba: For event-driven articles: http://savage.net.au/Ron/html/A.New.Marpa-based.Parser.for.Graphviz.html, http://savage.net.au/Ron/html/Conditional.preservation.of.whitespace.html, http://savage.net.au/Ron/html/Disambiguating.simultaneous.events.html. All taken from http://savage.net.au/Marpa.html#Articles.
07:06 Idiosyncrat Good night!
12:30 kaare_ joined #marpa
14:05 koo7 joined #marpa
16:00 JPGainsborough joined #marpa
19:09 koo7 joined #marpa
21:09 ronsavage joined #marpa
22:45 Idiosyncrat joined #marpa

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