Class: ParserUtils

mmir.parser. ParserUtils

mmir.parser.ParserUtils

A Utility class for parsing (eHTML) templates.
Utility functions for parsing templates (and template elements, e.g. JS-parts of template expressions)
Example
mmir.require('mmirf/parseUtils').parse(str, view)

Methods

Parse a text as view template (e.g. *.ehtml files).
Name Type Description
rawTemplateString String the text that should be parsed
view Object optional (optional) the view to which the rawTemplateString belongs (only used for error messages)
Returns:
Type Description
mmir.parser.ParsingResult the parsing result

parseJS(rawTemplateString, parseEntryRuleName, view){mmir.parser.ParsingResult}

Parse a text as JavaScript.
Name Type Description
rawTemplateString String the text that should be parsed
parseEntryRuleName String optional (optional) specifies the JavaScript element that should be parsed for
view Object optional (optional) the view to which the rawTemplateString belongs (only used for error messages)
Returns:
Type Description
mmir.parser.ParsingResult the parsing result