[antlr-interest] C directive as a comment

Monty Zukowski monty at codetransform.com
Mon Sep 13 10:12:56 PDT 2004


Sure, you can build something with ANTLR to do that.  A good starting 
place would be my C grammar, see the link below.  You would have to 
change the lexer to pass the comment into the parser and from there, in 
an action, send the contents of the comment to another lexer/parser to 
grab what you need.

Monty Zukowski

ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit -- 
http://www.codetransform.com/gcc.html
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html


On Sep 13, 2004, at 8:54 AM, m_barreteau wrote:

>
>  Hi!
>
>  I would like to recognise a directive (I mean an instruction that
> can be ignored by a C compiler if a given identifier is not set) that
> would be hidden inside a C comment. For instance:
>
> /* KEYWORD [parm1:parm2] */
>
>  Does ANTLR 2.7.2 is able to collect these parameters ?
>
>  Thanks.
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>



 
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