Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/3/85; site ukma.UUCP Path: utzoo!watmath!clyde!cbosgd!ukma!david From: david@ukma.UUCP (David Herron, NPR Lover) Newsgroups: net.wanted.sources Subject: Re: BASIC compiler needed Message-ID: <1889@ukma.UUCP> Date: Sat, 22-Jun-85 01:38:43 EDT Article-I.D.: ukma.1889 Posted: Sat Jun 22 01:38:43 1985 Date-Received: Sun, 23-Jun-85 03:31:39 EDT References: <1524@dalcs.UUCP> Reply-To: david@ukma.UUCP (David Herron, NPR Lover) Organization: Univ. of KY Mathematical Sciences Lines: 48 In article <1524@dalcs.UUCP> silvert@dalcs.UUCP (Bill Silvert) writes: >I need a BASIC compiler, translator, or interpreter, so that BASIC programs can >be run on my machine. It doesn't have to be very complete, since I am willing >to make changes by hand to fix up the code, but I would like to avoid recoding >from scratch every time I have a short BASIC program to run. I have a BASIC interpretor I wrote a couple of years ago. Unfortunately it never got finished. er...rather....it worked once and I was improving it, then got my current job and was side tracked and never finished improving it. I had a YACC grammar that parsed the BASIC expressions into postfix expressions. The postfix expressions were written as a stack based 0 (actually, sometimes 1) address machine. The interpretor was written in C on a PDP-11 running V7. This method was chosen because it was a LOT easier to interpret a postfix expression that an infix expression. The improvements I was doing was going to fix the grammar so it could EITHER drive the postfix interpretor directly or indirectly (by storing the interpretor code in ascii in a source file). The running version ran well, was easy to expand, etc. On the PDP-11 (an LSI-11/23 (not +)) it ran the "for i=1 to 10000 ... next i" benchmark at the same speed as the TRS-80 Color Computer the on the next table. (This was with integer on the PDP-11, and the interpreted floating pt on the Color Computer, running w/o the speedup poke). Anybody interested in seeing this BASIC interpretor? I can post it to the net if you like. Or privately too. whaddaya say? BTW. As an experiment a few months ago, I ran lint on this code. It didn't even whimper. (I'm sure there was a FEW complaints, but not many). And it was written on a machine that wouldn't even SUPPORT lint (under V7 you HAD to have i/d to run lint, 11/23 don't have that). -- --- David Herron --- ARPA-> ukma!david@ANL-MCS.ARPA or ukma!david<@ANL-MCS> --- or david%ukma.uucp@anl-mcs.arpa --- Or even anlams!ukma!david@ucbvax.arpa --- UUCP-> {ucbvax,unmvax,boulder,oddjob}!anlams!ukma!david --- {ihnp4,decvax,ucbvax}!cbosgd!ukma!david "It's *Super*User* to the rescue!"