how to use preprocessor in eclipse

how to use preprocessor in eclipse

Configuring Preprocessor Support
Due to limitations in the extensibility of the Eclipse Java Compiler (see Bug 116143 for further information), it is necessary for EclipseME to hook into the Eclipse platform at a lower level in order to provide preprocessor support. If you would like to take advantage of EclipseME’s support for preprocessing, a few extra changes need to be made to your Eclipse installation.
When installing the EclipseME feature, it is imperative that it be installed into the same directory structure as your base Eclipse installation. For instance, if your base Eclipse installation (not your workspace) is installed to c:softwareeclipse, you will need to make sure that you install EclipseME into c:softwareeclipse. When the installation has completed, the eclipseme.core.hooks_[version].jar file must be located in the same directory as the org.eclipse.org_[version].jar.
The Eclipse configuration file must be altered to reference the EclipseME framework hooks bundle.
Locate the file config.ini. This file is located in the <eclipse install>/configuration directory.
Edit the config.ini with your favorite text editor.
Add the property definition
osgi.framework.extensions=eclipseme.core.hooks
to the configuration file.
If the property already exists, append ",eclipseme.core.hooks" to the end of the current property definition.
It is very important that the line be added before the end-of-file marker. Failure to properly place the new line before the end-of-file marker could cause your Eclipse workbench to fail to start.
Save the configuration file.
Restart Eclipse.
You will be warned if you have projects that are configured for preprocessing, but the necessary configuration changes have not been made. In this case, a warning will be written to the Eclipse workspace log file with text similar to
"Preprocessor invoked, but hook is not installed. Consult the installation instructions for EclipseME."
After you have completed the preprocessor configuration, you will need to use Project -> Clean… to clean and rebuild your project. This will invoke the preprocessor and remove the errors.
 
You must know this:
now eclipseME version is 1.6.6,and preprocess still has some bug.eg:
In symbol defintion dialog,You must enter the symbol set name,but pay attention to it.You can not enter blank in the name.That’s will make you can’t delete a set.
Howerver,If you had done it,You can find symbol is defined in the file in your workspace(workspace.metadata.pluginseclipseme.core)
symbolDefinitions.xml store the information,delete or edit it.

Leave a Reply

Your email address will not be published. Required fields are marked *