tags:

views:

156

answers:

3

i am using flex as lexical analyzer and bison as parser generator , but the result of both is console window and i want to have a gui (like ide) for it so how to do that . thanks

+4  A: 

Don't. Leave the compiler as a command line application and instead teach some existing IDE about how to call it and parse its output.

Andrew McGregor
Parsing command-line output? Yuck. How about providing an API for third-parties to use to get a parsed AST or evaluate code etc.
Mike Weller
Fair enough suggestion, but then most of the open-source IDEs don't have much of a way to deal with that sort of thing.
Andrew McGregor
+1  A: 

If you leave it as a command line, you can use Open Source GUI's and plug your compiler into it -- for free you get a brilliant IDE for YOUR compiler ;).

For IDE's that could go well with a custom language:

You'll have a lot of fun writing your custom plugins anyway, but it will be a lot less than writing an IDE yourself.

Another topic however, is writing an interpreter for your language, but I assume that's not what you are aiming for. If so however, you should learn about readline.

And if you're really sure you want to write a simple IDE for your language (writing a complex one is a task for ages), try to at least use a language that is suited for rapid GUI development (C#, Java, others), and get a working Notepad-like application for a base. You can start from there.

Remember however, that almost every known compiler is command-line -- the IDE's just execute and parse the results. There's a reason for that, y'know.

Reasons for command-line:

  • easy to plug into any multi-purpose IDE
  • easy to automate compilation (makefiles, etc)
  • easy to automate other tasks (batch-building, release, deployment, testing)
Kornel Kisielewicz
+1  A: 

What OS are you on? I'll assume linux bc i had difficulties getting bison running on windows although i can compile my bison output in windows.

I didnt have an IDE. I had linux in VMWare with unity on (so i had linux windows on or under windows7 windows) and used programmers notepad to edit the files as its my preferred simple IDE. It has some autocomplete and etc. For my windows build of my compiler i can set a batch file to pnotepad and while changing source i can press F5 which ran the bat file and compiled my source AND it had the output. However developing the compiler i used alt-tab to switch to my linux terminal and ran the build in there.

When i built the compiler on linux it would run automated scripts to see if anything broke and my linux compiler build output errors in a different color. I had no need for an IDE. I do hope i can have some kind of language plugin for visual studios which i already looked into. It looks difficult but this guy has syntax highlight with php in visual studios http://stackoverflow.com/questions/1911254/native-php-support-in-visual-studio-2010/1911267#1911267

acidzombie24