[antlr-interest] Re: Suggestion for Parser

marcschellens m_schellens at hotmail.com
Mon Apr 21 22:41:13 PDT 2003


--- In antlr-interest at yahoogroups.com, mzukowski at y... wrote:
> What do you mean, a tree parser that doesn't parse the tree?  I don't
> understand.

I mean a tree walker, with no calls to the match(...)
function and no case statements (c++ mode) or at least
(maybe even better) that case statements could be suppressed
for some functions as the next sibling is determined by its
predecessor.
 
> See the tinybasic.g example for ideas on how to do an interpreter.
I had a short look at it, but I think it suffers (in terms of
performance) from the same problem, that in some places it checks
for the next sibling, even all this information could be delivered
from a first tree walk.

EG: A switch statement.
The first node would contain the number N of case entries
so the type (=function to call) is already known for the next
N siblings.

Hope I made my point clearer,
marc

> -----Original Message-----
> From: marcschellens [mailto:m_schellens at h...]
> Sent: Monday, April 21, 2003 3:46 AM
> To: antlr-interest at yahoogroups.com
> Subject: [antlr-interest] Suggestion for Parser
> 
> 
> It would be convenient, to have a tree parser,
> which doesn't actually check the tree anymore, as this is done
> before with another tree parser.
> Especially such a tree parser could easyly extended to be used as an
> interpreter.
> Are there any plans in this direction?
> Where are the crucial lines in the java code?
> I am using c++ code generation.



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list