Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Call a custom preprocessor and display its results in console

Hi  Petrou,

On Sun, Jun 10, 2012 at 10:52 AM, Lambros Petrou <lambrospower@xxxxxxxx> wrote:
Hello,

I am making a plugin to support more preprocessor commands in C/C++. I made the Content Assist features to work as expected ( with the help of this mailing list ) and I made a Panel for some additional things. Now I'd like to have a button in my panel with the following functionality.

1) Get the text from the open and active editor
2) Call my custom preprocessor executable with some arguments given by a wizard or defaults at first
3) Display the results of the preprocessor at the Console Output or somewhere to be read by the user
In CDT, console functionality is implemented using CommandLauncher. I implemented CDT console fairly recently for scanner discovery to detect compiler built-in settings. It starts at AbstractBuiltinSpecsDetector.runForLanguage(), then you can take a look at BuildRunnerHelper.build() and CommandLauncher code.
The code in AbstractBuiltinSpecsDetector:
- Creates CDT build console which manages separate consoles for each project (like it is done for regular build)
- Connects ErrorParsers and scanner discovery parsers to parse console output
- Provides progress monitor for user to see progress or cancel the build

Andrew

My main problem is the 2-3 points. As for the 3rd one I think this will suffice:


It's the 2nd part which I do not know how to do. Is there any easy way to do this or should I make my own Build System for CDT using my preprocessor ? If I have to, is there any tutorial or guide or even an example I can read ?

Thank you

--
Lambros Petrou



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top