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

📄 ognl.jj

📁 OGNL文档包:----->最新版本!学习Struts2的必须帮助参考文档
💻 JJ
📖 第 1 页 / 共 5 页
字号:
/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. src/java/ognl\ognl.jj */
/*@egen*///--------------------------------------------------------------------------
//	Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard
//  All rights reserved.
//
//	Redistribution and use in source and binary forms, with or without
//  modification, are permitted provided that the following conditions are
//  met:
//
//	Redistributions of source code must retain the above copyright notice,
//  this list of conditions and the following disclaimer.
//	Redistributions in binary form must reproduce the above copyright
//  notice, this list of conditions and the following disclaimer in the
//  documentation and/or other materials provided with the distribution.
//	Neither the name of the Drew Davidson nor the names of its contributors
//  may be used to endorse or promote products derived from this software
//  without specific prior written permission.
//
//	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
//  DAMAGE.
//--------------------------------------------------------------------------

/*
 * This file defines the syntax of OGNL, the Object-Graph Navigation Language.  This
 * language was devised by Drew Davidson, who called it Key-Value Coding Language.  Luke
 * Blanshard then made up the new name and reimplemented it using ANTLR, refining and
 * polishing the language a bit on the way.  Drew maintained the system for a couple of
 * years; then Luke converted the ANTLR grammar to JavaCC, to eliminate the run-time
 * dependency on ANTLR.
 *
 * See package.html for a description of the language.
 */

options {
      // Parser options
    LOOKAHEAD           = 1;
    STATIC              = false;
    JAVA_UNICODE_ESCAPE = true;
    UNICODE_INPUT       = true;                                                                                       
}

PARSER_BEGIN(OgnlParser)

package ognl;

import java.math.*;

/**
 * OgnlParser is a JavaCC parser class; it translates OGNL expressions into abstract
 * syntax trees (ASTs) that can then be interpreted by the getValue and setValue methods.
 */
public class OgnlParser/*@bgen(jjtree)*/implements OgnlParserTreeConstants/*@egen*/
{/*@bgen(jjtree)*/
  protected JJTOgnlParserState jjtree = new JJTOgnlParserState();

/*@egen*/
}

PARSER_END(OgnlParser)




/**
 * This is the top-level construct of OGNL.
 */
Node topLevelExpression() : {}
{
    expression() <EOF> { return jjtree.rootNode(); }
}

// sequence (level 14)
void expression() : {}
{
    assignmentExpression() ( ","/*@bgen(jjtree) #Sequence( 2) */
                                 {
                                   ASTSequence jjtn001 = new ASTSequence(JJTSEQUENCE);
                                   boolean jjtc001 = true;
                                   jjtree.openNodeScope(jjtn001);
                                 }
                                 try {
/*@egen*/ assignmentExpression()/*@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,  2);
                                   }
                                 }
/*@egen*/ )*
}

// assignment expression (level 13)
void assignmentExpression() : {}
{
    conditionalTestExpression() [ "="/*@bgen(jjtree) #Assign( 2) */
                                      {
                                        ASTAssign jjtn001 = new ASTAssign(JJTASSIGN);
                                        boolean jjtc001 = true;
                                        jjtree.openNodeScope(jjtn001);
                                      }
                                      try {
/*@egen*/ assignmentExpression()/*@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,  2);
                                        }
                                      }
/*@egen*/ ]
}

// conditional test (level 12)
void conditionalTestExpression() : {}
{
    logicalOrExpression()
        [ "?" conditionalTestExpression() ":"/*@bgen(jjtree) #Test( 3) */
                                              {
                                                ASTTest jjtn001 = new ASTTest(JJTTEST);
                                                boolean jjtc001 = true;
                                                jjtree.openNodeScope(jjtn001);
                                              }
                                              try {
/*@egen*/ conditionalTestExpression()/*@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,  3);
                                                }
                                              }
/*@egen*/ ]
}

// logical or (||)  (level 11)
void logicalOrExpression() : {}
{
    logicalAndExpression() (("||" | "or")/*@bgen(jjtree) #Or( 2) */
                                          {
                                            ASTOr jjtn001 = new ASTOr(JJTOR);
                                            boolean jjtc001 = true;
                                            jjtree.openNodeScope(jjtn001);
                                          }
                                          try {
/*@egen*/ logicalAndExpression()/*@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,  2);
                                            }
                                          }
/*@egen*/ )*
}


// logical and (&&)  (level 10)
void logicalAndExpression() : {}
{
    inclusiveOrExpression() (("&&" | "and")/*@bgen(jjtree) #And( 2) */
                                            {
                                              ASTAnd jjtn001 = new ASTAnd(JJTAND);
                                              boolean jjtc001 = true;
                                              jjtree.openNodeScope(jjtn001);
                                            }
                                            try {
/*@egen*/ inclusiveOrExpression()/*@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,  2);
                                              }
                                            }
/*@egen*/ )*
}


// bitwise or non-short-circuiting or (|)  (level 9)
void inclusiveOrExpression() : {}
{
    exclusiveOrExpression() (("|" | "bor")/*@bgen(jjtree) #BitOr( 2) */
                                           {
                                             ASTBitOr jjtn001 = new ASTBitOr(JJTBITOR);
                                             boolean jjtc001 = true;
                                             jjtree.openNodeScope(jjtn001);
                                           }
                                           try {
/*@egen*/ exclusiveOrExpression()/*@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,  2);
                                             }
                                           }
/*@egen*/ )*
}


// exclusive or (^)  (level 8)
void exclusiveOrExpression() : {}
{
    andExpression() (("^" | "xor")/*@bgen(jjtree) #Xor( 2) */
                                   {
                                     ASTXor jjtn001 = new ASTXor(JJTXOR);
                                     boolean jjtc001 = true;
                                     jjtree.openNodeScope(jjtn001);
                                   }
                                   try {
/*@egen*/ andExpression()/*@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,  2);
                                     }
                                   }
/*@egen*/ )*
}


// bitwise or non-short-circuiting and (&)  (level 7)
void andExpression() : {}
{
    equalityExpression() (("&" | "band")/*@bgen(jjtree) #BitAnd( 2) */
                                         {
                                           ASTBitAnd jjtn001 = new ASTBitAnd(JJTBITAND);
                                           boolean jjtc001 = true;
                                           jjtree.openNodeScope(jjtn001);
                                         }

⌨️ 快捷键说明

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