[futurebasic] Re: [FB] Compiler

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2006 : Group Archive : Group : All Groups

From: Stu Cram <stu@...>
Date: Mon, 2 Jan 2006 22:37:43 -0600
On Jan 2, 2006, at 6:40 PM, Brian Heibert wrote:
> Hi,
> Al Stafferri Jr.  told me sortof how to build a compiler
> at least what he does
> I need to have a runtime application
> and I need to send the source code the user enters into that runtime 
> app
> I am using FN ParseEFLines to interpret the code
> you can find this in Tools-Scripts-Ken's Scripts-Edit Field Parse Lines
> How would I send the code from the edit field to the runtime 
> application
> and then have the runtime application parse the code when the code 
> isn't in a edit field
> and also save a copy of the runtime app with the code in it?
> Sorry for so many complex questions
> Brian
> --

BRIAN...

KISS - Keep It Short and Simple!

So far, you are 'interpreting' the instructions in the edit field when 
you parse the instructions in it line by line and do something with 
them. Your 'WINDOW, 'PRINT', 'ALERT' and other instructions get typed 
in the editor edit field and their results are shown in some other 
window. Because the original text for the 'program' is decoded line by 
line, this is known as an interpreter. You're on track, sort of, 
keeping it all together; there's no sense making your project more 
complex that it need be.

A compiler, on the other hand, will translate the program's 
instructions into corresponding machine language binary codes for the 
target computer. The result would be a new file that is a stand-alone 
application meaning it would run by itself without the editor program 
that was used to enter the HBasic instructions. I suspect you aren't 
familiar with machine level coding for the Mac.

Stick with your interpreter as it is. Don't make it more complex by 
trying to send an edit field to another program that essentially will 
do what you've already started. You might never finish it, but you 
should learn a lot along the way.

Regards,
-Stu