Class mmir.env.grammar.JsccGenerator
Defined in: jsccGenerator.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Generator for executable language-grammars (i.e.
|
Field Attributes | Field Name and Description |
---|---|
The name/ID for the compile engine for the JS/CC compiler
|
Method Attributes | Method Name and Description |
---|---|
JsccGenerator#init(callback)
|
Class Detail
mmir.env.grammar.JsccGenerator()
Generator for executable language-grammars (i.e. converted JSON grammars).
This generator uses JS/CC for compiling the JSON grammar.
The generator for compiling the JSON grammar definitions in www/config/languages/<language code>/grammar.json
can be configured in www/config/configuration.json
:
{ ... "grammarCompiler": "jscc", ... }NOTE: this is the default grammar engine (if there is no setting in
configuration.json
, then this engine will be used)
JS/CC supports grammar generation for: LALR(1) (in difference to jison, JS/CC supports backtracking to certain extend)
- Requires:
- JS/CC
- jQuery.Deferred
- jQuery.extend
- jQuery.ajax
- jQuery.makeArray
Field Detail
JsccGenerator#engineId
The name/ID for the compile engine for the JS/CC compiler
Method Detail
{Deferred}
JsccGenerator#init(callback)
- Parameters:
- {Function} callback Optional
- OPTIONAL the callback that is triggered, when the engine is initialized
- Returns:
- {Deferred} a promise that is resolved, when the engine is initialized
(NOTE: if you use the same function for the
callback
AND the promise, then the function will be invoked twice!)