> Hi all, i am new to antlr and i have a conceptual problem:
> 
> I want to parse delphi pascal source code.
> In pascal the preprocessor directive is fast the same as a comment:
> 
> directive    { $R *.dfm }
> 
> I want to collect the directives also but i dont't want to have them
> in the rules. It will be impossible to handle this because
> preprocessor directives can appear fast anywhere.
> 
> Is there a possibility to create a custom channel and write
> 
> COMMENT
>     :   '{' WS* '$'  ( options {greedy=false;} : . )* '}'
> {$channel=CUSTOM;}

If you have a constant named CUSTOM, then the above syntax should work. HIDDEN 
is simply a predefined integer (probably with the value 100) and the 
NextToken() method compares the channel property to the used one.

Johannes
-- 
Jetzt 1 Monat kostenlos! GMX FreeDSL - Telefonanschluss + DSL 
für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to