I was reading the slides from PM's YAPC::NA, and a thought drifted into
my mind (more of a gentle alarm, actually). One of the examples struck me:

  rule parameter_list { <parameter> [ , <parameter>]* }

Its seems common in the higher layers of a grammar that there are more
non-terminal than terminals in each rule, so maybe the current "rule"
isn't properly huffmanized (also, the comma seemed some-how out of place
-- most symbols will need to be quoted if used in similar context). A
more traditional YACC/YAPP coding of the
rule would be:

  rule parameter_list { parameter [ "," parameter ]* }

Is there a strong reason (ambiguity) why every nonterminal needs to be
quoted (or could we at least have a form ( C< rule:y {...} > ) where
they are not)? I see this as increasingly important when rules are used
to process non-textual streams. In these cases every token will need to
be quoted using angle brackets, which at that point might become little
more than line noise.


Dave.

Reply via email to