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 4c2326889c Update README.md 7 years ago
.gitignore indent fixes, nested conditionals 7 years ago
Makefile big changes; no ints; things work better 7 years ago
README.md Update README.md 7 years ago
builtins.c implicit multiply, negatives, solve 7 years ago
builtins.h added else, order of ops 7 years ago
memory.h stdlib independence, fixes for calculator 7 years ago
ops.c added else, order of ops 7 years ago
ops.h conditionals, returns, cleaner code 7 years ago
parser.c implicit multiply, negatives, solve 7 years ago
parser.h implicit multiply, negatives, solve 7 years ago
script implicit multiply, negatives, solve 7 years ago
shell.c implicit multiply, negatives, solve 7 years ago
shelpers.c stdlib independence, fixes for calculator 7 years ago
shelpers.h conditionals, returns, cleaner code 7 years ago
stack.c big changes; no ints; things work better 7 years ago
stack.h big changes; no ints; things work better 7 years ago
stdlib.h stable for calculator 7 years ago
variable.c implicit multiply, negatives, solve 7 years ago
variable.h implicit multiply, negatives, solve 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 a read() and write(), as they expect a filesystem. This script interpreter intends to be as 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 prints and such), and only requiring a few standard library functions.

To use this program with your own device, you need some malloc/free implementation, atoi, strtof, and snprintf. Some other standard library functions are needed, but something like newlib should be able to provide them without needing any system calls.

Features:

  • function/variable defining through C
  • functions and variables in script
  • conditionals - if/else/end, do/while
  • solve - solve expressions stored in string variables

Todo list:

  • scopes for variables
  • error messages
  • arrays?
  • maybe for loops

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, link all .o's for x86) and use the header files.