Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2016-01-18

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

All times shown according to UTC.

Time Nick Message
00:16 ronsavage Need help with grammar. https://github.com/ronsavage/Image-Magick-CommandParser.git. Run scripts/synopsis.sh. BNF is data/command.line.options.bnf. Input is data/synopsis.txt.
00:18 ronsavage Problem: Why does action sub action_set() get called with params ('-') and not all of ('-', 'size', '320x85')?
00:18 ronsavage I'm working on a BNF for http://imagemagick.org/script/command-line-options.php. TIA!
00:45 Idiosyncrat The RHS for the action_set() action is a single symbol:
00:45 Idiosyncrat <action_set> -- therefore action_set will see a single arg.
00:45 Idiosyncrat What will that single arg be?
00:46 Idiosyncrat There is only one rule for <action_set>:
00:46 Idiosyncrat action_set ::= sign action_name parameter_set
00:47 Idiosyncrat What is its value?  There's no action explicitly associated with it, so we look for the default.
00:47 Idiosyncrat :default::= action => ::first
00:47 Idiosyncrat So the value of an <action_set> node will be the value of its first node <sign>
00:48 Idiosyncrat Any questions, let me know.
02:21 ronsavage Jk: Thanx! I expected the values to be passed to the action sub associated with the rule which has action_set on its RHS. Interesting but false assumption.
04:50 ronsavage joined #marpa
04:58 ronsavage I do have 1 q. Why does the rule 'parameter_set ::= string*' not gobble up add possible parameters? Move the 'action => action_set' clause from the 'rule' rule to the 'action_set' rule, and uncomment line 4 of data/synopsis.txt. The parameter 'canvas:none' just vanishes.
05:07 Idiosyncrat joined #marpa
05:08 Idiosyncrat ronsavage: Off the top of my head and w/o running the experiment, it looks like it is getting the default "::first" semantics.
05:10 Idiosyncrat In general, unless you're sure of what you're doing, it's best to make the default semantics something like "[values]"
05:11 Idiosyncrat That way, if you forget something, you'll get more than you want, and the problem won't be so mysterious.
05:13 Idiosyncrat Another good default is
05:13 Idiosyncrat :default ::= action => [name,values]
05:32 ronsavage OK. Thanx!
05:34 ronsavage Wow. Using [name, values] helped immediately. My original preference was always that. I forget why I didn't use it here.
05:46 ronsavage And it turns out [values] is even better.....
05:49 ronsavage JK: My false assumption probably means an error in http://savage.net.au/Ron/html/Understanding.Marpa-style.action.subs.parameters.html. See the line very near the end:
05:50 ronsavage http://savage.net.au/Ron/html/Understanding.Marpa-style.action.subs.parameters.html. Is that actually true when it says "And, that the nesting is because each rule's right-hand side tokens return the results of all rules on which that token depends."?
07:20 Idiosyncrat joined #marpa
07:21 Idiosyncrat Re: "And, that the nesting is because each rule's right-hand side tokens return the results of all rules on which that token depends."?
07:22 Idiosyncrat It's not incorrect, and I let the phrasing pass because I know many readers prefer your explanations to mine.
07:23 Idiosyncrat I would say "symbols" instead of "tokens" because in the parsing literature a token is most often used to mean what Marpa calls a "lexeme" -- a leaf symbol.
07:24 Idiosyncrat But they do nest, because if you use the "[values]" descriptor the values will be built up recursively.
07:25 Idiosyncrat Also instead of "the results of all rules" perhaps
07:27 Idiosyncrat "the results of evaluating value of the rule at all nodes"
07:27 Idiosyncrat oops make that
07:28 Idiosyncrat "the results of evaluating the value of the rule at all nodes"
07:28 Idiosyncrat But perhaps with your new understanding your own rewrite may make your point better.
07:40 Idiosyncrat Actually, rereading it in context all I think that you need to do is s/tokens/symbols/ so that it reads:
07:43 Idiosyncrat "And, that the nesting is because every symbol on the right hand side returns the values from all the rules in the nodes below that symbol."
08:21 Idiosyncrat Good night/morning!
08:29 VsyachePuz http://vsyachepuz.github.io/blog/How-to-rewrite-EBNF-into-BNF.htm
08:29 koo7 joined #marpa
08:31 VsyachePuz http://stackoverflow.com/questions/14922242/how-to-convert-bnf-to-ebnf
08:41 VsyachePuz why { } in EBNF syntax mean "0 to many" repetitions instead of "1 to many" ?
08:48 VsyachePuz { ... }-                  Symbols repeated one or more times
08:48 VsyachePuz { ... }                   Symbols repeated zero or more times
08:49 VsyachePuz {...}- notation is not part of the standard
08:51 ronsavage joined #marpa
08:51 ronsavage JK; Thanx. I was wondering if I should mention ::first to clarify Marpa won't necessarily return /all/ results.
08:55 VsyachePuz http://stackoverflow.com/questions/2466484/converting-ebnf-to-bnf
09:25 ronsavage joined #marpa
11:45 kaare_ joined #marpa
18:20 Idiosyncrat joined #marpa
18:41 Idiosyncrat ronsavage: mention "::first"?  Use your own best guess.
20:50 kaare_ joined #marpa
21:19 ronsavage joined #marpa
22:07 ronsavage JK: OK. I've re-written much of that section: http://savage.net.au/Ron/html/Understanding.Marpa-style.action.subs.parameters.html.
22:07 VsyachePuz joined #marpa

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