No such thing as a small change | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Thanks duelafn,
I really appreciate your code example as it seems to me a good starting point. I really like the use of $self you exploit to add optional terms to the expression. Now prehaps I understand it better. I still do not fully understand your: > which makes the convenient default ::= action => ::first work for the Dice_Expression rule If you have the patience to expand this further it will help me in the understanding the ::first (see also below my answer to GrandFather).
Again about optional sub elements:So the only way to specify somenthing optional is:
Right? there is no <Optional> syntax to play with? I tried a single rule like: Dice_with_modifier_r ::= Simple_Dice 'r' <Die_Modifier_Comp>* Die_Modifier_Val action => modifier_r as found at the end of this post but it throws the error:
Why on marpa-for-building-parsers there is: declaration ::= assignment* action => doResult and I cannot do
L*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS. In reply to Re^2: First steps with Marpa::R2 and BNF
by Discipulus
|
|