Reference

Class

RiGrammar

Name

expand

Description Expands a grammar from the supplied rule. If no rule is provided the $start and <start> symbols will be checked respectively.

If a context is needed, it should be passed in when the grammar is created (see 3rd example below).
Example
rg = RiTa.grammar(rules); 
result = rg.expand();

rg = RiTa.grammar(rules);
result = rg.expand(ruleName);

rg = RiTa.grammar(rules, context);
result = rg.expand(ruleName);
Parameters
Stringthe rule name to be expanded (optional)
Returns
Stringthe result of the expansion (or an error if the rule is not found)
Syntax
expand();
expand(ruleName);
Platform Java / JavaScript