I wrote a small interpretter for a stack-based scripting language I
called 'nscript' a while back. I wasn't very well-versed at C (more of a
C++ guy) so the code might suck a bit.
You can find it here: http://github.com/nikki93/nscript
It was born out of the one-file version here:
http://codepad.org/PaZxOeo8
There are no real 'control structures', even 'if', 'ifelse' etc. are
just functions like 'add'. Check out the long string in the main
function for some example code.
It uses tries for the name lookups. Hashmaps would have been better but
I just wanted to try something new. The trie code was pretty short so I
liked it.
Tell me what you think.
< I'm half-expecting some harsh criticism about my coding style or
something :-( >
-- Nikhilesh S http://www.nikhilesh.infoReceived on Wed Aug 25 2010 - 01:23:27 CEST
This archive was generated by hypermail 2.2.0 : Wed Aug 25 2010 - 00:36:01 CEST