You can learn how to make Forth interpreter if you want to, it is very simple to make.
I can explain the steps:
- Read a word from input stream (ending with any type of white-spaces)
- Look it up in dictionary
- If is in dictionary, do execute/compile word according to what type it is
- If it isn't in dictionary, try to treat it as a number
- Do it again for the next word
You can define the primitives, they don't have to be very much. Most things are defined directly in Forth. See my signature for a example of defining IF and THEN command in Forth.
I made in QBASIC:
http://zzo38computer.cjb.net/prog/QBFORTH/QBFORTH.ZIPThis post has been edited by zzo38 on Aug 21 2008, 09:05 PM