[C] A simple interpreted language

Someone asked me the other-day about writing a simple scripting language, so I got around to playing around a bit, and ended up writing a simple interpreter. In appearance I guess it looks something like a cross between assembly (source, destination) and BASIC, as shown in the below screenshot:

Below is a screenshot of the application after executing the above script:

It supports a simple form of loops, variable storage and retrieval, basic (limited functionality at this point) conditional statements, variable output.
-source code here.
-Project Files here (contains script file)
-sample script file


~ by Rhys Mossom on January 3, 2009.

5 Responses to “[C] A simple interpreted language”

  1. Excuse me sir this seems hawt :O
    I’ll learn Rhys++ now 🙂

  2. nice but try to use a second shorter as the first string.
    e.g. your first string is rofl and the second is lol you will get loll the old variable value never gets deleted and it just overwrites some parts of it

  3. Hey,
    Thanks for pointing that out, constructive criticism is always welcome.I’ll get around to sorting it out sometime when I’ve got time.

  4. The way you’ve designed this code is very much amazing to me – it was enjoyable to look through rather than full of things for the sake of them.

    I will certainly take apart this and learn how it is done, learning how a language can be parsed (apart from my work with BISON/Yacc) would be a fun task!

    Thank you for providing the source and sample scripts.

  5. Alexander,
    Glad you enjoyed my code!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: