help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to learn bison efficiently if I want to generate parse in C++?


From: Philip Herron
Subject: Re: How to learn bison efficiently if I want to generate parse in C++?
Date: Sat, 02 Jan 2010 06:11:21 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0

On 02/01/2010 04:22, John Levine wrote:
I want to learn to generate parser in C++. However, the book by Levine
only mentioned C++ in the last chapter, Chapter 9. All the examples in
Chapter 1-8 are in C. Instead of reading the book in order, could
somebody let me know if there is a faster way to learn bison to
generate parser in C++?

http://oreilly.com/catalog/9780596155988
Nearly everything it says about C parsers also apply to C++ parsers,
since nearly any C program is also a C++ program.  Just read the book,
you'll learn lots of useful stuff.

R's,
John

Yep John is right nothing changes on the bison side you just write your own code different since its a different language, even though C++ is really a very different language to C, though i don't have much experience with C++ parsers i am just an old man at heart using emacs, C and perl :P

http://www.gnu.org/software/bison/manual/html_node/C_002b_002b-Parsers.html#C_002b_002b-Parsers

Though note it seems a C++ parser wants to be in its own class and might affect how non-terminal rules return values etc or tokens static data is accessed though you'll just have to look at examples.

The bison manual is very good, though i have heard that o'reilly book isnt that great i got the Lex and Yacc o'reilly book it was very good, short and sweet.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]