[antlr-interest] TreeParsing with various roots
Monty Zukowski
monty at codetransform.com
Thu Nov 4 12:14:31 PST 2004
On Nov 4, 2004, at 12:12 PM, Bryan Ewbank wrote:
>
> From: "Monty Zukowski" <monty at codetransform.com>
> To: <antlr-interest at yahoogroups.com>
> Sent: Wednesday, November 03, 2004 17:48
> Subject: Re: [antlr-interest] TreeParsing with various roots
>
>
>>
>> On Nov 3, 2004, at 2:31 PM, Paul J. Lucas wrote:
>>
>>> But having to use the text of the original token seems a bit
>>> hokey to me. Is there a better way?
>>
>> Not saying it's better, but you could also introduce an imaginary root
>> to do the same thing. Makes your tree bigger, though.
>
> Perhaps an OPERATOR type, as you suggest, but and introduce a subtype
> member
> to preserve the original. It at least avoids looking at the text and
> preserves the information.
>
>
Yeah, that's what I meant. So the tree is #(COMP_OP LE 1 2) or
whatever, with COMP_OP as the root, the other op, in this case LE as
the first child.
Monty
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list