[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Productions for runlength encoded lists (EBNF++?)



Is anyone on this list aware of parser generators that have a form of
EBNF that allows you two specify the number of occurrences of a
sub-production?  i.e.  something like

Statically specific length:

   list_of_4 =
        list_element{4};

Dynamically Specified length (for run length encoding):

   rle_list =
        [length]:natural_number list_element{asInt(length)};

I've got a grammar with a few occurrences of productions where, because
of the run length encoding, I haven't figured out how to use SableCC to
parse the grammar.  If anyone  has bright ideas for how I can handle
this  type of production in SableCC or if there's another parser
generator that can, please let me know.  I currently have a hand coded
parser and want to get rid of the burden of maintaining the 90% that
SableCC is capable of handling.

Evan






-- Etienne M. Gagnon, Ph.D. egagnon@j-meg.com President http://www.sablevm.org/ J-Meg inc. http://www.sablecc.org/