[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Line-by-line evaluation or all at once?
Hi Marco.
Sorry for the rather long delay to reply...
See below.
Marco Ladermann wrote:
> This problem can be solved by intoducing a (final) LinkedList element (say
> listStack) to the class, removing the final modifier of the stack Iterator
> and inserting the statement
> stack = listStack.listIterator();
> as the first instruction to the parse-method.
>
> By overriding the filter-method of the Lexer one can provide a EOF token as
> needed.
>
> This would allow to use the same parser in an interactive enviroment
> (line-by-line evaluation) or where the input is a stream of parseable texts.
>
> 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
--
----------------------------------------------------------------------
Etienne M. Gagnon, M.Sc. e-mail: egagnon@j-meg.com
Author of SableCC: http://www.sablecc.org/
and SableVM: http://www.sablevm.org/