constructor
Adds a new enum
Adds a new function
Adds a new struct
Adds a new variable.
Executes a library function
Reads this library from a string (reverse of toString)
For use with generateFunctionCallCode. Use this to change what order arguments are pushed to stack before the bytecode for functionCall is generated
Generates bytecode for a function call, or return false
Generates bytecode that will push value of a variable to stack, or return false
Sets value of a variable
Writes this library to a single printable string
if this library is automatically imported
Enums exported by library
functions exported by library. The index is function ID.
library name
structs exported by library
global variables exported by this library. index is ID
if this library is automatically imported
Enums exported by library
functions exported by library. The index is function ID.
name of library
structs exported by library
global variables exported by this library. index is ID
Library dummyLib = new Library("dummyLib",true); dummyLib.addEnum(Enum("Potatoes",["red","brown"])); dummyLib.addEnum(Enum("Colors", ["red", "brown"])); dummyLib.addFunction(Function("main",DataType("void"),[DataType("char[][]")])); dummyLib.addFunction(Function("add",DataType("int"),[DataType("int"),DataType("int")])); dummyLib.addVar(Variable("abc",DataType("char[]"))); Library loadedLib = new Library("blabla",false); loadedLib.fromString(dummyLib.toString); assert(loadedLib.name == dummyLib.name); assert(loadedLib._autoImport == dummyLib._autoImport); assert(loadedLib._functions == dummyLib._functions); assert(loadedLib._structs == dummyLib._structs); assert(loadedLib._enums == dummyLib._enums); assert(loadedLib._vars == dummyLib._vars);
To store a library (could be a script as a library as well)