Interpreter interface

This is the documentation of the YANI interpreter interface: command-line parameters description, returned error codes, etc.

The Yani interpreter has the simpliest possible interface, I mean a command-line. To avoid exotic commands, I tried as far as possible to respect GNU command-line guidelines.

Command-line interface

Here are the YANI command-line syntax, reproduced above as it should be displayed when using the –help flag:


Usage : FL0 [OPTION] FILE
Compile and execute FL(0) programs.
-s, --symboltable Display the symbol table
-p, --programmemory Display the program memory
-c, --compile Only compile, do not execute
--help Display this help and exit
--version Print the version number of FL0 and exit
With no FILE, or when FILE is -, read standard input.

Error codes

An error code is always returned when the FL0 interpreter ends. This code can be obtained by typing echo $? at your shell command line. This code has the following meaning:

CodeMeaning
0All is fine
1Unrecognized option on the command line
2Cannot open source file
3Unexpected end of file
4Identifier too long
5String table is full
6Syntax error
7Program memory is full
8Trying to access unauthorized program memory
9Error while executing an instruction (usually a division by zero)
10Stack is full
11Trying to access unallocated element of the stack
12Symbol table is full

Alternatively, when an error happens, the full description of the problem is printed to the standard error stream as well as the part of the fl0 source which caused problem if it happened while scanning or parsing.

Stay tuned!
What others think

«I've just discovered your gUSB winamp plugin which I think is brilliant. Does exactly what I need: lets me add music to my MP3 player straight from winamp.»

Douglas E.