Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2015-05-12

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

All times shown according to UTC.

Time Nick Message
00:39 jeffreykegler joined #marpa
02:10 jeffreykegler joined #marpa
02:39 jeffreykegler joined #marpa
03:11 jeffreykegler joined #marpa
03:27 koo7 https://github.com/naturalog/tauchain/blob/master/marpa.cpp i started writing a libmarpa wrapper that will use grammars in rdf, if thats interesting for anyone
06:08 ronsavage joined #marpa
10:34 koo7 joined #marpa
11:15 koo7 — Function: int marpa_c_init ( Marpa_Config* config)
11:15 koo7 Initialize the config information to “safe” default values. Unspecified behavior will result if an initialized configuration is used to create a grammar.
11:43 rns usage example in C -- https://github.com/jeffreykegler/libmarpa/blob/master/test/simple/rule1.c#L18
11:44 rns in c++ -- https://github.com/jeffreykegler/Marpa--R2/issues/134#issuecomment-41091900
11:44 rns Hope it helps.
11:46 koo7 Compatibility is defined by two things: first the version of the running library is newer than the version required_major.required_minor.required_micro.
11:47 koo7 yeah could be useful thx
11:53 koo7 btw i think a link to https://github.com/koo5/new_shit/tree/master/marpa_cffi in https://github.com/rns/libmarpa-bindings/tree/master/python , with a disclaimer that my code isnt exactly top quality, would be a good idea
11:53 rns there is also Peter Stuifzand cpp experiment with libmarpa -- https://github.com/pstuifzand/marpa-cpp-rules
11:54 koo7 hmmm
11:56 rns re http://irclog.perlgeek.de/marpa/2015-05-12#i_10588587 -- there is a link to your work in my repo -- https://github.com/rns/libmarpa-bindings/blob/master/python/libmarpa.py#L8
11:57 koo7 ah youre right
11:59 koo7 i have useful stuff there, running marpa in a thread, scannerless parsing, graphing wrapper..
12:02 rns Yep, your code is actually more complete and more pythonic, mine is just your binding + regexp-based lexer = json parser which echoes the input.
12:07 koo7 mm, so your lexer collects all token regexes into one big..
12:09 koo7 i will actually have to learn to do scanning for this c++ thing
12:26 rns perhaps using libmarpa for character-based lexing can be easier --
12:26 rns define rules for literals, e.g. for l ~ 'literal' create symbols
12:26 rns S_lex_literal S_char_l  S_char_i S_char_t S_char_e S_char_r S_char_a S_char_l
12:26 koo7 yeah but not when i have a grammar with regexes
12:26 rns and rule
12:26 rns S_lex_literal ::= S_char_l S_char_i S_char_t S_char_e S_char_r S_char_a S_char_l
12:27 koo7 yeah see my scannerless parsing in python
12:27 rns charclasses ('a'..'z' range) can be done by creating a symbol S_charclass and returning it when input character is in the range.
12:27 rns lexemes (strings) can be done with left recursive sequence rules.
12:29 rns yes, I see you did scannerless in your python work
12:30 rns re regexes -- literals and charclasses as above, with alternation marpa provides it's basically here.
12:37 koo7 http://www.w3.org/2000/10/swap/grammar/n3-ietf.txt
12:39 koo7 except im gonna use http://www.w3.org/2000/10/swap/grammar/n3.rdf
12:41 koo7 well, hopefully it will be more generally useful
12:59 rns re http://irclog.perlgeek.de/marpa/2015-05-12#i_10588736 -- those can be rewritten in BNF with alternation, literals and charclasses (like EBNF to BNF) by creating intermediate symbols/rules
13:01 rns I'm going to support regex to slif compiles as part of a project -- https://github.com/rns/MarpaX-Regex
13:01 rns I mean its doable, relatively easy. :)
13:08 koo7 yeah it should be
18:01 koo7 joined #marpa
18:33 lwa joined #marpa
20:20 Cheery joined #marpa
20:20 Cheery hi
20:20 Cheery I've studied for several paper lasts week, worked through different parsing strategies and implemented them.
20:23 Cheery https://bpaste.net/show/b1870746d4ad
20:24 Cheery I wrote that based on aycock & horspool paper, after reading marpa paper.
20:51 Cheery studying leo optimiztaion now, but keeping eyes open, whether I'd figure out way to make it linear on all grammars recognized by LR(1)
20:53 Cheery It's giving me this kind of output now: https://bpaste.net/show/771e6c1a67c9
20:54 Cheery the State(4) climbs down like a ladder.
20:56 Aria That's classic non-Leo.
20:56 Aria I'm in the middle of implementing a Leo optimization too. A little tricky as I wrote it.
20:56 Aria (I didn't use the AH constructions -- more pure Earley.)
20:59 Cheery it completes at previous index, then it completes one index ahead, one ahead of that, and that, and that..
20:59 Cheery it'd seem like something easy to recognize
21:00 Cheery but I'd probably need another one with the different kind of right recursion that's problematic for leo too.
21:10 Cheery hm
21:10 Cheery maybe it's time to read the leo paper, then I'll see if it's good enough for me. :)
23:08 Cheery ok
23:08 Cheery read the leo paper, and few other tutorials
23:08 Cheery now I'm not sure if this thing reduces too soon.
23:09 Cheery but I added a 'fix' that causes it to trigger only if it detects same rule reduced again
23:09 Cheery it produces some useless reductions, then it figures it out and blasts
23:21 ronsavage joined #marpa
23:22 Cheery https://gist.github.com/cheery/99b5d82d09aa88b80199
23:24 Cheery I see how easily this thing could do incremental parsing
23:24 Cheery it basically knows at every point which symbols it may expect
23:24 Cheery well..
23:24 Cheery give it the previous tree!
23:26 Cheery but looking on, it'd likely not be that easy.
23:27 Cheery say you shift with addition tree, then it sees multiplication.
23:27 Cheery but it has seen addition
23:28 Cheery the error should cause the shift to be reverted and expanded.
23:29 Cheery the remaining problem is binarization of the repeating recursive rules
23:30 Cheery maybe it's feasible. it might need a star * -notation for those things.
23:31 Cheery since I'm building the table, it perhaps can be fitted with binarization rule.
23:31 Cheery the rule is required to form binary trees in long sequences, so the whole sequence isn't reparsed when altered

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