One thing you can do to optimize a tokenizing interpreter is to
precalculate and store the goto and gosub destination and return
addresses. This way the interpreter does not have to start at line 0
searching sequentially through the tree for the destination for a gosub
but will just go there directly. Of course calculated destinations (ie:
10 if x then gosub x+x+1) totally ruin this system for that line of code.
Basic XE and Basic XL from OSS used this feature in thier "FAST" command
(a sort of post-tokenized address precompiler) to boost performance. --
-----------------------------------------------------------
Jeffrey S. Worley
Technical Services
Bits & Bytes Computer Services Inc.
1979B Hendersonville Road
Asheville, NC 28803
828-684-8953 - voice 0900-1700 five days
828-687-9284 - 24hr fax
Who is General Failure and why is he reading my hard disk?
Technoid(a)Cheta.net
-----------------------------------------------------------