Class: ParserUtils

ParserUtils

A Utility class for parsing (eHTML) templates.
See:
  • mmir.parser.ParserUtils#constructor
Example
mmir.ParserUtils.parse(str, view)

Members

private_currentParsedViewView

privateerrorLevel

-2: internal debug -1: interanl info 0: debug 1: info 2: warn 3: error TODO make this set-able (export getter/setter? use configurationManager?)

privateinstanceParserUtils

Object containing the instance of the class ParserUtils

privateisDebug

Methods

private_attachInternalPrintFunc()

HELPER: attach internal print-functions to all classes (ie. prototypes) in the list

private_parserPrintDebug()

HELPER print debug messages during parsing

private_parserPrintError()

HELPER print errors during parsing

private_parserPrintInfo()

HELPER print informational messages during parsing

private_parserPrintWarning()

HELPER print warnings during parsing
HELPER print internal debug messages during parsing (VERY VERBOSE)
HELPER print internal, informational messages during parsing (VERBOSE)

privateinternalParse()

privateinternalParseJS()

privateparserCreatePrintMessage(prefix, msg, tokenSource, viewObj)

Creates a message with parsing-information. In case the msg is an error message containing relative/incorrect location information, an heuristic will be used to fix the location information; in addition the references location will be extracted from the source-String and a "pointer-String" will be generated, e.g.
	source:   "  	@{  mmmm.['sd']=wer ;}@"
	pointer:  "  	        ^"
Name Type Description
prefix String a prefix for the message
msg String the original message (may contain location-information "line :")
tokenSource Object optional OPTIONAL the token-source, from where the error/message was triggered If the argument has the field tokenSource.offset (Number) if will be used to correct/fix the location information in the original message. If the argument has the fields tokenSource.start (Number) and tokenSource.end (Number), then this will be used to correct/fix the location information in the original message text.
viewObj Object optional OPTIONAL currently not used! (will replace _currentParsedView in the future!)