Reference

Class

RiGrammar

Name

loadFrom

Description Re-initializes the grammar from a file or URL containing the grammar rules
Syntax
loadFrom(fileOrURL, option);
Parameters
StringFile or URL containing the grammar rules
Function or Object (optional)If a function is supplied (in JavaScript), it will be called after the file is loaded.
If a PApplet(in Java) is passed, it will be used to locate and check the 'data' folder of the sketch for the specified file
Returns
RiGrammarthis RiGrammar
Example
rg = new RiGrammar(); 
rg.loadFrom("grammar.yaml");
Platform Delegates to RiTa.loadString() to load. To check if the object has finished loading, check RiGrammar.ready(). Alternatively, one can use the <script src=...> tag to include the YAML/JSON grammar file in an html page (probably a better option).