Interface Compiler
access this type via: util.Compiler (provides, requires or uses)
This API provides access to the Dana compiler, allowing source code to be compiled into object code.
Functions
void setSearchPaths(String paths[])
CompileResult compile(char sourceName[], char sourceCode[])
void setSearchPaths(String paths[])
Set the list of search paths available to the compiler, to locate interface and data types (directories that contain a 'resources' folder). The compiler has no search paths by default, so you are required to provide everything needed here; you would usually provide at least the 'DANA_HOME/components' directory here.
CompileResult compile(char sourceName[], char sourceCode[])
Compile a given component. The source code is passed in as a character array, along with a 'name' for that source code which is usually the file name from which it was read. The name is used for compile error output, and is also associated with the compiled component for runtime exceptions. The result (success/fail) and additional data, including the compiled component as a byte array, is returned via a CompileResult instance.