⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parser.jj

📁 velocity 的脚本语言的全部代码集合
💻 JJ
📖 第 1 页 / 共 5 页
字号:
         *     and do the work later when init-ing.  That would work         *     as long as things were always defined before use.  This way         *     we don't have to worry about forward references and such...         */        if (doItNow)        {            Macro.processAndRegister(rsvc, jjtn000, currentTemplateName);        }        /*         *  VM : end         */        return jjtn000;    }/*@bgen(jjtree)*/    } catch (Throwable jjte000) {      if (jjtc000) {        jjtree.clearNodeScope(jjtn000);        jjtc000 = false;      } else {        jjtree.popNode();      }      if (jjte000 instanceof RuntimeException) {        throw (RuntimeException)jjte000;      }      if (jjte000 instanceof ParseException) {        throw (ParseException)jjte000;      }      throw (Error)jjte000;    } finally {      if (jjtc000) {        jjtree.closeNodeScope(jjtn000, true);      }    }/*@egen*/}void ObjectArray() : {/*@bgen(jjtree) ObjectArray */  ASTObjectArray jjtn000 = new ASTObjectArray(this, JJTOBJECTARRAY);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);/*@egen*/}{/*@bgen(jjtree) ObjectArray */    try {/*@egen*/    <LBRACKET> [ Parameter() ( <COMMA> Parameter() )* ] <RBRACKET>/*@bgen(jjtree)*/    } catch (Throwable jjte000) {      if (jjtc000) {        jjtree.clearNodeScope(jjtn000);        jjtc000 = false;      } else {        jjtree.popNode();      }      if (jjte000 instanceof RuntimeException) {        throw (RuntimeException)jjte000;      }      if (jjte000 instanceof ParseException) {        throw (ParseException)jjte000;      }      throw (Error)jjte000;    } finally {      if (jjtc000) {        jjtree.closeNodeScope(jjtn000, true);      }    }/*@egen*/}/** *  supports the [n..m] vector generator for use in *  the #foreach() to generate measured ranges w/o *  needing explicit support from the app/servlet */void IntegerRange() : {/*@bgen(jjtree) IntegerRange */  ASTIntegerRange jjtn000 = new ASTIntegerRange(this, JJTINTEGERRANGE);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);/*@egen*/}{/*@bgen(jjtree) IntegerRange */    try {/*@egen*/    <LBRACKET> [<WHITESPACE>]    ( Reference() | NumberLiteral())    [<WHITESPACE>] <DOUBLEDOT> [<WHITESPACE>]    (Reference() | NumberLiteral())    [<WHITESPACE>] <RBRACKET>/*@bgen(jjtree)*/    } catch (Throwable jjte000) {      if (jjtc000) {        jjtree.clearNodeScope(jjtn000);        jjtc000 = false;      } else {        jjtree.popNode();      }      if (jjte000 instanceof RuntimeException) {        throw (RuntimeException)jjte000;      }      if (jjte000 instanceof ParseException) {        throw (ParseException)jjte000;      }      throw (Error)jjte000;    } finally {      if (jjtc000) {        jjtree.closeNodeScope(jjtn000, true);      }    }/*@egen*/}/** * This method has yet to be fully implemented * but will allow arbitrarily nested method * calls */void Parameter()      : {}{    [<WHITESPACE>]    (        StringLiteral()        | LOOKAHEAD(  <LBRACKET> [<WHITESPACE>]    ( Reference() | NumberLiteral())     [<WHITESPACE>] <DOUBLEDOT> ) IntegerRange()        | ObjectArray()        | True()        | False()        | Reference()        | NumberLiteral()        )    [ <WHITESPACE>]}/** * This method has yet to be fully implemented * but will allow arbitrarily nested method * calls */void Method() : {/*@bgen(jjtree) Method */  ASTMethod jjtn000 = new ASTMethod(this, JJTMETHOD);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);/*@egen*/}{/*@bgen(jjtree) Method */   try {/*@egen*/   Identifier() <LPAREN> [ Parameter() ( <COMMA> Parameter() )* ] <REFMOD2_RPAREN>/*@bgen(jjtree)*/   } catch (Throwable jjte000) {     if (jjtc000) {       jjtree.clearNodeScope(jjtn000);       jjtc000 = false;     } else {       jjtree.popNode();     }     if (jjte000 instanceof RuntimeException) {       throw (RuntimeException)jjte000;     }     if (jjte000 instanceof ParseException) {       throw (ParseException)jjte000;     }     throw (Error)jjte000;   } finally {     if (jjtc000) {       jjtree.closeNodeScope(jjtn000, true);     }   }/*@egen*/}void Reference() : {/*@bgen(jjtree) Reference */  ASTReference jjtn000 = new ASTReference(this, JJTREFERENCE);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);/*@egen*/}{/*@bgen(jjtree) Reference */      try {/*@egen*/    /*     *  A reference is either ${<FOO>} or  $<FOO>     */      (         <IDENTIFIER>         (LOOKAHEAD(2) <DOT> (LOOKAHEAD(3) Method() | Identifier() ))*      )      |      (         <LCURLY>         <IDENTIFIER>         (LOOKAHEAD(2) <DOT> (LOOKAHEAD(3) Method() | Identifier() ))*         <RCURLY>      )/*@bgen(jjtree)*/      } catch (Throwable jjte000) {        if (jjtc000) {          jjtree.clearNodeScope(jjtn000);          jjtc000 = false;        } else {          jjtree.popNode();        }        if (jjte000 instanceof RuntimeException) {          throw (RuntimeException)jjte000;        }        if (jjte000 instanceof ParseException) {          throw (ParseException)jjte000;        }        throw (Error)jjte000;      } finally {        if (jjtc000) {          jjtree.closeNodeScope(jjtn000, true);        }      }/*@egen*/}void True() : {/*@bgen(jjtree) True */  ASTTrue jjtn000 = new ASTTrue(this, JJTTRUE);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);/*@egen*/}{/*@bgen(jjtree) True */    try {/*@egen*/    <TRUE>/*@bgen(jjtree)*/    } finally {      if (jjtc000) {        jjtree.closeNodeScope(jjtn000, true);      }    }/*@egen*/}void False() : {/*@bgen(jjtree) False */  ASTFalse jjtn000 = new ASTFalse(this, JJTFALSE);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);/*@egen*/}{/*@bgen(jjtree) False */    try {/*@egen*/    <FALSE>/*@bgen(jjtree)*/    } finally {      if (jjtc000) {        jjtree.closeNodeScope(jjtn000, true);      }    }/*@egen*/}/** * This method is responsible for allowing * all non-grammar text to pass through * unscathed. */void Text() : {/*@bgen(jjtree) Text */  ASTText jjtn000 = new ASTText(this, JJTTEXT);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);/*@egen*/}{/*@bgen(jjtree) Text */    try {/*@egen*/    <TEXT>|   <DOT>|   <RPAREN>|   <LPAREN>|   <NUMBER_LITERAL>|   <STRING_LITERAL>|   <ESCAPE>|   <LCURLY>|   <RCURLY>/*@bgen(jjtree)*/    } finally {      if (jjtc000) {        jjtree.closeNodeScope(jjtn000, true);      }    }/*@egen*/}/* ----------------------------------------------------------------------- * *  Defined Directive Syntax * * ----------------------------------------------------------------------*/void IfStatement() : {/*@bgen(jjtree) IfStatement */  ASTIfStatement jjtn000 = new ASTIfStatement(this, JJTIFSTATEMENT);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);/*@egen*/}{/*@bgen(jjtree) IfStatement */    try {/*@egen*/    <IF_DIRECTIVE> [<WHITESPACE>] <LPAREN> Expression() <RPAREN>/*@bgen(jjtree) Block */    {      ASTBlock jjtn001 = new ASTBlock(this, JJTBLOCK);      boolean jjtc001 = true;      jjtree.openNodeScope(jjtn001);    }    try {/*@egen*/    ( Statement() )+/*@bgen(jjtree)*/    } catch (Throwable jjte001) {      if (jjtc001) {        jjtree.clearNodeScope(jjtn001);        jjtc001 = false;      } else {        jjtree.popNode();      }      if (jjte001 instanceof RuntimeException) {        throw (RuntimeException)jjte001;      }      if (jjte001 instanceof ParseException) {        throw (ParseException)jjte001;      }      throw (Error)jjte001;    } finally {      if (jjtc001) {        jjtree.closeNodeScope(jjtn001, true);      }    }/*@egen*/    [ LOOKAHEAD(1) ( ElseIfStatement() )+ ]    [ LOOKAHEAD(1) ElseStatement() ]    <END>/*@bgen(jjtree)*/    } catch (Throwable jjte000) {      if (jjtc000) {        jjtree.clearNodeScope(jjtn000);        jjtc000 = false;      } else {        jjtree.popNode();      }      if (jjte000 instanceof RuntimeException) {        throw (RuntimeException)jjte000;      }      if (jjte000 instanceof ParseException) {        throw (ParseException)jjte000;      }      throw (Error)jjte000;    } finally {      if (jjtc000) {        jjtree.closeNodeScope(jjtn000, true);      }    }/*@egen*/}void ElseStatement() : {/*@bgen(jjtree) ElseStatement */  ASTElseStatement jjtn000 = new ASTElseStatement(this, JJTELSESTATEMENT);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);/*@egen*/}{/*@bgen(jjtree) ElseStatement */   try {/*@egen*/   <ELSE_DIRECTIVE>/*@bgen(jjtree) Block */    {      ASTBlock jjtn001 = new ASTBlock(this, JJTBLOCK);      boolean jjtc001 = true;      jjtree.openNodeScope(jjtn001);    }    try {/*@egen*/    ( Statement() )+/*@bgen(jjtree)*/    } catch (Throwable jjte001) {      if (jjtc001) {        jjtree.clearNodeScope(jjtn001);        jjtc001 = false;      } else {        jjtree.popNode();      }      if (jjte001 instanceof RuntimeException) {        throw (RuntimeException)jjte001;      }      if (jjte001 instanceof ParseException) {        throw (ParseException)jjte001;      }      throw (Error)jjte001;    } finally {      if (jjtc001) {        jjtree.closeNodeScope(jjtn001, true);      }    }/*@egen*//*@bgen(jjtree)*/   } catch (Throwable jjte000) {     if (jjtc000) {       jjtree.clearNodeScope(jjtn000);       jjtc000 = false;     } else {       jjtree.popNode();     }     if (jjte000 instanceof RuntimeException) {       throw (RuntimeException)jjte000;     }     if (jjte000 instanceof ParseException) {       throw (ParseException)jjte000;     }     throw (Error)jjte000;   } finally {     if (jjtc000) {       jjtree.closeNodeScope(jjtn000, true);     }   }/*@egen*/}void ElseIfStatement() : {/*@bgen(jjtree) ElseIfStatement */  ASTElseIfStatement jjtn000 = new ASTElseIfStatement(this, JJTELSEIFSTATEMENT);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);/*@egen*/}{/*@bgen(jjtree) ElseIfStatement */    try {/*@egen*/    <ELSEIF_DIRECTIVE> [<WHITESPACE>]    <LPAREN> Expression() <RPAREN>/*@bgen(jjtree) Block */    {      ASTBlock jjtn001 = new ASTBlock(this, JJTBLOCK);      boolean jjtc001 = true;      jjtree.openNodeScope(jjtn001);    }    try {/*@egen*/    ( Statement() )+/*@bgen(jjtree)*/    } catch (Throwable jjte001) {      if (jjtc001) {        jjtree.clearNodeScope(jjtn001);        jjtc001 = false;      } else {        jjtree.popNode();      }      if (jjte001 instanceof RuntimeException) {        throw (RuntimeException)jjte001;      }      if (jjte001 instanceof ParseException) {        throw (ParseException)jjte001;      }      throw (Error)jjte001;    } finally {      if (jjtc001) {        jjtree.closeNodeScope(jjtn001, true);      }    }/*@egen*//*@bgen(jjtree)*/    } catch (Throwable jjte000) {      if (jjtc000) {        jjtree.clearNodeScope(jjtn000);        jjtc000 = false;      } else {        jjtree.popNode();      }      if (jjte000 instanceof RuntimeException) {        throw (RuntimeException)jjte000;      }      if (jjte000 instanceof ParseException) {        throw (ParseException)jjte000;      }      throw (Error)jjte000;    } finally {      if (jjtc000) {        jjtree.closeNodeScope(jjtn000, true);      }    }/*@egen*/}/** *  Currently support both types of set : *   #set( expr ) *   #set expr */void SetDirective() : {/*@bgen(jjtree) SetDirective */  ASTSetDirective jjtn000 = new ASTSetDirective(this, JJTSETDIRECTIVE);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);/*@egen*/}{/*@bgen(jjtree) SetDirective */    try {/*@egen*/    <SET_DIRECTIVE>    [ LOOKAHEAD(2) <WHITESPACE> ]    ( <LPAREN>  [<WHITESPACE>] Reference() [<WHITESPACE>] <EQUALS>  Expression() <RPAREN>    {        /*         * ensure that inSet is false.  Leads to some amusing bugs...         */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -