Get Started

To have acces to OwlSL classes from your source code you'll need to include the file "owlsl/cwl.h".

All the classes needed to load, parse and run OwlSL script files can be found within the namespace "owlsl".

The class method cwl.open(path) loads and parses the given file.
The class method cwl.compile() compiles it into bytecode.
And then to run a method from a script file you'd invoke cwl.call(classname, method_name) or cwl.static_call(classname, method_name).

So, a c++ application that loads an OwlSL script file and runs a class method statically would look like this:
And the script file:

OwlSL currently comes with a few types of it's own like: number (double), text (wide char string), bool, list<T> (std::deque<T>) and ref<T> (kind of a shared pointer) but you can define your own and make them work in the way you want.

The folowing script shows their usage:

You may note that the type list<T> has a method print which doesn't really makes sense, it's a hardcoded method that went there for testing purporses and will be removed shortly. So for the sake of being correct, lets expose our own C++ class for handling console output. So in main.cpp we will add:

And in the main function: And now in our script we will be able to use the new type console: