You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Clyne Sullivan 3fc57ae22f many bug fixes, minimizing memory/leaks 7 years ago
.gitignore indent fixes, nested conditionals 7 years ago
Makefile many bug fixes, minimizing memory/leaks 7 years ago
README.md Merge branch 'master' of http://code.bitgloo.com/clyne/interpreter 7 years ago
builtins.c many bug fixes, minimizing memory/leaks 7 years ago
builtins.h interpreter overhaul, should be better 7 years ago
old.tar.gz interpreter overhaul, should be better 7 years ago
ops.c interpreter overhaul, should be better 7 years ago
ops.h interpreter overhaul, should be better 7 years ago
parser.c many bug fixes, minimizing memory/leaks 7 years ago
parser.h many bug fixes, minimizing memory/leaks 7 years ago
shell.c interpreter overhaul, should be better 7 years ago
test1 interpreter overhaul, should be better 7 years ago
test2 interpreter overhaul, should be better 7 years ago
test3 interpreter overhaul, should be better 7 years ago
test4 interpreter overhaul, should be better 7 years ago
variable.h interpreter overhaul, should be better 7 years ago

README.md

interpreter

This project aims to provide a very minimal scripting language for embedded systems. Many other languages already exist, such as Lua, Tcl, or BASIC; however, most implementations require certain system calls like read() and write(), as they expect a filesystem. This interpreter wants to be as system-independent and portable as possible: parsing script from strings one at a time, having minimal built-in functions (so the user can define their own IO calls and such), and only requiring a few standard library functions.

To use this program with your own device, you'll need some malloc/free implementation, and a freestanding standard library. Newlib works well for this; however, functions like atoi() and snprintf() will probably need to be rewritten (if you don't have an _sbrk defined).

Interpreter features:

  • Variable/function definition - in C and in script
  • if/else and while loops
  • a solve function to parse strings at runtime

Inconvenient features:

  • no local variables
  • whitespace sometimes ignored

Some TODO items:

  • fix all memory leaks
  • add better error messages
  • arrays?
  • for loops

This project can be made for the host system (make) or an ARM system (make arm). This project is still in heavy development, so don't expect much. To include it in your own project, just link in libinterp.a (for ARM) and use the header files.