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

Re: Line-by-line evaluation or all at once?

> > This approach might be an alternative to always create a new parser object,
> > since the entries in the LinkedList can be reused and must not be newly
> > created.
> Would you like to implement this?  (Maybe you already have).  If you
> send me the code (licensed under the LGPL, you retain copyright:-), I
> can take care of integrating it into the official SableCC development
> tree.  Just be patient.  I won't have much time to devote to SableCC
> until the summer.
> Etienne

Parsing line by line relates to two other SableCC feature possibilities:

1 - Being able to parse constructs in the grammar other than just the
starting production.  If you have a bunch of different kinds of
statements that need to be parsed, and they share common helpers,
tokens, etc, it would be nice if they could all be in one grammar file,
and you could instruct SableCC to parse one or the other.  Right now you
need completely different parsers for each production you want to be
able to parse.

2 - Having EOF be an explicit part of the grammar.  It would be nice if
you could go : 

one_line = some stuff and then eol EOF;

This way you wouldn't need to be sticking EOFs in filter methods.  It
would be much more self-documenting than splitting SableCC functionality
between code and grammar.  It would also allow grammars to be written
more simply in certain cases.