Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2016-04-17

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

All times shown according to UTC.

Time Nick Message
01:56 beaugunderson joined #marpa
02:23 ronsavage joined #marpa
02:24 ronsavage As an idea on reworking the BNF, how about:
02:24 ronsavage :directives::= action => [values]
02:24 ronsavage latm => 1
02:24 ronsavage start => name_of_rule
02:24 ronsavage discard => [this, that]
02:26 ronsavage I use the word directives (or options) to indicate the grammar author is providing directives or options to the parser.
02:27 ronsavage And yes they could all be on the same line.
03:23 kaare_ joined #marpa
03:43 idiosyncrat_ ronsavage: Interesting
03:44 idiosyncrat_ Note that my intent was that above form be considered a "pseudo-rule" because of the '::=' operator, which I intended to mean ...
03:44 idiosyncrat_ its effect did not depend in any way on its lexical position in the DSL, ...
03:44 idiosyncrat_ and it was in some way analagous to a rule.
03:45 idiosyncrat_ s/analagouos/analogous/
03:46 idiosyncrat_ For the :start, :discard targets I think the analogy can be seen and
03:46 idiosyncrat_ in :default ::= action => main::doit
03:46 idiosyncrat_ we perhaps see that its rule defaults being specified with a pseudo-rule.
03:47 idiosyncrat_ I'm not necessarily all that happy with my choices, but that was my reasoning.
03:47 idiosyncrat_ Only two "REWORK" tests left.
03:53 ronsavage Alternately, :directives = ... so as to skip using '::='.
03:59 ronsavage In effect, I'm saying ":directives = $some_option_set" means $n x ":default = $some_option".
04:01 idiosyncrat_ OK, conversion of tests to the SLIF is now complete!
04:02 idiosyncrat_ The test suite now has 129 tests of which 47 can be deleted at any time.
04:02 idiosyncrat_ Once that happens there will be 82 tests left.
04:03 idiosyncrat_ I'd been doing the tests in order of difficulty and the last two turned out to be so trivial they should have been deleted long ago.
04:04 idiosyncrat_ I think they were left over from my very first efforts to get the basics of Marpa/Earley working, many years ago.
04:05 idiosyncrat_ Btw, that matter of tracing externally-lexed terminals turned out to be more difficult than I thought -- I filed a Github issue on it.
04:05 idiosyncrat_ It turns out to depend a lot on the idea of lexeme location, and I have other work on that that needs to be done first.
04:06 idiosyncrat_ So next I'll start removing the NAIF from Marpa::R3.
04:07 idiosyncrat_ I'm glad to get the test conversion out of the way.  It had to be done and I *did* learn a lot, but it could be tedious and I'm happy to see the end of it.
04:08 idiosyncrat_ rns: Many thanks for your help in this matter, which made an onerous task considerably less onerous.
04:09 idiosyncrat_ Good night!
04:26 harovali joined #marpa
04:31 harovali hi, i'd like to write a parser to a DSL  in which I have a lot of code written. There are comments, as usual. I believe the comments are a constituent part of the operational body. Should I put  the comments nonterminal in each G1 rule , so that I can do things with them as I do things with the DSL lines ? Or should I parse twice , one with the comments, and one with the code, and then link them back somehow?
05:08 ronsavage joined #marpa
05:10 ronsavage harovali: For sample code on comments, see https://metacpan.org/source/RSAVAGE/GraphV​iz2-Marpa-2.03/lib/GraphViz2/Marpa.pm#L385. Of course, I discard them, but you could include them.
05:12 ronsavage For instance, you could make them trigger an event: https://metacpan.org/pod/distribution/Marpa-​R2/pod/Scanless/DSL.pod#Discard-pseudo-rule.
05:12 rns joined #marpa
05:13 harovali thanks ! ronsavage
05:18 harovali In addition, the DSL I have to parse also has a form of enveloping syntax which resembles that of XML. I wonder if it is convenient to enumerate all the possible 'tag names' which open and (prefixed with a character) close a section , or if it possible to avoid enmumarating all of this tagnames by having the grammar detect an opening tag , and its corresponding closing tag just by checking the string which is inside the opening-t
05:21 harovali Equivalently , I would ask who to write a generic grammar for parsing XML, for instance.
05:23 harovali s/who/how/
05:24 rns Enumeration looks simpler to me -- it makes start/end tag matching straightforward.
05:28 harovali rns: thanks
05:29 rns However, ronsavage did Text-Delimited-Marpa and Text-Balanced-Marpa and if you specify '<' and '>' as open and close delimiters you'll get text in tags and between tags out of the box.
05:29 rns http://search.cpan.org/~rsava​ge/Text-Balanced-Marpa-1.07/
05:29 rns http://search.cpan.org/~rsava​ge/Text-Delimited-Marpa-1.00/
05:29 harovali rns: thanks for that too !
05:30 rns harovali: absolutel welcome, fell free to ask for more. :)
05:30 rns s/absolutel/absolutly/
05:30 harovali rns: that helps a lot
05:30 rns harovali: great to hear that/
05:31 harovali rns: I'm happy i found marpa before getting too deep in pypeg
05:32 harovali i don't care much using either perl or python, I use both
05:33 harovali are you aware of the "moose" project written in smalltalk / pharo ? I fell marpa can be a useful tool for moose source code analysis
05:34 harovali s/fell/feel/
05:34 rns re PEG -- oh, yes. Honestly I've never tried any PEG (I used Marpa) as it looked like a can of worms -- unpredictable backtracking and all that -- http://jeffreykegler.github.io/Ocean-of-A​wareness-blog/individual/2015/03/peg.html
05:35 harovali rns: yes, I saw that pertinent discussion : )
05:35 rns Exactly. :)
05:37 rns re moose -- if that one -- http://moosetechnology.org/ -- nope, sorry, only perl's Moose. :)
05:38 rns But yes, with Marpa parsing is easy -- just get a BNF and process the resuts. All the work is in those two -- Marpa does all the rest.
05:39 harovali hahaha, yes I knew of that name overload : )
05:39 rns :)
05:40 harovali :) i'm happy parsing can be fun
05:41 rns yep, at last -- it hasn't been for a while.
05:43 harovali sure
05:44 harovali haskell parsing is interesting too
05:44 harovali but you have to do haskell !
05:44 harovali :)
05:46 rns oh yes :)
05:58 harovali what's the difference between text-balanced and text delimited ?
06:18 rns Good question -- http://search.cpan.org/~rsavage/Text-Delim​ited-Marpa-1.00/lib/Text/Delimited/Marpa.p​m#What_are_the_differences_between_Text::B​alanced::Marpa_and_Text::Delimited::Marpa?
06:19 rns idiosyncart: re http://irclog.perlgeek.de/m​arpa/2016-04-17#i_12349239 -- you did all the rest after chaf.t in 2 days -- impressive!
06:22 ronsavage rns: Thanx.
06:22 ronsavage harovali: I suspect Text::Balanced::Marpa will split the text in a way more suitable to your work.
06:52 harovali joined #marpa
07:55 VsyachePuz_ joined #marpa
08:07 lucs_ joined #marpa
08:08 VsyachePuz joined #marpa
08:09 kaare__ joined #marpa
08:09 ronsavage joined #marpa
08:18 sivoais joined #marpa
08:18 sivoais joined #marpa
08:37 Pursuit joined #marpa
09:18 koo7 joined #marpa
11:23 JPGainsborough joined #marpa
13:41 koo7 joined #marpa
14:35 VsyachePuz joined #marpa
16:05 kaare_ joined #marpa
16:34 JPGainsborough joined #marpa
16:58 VsyachePuz_ joined #marpa
16:58 VsyachePuz_ joined #marpa
18:04 VsyachePuz joined #marpa
18:35 idiosyncrat_ joined #marpa
18:36 idiosyncrat_ The tedious bit of converting tests is over, and now I'm into the fun part -- eliminating obsolete and deprecated methods and interfaces.
18:37 idiosyncrat_ It's comparatively easy and I get to watch the code getting rapidly faster and clearer.  Fun!
18:53 idiosyncrat_ I just uploaded Marpa-R3-4.001_000 to CPAN.
18:55 idiosyncrat_ With respect to the build issues, I added ".NOTPARALLEL" to the Makefile -- it works under GNU make and, rns's researches indicate, some BSD's as well.
18:56 idiosyncrat_ When and if things break, we'll special-case the use of ".NOTPARALLEL".
18:56 idiosyncrat_ For the moment, it should make targets test OK that otherwise would not test OK.
21:32 user2_ joined #marpa
21:33 VsyachePuz_ joined #marpa
21:37 VsyachePuz_ joined #marpa
22:22 VsyachePuz joined #marpa
22:47 ronsavage joined #marpa
23:04 idiosyncrat_ joined #marpa

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