[antlr-interest] more specific (lang independent?) actions (WAS: header sections)

Monty Zukowski monty at codetransform.com
Thu Nov 18 10:49:47 PST 2004


On Nov 18, 2004, at 10:43 AM, Terence Parr wrote:

>
>
> On Nov 18, 2004, at 10:34 AM, Monty Zukowski wrote:
>> On Nov 18, 2004, at 9:59 AM, Terence Parr wrote:
>>>
>>
>> So are these handled by a generic rule like ID '{' (.)* '}'  where the
>> stuff inside is just passed as an attribute to the template?  So
>> antlr.g doesn't have to change if some other language needs its own
>> special block?
>
> Wow.  Devious thought.  I like the flexibility so any language target
> could require special code sections.  We'd probably have to make it
>
> section fields {
> ....
> }
>
> rather than
>
> fields {
> }
>
>

More devious than you might presume.  This opens the field for aspects 
in a .g file ;)

Now to press my luck for conditionals.....I suppose that can be 
controlled by which templates are in use.

section debug {
#DEFINE DEBUG 1
}

section error_reporting {
...
}

section tracing {
...
}

We need to get a handle on stuff like optionally including my own 
tracing methods v. the standard ones in a sane way.  I'm not sure I'm 
awake enough to coherently describe everything we need.

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