Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to handle a flex / bison parser in a QNX C/C++ project: (3 Items)
   
How to handle a flex / bison parser in a QNX C/C++ project  
Hi everybody,

I'm using IDE 4.7 for QNX 6.5. I would like to add a flex/bison parser in a QNX C/C++ project. I've added the .l and the
 .y files in the project but the build process doesn't do anything with them. 
What do I need to change to ensure that flex and bison are called ?

Best regards
Re: How to handle a flex / bison parser in a QNX C/C++ project  
Hi,

I recently had to figure this out for something else (State Machine Compiler) so thought I'd share what I did, although 
it may not be useful to you since your post is > 1 month old. Maybe this isn't the best way to do it, but it was the 
only reliable way I found.

I had to create a custom Builder (Project -> Properties -> Builders -> New) and then I used another makefile to specify 
the translation from my source to C sources and headers. Apparently (after searching the WWW) it's a common thing to 
have to do and people typically use Ant or integrate into the makefiles, although the awkwardness comes from Eclipse. 
Later versions of the CDT have an easier way to set up external build commands. I then made it run in the list before "
QNX Builder" so that the sources would be available for the real build. The custom build settings were:

Main:
    Location: ${system_path:make}
    Working directory: ${project_loc}/src
    Arguments: -fmakefile.smc ${build_type}

Refresh:
    Refresh resources upon completion: checked
    The project containing the selected resource: checked
    Recusrsively include sub-folders: unchecked

Environment: Leave everything at default

Build Options:
    Allocate Console: checked
    Launch in background: unchecked
    After a clean: checked
    During manual builds: checked
    During auto builds: unchecked
    During a clean: checked

My custom makefile (makefile.smc) is as attached.

You could probably also figure a way to add it to the QNX Makefile (or common.mk) but I could not get it to reliably 
translate into C source before the main build.

Hope that helps.
Attachment: Text makefile.smc 1.74 KB
Re: How to handle a flex / bison parser in a QNX C/C++ project  
Thank you very much for the tip.