2

I’ve recently been developing a parser with flex/bison bison pair. I was having trouble getting the parser to fit into my application the way I wanted. This included problems with making the parser reentrant and thread safe as well as fitting it into the application framework nicely.

I very recently moved over to flex++/bison++ which offers many advantages to programming in C++ and gives a very clear and manageable way of interfacing and extending the parsers using OOP. Bison++ shares large portion of its interface with original bison. The downside is that documentation surrounding the specific usage is poor. Generally the interface is far more intuitive so this has not been a problem until now.

As development on my parsers has progressed I’ve realised the potential in using GLR in some of the more elaborate parsers.

Question: Is it possible to use GLR in bison++ specifically and how do I activate the option?

Charles
  • 50,943
  • 13
  • 104
  • 142
Dominic Birmingham
  • 325
  • 1
  • 3
  • 11

1 Answers1

1

GNU Bison also supports C++, see http://www.gnu.org/software/bison/manual/bison.html#C++-Parsers. This support includes GLR.

akim
  • 8,255
  • 3
  • 44
  • 60
  • Yes. The interface generated by GNU bison is not as suited to my coding style as bison++ is. Therefore I opted for bison++. I just need to know if GLR is supported. thanks. D – Dominic Birmingham Nov 02 '12 at 10:04
  • Could you please explain what you don't like in its interface, and what you would have preferred? Thanks! – akim Nov 03 '12 at 07:17
  • Flex++/Bison++ has more error detection output (I had none in flex/bison using c++/might have been the way it was setup in the build.). I've had more success in debugging the generated code. I found that the class generated is easier to integrate into an existing codebase / requres less steps / more intuitive to use. I like things that are easy as I tend to spend more time experimenting and less time getting the thing to work. So overall for me it has been an improved experience over using GNU flex/bison with c++. – Dominic Birmingham Nov 08 '12 at 15:52
  • My less rewarding en-devours using GNU Flex and Bison may have much todo with Flex & c++ integration but i was warned against mixing and matching. Flex++/Bison++ seems greatly suited to my needs I just wondered if there was support for GLR parsing so that I could experiment with its capabilities. – Dominic Birmingham Nov 08 '12 at 15:57