Interpreting C++

D.J.Tallis@cen.exeter.ac.uk (Dan Tallis)
Tue, 23 Mar 1993 10:27:05 GMT

          From comp.compilers

Related articles
Interpreting C++ D.J.Tallis@cen.exeter.ac.uk (1993-03-23)
Re: Interpreting C++ hlf@nic.cerf.net (1993-03-25)
Re: Interpreting C++ mehrotra@csrd.uiuc.edu (1993-03-29)
| List of all articles for this month |

Newsgroups: comp.compilers,comp.lang.c++
From: D.J.Tallis@cen.exeter.ac.uk (Dan Tallis)
Keywords: interpreter, C++, comment
Organization: University of Exeter, UK.
Date: Tue, 23 Mar 1993 10:27:05 GMT

Has anyone out there got any experience of -interpreting- C++ (as opposed
to compiling)?


I am involved in a research project (to do with visual programming
environments) where it would (perhaps) be useful to be able to interpret
C++ code (we're still undecided - hence your thoughts and experiences
would be appreciated...).


I realise this is a major undertaking from scratch, and since this is not
really part of the _research_, we wouldn't want to get bogged down in it,
so...


  - What if we ASSUME the program is CORRECT, both syntactically and
      semantically - ie. assume a compiler could happily generate an
      executable.


My feeling is that this cuts down much of the work - no need for error
rules in the grammar (we'll use Jim Roskind's C++ grammar), and we can
forget checking all the semantic constraints, etc. This leaves us with
maintaining a symbol table and data values, and interpreting the control
structures. Hmmm... could get tricky interfacing with library routines I
guess...?


Well, what do you think? The question is really:


Q) How much work is involved in writing a C++ interpreter GIVEN THE
      ASSUMPTIONS ABOVE and any others you think would simplify the task?


All comments, thoughts, experiences, anything that could help our
decision, greatly appreciated.


Email preferred. Thanks.


Dan
[DJTallis@cen.ex.ac.uk]
[Yacc automatically does full syntactic error checking, although its default
recovery scheme is to give up at the first error. You'll probably find that
any sort of useful C++ interpreter is still an enormous amount of work. -John]
--


Post a followup to this message

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