📄 ognl.jj
字号:
// navigation chain: property references, method calls, projections, selections, etc.
void navigationChain() : {}
{
primaryExpression()
( "."/*@bgen(jjtree) #Chain( 2) */
{
ASTChain jjtn001 = new ASTChain(JJTCHAIN);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
}
try {
/*@egen*/
( /* Prevent the "eval" ambiguity from issuing a warning; see discussion below. */
( LOOKAHEAD(2) methodCall() | propertyName() )
// Also handle "{", which requires a lookahead of 2.
| ( LOOKAHEAD(2) projection() | selection() )
| "(" expression() ")"
)/*@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*/
|/*@bgen(jjtree) #Chain( 2) */
{
ASTChain jjtn002 = new ASTChain(JJTCHAIN);
boolean jjtc002 = true;
jjtree.openNodeScope(jjtn002);
}
try {
/*@egen*/ index()/*@bgen(jjtree)*/
} catch (Throwable jjte002) {
if (jjtc002) {
jjtree.clearNodeScope(jjtn002);
jjtc002 = false;
} else {
jjtree.popNode();
}
if (jjte002 instanceof RuntimeException) {
throw (RuntimeException)jjte002;
}
if (jjte002 instanceof ParseException) {
throw (ParseException)jjte002;
}
throw (Error)jjte002;
} finally {
if (jjtc002) {
jjtree.closeNodeScope(jjtn002, 2);
}
}
/*@egen*/
| "(" expression()/*@bgen(jjtree) #Eval( 2) */
{
ASTEval jjtn003 = new ASTEval(JJTEVAL);
boolean jjtc003 = true;
jjtree.openNodeScope(jjtn003);
}
try {
/*@egen*/ ")"/*@bgen(jjtree)*/
} finally {
if (jjtc003) {
jjtree.closeNodeScope(jjtn003, 2);
}
}
/*@egen*/
/* Using parentheses to indicate evaluation of the current
object makes this language ambiguous, because the
expression "ident(args)" could be seen as a single
method call or as a property name followed by an
evaluation. We always put the method call first and
turn off the ambiguity warning; we always want to
interpret this as a method call. */
)*
}
void primaryExpression() : {
Token t;
String className = null;
}
{
(
(<CHAR_LITERAL> | <BACK_CHAR_LITERAL> | <STRING_LITERAL> | <INT_LITERAL> | <FLT_LITERAL>)/*@bgen(jjtree) #Const( 0) */
{
ASTConst jjtn001 = new ASTConst(JJTCONST);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
}
try {
/*@egen*//*@bgen(jjtree)*/
{
jjtree.closeNodeScope(jjtn001, 0);
jjtc001 = false;
}
/*@egen*/
{ jjtn001.setValue( token_source.literalValue ); }/*@bgen(jjtree)*/
} finally {
if (jjtc001) {
jjtree.closeNodeScope(jjtn001, 0);
}
}
/*@egen*/
|
"true"/*@bgen(jjtree) #Const( 0) */
{
ASTConst jjtn002 = new ASTConst(JJTCONST);
boolean jjtc002 = true;
jjtree.openNodeScope(jjtn002);
}
try {
/*@egen*//*@bgen(jjtree)*/
{
jjtree.closeNodeScope(jjtn002, 0);
jjtc002 = false;
}
/*@egen*/ { jjtn002.setValue( Boolean.TRUE ); }/*@bgen(jjtree)*/
} finally {
if (jjtc002) {
jjtree.closeNodeScope(jjtn002, 0);
}
}
/*@egen*/
|
"false"/*@bgen(jjtree) #Const( 0) */
{
ASTConst jjtn003 = new ASTConst(JJTCONST);
boolean jjtc003 = true;
jjtree.openNodeScope(jjtn003);
}
try {
/*@egen*//*@bgen(jjtree)*/
{
jjtree.closeNodeScope(jjtn003, 0);
jjtc003 = false;
}
/*@egen*/ { jjtn003.setValue( Boolean.FALSE ); }/*@bgen(jjtree)*/
} finally {
if (jjtc003) {
jjtree.closeNodeScope(jjtn003, 0);
}
}
/*@egen*/
|/*@bgen(jjtree) #Const( 0) */
{
ASTConst jjtn004 = new ASTConst(JJTCONST);
boolean jjtc004 = true;
jjtree.openNodeScope(jjtn004);
}
try {
/*@egen*/
"null"/*@bgen(jjtree)*/
} finally {
if (jjtc004) {
jjtree.closeNodeScope(jjtn004, 0);
}
}
/*@egen*/ // Null is the default value in an ASTConst
|
LOOKAHEAD(2) "#this"/*@bgen(jjtree) #ThisVarRef( 0) */
{
ASTThisVarRef jjtn005 = new ASTThisVarRef(JJTTHISVARREF);
boolean jjtc005 = true;
jjtree.openNodeScope(jjtn005);
}
try {
/*@egen*//*@bgen(jjtree)*/
{
jjtree.closeNodeScope(jjtn005, 0);
jjtc005 = false;
}
/*@egen*/ { jjtn005.setName( "this" ); }/*@bgen(jjtree)*/
} finally {
if (jjtc005) {
jjtree.closeNodeScope(jjtn005, 0);
}
}
/*@egen*/
|
LOOKAHEAD(2) "#root"/*@bgen(jjtree) #RootVarRef( 0) */
{
ASTRootVarRef jjtn006 = new ASTRootVarRef(JJTROOTVARREF);
boolean jjtc006 = true;
jjtree.openNodeScope(jjtn006);
}
try {
/*@egen*//*@bgen(jjtree)*/
{
jjtree.closeNodeScope(jjtn006, 0);
jjtc006 = false;
}
/*@egen*/ { jjtn006.setName( "root" ); }/*@bgen(jjtree)*/
} finally {
if (jjtc006) {
jjtree.closeNodeScope(jjtn006, 0);
}
}
/*@egen*/
|
LOOKAHEAD(2) "#" t=<IDENT>/*@bgen(jjtree) #VarRef( 0) */
{
ASTVarRef jjtn007 = new ASTVarRef(JJTVARREF);
boolean jjtc007 = true;
jjtree.openNodeScope(jjtn007);
}
try {
/*@egen*//*@bgen(jjtree)*/
{
jjtree.closeNodeScope(jjtn007, 0);
jjtc007 = false;
}
/*@egen*/ { jjtn007.setName( t.image ); }/*@bgen(jjtree)*/
} finally {
if (jjtc007) {
jjtree.closeNodeScope(jjtn007, 0);
}
}
/*@egen*/
|
LOOKAHEAD(2) ":" "[" expression() "]"/*@bgen(jjtree) #Const( 1) */
{
ASTConst jjtn008 = new ASTConst(JJTCONST);
boolean jjtc008 = true;
jjtree.openNodeScope(jjtn008);
}
try {
/*@egen*//*@bgen(jjtree)*/
{
jjtree.closeNodeScope(jjtn008, 1);
jjtc008 = false;
}
/*@egen*/ { jjtn008.setValue( jjtn008.jjtGetChild(0) ); }/*@bgen(jjtree)*/
} finally {
if (jjtc008) {
jjtree.closeNodeScope(jjtn008, 1);
}
}
/*@egen*/
|
staticReference()
|
LOOKAHEAD(2) constructorCall()
|
// Prevent the "eval" ambiguity from issuing a warning; see discussion elsewhere.
( LOOKAHEAD(2) methodCall() | propertyName() )
|
index()
|
"(" expression() ")"
|
"{"/*@bgen(jjtree) List */
{
ASTList jjtn009 = new ASTList(JJTLIST);
boolean jjtc009 = true;
jjtree.openNodeScope(jjtn009);
}
try {
/*@egen*/ [assignmentExpression() ("," assignmentExpression())*]/*@bgen(jjtree)*/
} catch (Throwable jjte009) {
if (jjtc009) {
jjtree.clearNodeScope(jjtn009);
jjtc009 = false;
} else {
jjtree.popNode();
}
if (jjte009 instanceof RuntimeException) {
throw (RuntimeException)jjte009;
}
if (jjte009 instanceof ParseException) {
throw (ParseException)jjte009;
}
throw (Error)jjte009;
} finally {
if (jjtc009) {
jjtree.closeNodeScope(jjtn009, true);
}
}
/*@egen*/ "}"
|
LOOKAHEAD(2)/*@bgen(jjtree) Map */
{
ASTMap jjtn010 = new ASTMap(JJTMAP);
boolean jjtc010 = true;
jjtree.openNodeScope(jjtn010);
}
try {
/*@egen*/ ( "#" (className=classReference())? "{" [keyValueExpression() ("," keyValueExpression())*] { jjtn010.setClassName(className); } "}" )/*@bgen(jjtree)*/
} catch (Throwable jjte010) {
if (jjtc010) {
jjtree.clearNodeScope(jjtn010);
jjtc010 = false;
} else {
jjtree.popNode();
}
if (jjte010 instanceof RuntimeException) {
throw (RuntimeException)jjte010;
}
if (jjte010 instanceof ParseException) {
throw (ParseException)jjte010;
}
throw (Error)jjte010;
} finally {
if (jjtc010) {
jjtree.closeNodeScope(jjtn010, true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -