[antlr-interest] ANTLR3 AST construction with optionsandalternatives

Kay Roepke kroepke at classdump.org
Tue Nov 14 04:18:56 PST 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/






More information about the antlr-interest mailing list