Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » preprocessor plugin
preprocessor plugin [message #163285] Fri, 28 November 2003 13:20 Go to next message
Eugeny N Dzhurinsky is currently offline Eugeny N DzhurinskyFriend
Messages: 17
Registered: July 2009
Junior Member
Hello

I found that standart "cpp" preprocessor can parse Java files.
I checked source code for it - seems so be simple enough, so i'm going
to develop the plug-in for C-like pre-processing in Java files. Right
now i thinking in this way:

When statring build-in parser for syntax check, get input stream of file
to parse, then run the pre-processor, get output stream and pass it to
the Eclipse's lexer (or whatever it uses). This way Eclipse will be able
to parse the result file, and show the syntax/grammar's errors. For
correct mapping of found error to original file (in case if they occures
inside the case conditions or macros) i will need to have a way to get
the line numbers for errors and map it to actual lines of original file
with pre-processor statements. So the plug-in will be a "layer" between
the UI for the graphical representation of Java file and the Eclipse's
lexer.

Can anybody suggest me anything regarding the thoughts given above?
Re: preprocessor plugin [message #163438 is a reply to message #163285] Sat, 29 November 2003 02:04 Go to previous messageGo to next message
David Vydra is currently offline David VydraFriend
Messages: 12
Registered: July 2009
Junior Member
What benefit is a preprocessor when you can use AspectJ?
-d
"Eugeny N Dzhurinsky" <eugenydzh@jdevelop.com> wrote in message
news:bq7hti$tcc$1@eclipse.org...
> Hello
>
> I found that standart "cpp" preprocessor can parse Java files.
> I checked source code for it - seems so be simple enough, so i'm going
> to develop the plug-in for C-like pre-processing in Java files. Right
> now i thinking in this way:
>
> When statring build-in parser for syntax check, get input stream of file
> to parse, then run the pre-processor, get output stream and pass it to
> the Eclipse's lexer (or whatever it uses). This way Eclipse will be able
> to parse the result file, and show the syntax/grammar's errors. For
> correct mapping of found error to original file (in case if they occures
> inside the case conditions or macros) i will need to have a way to get
> the line numbers for errors and map it to actual lines of original file
> with pre-processor statements. So the plug-in will be a "layer" between
> the UI for the graphical representation of Java file and the Eclipse's
> lexer.
>
> Can anybody suggest me anything regarding the thoughts given above?
>
Re: preprocessor plugin [message #163488 is a reply to message #163285] Sat, 29 November 2003 10:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: crscca.bol.net.n

Eugene did u try the eclipse cdt? does it already solve this issue?cann it
be resused?

Well I dont know about aspectj but a pre-processor could be useful if you
are in some rare case writing the same code again and again and for some
reson or the other you are not able to encapsulate it beyond a point using
OOP.

So as an alternative you end up developing a kind of template for various
pieces of code. If this is the purpose a C++ style preprocesor might be a
good idea.
As an extension or add on see if you can get the preprocessor to read
inputs from propertyfiles for "define" values and also run a loop on
various property/xml files as specified in one particular central
controller property/xml file. Could be useful under those circumstances.

This would eliminate some of the tedius apects of even preprocessor
statements.

Eugeny N Dzhurinsky wrote:

> Hello

> I found that standart "cpp" preprocessor can parse Java files.
> I checked source code for it - seems so be simple enough, so i'm going
> to develop the plug-in for C-like pre-processing in Java files. Right
> now i thinking in this way:

> When statring build-in parser for syntax check, get input stream of file
> to parse, then run the pre-processor, get output stream and pass it to
> the Eclipse's lexer (or whatever it uses). This way Eclipse will be able
> to parse the result file, and show the syntax/grammar's errors. For
> correct mapping of found error to original file (in case if they occures
> inside the case conditions or macros) i will need to have a way to get
> the line numbers for errors and map it to actual lines of original file
> with pre-processor statements. So the plug-in will be a "layer" between
> the UI for the graphical representation of Java file and the Eclipse's
> lexer.

> Can anybody suggest me anything regarding the thoughts given above?
Re: preprocessor plugin [message #266885 is a reply to message #163488] Fri, 13 August 2004 16:39 Go to previous message
Eclipse UserFriend
Originally posted by: jbacon_FAKE_.magmic_FAKE_.com

Did anyone ever get around to writing a plugin for this? I am using
Antenna (antenna.sourceforge.net) for my J2ME development in Eclipse and
I have ifdef's all over the place which makes Eclipse's parsing choke.

I'd LOVE a plugin that would handle a preprocessor. I don't have the
time to spend on it but if someone else did that would ROCK.

Raster wrote:

> Eugene did u try the eclipse cdt? does it already solve this issue?cann it
> be resused?
>
> Well I dont know about aspectj but a pre-processor could be useful if you
> are in some rare case writing the same code again and again and for some
> reson or the other you are not able to encapsulate it beyond a point using
> OOP.
>
> So as an alternative you end up developing a kind of template for various
> pieces of code. If this is the purpose a C++ style preprocesor might be a
> good idea.
> As an extension or add on see if you can get the preprocessor to read
> inputs from propertyfiles for "define" values and also run a loop on
> various property/xml files as specified in one particular central
> controller property/xml file. Could be useful under those circumstances.
>
> This would eliminate some of the tedius apects of even preprocessor
> statements.
>
> Eugeny N Dzhurinsky wrote:
>
>
>>Hello
>
>
>>I found that standart "cpp" preprocessor can parse Java files.
>>I checked source code for it - seems so be simple enough, so i'm going
>>to develop the plug-in for C-like pre-processing in Java files. Right
>>now i thinking in this way:
>
>
>>When statring build-in parser for syntax check, get input stream of file
>>to parse, then run the pre-processor, get output stream and pass it to
>>the Eclipse's lexer (or whatever it uses). This way Eclipse will be able
>>to parse the result file, and show the syntax/grammar's errors. For
>>correct mapping of found error to original file (in case if they occures
>>inside the case conditions or macros) i will need to have a way to get
>>the line numbers for errors and map it to actual lines of original file
>>with pre-processor statements. So the plug-in will be a "layer" between
>>the UI for the graphical representation of Java file and the Eclipse's
>>lexer.
>
>
>>Can anybody suggest me anything regarding the thoughts given above?
>
>
>
Previous Topic:Eclipse 3.0.0 & task view
Next Topic:Java Preprocessor
Goto Forum:
  


Current Time: Wed Jul 17 20:22:04 GMT 2024

Powered by FUDForum. Page generated in 0.03506 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top