Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » how to integrate the preprocesser function of cdt into jdt
how to integrate the preprocesser function of cdt into jdt [message #188624] Mon, 06 December 2004 07:29
Eclipse UserFriend
Originally posted by: jimisong.hotmail.com

Hi:
During my programming work, I always meet such a problem:
the original source code includes two parts:
1) one is c/c++ preprocessor macro, #define, #if, #else etc.
2) the rest is pure java code
I always use "bcc32.exe"--a preprocesser tool of Borland Corporation to
process the original source code, so that I get different versions of pure
java source code according to different preprocessor macro variables

Fox example:
--------------------------
/**
*the original source code
*/
#define ENGLISH 1
#define FRENCH 2
#define LANGUAGE ENGLISH
public class Test
{
public static void main(String args[])
{
String currentLanguage = "";
#if LANGUAGE == ENGLISH
currentLanguage = "English";
#elif LANGUAGE == FRENCH
currentLanguage = "French";
#endif
System.out.println("current language is " + currentLanguage);
}

public Test()
{
}
}
--------------------------
/**
*after "bcc32.exe"'s process in the case of #define LANGUAGE ENGLISH
*the source code should be pure java source code:
*/
public class Test
{
public static void main(String args[])
{
String currentLanguage = "";

currentLanguage = "English";

System.out.println("current language is " + currentLanguage);
}

public Test()
{
}
}
------------------------
so I want to make a special java code editor, which can recognize c/c++
preprocessor macro signal.
By far, I have studied the source code of CEditor.java in
org.eclipse.cdt.internal.ui.editor and JavaEditor.java in
org.eclipse.jdt.internal.ui.javaeditor and so on, but find little clue, I
don't know what should I study in order to create such a code editor, so
pls give me some advices, that I can begin the first step. thanks!
Previous Topic:Visibroker and eclipse
Next Topic:issue with Ant in latest 3.1 integration
Goto Forum:
  


Current Time: Sun Jun 08 04:31:40 EDT 2025

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

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

Back to the top