Type-checking in bison, C++

Tim Converse <converse@cs.uchicago.edu>
11 Jun 1998 16:14:05 -0400

          From comp.compilers

Related articles
Type-checking in bison, C++ converse@cs.uchicago.edu (Tim Converse) (1998-06-11)
Re: Type-checking in bison, C++ pjmlp@students.si.fct.unl.pt (1998-06-18)
Re: Type-checking in bison, C++ mzraly@world.std.com (1998-06-18)
| List of all articles for this month |
From: Tim Converse <converse@cs.uchicago.edu>
Newsgroups: comp.compilers
Date: 11 Jun 1998 16:14:05 -0400
Organization: Univ. of Chicago, Computer Science
Keywords: yacc, C++, types

I'm new to flex and bison, and am using them to generate code that will
be compiled as C++. The forms I will be parsing correspond to instances
of a complex C++ class, and the ideal thing for me would be to use all
the bison machinery to build up a parse tree where some of the
non-terminals correspond to constructed data members of the class.


However, I doubt that a simple %union declaration,
with some of the alternative types being my C++ classes,
will let me compose classes using the bison type machinery.


Before I go down the road of trying to make that work, does anyone out
there have any experience with this kind of problem? Is there any way
to disable type-checking in bison? is it smart enough to be
reassured by explicit casts? Or am I better off declaring all the
tokens and non-terminals to be integers, and doing the parse-tree
construction "behind the scenes"?


thanks for any suggestions,


        Tim Converse
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.