Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2016-01-29

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

All times shown according to UTC.

Time Nick Message
01:49 kaare_ joined #marpa
04:52 Idiosyncrat joined #marpa
05:59 Idiosyncrat Good night!
11:18 kaare_ joined #marpa
16:38 JPGainsborough hi
18:05 Idiosyncrat joined #marpa
18:10 choroba joined #marpa
18:19 JPGainsborough hi
18:20 Idiosyncrat hi
18:24 JPGainsborough I apologize if this is off topic: I have been working on a lexer that creates a clone of itself, in many cases, such as in an <rule1> | <rule2>, clones are made of the lexer for rule1 and rule2, and each clone is run simultaneously, in lockstep, processing the same character with each iteration of the parser. The clones continue seperately until the lexing is complete, a non-matching rule can cause the clone to be
18:24 JPGainsborough deleted. I am not sure what this is called. But its very simple
18:24 JPGainsborough Its not very efficient but its simple and easy to understand
18:25 JPGainsborough It processes the BNF directly, each BNF rule is basically run directly by a handler function
18:27 JPGainsborough for nested rules, each clone as its own stack, if BNF rules are nested, the stack is used. The stack is cloned
18:28 JPGainsborough I have the clones stored in a tree
18:34 JPGainsborough Only one character needs to be held in memory at a time
18:35 JPGainsborough i am sure that this model has been done before because its obvious. Its always good to have more entries in the diverse field of lexer and parser designs
18:36 Idiosyncrat re "off-topic" -- lucs is the moderator, but we've been basically allowing all discussions of advanced parsing techniques, even when there is no direct Marpa connection
18:37 Idiosyncrat On the idea that having this be the place where the people doing advanced parsing work gather is a cool thing.
18:38 JPGainsborough yes
18:40 Idiosyncrat Are your BNF rules restricted to regular expressions?
18:40 Idiosyncrat That is, can be they recursive?
18:45 JPGainsborough BNF blocks can be nested in other rule blocks.
18:46 Idiosyncrat Then it's a top-down parser -- a close relative of recursive descent, is my guess.
18:46 JPGainsborough if we have <block1> | <block2>, the lexer is cloned for each block
18:47 JPGainsborough the clone stays around, until either the end of the lexer run or when there is a non-matching rule. Failed clones are weeded out as the parser runs.
18:48 Idiosyncrat Ah, I see
18:49 JPGainsborough each clone of the lexer is run in parallel, looking at the same character at a time. It can handle ambiguous grammars
18:49 Idiosyncrat Right
18:49 Idiosyncrat it sound like a non-deterministic variant of top-down, in that case.
18:51 Idiosyncrat It would be fully general, yes, but as you also say, potentially very expensive in time and space.
18:52 Idiosyncrat Have you looked at Mark Dominus's parsing chapter from Higher-Order Perl?
18:54 JPGainsborough I havent
18:54 Idiosyncrat I think you might recognizer Mark's parser as a deterministic variant of yours -- and MJD's could readily be modified to proceed in parallel.
18:54 Idiosyncrat It's online.
18:55 Idiosyncrat http://hop.perl.plover.com/book/pdf/08Parsing.pdf
18:56 JPGainsborough i will take a look. I use copy on write clones of the lexer
18:56 JPGainsborough i will take a look
18:57 Idiosyncrat MJD's take on parsing (at least as expressed in his book) is very different from mine
18:57 Idiosyncrat I often recommend his chapter as an introduction to pre-Marpa parsing.
18:58 Idiosyncrat Off to lunch now.
18:58 Idiosyncrat AFK
21:47 Idiosyncrat joined #marpa
22:55 Idiosyncrat joined #marpa
22:56 Idiosyncrat joined #marpa
23:08 koo7 joined #marpa
23:46 Idiosyncrat joined #marpa

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