📄 elparser.java
字号:
case MODULUS1:
case MODULUS2:
;
break;
default:
jj_la1[20] = jj_gen;
break label_7;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case MULTIPLY:
jj_consume_token(MULTIPLY);
operator = MultiplyOperator.SINGLETON;
break;
case DIVIDE1:
case DIVIDE2:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case DIVIDE1:
jj_consume_token(DIVIDE1);
break;
case DIVIDE2:
jj_consume_token(DIVIDE2);
break;
default:
jj_la1[21] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
operator = DivideOperator.SINGLETON;
break;
case MODULUS1:
case MODULUS2:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case MODULUS1:
jj_consume_token(MODULUS1);
break;
case MODULUS2:
jj_consume_token(MODULUS2);
break;
default:
jj_la1[22] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
operator = ModulusOperator.SINGLETON;
break;
default:
jj_la1[23] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
expression = UnaryExpression();
if (operators == null) {
operators = new ArrayList ();
expressions = new ArrayList ();
}
operators.add (operator);
expressions.add (expression);
}
if (operators != null) {
{if (true) return new BinaryOperatorExpression (startExpression,
operators,
expressions);}
}
else {
{if (true) return startExpression;}
}
throw new Error("Missing return statement in function");
}
final public Expression ConditionalExpression() throws ParseException {
Expression condition, trueBranch, falseBranch;
condition = OrExpression();
jj_consume_token(COND);
trueBranch = Expression();
jj_consume_token(COLON);
falseBranch = Expression();
{if (true) return new ConditionalExpression(condition, trueBranch, falseBranch);}
throw new Error("Missing return statement in function");
}
final public Expression UnaryExpression() throws ParseException {
Expression expression;
UnaryOperator singleOperator = null;
UnaryOperator operator;
List operators = null;
label_8:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case MINUS:
case NOT1:
case NOT2:
case EMPTY:
;
break;
default:
jj_la1[24] = jj_gen;
break label_8;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case NOT1:
case NOT2:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case NOT1:
jj_consume_token(NOT1);
break;
case NOT2:
jj_consume_token(NOT2);
break;
default:
jj_la1[25] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
operator = NotOperator.SINGLETON;
break;
case MINUS:
jj_consume_token(MINUS);
operator = UnaryMinusOperator.SINGLETON;
break;
case EMPTY:
jj_consume_token(EMPTY);
operator = EmptyOperator.SINGLETON;
break;
default:
jj_la1[26] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
if (singleOperator == null) {
singleOperator = operator;
}
else if (operators == null) {
operators = new ArrayList ();
operators.add (singleOperator);
operators.add (operator);
}
else {
operators.add (operator);
}
}
expression = Value();
if (operators != null) {
{if (true) return new UnaryOperatorExpression (null, operators, expression);}
}
else if (singleOperator != null) {
{if (true) return new UnaryOperatorExpression (singleOperator, null, expression);}
}
else {
{if (true) return expression;}
}
throw new Error("Missing return statement in function");
}
final public Expression Value() throws ParseException {
Expression prefix;
ValueSuffix suffix;
List suffixes = null;
prefix = ValuePrefix();
label_9:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case DOT:
case LBRACKET:
;
break;
default:
jj_la1[27] = jj_gen;
break label_9;
}
suffix = ValueSuffix();
if (suffixes == null) {
suffixes = new ArrayList ();
}
suffixes.add (suffix);
}
if (suffixes == null) {
{if (true) return prefix;}
}
else {
{if (true) return new ComplexValue (prefix, suffixes);}
}
throw new Error("Missing return statement in function");
}
/**
* This is an element that can start a value
**/
final public Expression ValuePrefix() throws ParseException {
Expression ret;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case INTEGER_LITERAL:
case FLOATING_POINT_LITERAL:
case STRING_LITERAL:
case TRUE:
case FALSE:
case NULL:
ret = Literal();
break;
case LPAREN:
jj_consume_token(LPAREN);
ret = Expression();
jj_consume_token(RPAREN);
break;
default:
jj_la1[28] = jj_gen;
if (jj_2_2(2147483647)) {
ret = FunctionInvocation();
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IDENTIFIER:
ret = NamedValue();
break;
default:
jj_la1[29] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
}
{if (true) return ret;}
throw new Error("Missing return statement in function");
}
final public NamedValue NamedValue() throws ParseException {
ELToken t;
t = jj_consume_token(IDENTIFIER);
{if (true) return new NamedValue (t.image);}
throw new Error("Missing return statement in function");
}
final public FunctionInvocation FunctionInvocation() throws ParseException {
String qualifiedName;
List argumentList = new ArrayList();
Expression exp;
qualifiedName = QualifiedName();
jj_consume_token(LPAREN);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case INTEGER_LITERAL:
case FLOATING_POINT_LITERAL:
case STRING_LITERAL:
case TRUE:
case FALSE:
case NULL:
case LPAREN:
case MINUS:
case NOT1:
case NOT2:
case EMPTY:
case IDENTIFIER:
exp = Expression();
argumentList.add(exp);
label_10:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[30] = jj_gen;
break label_10;
}
jj_consume_token(COMMA);
exp = Expression();
argumentList.add(exp);
}
break;
default:
jj_la1[31] = jj_gen;
;
}
jj_consume_token(RPAREN);
{if (true) return new FunctionInvocation(qualifiedName, argumentList);}
throw new Error("Missing return statement in function");
}
final public ValueSuffix ValueSuffix() throws ParseException {
ValueSuffix suffix;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case DOT:
suffix = PropertySuffix();
break;
case LBRACKET:
suffix = ArraySuffix();
break;
default:
jj_la1[32] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return suffix;}
throw new Error("Missing return statement in function");
}
final public PropertySuffix PropertySuffix() throws ParseException {
// ELToken t;
String property;
jj_consume_token(DOT);
property = Identifier();
{if (true) return new PropertySuffix (property);}
throw new Error("Missing return statement in function");
}
final public ArraySuffix ArraySuffix() throws ParseException {
Expression index;
jj_consume_token(LBRACKET);
index = Expression();
jj_consume_token(RBRACKET);
{if (true) return new ArraySuffix (index);}
throw new Error("Missing return statement in function");
}
final public Literal Literal() throws ParseException {
Literal ret;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case TRUE:
case FALSE:
ret = BooleanLiteral();
break;
case INTEGER_LITERAL:
ret = IntegerLiteral();
break;
case FLOATING_POINT_LITERAL:
ret = FloatingPointLiteral();
break;
case STRING_LITERAL:
ret = StringLiteral();
break;
case NULL:
ret = NullLiteral();
break;
default:
jj_la1[33] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return ret;}
throw new Error("Missing return statement in function");
}
final public BooleanLiteral BooleanLiteral() throws ParseException {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case TRUE:
jj_consume_token(TRUE);
{if (true) return BooleanLiteral.TRUE;}
break;
case FALSE:
jj_consume_token(FALSE);
{if (true) return BooleanLiteral.FALSE;}
break;
default:
jj_la1[34] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
final public StringLiteral StringLiteral() throws ParseException {
ELToken t;
t = jj_consume_token(STRING_LITERAL);
{if (true) return StringLiteral.fromToken (t.image);}
throw new Error("Missing return statement in function");
}
final public IntegerLiteral IntegerLiteral() throws ParseException {
ELToken t;
t = jj_consume_token(INTEGER_LITERAL);
{if (true) return new IntegerLiteral (t.image);}
throw new Error("Missing return statement in function");
}
final public FloatingPointLiteral FloatingPointLiteral() throws ParseException {
ELToken t;
t = jj_consume_token(FLOATING_POINT_LITERAL);
{if (true) return new FloatingPointLiteral (t.image);}
throw new Error("Missing return statement in function");
}
final public NullLiteral NullLiteral() throws ParseException {
jj_consume_token(NULL);
{if (true) return NullLiteral.SINGLETON;}
throw new Error("Missing return statement in function");
}
final public String Identifier() throws ParseException {
ELToken t;
t = jj_consume_token(IDENTIFIER);
{if (true) return t.image;}
throw new Error("Missing return statement in function");
}
final public String QualifiedName() throws ParseException {
String prefix = null, localPart = null;
if (jj_2_3(2147483647)) {
prefix = Identifier();
jj_consume_token(COLON);
} else {
;
}
localPart = Identifier();
if (prefix == null)
{if (true) return localPart;}
else
{if (true) return prefix + ":" + localPart;}
throw new Error("Missing return statement in function");
}
final private boolean jj_2_1(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
boolean retval = !jj_3_1();
jj_save(0, xla);
return retval;
}
final private boolean jj_2_2(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
boolean retval = !jj_3_2();
jj_save(1, xla);
return retval;
}
final private boolean jj_2_3(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
boolean retval = !jj_3_3();
jj_save(2, xla);
return retval;
}
final private boolean jj_3R_42() {
if (jj_scan_token(NE2)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
final private boolean jj_3R_91() {
if (jj_scan_token(FLOATING_POINT_LITERAL)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
final private boolean jj_3R_40() {
if (jj_scan_token(EQ2)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
final private boolean jj_3R_41() {
if (jj_scan_token(NE1)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
final private boolean jj_3R_32() {
ELToken xsp;
xsp = jj_scanpos;
if (jj_3R_41()) {
jj_scanpos = xsp;
if (jj_3R_42()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
} else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
final private boolean jj_3R_90() {
if (jj_scan_token(INTEGER_LITERAL)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
final private boolean jj_3R_39() {
if (jj_scan_token(EQ1)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
final private boolean jj_3R_31() {
ELToken xsp;
xsp = jj_scanpos;
if (jj_3R_39()) {
jj_scanpos = xsp;
if (jj_3R_40()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
} else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -