Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Basic Compiler > Re: BASIC gramm...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 10 of 14 Topic 75 of 149
Post > Topic >>

Re: BASIC grammar

by arargh403NOSPAM@[EMAIL PROTECTED] Mar 8, 2004 at 03:47 PM

On Mon, 08 Mar 2004 13:58:24 -0600, "Stephen J. Rush"
<steverush1@[EMAIL PROTECTED]
> wrote:

<snip>
>If you've never tried it before, start with the smallest subset of BASIC
>that you can write nontrivial programs in.  I've never tried to analyze
>it, but I suspect that QBasic's grammar isn't LL1.  You can write a
>recursive-descent parser in any language. It helps if the language
>supports recursive functions, so you don't have to maintain your own
>stack, but you could theoretically do it on a Turing machine, given a few
>man-centuries of programming effort.
BCET is a (working) Basic compiler written in Basic.  For the portions
of the language currently implimented, you need the current token, and
the next token to decide what to do.  Is that LL1?  I never really
bothered to figure out just what all of those mean.
>
>Seriously, it's been done in Pascal and QuickBasic.  I worked through
most
>of Jack Crenshaw's "Let's Build A Compiler!" tutorial (see
>http://compilers.iecc.com/crenshaw/),
translating his Pascal code into
>QuickBasic as I went along.  It wasn't that hard, given QB's Pascal -
like
>control structures and the trick of using strings to represent sets, so
>that INSTR() can serve as the membership function.  Crenshaw's "Tiny"
>language is far smaller than any BASIC, but I wound up with a compiler
>that actually worked (under real-mode DOS; *don't* try this in a
>Windows environment).
I read Crenshaw's tutorial, and for me, it make a nice overview, but I
didn't really get anything new out of it.  But, it is a good starting
point.
>

<snip>

BTW, BCET includes utilities to dump/format it's internal work files.
By looking at the formated work file, and the intermediate files, you
could get a pretty good idea how I go from basic source to assmbler.

2nd URL in the Sig.

-- 
Arargh403 at [drop the 'http://www.'
from ->] http://www.arargh.com
BCET Basic Compiler Page: http://www.arargh.com/basic/index.html

To reply by email, remove the garbage from the reply address.




 14 Posts in Topic:
BASIC grammar
Johnathan <zork_666@[E  2004-03-09 01:35:52 
Re: BASIC grammar
erewhon@[EMAIL PROTECTED]  2004-03-08 14:51:57 
Re: BASIC grammar
Johnathan <zork_666@[E  2004-03-09 04:52:32 
Re: BASIC grammar
"Stephen J. Rush&quo  2004-03-08 13:58:24 
Re: BASIC grammar
Johnathan <zork_666@[E  2004-03-09 08:02:15 
Re: BASIC grammar
arargh403NOSPAM@[EMAIL PR  2004-03-08 16:01:11 
Re: BASIC grammar
Johnathan <zork_666@[E  2004-03-09 19:16:56 
Re: BASIC grammar
arargh403NOSPAM@[EMAIL PR  2004-03-09 14:29:56 
Re: BASIC grammar
arargh403NOSPAM@[EMAIL PR  2004-03-10 02:14:26 
Re: BASIC grammar
arargh403NOSPAM@[EMAIL PR  2004-03-08 15:47:38 
Re: BASIC grammar
"Markku Alén" &  2004-03-08 23:30:26 
Re: BASIC grammar
Johnathan <zork_666@[E  2004-03-09 19:22:03 
Re: BASIC grammar
"Markku Alén" &  2004-03-21 02:31:17 
Re: BASIC grammar
"Scott Moore" &  2004-03-10 08:22:41 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 22:44:35 CDT 2008.