Object-oriented lex(flex) and yacc(bison) for c++?

Object-oriented lex(flex) and yacc(bison) for c++?

Post by Christian Nels » Fri, 17 Feb 1995 14:04:09



I'm interested in using lex and yacc to implement a parser for one of
my projects, and would really like to know if there's something out
there that facilitates something a little easier to incorperate it into
my c++ code.  I'd like to have a Parser class, which uses the two
utilities.  What's out there that might help, or be of interest?

Any suggestions or pointers would be greatly appreciated...

[I prefer email responses, since I don't have time to read news often.]

-Christian


 
 
 

Object-oriented lex(flex) and yacc(bison) for c++?

Post by Leo Bickne » Fri, 17 Feb 1995 22:43:17




>I'm interested in using lex and yacc to implement a parser for one of
>my projects, and would really like to know if there's something out
>there that facilitates something a little easier to incorperate it into
>my c++ code.  I'd like to have a Parser class, which uses the two
>utilities.  What's out there that might help, or be of interest?

        GNU flex, a lex replacement will generate C++ code with
the "-+" command line option.  There is also an unofficial modification
called "flex++" that does a better (?) job.  I'm not sure about a
yacc replacement.  Personally I use plain lex/yacc and encapsulate the
parser in my own class.  I think that's a more portable solution.

--



http://csugrad.cs.vt.edu/~bicknell/                | Be Giants

 
 
 

Object-oriented lex(flex) and yacc(bison) for c++?

Post by Paul Smi » Sat, 18 Feb 1995 07:40:00


%% Regarding Re: Object-oriented lex(flex) and yacc(bison) for c++?;



    >> I'm interested in using lex and yacc to implement a parser for
    >> one of my projects, and would really like to know if there's
    >> something out there that facilitates something a little easier to
    >> incorperate it into my c++ code.  I'd like to have a Parser
    >> class, which uses the two utilities.  What's out there that might
    >> help, or be of interest?

    lb>      GNU flex, a lex replacement will generate C++ code with
    lb> the "-+" command line option.  There is also an unofficial
    lb> modification called "flex++" that does a better (?) job.  I'm
    lb> not sure about a yacc replacement.  Personally I use plain
    lb> lex/yacc and encapsulate the parser in my own class.  I think
    lb> that's a more portable solution.

I'd take a look at PCCTS first, if I were you.  It's a much improved
combination of lex & yacc which implements n-token lookahead, is easier
to debug, allows you to pass arguments both to and from rules (multiple
arguments and multiple return values), uses an Enhanced BNF (EBNF)
syntax which makes things like lists easier to write & read, and it's
actively under development for new features.

Further, it's totally unencumbered, unlike Bison which causes your
project to fall under the GPL :(.  And it generates quite nice C++
output, as well as good C output.

Check out the newsgroup comp.compilers.tools.pccts for more info, or
check out the ftp site ftp.parr-research.com:/pub/pccts.
--
-------------------------------------------------------------------------------

 Senior Software Engineer                                   Bay Networks, Inc.
-------------------------------------------------------------------------------
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
     These are my opinions--Bay Networks takes no responsibility for them.

 
 
 

Object-oriented lex(flex) and yacc(bison) for c++?

Post by Guy L. Winterboth » Sun, 19 Feb 1995 10:50:26





I have used flex++ but not its yacc companion bison++. The flex++
package did a great job. The best I've seen is PCCTS which combines
the lexical and grammer together in one package. Look for its news
group comp.compiler.tools.pccts (?). for more info

 
 
 

Object-oriented lex(flex) and yacc(bison) for c++?

Post by Orphe » Mon, 20 Feb 1995 05:06:11




>[...]
>Further, it's totally unencumbered, unlike Bison which causes your
>project to fall under the GPL :(.  [...]

What is "the GPL"?

-t
--
  soliloquy -  a shakespearean sound bite.

 
 
 

Object-oriented lex(flex) and yacc(bison) for c++?

Post by Nelson Bro » Fri, 24 Feb 1995 00:49:38




>    GNU flex, a lex replacement will generate C++ code with
>the "-+" command line option.  There is also an unofficial modification
>called "flex++" that does a better (?) job.  I'm not sure about a
>yacc replacement.  Personally I use plain lex/yacc and encapsulate the
>parser in my own class.  I think that's a more portable solution.

Actually, flex++ is just a link to flex.  It check argv[0] and if it's
flex++ it implements the -+ option.
--
                                        Nelson Brown

 
 
 

1. lookinf for Flex.Lex and Bison/Yacc ...

I'm looking for versions of Flex and Bison (or Lex and Yacc)
that run on a Wintel PC.  Although I haven't really used these
tools in the past, I have been givin a .l file, a .y file and some
C source tha thave been used in a Unix environment to create
a parser for WGL, and I've been taksed with porting this
parser to a PC.  Everything I've found on the web so far is
geared to Unix or Linux.  Do DOS/Windows versions of
these tools exist, and if so, can anyone point me to them?
We can purchase them if they are commercial instead of
freeware/shareware.

Carl Husic


2. Naturetech Sparc Laptop review

3. flex/lex/bison/yacc parser for C ?

4. Answerbook and X terminals

5. Yacc/Lex vs Bison/Flex

6. New locking primitive for 2.5

7. lex/flex and yacc/bison

8. Support for Nx586 CPU & Motherboard?

9. lexer/parser generators other than lex/yacc/flex/bison

10. Lex (Flex) and Yacc (or Bison) questions.

11. flex/bison(lex/yacc) help needed.

12. flex,lex,yacc & bison doc???

13. Lex/Yacc Substitute (not bison/flex)