C++ and YACC (?)

David Herron, NPR Lover david at ukma.UUCP
Mon Feb 3 12:30:06 AEST 1986


I'm wanting to learn C++.  As the language is geared towards large
projects what I have in mind is finally fixing up my BASIC interpretor.
(You may remember me posting it to mod.sources last summer).

As I know very little about parsing I will want to use a YACC grammar
spec for the parser.  But will YACC and C++ inter-operate properly?
Or would a new sort of "language hosting" need to be done for C++?
Has anybody done a parser using YACC and C++?

My "working design" at the moment has the grammar also recognizing
the normal user-level commands (i.e. RUN, LIST, etc).  It generates
code lists into an intermediate language, and calls a function to
interpret this intermediate language at appropriate times.  So I won't
have to call yyparse() lots of times (I couldn't figure that one
out when I tried a couple of years ago).  But I will need to be
using some code that's C to call code that's C++.  Or maybe I can
just compile the yacc output with C++ instead of C?

Any suggestions?
-- 
David Herron,  cbosgd!ukma!david, david at UKMA.BITNET, soon, david at uky.csnet.

Experience is something you don't get until just after you need it.



More information about the Comp.lang.c mailing list