SPL programs are sequences of statements; most statements look like
method calls or block-opening calls ending with end;.
use a.b.c; — load a modulename.setVar(expr); — assignobj.method(args); — expression statementobj.method(args): then
nested statements, closed by end;
inherit path.spl; (only inside
classDefine) — see
Classes & OOP
Inner blocks that end with end; must
balance with outer blocks. The parser tracks depth by spotting another
... : block start inside the body.
Define with functionDefine.name(a,b):
… end;. Call with
function.name(expr, expr); or
function.call(function.ref(name), ...).
Return with return.number /
return.string /
return.boolean.
Define with classDefine.ClassName():,
optional constructorDefine():,
methodDefine.meth(a):, and
inherit lib.file.spl;. Instantiate with
class.createObj(varName, ClassName);.
Full syntax and calling rules:
Classes & OOP.
test.* for control flow and comparisonsprint.* and return.*this, and methods (see OOP guide)error.try / except