[antlr-interest] ANTLR3 AST construction withoptionsandalternatives
Foolish Ewe
foolishewe at hotmail.com
Tue Nov 14 05:51:19 PST 2006
Thanks Kay:
That is very helpful, good notation is like clean living, a good, helpful
and sometimes necessary
thing :-).
Currently I am thinking about what sort of semantic processing my language
needs.
Since the AST is "walked" during tree construction, I'm hoping to complete
any needed
processing during the initial construction phase, however until I start
trying stuff, I'm not
sure if I will be so lucky. In the event that I might need to walk
part of the tree after construction, am I right that this is typically done
in Java
(based on what I noticed
at:http://www.antlr.org/wiki/pages/viewpage.action?pageId=754) ,
or does ANTLR have a grammar for traversing the AST after construction as
well?
Regards:
Bill M.
Kay Roepke wrote on November 14, 2006
>On 13. Nov 2006, at 21:24 , David Holroyd wrote:
>
>>On Mon, Nov 13, 2006 at 06:40:05PM +0000, Foolish Ewe wrote:
>>>I'm not sure about what the ANTLR folks call these things so just
>>>to be clear, if we have a rule like the one I originally suggested,
>>>b and c+ are what I'll call atributes. I'm guessing that Dave
>>>refers to the + suffix as the cardinality of the attribute.
>>
>>Yes. (I hope it's the right term.)
>
>Don't call them attributes, that term is used for something different.
>They are called rule or token references (depending whether you write a+
>or A+).
>Attributes are "fields" of those references, like $a.text and the like.
>Also, parameters, return values, and scope "fields" are also called
>attributes
>(since they are essentially the same thing).
>As such, there are predefined attributes (text, start, stop, line, st come
>to mind)
>and "user defined" attributes, though I think we don't have a qualifier
>like that,
>they are just "attributes".
>
>Hope that clears that up :)
>
>cheers,
>-k
>--
>Kay Röpke
>http://classdump.org/
>
>
>
>
_________________________________________________________________
Use your PC to make calls at very low rates
https://voiceoam.pcs.v2s.live.com/partnerredirect.aspx
More information about the antlr-interest
mailing list