Do flex and bison support C++?
I want to write my action for rules and grammar in lex and yacc in c++. But I am not sure, whether flex and bison supports this. In case it does not support, what do i need to do, if i want to write my actions in c++ and C code. Do i need to change the source code in lex and yacc or just the the way and procedure of compilation like suppose i need to use flex++ instead of flex, do i need to just write flex++ during compilation instead of flex or do i need to change the coding in source files also(lex and yacc) ?
I read from man pages that there's flex++ also available for c++. But din't understand much as there was not much information given about that. So, I have posted this thread here. I am using fedora core 2. So what should i do? Hope to get a reply from you soon. Thank you. Cheers Ankit Parikh:Pengy: |
|
thanks for the info..i'll try according to the info given on the webpage...
|
I welcome more suggestions, because i read that for lex only C code can be used in action while in yacc, C++ can be used. And i am using flex not lex.
Also I want to use only C++ , as I am using STL (standard template library). So hope to get help regarding this. Thank you. |
flex++ accepts C++ code.
Try info flex++ |
ok. so i just need to write flex++ while compilation right?
I'll try that. Thanks for the info. |
Hi all,
A little bit late reply, but I just discovered flex and bison a couple of months ago, and I am now in the way of my 2nd assembler with flex and bison. For me these tools are great. Have a look here for flex and bison c++ support: http://idlebox.net/2007/flex-bison-cpp-example/ Enjoy. |
flex++ and bison++ support writing actions in c++ and also support encapsulating the parser and scanner within a class definition.
I believe Ubuntu offers flex++ and bison++ packages. For other distributions and also for flex++/bison++ code examples, download here: http://code.google.com/p/flexpp-bisonpp/ |
All times are GMT -5. The time now is 12:40 AM. |