Plugin for Antenna preprocessor (Java Micro Edition)

Hi,

I'm trying to figure out how to write a plugin that can support Antenna
preprocessor directives . It seems to me that one could write a
custom language plugin, but then again this is Java syntax with some
special comments - maybe extending the existing Java parser will do. But
I don't know if that is even possible.

The complete list of directives that must be supported are:
#define #undefine #ifdef #ifndef #else #endif #elifdef #elifndef #if #elif #include ]]>
#endinclude

Great if anyone has some ideas on how to proceed with such a plugin.

http://antenna.sourceforge.net/#preprocess

--
Per Thomas

1 comment
Comment actions Permalink

Hello Per,

PJ> I'm trying to figure out how to write a plugin that can support
PJ> Antenna preprocessor directives . It seems to me that one could
PJ> write a custom language plugin, but then again this is Java syntax
PJ> with some special comments - maybe extending the existing Java
PJ> parser will do. But I don't know if that is even possible.
PJ>
PJ> The complete list of directives that must be supported are:
PJ> #define PJ> #undefine PJ> #ifdef PJ> #ifndef PJ> #else PJ> #endif PJ> #elifdef PJ> #elifndef PJ> #if PJ> #elif PJ> #include PJ> #endinclude PJ>]]> Great if anyone has some ideas on how to proceed with such a plugin.

The hardest part of writing any pre-processor plugin is having to deal with
multiple instances of the same identifier (for example, one implementation
of a method under #ifdef and another under #else), and with more complex
cases of preprocessor directives breaking the program structure.

--
Dmitry Jemerov
Software Developer
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.