Hi Hong Phuc,
This is a very interesting idea.
There is a potentially infinite number of incomplete ASTs that can
match the parse stack. I guess that SableCC would have to pick one
arbitrarily (I see no point in being picky about an incomplete
AST).
Given the arbitrary nature of an incomplete AST, its utility is
restricted to superficial syntactic applications (e.g. indenting
incomplete files). It would be an error to use such an AST for
doing meaningful semantic work. As a consequence, I think that the
arbitrary incomplete AST should only be available upon request,
not by default.
I'm adding this feature to the SableCC 4 todo list. (One more
thing to do!)
Thanks for the proposition,
Etienne
Etienne Gagnon, Ph.D.
http://sablecc.org
Le 12-07-29 12:25, Phuc Luoi a écrit :