mmir-lib
Version:
MMIR (Mobile Multimodal Interaction and Relay) library
2 lines • 14.4 kB
JavaScript
define(["mmirf/antlr3"],function(E){var r=function(t,e){e=e||new E.antlr.runtime.RecognizerSharedState,function(){r.__mmirExtend(this)}.call(this),this.dfa4=new r.DFA4(this),r.superclass.constructor.call(this,t,e)};return E.antlr.lang.augmentObject(r,{EOF:-1,CHAR:4,NL:5,END:6,EscapeExit:7,ESC_DoEnter:8,COMMENT:9,DoEnterBlock:10,DoEnterStatement:11,DoEnterIncludeScript:12,DoEnterIncludeStyle:13,DoEnterLocalize:14,DoEnterYieldDeclaration:15,DoEnterYieldContent:16,DoEnterIfStatement:17,DoEnterElseStatement:18,DoEnterForStatement:19,DoEnterDeclareVar:20,DoEnterHelper:21,DoEnterRender:22,END_SCRIPT:23}),function(){var a=E.antlr.runtime.Token.HIDDEN_CHANNEL;E.antlr.runtime.Token.EOF;E.antlr.lang.extend(r,E.antlr.runtime.Lexer,{EOF:-1,CHAR:4,NL:5,END:6,EscapeExit:7,ESC_DoEnter:8,COMMENT:9,DoEnterBlock:10,DoEnterStatement:11,DoEnterIncludeScript:12,DoEnterIncludeStyle:13,DoEnterLocalize:14,DoEnterYieldDeclaration:15,DoEnterYieldContent:16,DoEnterIfStatement:17,DoEnterElseStatement:18,DoEnterForStatement:19,DoEnterDeclareVar:20,DoEnterHelper:21,DoEnterRender:22,END_SCRIPT:23,getGrammarFileName:function(){return"MmirTemplate.g"}}),E.antlr.lang.augmentObject(r.prototype,{mEscapeExit:function(){var t=this.EscapeExit,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("}@@");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),r=this.processEscape("}@","ESCAPE_exit");r.start=n.getStartIndex(),r.endOffset=1,r.end=n.getStopIndex()+1,r.type=this.INTERNAL_ESCAPE_EXIT,this.state.type=t,this.state.channel=e},mESC_DoEnter:function(){var t=this.ESC_DoEnter,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("@@");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),r=this.processEscape("@","ESCAPE_enter");r.start=n.getStartIndex(),r.endOffset=1,r.end=n.getStopIndex()+1,r.type=this.INTERNAL_ESCAPE_ENTER,this.state.type=t,this.state.channel=e},mDoEnterBlock:function(){var t=this.DoEnterBlock,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("@{");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),r=this.enterBlock(e,"main",this.processBlock,"BLOCK");r.start=n.getStartIndex(),r.endOffset=3,r.end=r.end+3,r.type=this.INTERNAL_BLOCK,e=a,this.state.type=t,this.state.channel=e},mDoEnterStatement:function(){var t=this.DoEnterStatement,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("@(");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),r=this.enterScript(e,"main",this.processStatement,"STATEMENT");r.start=n.getStartIndex(),r.endOffset=2,r.end=r.end+2,r.type=this.INTERNAL_STATEMENT,e=a,this.state.type=t,this.state.channel=e},mDoEnterIncludeScript:function(){var t=this.DoEnterIncludeScript,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("@script(");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),r=this.enterJavaScript(e,"embeddedCallStatement",this.processIncludeScript,"INCLUDE_SCRIPT");r.start=n.getStartIndex(),r.endOffset=2,r.end=r.end+2,r.type=this.INTERNAL_INCLUDE_SCRIPT,e=a,this.state.type=t,this.state.channel=e},mDoEnterIncludeStyle:function(){var t=this.DoEnterIncludeStyle,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("@style(");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),r=this.enterJavaScript(e,"embeddedCallStatement",this.processIncludeStyle,"INCLUDE_STYLE");r.start=n.getStartIndex(),r.endOffset=2,r.end=r.end+2,r.type=this.INTERNAL_INCLUDE_STYLE,e=a,this.state.type=t,this.state.channel=e},mDoEnterLocalize:function(){var t=this.DoEnterLocalize,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("@localize(");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),r=this.enterJavaScript(e,"embeddedCallStatement",this.processLocalize,"LOCALIZE");r.start=n.getStartIndex(),r.endOffset=2,r.end=r.end+2,r.type=this.INTERNAL_LOCALIZE,e=a,this.state.type=t,this.state.channel=e},mDoEnterDeclareVar:function(){var t=this.DoEnterDeclareVar,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("@var(");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),r=this.enterJavaScript(e,"embeddedCallStatement",this.processDeclareVar,"DECLARE_VAR");r.start=n.getStartIndex(),r.endOffset=2,r.end=r.end+2,r.type=this.INTERNAL_VAR_DECLARATION,e=a,this.state.type=t,this.state.channel=e},mDoEnterHelper:function(){var t=this.DoEnterHelper,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("@helper(");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),r=this.enterJavaScript(e,"embeddedDataCallStatement",this.processHelperFunction,"HELPER_FUNCTION");r.start=n.getStartIndex(),r.endOffset=2,r.end=r.end+2,r.type=this.INTERNAL_HELPER,e=a,this.state.type=t,this.state.channel=e},mDoEnterRender:function(){var t=this.DoEnterRender,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("@render(");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),r=this.enterJavaScript(e,"embeddedRenderControlStatement",this.processRenderPartial,"RENDER_PARTIAL");r.start=n.getStartIndex(),r.endOffset=2,r.end=r.end+2,r.type=this.INTERNAL_RENDER,e=a,this.state.type=t,this.state.channel=e},mDoEnterYieldDeclaration:function(){var t=this.DoEnterYieldDeclaration,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("@yield(");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),r=this.enterJavaScript(e,"embeddedCallStatement",this.processYieldDeclaration,"YieldDeclaration");r.start=n.getStartIndex(),r.endOffset=2,r.end=r.end+2,r.type=this.INTERNAL_YIELD_DECLARATION,e=a,this.state.type=t,this.state.channel=e},mDoEnterYieldContent:function(){var t=this.DoEnterYieldContent,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("@contentFor(");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),r=this.enterJavaScript(e,"embeddedCallStatement",this.processYieldContentParam,"YieldContentParam");r.start=n.getStartIndex(),(r=this.enterContent(e,"content",this.processYieldContent,"YieldContent",r)).endOffset=3,r.end=r.end+3,r.type=this.INTERNAL_YIELD_CONTENT,e=a,this.state.type=t,this.state.channel=e},mDoEnterIfStatement:function(){var t=this.DoEnterIfStatement,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("@if(");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),r=this.enterJavaScript(e,"embeddedIfExpressionFragment",this.processIfExpr,"IfExpr");r.start=n.getStartIndex(),(r=this.enterContent(e,"content",this.processIfContent,"IfContent",r)).endOffset=3,r.end=r.end+3,r.type=this.INTERNAL_IF,e=a,this.state.type=t,this.state.channel=e},mDoEnterElseStatement:function(){var t=this.DoEnterElseStatement,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("@else");var n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),i=this.enterContent(e,"content",this.processElse,"ELSE",i);i.start=n.getStartIndex(),i.endOffset=3,i.end=i.end+3,i.type=this.INTERNAL_ELSE,e=a,this.state.type=t,this.state.channel=e},mDoEnterForStatement:function(){var t=this.DoEnterForStatement,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=this.getCharIndex();this.match("@for(");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,r,this.getCharIndex()-1),r=this.enterJavaScript(e,"embeddedForControlStatement",this.processForControl,"ForControl");r.start=n.getStartIndex(),(r=this.enterContent(e,"content",this.processForContent,"ForContent",r)).endOffset=3,r.end=r.end+3,r.type=this.INTERNAL_FOR,e=a,this.state.type=t,this.state.channel=e},mNL:function(){var t=this.NL,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=4;switch(this.input.LA(1)){case"\r":n="\n"==this.input.LA(2)?1:2;break;case"\n":n=1;break;case"\u2028":n=3;break;case"\u2029":n=4;break;default:throw new E.antlr.runtime.NoViableAltException("",2,0,this.input)}switch(n){case 1:var r=2;1===(r="\r"==this.input.LA(1)?1:r)&&this.match("\r"),this.match("\n");break;case 2:this.match("\r");break;case 3:this.match("\u2028");break;case 4:this.match("\u2029")}this.state.type=t,this.state.channel=e},mEND_SCRIPT:function(){var t=this.END_SCRIPT,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;this.match("}@"),this.state.type=t,this.state.channel=e},mCHAR:function(){var t=this.CHAR,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;if(!("\0"<=this.input.LA(1)&&this.input.LA(1)<="\t"||"\v"<=this.input.LA(1)&&this.input.LA(1)<="\f"||""<=this.input.LA(1)&&this.input.LA(1)<="")){var n=new E.antlr.runtime.MismatchedSetException(null,this.input);throw this.recover(n),n}this.input.consume(),this.state.type=t,this.state.channel=e},mCOMMENT:function(){var t=this.COMMENT,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL,n=null,r=null,i=this.getCharIndex();this.match("@*");n=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,i,this.getCharIndex()-1);t:for(;;){var a,s=2,o=this.input.LA(1);if("*"==o?"@"==(a=this.input.LA(2))?s=2:("\0"<=a&&a<="?"||"A"<=a&&a<="")&&(s=1):("\0"<=o&&o<=")"||"+"<=o&&o<="")&&(s=1),1!==s)break t;this.matchAny()}i=this.getCharIndex();this.match("*@");r=new E.antlr.runtime.CommonToken(this.input,E.antlr.runtime.Token.INVALID_TOKEN_TYPE,E.antlr.runtime.Token.DEFAULT_CHANNEL,i,this.getCharIndex()-1),i=this.processComment("COMMENT");i.start=n.getStartIndex(),i.endOffset=1,i.end=r.getStopIndex()+1,i.type=this.INTERNAL_COMMENT,this.state.type=t,this.state.channel=e},mEND:function(){var t=this.END,e=E.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;this.match(this.EOF),this.emit(E.antlr.runtime.Token.EOF_TOKEN),this.isDebug&&this.printDebug("exit text"),this.state.type=t,this.state.channel=e},mTokens:function(){switch(this.dfa4.predict(this.input)){case 1:this.mEscapeExit();break;case 2:this.mESC_DoEnter();break;case 3:this.mDoEnterBlock();break;case 4:this.mDoEnterStatement();break;case 5:this.mDoEnterIncludeScript();break;case 6:this.mDoEnterIncludeStyle();break;case 7:this.mDoEnterLocalize();break;case 8:this.mDoEnterDeclareVar();break;case 9:this.mDoEnterHelper();break;case 10:this.mDoEnterRender();break;case 11:this.mDoEnterYieldDeclaration();break;case 12:this.mDoEnterYieldContent();break;case 13:this.mDoEnterIfStatement();break;case 14:this.mDoEnterElseStatement();break;case 15:this.mDoEnterForStatement();break;case 16:this.mNL();break;case 17:this.mEND_SCRIPT();break;case 18:this.mCHAR();break;case 19:this.mCOMMENT();break;case 20:this.mEND()}}},!0),E.antlr.lang.augmentObject(r,{DFA4_eotS:"",DFA4_eofS:"",DFA4_minS:"\0@(@c",DFA4_maxS:"@{@t",DFA4_acceptS:"\b\t\n\v\f\r",DFA4_specialS:"\0}>",DFA4_transitionS:["\n2<ᾪ\udfd6","\b",'\v\t"\r\f\n',"","","","","","","","","","","","","","","","","","","","","","","",""]}),E.antlr.lang.augmentObject(r,{DFA4_eot:E.antlr.runtime.DFA.unpackEncodedString(r.DFA4_eotS),DFA4_eof:E.antlr.runtime.DFA.unpackEncodedString(r.DFA4_eofS),DFA4_min:E.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(r.DFA4_minS),DFA4_max:E.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(r.DFA4_maxS),DFA4_accept:E.antlr.runtime.DFA.unpackEncodedString(r.DFA4_acceptS),DFA4_special:E.antlr.runtime.DFA.unpackEncodedString(r.DFA4_specialS),DFA4_transition:function(){for(var t=[],e=r.DFA4_transitionS.length,n=0;n<e;n++)t.push(E.antlr.runtime.DFA.unpackEncodedString(r.DFA4_transitionS[n]));return t}()}),r.DFA4=function(t){this.recognizer=t,this.decisionNumber=4,this.eot=r.DFA4_eot,this.eof=r.DFA4_eof,this.min=r.DFA4_min,this.max=r.DFA4_max,this.accept=r.DFA4_accept,this.special=r.DFA4_special,this.transition=r.DFA4_transition},E.antlr.lang.extend(r.DFA4,E.antlr.runtime.DFA,{getDescription:function(){return"1:1: Tokens : ( EscapeExit | ESC_DoEnter | DoEnterBlock | DoEnterStatement | DoEnterIncludeScript | DoEnterIncludeStyle | DoEnterLocalize | DoEnterDeclareVar | DoEnterHelper | DoEnterRender | DoEnterYieldDeclaration | DoEnterYieldContent | DoEnterIfStatement | DoEnterElseStatement | DoEnterForStatement | NL | END_SCRIPT | CHAR | COMMENT | END );"},specialStateTransition:function(t,e){var n=t,t=function(t,e){if(0===t){e=e.LA(1);if(t=-1,0<=(t="}"==e?1:"@"==e?2:"\n"==e||"\r"==e?3:"\u2028"==e?4:"\u2029"==e?5:"\0"<=e&&e<="\t"||"\v"<=e&&e<="\f"||""<=e&&e<="?"||"A"<=e&&e<="|"||"~"<=e&&e<="‧"||""<=e&&e<=""?6:7))return t}}.call(this.recognizer,t,e);if(!E.antlr.lang.isUndefined(t))return t;e=new E.antlr.runtime.NoViableAltException(this.getDescription(),4,n,e);throw this.error(e),e},dummy:null})}(),r});
//# sourceMappingURL=MmirTemplateLexer_amd.min.js.map