JUCE
|
This class compiles littlefoot source code into a littlefoot::Program object which can be executed by a littlefoot::Runner. More...
Public Member Functions | |
Compiler ()=default | |
void | addNativeFunctions (const char *const *functionPrototypes) |
Gives the compiler a zero-terminated list of native function prototypes to use when parsing function calls. More... | |
template<typename RunnerType > | |
void | addNativeFunctions (const RunnerType &runner) |
Tells the compiler to use the list of native function prototypes from this littlefoot::Runner object. More... | |
Result | compile (const String &sourceCode, uint32 defaultHeapSize, const Array< File > &searchPaths={}) |
Compiles a littlefoot program. More... | |
Program | getCompiledProgram () const noexcept |
After a successful compilation, this returns the finished Program. More... | |
Static Public Member Functions | |
static File | resolveIncludePath (String include, Array< File > searchPaths) |
Public Attributes | |
Array< uint8 > | compiledObjectCode |
After a successful call to compile(), this contains the bytecode generated. More... | |
This class compiles littlefoot source code into a littlefoot::Program object which can be executed by a littlefoot::Runner.
|
default |
void littlefoot::Compiler::addNativeFunctions | ( | const char *const * | functionPrototypes | ) |
Gives the compiler a zero-terminated list of native function prototypes to use when parsing function calls.
void littlefoot::Compiler::addNativeFunctions | ( | const RunnerType & | runner | ) |
Tells the compiler to use the list of native function prototypes from this littlefoot::Runner object.
Result littlefoot::Compiler::compile | ( | const String & | sourceCode, |
uint32 | defaultHeapSize, | ||
const Array< File > & | searchPaths = {} |
||
) |
Compiles a littlefoot program.
If there's an error, this returns it, otherwise the compiled bytecode is placed in the compiledObjectCode member.
References Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::clear(), compiledObjectCode, Result::fail(), and Result::ok().
|
noexcept |
After a successful compilation, this returns the finished Program.
References Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::begin(), compiledObjectCode, and Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::size().
|
static |
References String::fromLastOccurrenceOf(), and File::isAbsolutePath().
After a successful call to compile(), this contains the bytecode generated.
A littlefoot::Program object can be created directly from this array.
Referenced by compile(), and getCompiledProgram().