?? elparser.java
字號:
/*
* Copyright (C) 2007 Sun Microsystems, Inc. All rights reserved. Use is
* subject to license terms.
*
*//* Generated By:JJTree&JavaCC: Do not edit this line. ELParser.java */
package org.jdesktop.el.impl.parser;
import java.io.StringReader;
import org.jdesktop.el.ELException;
public class ELParser/*@bgen(jjtree)*/implements ELParserTreeConstants, ELParserConstants {/*@bgen(jjtree)*/
protected JJTELParserState jjtree = new JJTELParserState();public static Node parse(String ref) throws ELException
{
try {
return (new ELParser(new StringReader(ref))).CompositeExpression();
} catch (ParseException pe) {
throw new ELException(pe.getMessage());
}
}
/*
* CompositeExpression
* Allow most flexible parsing, restrict by examining
* type of returned node
*/
final public AstCompositeExpression CompositeExpression() throws ParseException {
/*@bgen(jjtree) CompositeExpression */
AstCompositeExpression jjtn000 = new AstCompositeExpression(JJTCOMPOSITEEXPRESSION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
label_1:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LITERAL_EXPRESSION:
case START_DYNAMIC_EXPRESSION:
case START_DEFERRED_EXPRESSION:
;
break;
default:
jj_la1[0] = jj_gen;
break label_1;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case START_DEFERRED_EXPRESSION:
DeferredExpression();
break;
case START_DYNAMIC_EXPRESSION:
DynamicExpression();
break;
case LITERAL_EXPRESSION:
LiteralExpression();
break;
default:
jj_la1[1] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
jj_consume_token(0);
jjtree.closeNodeScope(jjtn000, true);
jjtc000 = false;
{if (true) return jjtn000;}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
throw new Error("Missing return statement in function");
}
/*
* LiteralExpression
* Non-EL Expression blocks
*/
final public void LiteralExpression() throws ParseException {
/*@bgen(jjtree) LiteralExpression */
AstLiteralExpression jjtn000 = new AstLiteralExpression(JJTLITERALEXPRESSION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);Token t = null;
try {
t = jj_consume_token(LITERAL_EXPRESSION);
jjtree.closeNodeScope(jjtn000, true);
jjtc000 = false;
jjtn000.setImage(t.image);
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
/*
* DeferredExpression
* #{..} Expressions
*/
final public void DeferredExpression() throws ParseException {
/*@bgen(jjtree) DeferredExpression */
AstDeferredExpression jjtn000 = new AstDeferredExpression(JJTDEFERREDEXPRESSION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(START_DEFERRED_EXPRESSION);
Expression();
jj_consume_token(END_EXPRESSION);
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
/*
* DynamicExpression
* ${..} Expressions
*/
final public void DynamicExpression() throws ParseException {
/*@bgen(jjtree) DynamicExpression */
AstDynamicExpression jjtn000 = new AstDynamicExpression(JJTDYNAMICEXPRESSION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(START_DYNAMIC_EXPRESSION);
Expression();
jj_consume_token(END_EXPRESSION);
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
/*
* Expression
* EL Expression Language Root, goes to Choice
*/
final public void Expression() throws ParseException {
Choice();
}
/*
* Choice
* For Choice markup a ? b : c, then Or
*/
final public void Choice() throws ParseException {
Or();
label_2:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case QUESTIONMARK:
;
break;
default:
jj_la1[2] = jj_gen;
break label_2;
}
jj_consume_token(QUESTIONMARK);
Or();
jj_consume_token(COLON);
AstChoice jjtn001 = new AstChoice(JJTCHOICE);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
try {
Choice();
} catch (Throwable jjte001) {
if (jjtc001) {
jjtree.clearNodeScope(jjtn001);
jjtc001 = false;
} else {
jjtree.popNode();
}
if (jjte001 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte001;}
}
if (jjte001 instanceof ParseException) {
{if (true) throw (ParseException)jjte001;}
}
{if (true) throw (Error)jjte001;}
} finally {
if (jjtc001) {
jjtree.closeNodeScope(jjtn001, 3);
}
}
}
}
/*
* Or
* For 'or' '||', then And
*/
final public void Or() throws ParseException {
And();
label_3:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case OR0:
case OR1:
;
break;
default:
jj_la1[3] = jj_gen;
break label_3;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case OR0:
jj_consume_token(OR0);
break;
case OR1:
jj_consume_token(OR1);
break;
default:
jj_la1[4] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
AstOr jjtn001 = new AstOr(JJTOR);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
try {
And();
} catch (Throwable jjte001) {
if (jjtc001) {
jjtree.clearNodeScope(jjtn001);
jjtc001 = false;
} else {
jjtree.popNode();
}
if (jjte001 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte001;}
}
if (jjte001 instanceof ParseException) {
{if (true) throw (ParseException)jjte001;}
}
{if (true) throw (Error)jjte001;}
} finally {
if (jjtc001) {
jjtree.closeNodeScope(jjtn001, 2);
}
}
}
}
/*
* And
* For 'and' '&&', then Equality
*/
final public void And() throws ParseException {
Equality();
label_4:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AND0:
case AND1:
;
break;
default:
jj_la1[5] = jj_gen;
break label_4;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AND0:
jj_consume_token(AND0);
break;
case AND1:
jj_consume_token(AND1);
break;
default:
jj_la1[6] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
AstAnd jjtn001 = new AstAnd(JJTAND);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
try {
Equality();
} catch (Throwable jjte001) {
if (jjtc001) {
jjtree.clearNodeScope(jjtn001);
jjtc001 = false;
} else {
jjtree.popNode();
}
if (jjte001 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte001;}
}
if (jjte001 instanceof ParseException) {
{if (true) throw (ParseException)jjte001;}
}
{if (true) throw (Error)jjte001;}
} finally {
if (jjtc001) {
jjtree.closeNodeScope(jjtn001, 2);
}
}
}
}
/*
* Equality
* For '==' 'eq' '!=' 'ne', then Compare
*/
final public void Equality() throws ParseException {
Compare();
label_5:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EQ0:
case EQ1:
case NE0:
case NE1:
;
break;
default:
jj_la1[7] = jj_gen;
break label_5;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EQ0:
case EQ1:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EQ0:
jj_consume_token(EQ0);
break;
case EQ1:
jj_consume_token(EQ1);
break;
default:
jj_la1[8] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
AstEqual jjtn001 = new AstEqual(JJTEQUAL);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
try {
Compare();
} catch (Throwable jjte001) {
if (jjtc001) {
jjtree.clearNodeScope(jjtn001);
jjtc001 = false;
} else {
jjtree.popNode();
}
if (jjte001 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte001;}
}
if (jjte001 instanceof ParseException) {
{if (true) throw (ParseException)jjte001;}
}
{if (true) throw (Error)jjte001;}
} finally {
if (jjtc001) {
jjtree.closeNodeScope(jjtn001, 2);
}
}
break;
case NE0:
case NE1:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case NE0:
jj_consume_token(NE0);
break;
case NE1:
jj_consume_token(NE1);
break;
default:
jj_la1[9] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
AstNotEqual jjtn002 = new AstNotEqual(JJTNOTEQUAL);
boolean jjtc002 = true;
jjtree.openNodeScope(jjtn002);
try {
Compare();
} catch (Throwable jjte002) {
if (jjtc002) {
jjtree.clearNodeScope(jjtn002);
jjtc002 = false;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -