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

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



Dan Sandberg wrote:
> 1 - Being able to parse constructs in the grammar other than just the
> starting production. 

This feature only works well with LL grammars.  LR parsers maintain an
"ambiguous" state as long a possible.  This is why LR parsers can deal
with grammars that LL parsers can't.  So, to parse from a different
starting point, you need to generate new LR parsing tables.  LL parsers
only allow an unambiguous parse context. So, they can start from any
state without problem.

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

EOF is a special thing.  I have plans about its handling in SableCC 3.0,
but probably not through explicit notation as a token in the grammar.

To give you an idea, (and as previously suggested on the mailing-list),
one can play with things like "0 lookahead" to end a parse, and not
reuire an "EOF" between multiple parses.

Etienne
-- 
----------------------------------------------------------------------
Etienne M. Gagnon, M.Sc.                     e-mail: egagnon@j-meg.com
Author of SableCC:                             http://www.sablecc.org/
and SableVM:                                   http://www.sablevm.org/