Interpreter V3 ============== Minimum Viable Product (MVP): required implementations marked with '*'. Interpreter: * switch-case @@jump via table direct &&jump w/ jump address used as opcode ((-> iter/vx/execute) register: rsp, vsp, ip, top Parser / Compiler: input: memory buffer: (char[], size) input: source text Library: array of struct: flags, name, union(data) Datentypen: uint8 uint16 uint32 bool char * int long float double * str array[] thereof proc & function (type ~ signature) Predefined Procedures: (no return value) * print -- ++ Predefined Functions: min max Predefined Operators: monadic + - ~ ! prefix ++ -- postfix ++ -- * + - * / % & | ^ pruning && || ?: * == != < <= > >= [] () Sprachinhalte: * 1 instruction per line multiple instructions separated by ';' * source is parsed, * compiled * and executed source consists of definitions * and executable instructions * language has some predefined procedures, functions and operators Definitions: type name = value variable global local const [type] name = value immutable value type name(args) { body } procedure or function Executable Instruction: Procedure Call Assignment Flow Control * { block of instructions } Procedure Call: * name ( arg1, arg2, .. ) name arg1, arg2, .. tbd. Assignment: * name = value name[index] = value Flow Control: * if(cond) instr elif (cond) instr else instr if(cond) instr elif (cond) instr else instr while(cond) instr tbd. * do instr for(start,incr,cond) instr * while(cond) tbd. return [value] Expressions (Values): literal_value * ±123 ±123.4 ±123.4e±5 'A' 'ABCD' 0xABCD 0b1111 * "abcde" variable const function call predefined monadic prefix and postfix operator * predefined diadic operator predefined triadic operator .