Update README.md
parent
28447df15a
commit
4c2326889c
@ -1,24 +1,18 @@
|
|||||||
# interpreter
|
# 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 interpreter aims 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.
|
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, and string functions like those in string.h, atoi, and snprintf. Some of these functions may become coded in so that a standard library isn't required.
|
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.
|
||||||
|
|
||||||
Only a few commands are built in to the interpreter:
|
Features:
|
||||||
* set - set variables
|
* function/variable defining through C
|
||||||
* func/end - define functions
|
* functions and variables in script
|
||||||
* if/end - if conditional
|
* conditionals - if/else/end, do/while
|
||||||
* do/while
|
* solve - solve expressions stored in string variables
|
||||||
* ret - return value from function
|
|
||||||
|
|
||||||
Other features:
|
Todo list:
|
||||||
* function/variable defining in c
|
* scopes for variables
|
||||||
* expression solving
|
|
||||||
* no local variables
|
|
||||||
* whitespace hopefully ignored
|
|
||||||
|
|
||||||
Soon:
|
|
||||||
* error messages
|
* error messages
|
||||||
* arrays?
|
* arrays?
|
||||||
* maybe for loops
|
* 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 parser.o and use the header files.
|
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.
|
||||||
|
Loading…
Reference in New Issue