net.hasor.dataql.domain.parser.DataQLParser Maven / Gradle / Ivy
/* DataQLParser.java */
/* Generated By:JavaCC: Do not edit this line. DataQLParser.java */
/*
* Copyright 2008-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.hasor.dataql.domain.parser;
import net.hasor.dataql.domain.*;
import net.hasor.dataql.domain.PrimitiveExpression.ValueType;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.Arrays;
/**
* DSL 语法解析器
* @author 赵永春([email protected])
* @version : 2017-03-23
*/
public class DataQLParser implements DataQLParserConstants {
private DataQLParser() {
}
//
public static BlockSet parserDataQL(String queryString) throws ParseException {
DataQLParser parser = new DataQLParser(new ByteArrayInputStream(queryString.getBytes()));
return parser.rootBlock();
}
public static BlockSet parserDataQL(InputStream inputStream, String encoding) throws ParseException {
DataQLParser parser = new DataQLParser(inputStream, encoding);
return parser.rootBlock();
}
public static Number automaticBigInteger(java.math.BigInteger bigInt) {
int bitLength = bigInt.bitLength();
if (bitLength < 8) {
return bigInt.byteValue();
}
if (bitLength < 16) {
return bigInt.shortValue();
}
if (bitLength < 32) {
return bigInt.intValue();
}
if (bitLength < 64) {
return bigInt.longValue();
}
return bigInt;
}
public static Number automaticBigDecimal(java.math.BigDecimal bigDec) {
int precisionLength = bigDec.precision();
if (precisionLength < 8) {
return bigDec.floatValue();
}
if (precisionLength < 16) {
return bigDec.doubleValue();
}
return bigDec;
}
public static String fixNumberValue(Token t) {
boolean signBit = t.image.charAt(0) == '-';
if (t.kind == HEX_NUM || t.kind == OCTAL_NUM || t.kind == BINARY_NUM) {
if (signBit) {
return "-" + t.image.substring(3);
} else {
return t.image.substring(2);
}
}
return t.image;
}
//-----------------------------------------------------------------------------
// .标识符
final public String identifier() throws ParseException {
Token dataToken = null;
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case IDENTIFIER: {
dataToken = jj_consume_token(IDENTIFIER);
{
if ("" != null)
return dataToken.image;
}
break;
}
case OCBREXT: {
Token ocbrToken = null;
ocbrToken = jj_consume_token(OCBREXT);
dataToken = jj_consume_token(IDENTIFIER);
jj_consume_token(CCBR);
{
if ("" != null)
return ocbrToken.image + dataToken.image + "}";
}
break;
}
default:
jj_la1[0] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
// .带引号的字符串
final public String stringValue() throws ParseException {
Token dataToken = null;
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case STR_DOUBLE_QUOTED: {
dataToken = jj_consume_token(STR_DOUBLE_QUOTED);
break;
}
case STR_SINGLE_QUOTED: {
dataToken = jj_consume_token(STR_SINGLE_QUOTED);
break;
}
case STR_EMPTY: {
dataToken = jj_consume_token(STR_EMPTY);
break;
}
default:
jj_la1[1] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
String image = dataToken.image;
{
if ("" != null)
return image.substring(1, image.length() - 1);
}
throw new Error("Missing return statement in function");
}
// .空值
final public Object nullValue() throws ParseException {
jj_consume_token(NULL);
{
if ("" != null)
return null;
}
throw new Error("Missing return statement in function");
}
// .布尔
final public Boolean booleanValue() throws ParseException {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case TRUE: {
jj_consume_token(TRUE);
{
if ("" != null)
return Boolean.TRUE;
}
break;
}
case FALSE: {
jj_consume_token(FALSE);
{
if ("" != null)
return Boolean.FALSE;
}
break;
}
default:
jj_la1[2] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
// .数字
final public Number numberValue() throws ParseException {
Number number = null;
Token t = null;
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case DECIMAL_NUM: {
t = jj_consume_token(DECIMAL_NUM);
number = automaticBigDecimal(new java.math.BigDecimal(fixNumberValue(t)));
break;
}
case INTEGER_NUM: {
t = jj_consume_token(INTEGER_NUM);
number = automaticBigInteger(new java.math.BigInteger(fixNumberValue(t)));
break;
}
case HEX_NUM: {
t = jj_consume_token(HEX_NUM);
number = automaticBigInteger(new java.math.BigInteger(fixNumberValue(t), 16));
break;
}
case OCTAL_NUM: {
t = jj_consume_token(OCTAL_NUM);
number = automaticBigInteger(new java.math.BigInteger(fixNumberValue(t), 8));
break;
}
case BINARY_NUM: {
t = jj_consume_token(BINARY_NUM);
number = automaticBigInteger(new java.math.BigInteger(fixNumberValue(t), 2));
break;
}
default:
jj_la1[3] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{
if ("" != null)
return number;
}
throw new Error("Missing return statement in function");
}
// .列表:[ ... ]
final public ListExpression list() throws ParseException {
ListExpression listExp = new ListExpression();
Expression valueExp = null;
if (jj_2_1(2)) {
jj_consume_token(OBRA);
jj_consume_token(CBRA);
} else {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case OBRA: {
jj_consume_token(OBRA);
valueExp = expression();
listExp.addItem(valueExp);
valueExp = null;
label_1:
while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case COMMA: {
;
break;
}
default:
jj_la1[4] = jj_gen;
break label_1;
}
jj_consume_token(COMMA);
valueExp = expression();
listExp.addItem(valueExp);
valueExp = null;
}
jj_consume_token(CBRA);
break;
}
default:
jj_la1[5] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
{
if ("" != null)
return listExp;
}
throw new Error("Missing return statement in function");
}
// .对象:
final public ObjectExpression object() throws ParseException {
ObjectExpression objExp = new ObjectExpression();
String fieldName = null;
Expression valueExp = null;
if (jj_2_2(2)) {
jj_consume_token(OCBR);
jj_consume_token(CCBR);
} else {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case OCBR: {
jj_consume_token(OCBR);
fieldName = stringValue();
valueExp = new RouteExpression(fieldName);
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case COLON: {
jj_consume_token(COLON);
valueExp = expression();
break;
}
default:
jj_la1[6] = jj_gen;
;
}
objExp.addField(fieldName, valueExp);
fieldName = null;
valueExp = null;
label_2:
while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case COMMA: {
;
break;
}
default:
jj_la1[7] = jj_gen;
break label_2;
}
jj_consume_token(COMMA);
fieldName = stringValue();
valueExp = new RouteExpression(fieldName);
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case COLON: {
jj_consume_token(COLON);
valueExp = expression();
break;
}
default:
jj_la1[8] = jj_gen;
;
}
objExp.addField(fieldName, valueExp);
fieldName = null;
valueExp = null;
}
jj_consume_token(CCBR);
break;
}
default:
jj_la1[9] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
{
if ("" != null)
return objExp;
}
throw new Error("Missing return statement in function");
}
//-----------------------------------------------------------------------------
// .表达式 = 表达式 or 表达式 + 运算符
final public Expression expression() throws ParseException {
Expression exp;
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case OPAR: {
jj_consume_token(OPAR);
exp = expression();
jj_consume_token(CPAR);
exp = new PrivilegeExpression(exp);
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case QUEM:
case PLUS:
case MINUS:
case STAR:
case SLASH:
case REM:
case ALI:
case GT:
case GE:
case LT:
case LE:
case EQ:
case NE:
case BIT_AND:
case BIT_OR:
case XOR:
case LSHIFT:
case RSIGNEDSHIFT:
case RUNSIGNEDSHIFT:
case SC_OR:
case SC_AND: {
exp = extExpression(exp);
break;
}
default:
jj_la1[10] = jj_gen;
;
}
{
if ("" != null)
return exp;
}
break;
}
default:
jj_la1[12] = jj_gen;
if (jj_2_3(2147483647)) {
exp = unaryExpression();
{
if ("" != null)
return exp;
}
} else {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case INTEGER_NUM:
case HEX_NUM:
case OCTAL_NUM:
case BINARY_NUM:
case DECIMAL_NUM:
case TRUE:
case FALSE:
case NULL:
case OBRA:
case OCBR:
case OCBREXT:
case STR_DOUBLE_QUOTED:
case STR_SINGLE_QUOTED:
case STR_EMPTY:
case IDENTIFIER: {
exp = basicValue();
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case QUEM:
case PLUS:
case MINUS:
case STAR:
case SLASH:
case REM:
case ALI:
case GT:
case GE:
case LT:
case LE:
case EQ:
case NE:
case BIT_AND:
case BIT_OR:
case XOR:
case LSHIFT:
case RSIGNEDSHIFT:
case RUNSIGNEDSHIFT:
case SC_OR:
case SC_AND: {
exp = extExpression(exp);
break;
}
default:
jj_la1[11] = jj_gen;
;
}
{
if ("" != null)
return exp;
}
break;
}
default:
jj_la1[13] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
}
throw new Error("Missing return statement in function");
}
final public Expression unaryExpression() throws ParseException {
Token symbol = null;
Expression target = null;
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case BANG: {
symbol = jj_consume_token(BANG);
break;
}
case MINUS: {
symbol = jj_consume_token(MINUS);
break;
}
default:
jj_la1[14] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
target = basicValue();
{
if ("" != null)
return new UnaryExpression(target, symbol.image);
}
throw new Error("Missing return statement in function");
}
final public Expression extExpression(Expression fstExp) throws ParseException {
Expression resultExp = null;
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case PLUS:
case MINUS:
case STAR:
case SLASH:
case REM:
case ALI:
case GT:
case GE:
case LT:
case LE:
case EQ:
case NE:
case BIT_AND:
case BIT_OR:
case XOR:
case LSHIFT:
case RSIGNEDSHIFT:
case RUNSIGNEDSHIFT:
case SC_OR:
case SC_AND: {
resultExp = dyadicExpression(fstExp);
break;
}
case QUEM: {
resultExp = ternaryExpression(fstExp);
break;
}
default:
jj_la1[15] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{
if ("" != null)
return resultExp;
}
throw new Error("Missing return statement in function");
}
final public DyadicExpression dyadicExpression(Expression fstExp) throws ParseException {
Token symbol = null;
Expression secExp = null;
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case PLUS: {
symbol = jj_consume_token(PLUS);
break;
}
case MINUS: {
symbol = jj_consume_token(MINUS);
break;
}
case STAR: {
symbol = jj_consume_token(STAR);
break;
}
case SLASH: {
symbol = jj_consume_token(SLASH);
break;
}
case REM: {
symbol = jj_consume_token(REM);
break;
}
case ALI: {
symbol = jj_consume_token(ALI);
break;
}
case GT: {
symbol = jj_consume_token(GT);
break;
}
case GE: {
symbol = jj_consume_token(GE);
break;
}
case LT: {
symbol = jj_consume_token(LT);
break;
}
case LE: {
symbol = jj_consume_token(LE);
break;
}
case EQ: {
symbol = jj_consume_token(EQ);
break;
}
case NE: {
symbol = jj_consume_token(NE);
break;
}
case BIT_AND: {
symbol = jj_consume_token(BIT_AND);
break;
}
case BIT_OR: {
symbol = jj_consume_token(BIT_OR);
break;
}
case XOR: {
symbol = jj_consume_token(XOR);
break;
}
case LSHIFT: {
symbol = jj_consume_token(LSHIFT);
break;
}
case RSIGNEDSHIFT: {
symbol = jj_consume_token(RSIGNEDSHIFT);
break;
}
case RUNSIGNEDSHIFT: {
symbol = jj_consume_token(RUNSIGNEDSHIFT);
break;
}
case SC_OR: {
symbol = jj_consume_token(SC_OR);
break;
}
case SC_AND: {
symbol = jj_consume_token(SC_AND);
break;
}
default:
jj_la1[16] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
secExp = expression();
{
if ("" != null)
return new DyadicExpression(fstExp, symbol.image, secExp);
}
throw new Error("Missing return statement in function");
}
final public Expression ternaryExpression(Expression testExp) throws ParseException {
Expression thenExp = null;
Expression elseExp = null;
jj_consume_token(QUEM);
thenExp = expression();
jj_consume_token(COLON);
elseExp = expression();
{
if ("" != null)
return new TernaryExpression(testExp, thenExp, elseExp);
}
throw new Error("Missing return statement in function");
}
// .值
final public Expression basicValue() throws ParseException {
Expression finalExp = null;
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case INTEGER_NUM:
case HEX_NUM:
case OCTAL_NUM:
case BINARY_NUM:
case DECIMAL_NUM:
case TRUE:
case FALSE:
case NULL:
case STR_DOUBLE_QUOTED:
case STR_SINGLE_QUOTED:
case STR_EMPTY: {
finalExp = primitiveValue();
break;
}
case OCBREXT:
case IDENTIFIER: {
String mabeCallerName = null;
mabeCallerName = identifier();
finalExp = new RouteExpression(mabeCallerName);
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case OPAR:
case 75: {
finalExp = funCall(mabeCallerName);
break;
}
default:
jj_la1[17] = jj_gen;
;
}
break;
}
case OBRA: {
finalExp = list();
break;
}
case OCBR: {
finalExp = object();
break;
}
default:
jj_la1[18] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{
if ("" != null)
return finalExp;
}
throw new Error("Missing return statement in function");
}
final public PrimitiveExpression primitiveValue() throws ParseException {
Object value = null;
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case STR_DOUBLE_QUOTED:
case STR_SINGLE_QUOTED:
case STR_EMPTY: {
value = stringValue();
{
if ("" != null)
return new PrimitiveExpression(value, ValueType.String);
}
break;
}
case NULL: {
value = nullValue();
{
if ("" != null)
return new PrimitiveExpression(value, ValueType.Null);
}
break;
}
case TRUE:
case FALSE: {
value = booleanValue();
{
if ("" != null)
return new PrimitiveExpression(value, ValueType.Boolean);
}
break;
}
case INTEGER_NUM:
case HEX_NUM:
case OCTAL_NUM:
case BINARY_NUM:
case DECIMAL_NUM: {
value = numberValue();
{
if ("" != null)
return new PrimitiveExpression(value, ValueType.Number);
}
break;
}
default:
jj_la1[19] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
//-----------------------------------------------------------------------------
// .函数参数
final public Variable callerParamItem() throws ParseException {
Variable value = null;
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case LAMBDA: {
value = lambdaDef();
break;
}
case INTEGER_NUM:
case HEX_NUM:
case OCTAL_NUM:
case BINARY_NUM:
case DECIMAL_NUM:
case TRUE:
case FALSE:
case NULL:
case OPAR:
case OBRA:
case OCBR:
case OCBREXT:
case BANG:
case MINUS:
case STR_DOUBLE_QUOTED:
case STR_SINGLE_QUOTED:
case STR_EMPTY:
case IDENTIFIER: {
value = expression();
break;
}
default:
jj_la1[20] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{
if ("" != null)
return value;
}
throw new Error("Missing return statement in function");
}
// .参数集:(xx , xx , xx)
final public CallerExpression callerParamSet(String callName) throws ParseException {
Variable atParam = null;
String quickSelect = null;
CallerExpression callerExp = new CallerExpression(callName);
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case OPAR: {
jj_consume_token(OPAR);
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case CPAR: {
jj_consume_token(CPAR);
break;
}
case INTEGER_NUM:
case HEX_NUM:
case OCTAL_NUM:
case BINARY_NUM:
case DECIMAL_NUM:
case LAMBDA:
case TRUE:
case FALSE:
case NULL:
case OPAR:
case OBRA:
case OCBR:
case OCBREXT:
case BANG:
case MINUS:
case STR_DOUBLE_QUOTED:
case STR_SINGLE_QUOTED:
case STR_EMPTY:
case IDENTIFIER: {
atParam = callerParamItem();
callerExp.addParam(atParam);
atParam = null;
label_3:
while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case COMMA: {
;
break;
}
default:
jj_la1[21] = jj_gen;
break label_3;
}
jj_consume_token(COMMA);
atParam = callerParamItem();
callerExp.addParam(atParam);
atParam = null;
}
jj_consume_token(CPAR);
break;
}
default:
jj_la1[22] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case 75: {
jj_consume_token(75);
quickSelect = stringValue();
callerExp.setQuickSelect(false, quickSelect);
break;
}
default:
jj_la1[23] = jj_gen;
;
}
break;
}
case 75: {
jj_consume_token(75);
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case STR_DOUBLE_QUOTED:
case STR_SINGLE_QUOTED:
case STR_EMPTY: {
quickSelect = stringValue();
break;
}
default:
jj_la1[24] = jj_gen;
;
}
callerExp.setQuickSelect(true, quickSelect);
break;
}
default:
jj_la1[25] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{
if ("" != null)
return callerExp;
}
throw new Error("Missing return statement in function");
}
// .函数调用
final public CallerExpression funCall(String callName) throws ParseException {
CallerExpression callerExp = null;
Format finalFormat = null;
callerExp = callerParamSet(callName);
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case 76: {
jj_consume_token(76);
finalFormat = new RawFormat();
break;
}
case OBRA: {
ListExpression listExp = null;
listExp = list();
finalFormat = new ListFormat(listExp);
break;
}
case OCBR: {
ObjectExpression objectExp = null;
objectExp = object();
finalFormat = new ObjectFormat(objectExp);
break;
}
default:
jj_la1[26] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
callerExp.setResultFormat(finalFormat);
{
if ("" != null)
return callerExp;
}
throw new Error("Missing return statement in function");
}
// .Lambda函数: lambda : (obj,obj2) -> {}
final public LambdaBlockSet lambdaDef() throws ParseException {
LambdaBlockSet lambdaBlockSet = new LambdaBlockSet();
Token paramName = null;
BlockSet scriptBodys = null;
jj_consume_token(LAMBDA);
jj_consume_token(COLON);
jj_consume_token(OPAR);
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case IDENTIFIER: {
paramName = jj_consume_token(IDENTIFIER);
lambdaBlockSet.addParam(paramName.image);
break;
}
default:
jj_la1[27] = jj_gen;
;
}
label_4:
while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case COMMA: {
;
break;
}
default:
jj_la1[28] = jj_gen;
break label_4;
}
jj_consume_token(COMMA);
paramName = jj_consume_token(IDENTIFIER);
lambdaBlockSet.addParam(paramName.image);
}
jj_consume_token(CPAR);
jj_consume_token(75);
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case OCBR: {
jj_consume_token(OCBR);
scriptBodys = blockSet();
jj_consume_token(CCBR);
break;
}
default:
jj_la1[29] = jj_gen;
if (jj_2_4(2147483647)) {
Inst inst = null;
inst = block();
scriptBodys = new BlockSet(Arrays.asList(inst));
} else {
jj_consume_token(-1);
throw new ParseException();
}
}
lambdaBlockSet.addToBody(scriptBodys);
{
if ("" != null)
return lambdaBlockSet;
}
throw new Error("Missing return statement in function");
}
//-----------------------------------------------------------------------------
// .函数
final public VariableInst varBlock() throws ParseException {
String varName = null;
Variable value = null;
jj_consume_token(VAR);
varName = identifier();
jj_consume_token(ASS);
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case LAMBDA: {
value = lambdaDef();
break;
}
case INTEGER_NUM:
case HEX_NUM:
case OCTAL_NUM:
case BINARY_NUM:
case DECIMAL_NUM:
case TRUE:
case FALSE:
case NULL:
case OPAR:
case OBRA:
case OCBR:
case OCBREXT:
case BANG:
case MINUS:
case STR_DOUBLE_QUOTED:
case STR_SINGLE_QUOTED:
case STR_EMPTY:
case IDENTIFIER: {
value = expression();
break;
}
default:
jj_la1[30] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{
if ("" != null)
return new VariableInst(varName, value);
}
throw new Error("Missing return statement in function");
}
// .反回
final public ReturnInst returnBlock() throws ParseException {
Expression result = null;
jj_consume_token(RETURN);
result = expression();
{
if ("" != null)
return new ReturnInst(result);
}
throw new Error("Missing return statement in function");
}
// .判断
final public SwitchInst ifBlock() throws ParseException {
SwitchInst switchInst = new SwitchInst();
Expression testExp;
BlockSet instBlockSet;
jj_consume_token(IF);
jj_consume_token(OPAR);
testExp = expression();
jj_consume_token(CPAR);
instBlockSet = blockSet();
switchInst.addBlockSet(testExp, instBlockSet);
testExp = null;
instBlockSet = null;
label_5:
while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case ELSEIF: {
;
break;
}
default:
jj_la1[31] = jj_gen;
break label_5;
}
jj_consume_token(ELSEIF);
jj_consume_token(OPAR);
testExp = expression();
jj_consume_token(CPAR);
instBlockSet = blockSet();
switchInst.addBlockSet(testExp, instBlockSet);
testExp = null;
instBlockSet = null;
}
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case ELSE: {
jj_consume_token(ELSE);
instBlockSet = blockSet();
switchInst.setElseBlockSet(instBlockSet);
break;
}
default:
jj_la1[32] = jj_gen;
;
}
jj_consume_token(END);
{
if ("" != null)
return switchInst;
}
throw new Error("Missing return statement in function");
}
// .异常 or 中断
final public Inst breakBlock() throws ParseException {
String typeClass = null;
Number throwStatus = null;
Expression throwData = null;
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case EXIT: {
jj_consume_token(EXIT);
typeClass = "ExitInst";
break;
}
case THROW: {
jj_consume_token(THROW);
typeClass = "ThrowInst";
break;
}
default:
jj_la1[33] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
if (jj_2_5(2147483647)) {
throwStatus = breakBlockStatus();
throwData = expression();
} else {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case INTEGER_NUM:
case HEX_NUM:
case OCTAL_NUM:
case BINARY_NUM:
case DECIMAL_NUM:
case TRUE:
case FALSE:
case NULL:
case OPAR:
case OBRA:
case OCBR:
case OCBREXT:
case BANG:
case MINUS:
case STR_DOUBLE_QUOTED:
case STR_SINGLE_QUOTED:
case STR_EMPTY:
case IDENTIFIER: {
throwData = expression();
break;
}
default:
jj_la1[34] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
{
if ("" != null)
return "ThrowInst".equals(typeClass) ? new ThrowInst(throwStatus, throwData) : new ExitInst(throwStatus, throwData);
}
throw new Error("Missing return statement in function");
}
final public Number breakBlockStatus() throws ParseException {
Number errorCode = null;
errorCode = numberValue();
jj_consume_token(COMMA);
{
if ("" != null)
return errorCode;
}
throw new Error("Missing return statement in function");
}
// .选项指令
final public Inst optionBlock() throws ParseException {
String optKey = null;
PrimitiveExpression optValue = null;
jj_consume_token(OPTION);
optKey = identifier();
jj_consume_token(ASS);
optValue = primitiveValue();
{
if ("" != null)
return new OptionInst(optKey, optValue);
}
throw new Error("Missing return statement in function");
}
// .指令
final public Inst block() throws ParseException {
Inst inst = null;
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case VAR: {
inst = varBlock();
break;
}
case IF: {
inst = ifBlock();
break;
}
case RETURN: {
inst = returnBlock();
break;
}
case THROW:
case EXIT: {
inst = breakBlock();
break;
}
default:
jj_la1[35] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{
if ("" != null)
return inst;
}
throw new Error("Missing return statement in function");
}
// .块
final public BlockSet blockSet() throws ParseException {
BlockSet blockSet = new BlockSet();
Inst inst = null;
label_6:
while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case IF:
case RETURN:
case THROW:
case EXIT:
case VAR: {
;
break;
}
default:
jj_la1[36] = jj_gen;
break label_6;
}
inst = block();
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case SEMI: {
jj_consume_token(SEMI);
break;
}
default:
jj_la1[37] = jj_gen;
;
}
blockSet.addInst(inst);
inst = null;
}
{
if ("" != null)
return blockSet;
}
throw new Error("Missing return statement in function");
}
// 入口
final public BlockSet rootBlock() throws ParseException {
BlockSet rootBlockSet = new BlockSet();
BlockSet instBlockSet = null;
Inst optionInst = null;
label_7:
while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case OPTION: {
;
break;
}
default:
jj_la1[38] = jj_gen;
break label_7;
}
optionInst = optionBlock();
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case SEMI: {
jj_consume_token(SEMI);
break;
}
default:
jj_la1[39] = jj_gen;
;
}
rootBlockSet.addInst(optionInst);
optionInst = null;
}
instBlockSet = blockSet();
jj_consume_token(0);
rootBlockSet.addInstSet(instBlockSet);
{
if ("" != null)
return rootBlockSet;
}
throw new Error("Missing return statement in function");
}
private boolean jj_2_1(int xla) {
jj_la = xla;
jj_lastpos = jj_scanpos = token;
try {
return !jj_3_1();
} catch (LookaheadSuccess ls) {
return true;
} finally {
jj_save(0, xla);
}
}
private boolean jj_2_2(int xla) {
jj_la = xla;
jj_lastpos = jj_scanpos = token;
try {
return !jj_3_2();
} catch (LookaheadSuccess ls) {
return true;
} finally {
jj_save(1, xla);
}
}
private boolean jj_2_3(int xla) {
jj_la = xla;
jj_lastpos = jj_scanpos = token;
try {
return !jj_3_3();
} catch (LookaheadSuccess ls) {
return true;
} finally {
jj_save(2, xla);
}
}
private boolean jj_2_4(int xla) {
jj_la = xla;
jj_lastpos = jj_scanpos = token;
try {
return !jj_3_4();
} catch (LookaheadSuccess ls) {
return true;
} finally {
jj_save(3, xla);
}
}
private boolean jj_2_5(int xla) {
jj_la = xla;
jj_lastpos = jj_scanpos = token;
try {
return !jj_3_5();
} catch (LookaheadSuccess ls) {
return true;
} finally {
jj_save(4, xla);
}
}
private boolean jj_3_3() {
if (jj_3R_8())
return true;
return false;
}
private boolean jj_3R_74() {
if (jj_3R_80())
return true;
return false;
}
private boolean jj_3R_23() {
if (jj_scan_token(RETURN))
return true;
if (jj_3R_37())
return true;
return false;
}
private boolean jj_3R_8() {
Token xsp;
xsp = jj_scanpos;
if (jj_scan_token(44)) {
jj_scanpos = xsp;
if (jj_scan_token(46))
return true;
}
if (jj_3R_11())
return true;
return false;
}
private boolean jj_3R_36() {
if (jj_3R_37())
return true;
return false;
}
private boolean jj_3R_57() {
if (jj_3R_11())
return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3R_74())
jj_scanpos = xsp;
return false;
}
private boolean jj_3R_73() {
if (jj_3R_80())
return true;
return false;
}
private boolean jj_3R_35() {
if (jj_3R_54())
return true;
return false;
}
private boolean jj_3_4() {
if (jj_3R_9())
return true;
return false;
}
private boolean jj_3R_56() {
if (jj_3R_8())
return true;
return false;
}
private boolean jj_3R_21() {
if (jj_scan_token(VAR))
return true;
if (jj_3R_31())
return true;
if (jj_scan_token(ASS))
return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3R_35()) {
jj_scanpos = xsp;
if (jj_3R_36())
return true;
}
return false;
}
private boolean jj_3R_79() {
if (jj_scan_token(COLON))
return true;
if (jj_3R_37())
return true;
return false;
}
private boolean jj_3R_72() {
if (jj_3R_9())
return true;
return false;
}
private boolean jj_3R_37() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_55()) {
jj_scanpos = xsp;
if (jj_3R_56()) {
jj_scanpos = xsp;
if (jj_3R_57())
return true;
}
}
return false;
}
private boolean jj_3R_55() {
if (jj_scan_token(OPAR))
return true;
if (jj_3R_37())
return true;
if (jj_scan_token(CPAR))
return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3R_73())
jj_scanpos = xsp;
return false;
}
private boolean jj_3R_68() {
if (jj_scan_token(COMMA))
return true;
if (jj_3R_59())
return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3R_79())
jj_scanpos = xsp;
return false;
}
private boolean jj_3R_71() {
if (jj_scan_token(OCBR))
return true;
if (jj_3R_38())
return true;
if (jj_scan_token(CCBR))
return true;
return false;
}
private boolean jj_3R_67() {
if (jj_scan_token(COLON))
return true;
if (jj_3R_37())
return true;
return false;
}
private boolean jj_3R_70() {
if (jj_scan_token(COMMA))
return true;
if (jj_scan_token(IDENTIFIER))
return true;
return false;
}
private boolean jj_3R_69() {
if (jj_scan_token(IDENTIFIER))
return true;
return false;
}
private boolean jj_3R_53() {
if (jj_scan_token(OCBR))
return true;
if (jj_3R_59())
return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3R_67())
jj_scanpos = xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3R_68()) {
jj_scanpos = xsp;
break;
}
}
if (jj_scan_token(CCBR))
return true;
return false;
}
private boolean jj_3R_54() {
if (jj_scan_token(LAMBDA))
return true;
if (jj_scan_token(COLON))
return true;
if (jj_scan_token(OPAR))
return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3R_69())
jj_scanpos = xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3R_70()) {
jj_scanpos = xsp;
break;
}
}
if (jj_scan_token(CPAR))
return true;
if (jj_scan_token(75))
return true;
xsp = jj_scanpos;
if (jj_3R_71()) {
jj_scanpos = xsp;
if (jj_3R_72())
return true;
}
return false;
}
private boolean jj_3_2() {
if (jj_scan_token(OCBR))
return true;
if (jj_scan_token(CCBR))
return true;
return false;
}
private boolean jj_3R_66() {
if (jj_scan_token(COMMA))
return true;
if (jj_3R_37())
return true;
return false;
}
private boolean jj_3R_65() {
if (jj_3R_34())
return true;
return false;
}
private boolean jj_3R_34() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_2()) {
jj_scanpos = xsp;
if (jj_3R_53())
return true;
}
return false;
}
private boolean jj_3R_64() {
if (jj_3R_33())
return true;
return false;
}
private boolean jj_3R_63() {
if (jj_scan_token(76))
return true;
return false;
}
private boolean jj_3R_52() {
if (jj_scan_token(OBRA))
return true;
if (jj_3R_37())
return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3R_66()) {
jj_scanpos = xsp;
break;
}
}
if (jj_scan_token(CBRA))
return true;
return false;
}
private boolean jj_3R_83() {
if (jj_3R_59())
return true;
return false;
}
private boolean jj_3R_51() {
if (jj_3R_62())
return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3R_63()) {
jj_scanpos = xsp;
if (jj_3R_64()) {
jj_scanpos = xsp;
if (jj_3R_65())
return true;
}
}
return false;
}
private boolean jj_3R_87() {
if (jj_scan_token(COMMA))
return true;
if (jj_3R_86())
return true;
return false;
}
private boolean jj_3R_82() {
if (jj_scan_token(75))
return true;
if (jj_3R_59())
return true;
return false;
}
private boolean jj_3_1() {
if (jj_scan_token(OBRA))
return true;
if (jj_scan_token(CBRA))
return true;
return false;
}
private boolean jj_3R_78() {
if (jj_scan_token(75))
return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3R_83())
jj_scanpos = xsp;
return false;
}
private boolean jj_3R_33() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_1()) {
jj_scanpos = xsp;
if (jj_3R_52())
return true;
}
return false;
}
private boolean jj_3R_81() {
if (jj_3R_86())
return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3R_87()) {
jj_scanpos = xsp;
break;
}
}
if (jj_scan_token(CPAR))
return true;
return false;
}
private boolean jj_3R_29() {
if (jj_scan_token(BINARY_NUM))
return true;
return false;
}
private boolean jj_3R_28() {
if (jj_scan_token(OCTAL_NUM))
return true;
return false;
}
private boolean jj_3R_27() {
if (jj_scan_token(HEX_NUM))
return true;
return false;
}
private boolean jj_3R_26() {
if (jj_scan_token(INTEGER_NUM))
return true;
return false;
}
private boolean jj_3R_25() {
if (jj_scan_token(DECIMAL_NUM))
return true;
return false;
}
private boolean jj_3R_77() {
if (jj_scan_token(OPAR))
return true;
Token xsp;
xsp = jj_scanpos;
if (jj_scan_token(38)) {
jj_scanpos = xsp;
if (jj_3R_81())
return true;
}
xsp = jj_scanpos;
if (jj_3R_82())
jj_scanpos = xsp;
return false;
}
private boolean jj_3R_16() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_25()) {
jj_scanpos = xsp;
if (jj_3R_26()) {
jj_scanpos = xsp;
if (jj_3R_27()) {
jj_scanpos = xsp;
if (jj_3R_28()) {
jj_scanpos = xsp;
if (jj_3R_29())
return true;
}
}
}
}
return false;
}
private boolean jj_3R_62() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_77()) {
jj_scanpos = xsp;
if (jj_3R_78())
return true;
}
return false;
}
private boolean jj_3R_76() {
if (jj_scan_token(FALSE))
return true;
return false;
}
private boolean jj_3R_91() {
if (jj_3R_37())
return true;
return false;
}
private boolean jj_3R_75() {
if (jj_scan_token(TRUE))
return true;
return false;
}
private boolean jj_3R_61() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_75()) {
jj_scanpos = xsp;
if (jj_3R_76())
return true;
}
return false;
}
private boolean jj_3R_60() {
if (jj_scan_token(NULL))
return true;
return false;
}
private boolean jj_3R_90() {
if (jj_3R_54())
return true;
return false;
}
private boolean jj_3R_86() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_90()) {
jj_scanpos = xsp;
if (jj_3R_91())
return true;
}
return false;
}
private boolean jj_3R_58() {
if (jj_3R_9())
return true;
Token xsp;
xsp = jj_scanpos;
if (jj_scan_token(33))
jj_scanpos = xsp;
return false;
}
private boolean jj_3R_48() {
if (jj_3R_16())
return true;
return false;
}
private boolean jj_3R_38() {
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3R_58()) {
jj_scanpos = xsp;
break;
}
}
return false;
}
private boolean jj_3R_47() {
if (jj_3R_61())
return true;
return false;
}
private boolean jj_3R_15() {
if (jj_3R_24())
return true;
return false;
}
private boolean jj_3R_46() {
if (jj_3R_60())
return true;
return false;
}
private boolean jj_3R_14() {
if (jj_3R_23())
return true;
return false;
}
private boolean jj_3R_59() {
Token xsp;
xsp = jj_scanpos;
if (jj_scan_token(68)) {
jj_scanpos = xsp;
if (jj_scan_token(70)) {
jj_scanpos = xsp;
if (jj_scan_token(71))
return true;
}
}
return false;
}
private boolean jj_3R_13() {
if (jj_3R_22())
return true;
return false;
}
private boolean jj_3R_32() {
if (jj_3R_51())
return true;
return false;
}
private boolean jj_3R_50() {
if (jj_scan_token(OCBREXT))
return true;
if (jj_scan_token(IDENTIFIER))
return true;
if (jj_scan_token(CCBR))
return true;
return false;
}
private boolean jj_3R_30() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_45()) {
jj_scanpos = xsp;
if (jj_3R_46()) {
jj_scanpos = xsp;
if (jj_3R_47()) {
jj_scanpos = xsp;
if (jj_3R_48())
return true;
}
}
}
return false;
}
private boolean jj_3R_45() {
if (jj_3R_59())
return true;
return false;
}
private boolean jj_3R_20() {
if (jj_3R_34())
return true;
return false;
}
private boolean jj_3R_19() {
if (jj_3R_33())
return true;
return false;
}
private boolean jj_3R_12() {
if (jj_3R_21())
return true;
return false;
}
private boolean jj_3R_49() {
if (jj_scan_token(IDENTIFIER))
return true;
return false;
}
private boolean jj_3R_9() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_12()) {
jj_scanpos = xsp;
if (jj_3R_13()) {
jj_scanpos = xsp;
if (jj_3R_14()) {
jj_scanpos = xsp;
if (jj_3R_15())
return true;
}
}
}
return false;
}
private boolean jj_3R_31() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_49()) {
jj_scanpos = xsp;
if (jj_3R_50())
return true;
}
return false;
}
private boolean jj_3R_18() {
if (jj_3R_31())
return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3R_32())
jj_scanpos = xsp;
return false;
}
private boolean jj_3R_17() {
if (jj_3R_30())
return true;
return false;
}
private boolean jj_3_5() {
if (jj_3R_10())
return true;
return false;
}
private boolean jj_3R_11() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_17()) {
jj_scanpos = xsp;
if (jj_3R_18()) {
jj_scanpos = xsp;
if (jj_3R_19()) {
jj_scanpos = xsp;
if (jj_3R_20())
return true;
}
}
}
return false;
}
private boolean jj_3R_10() {
if (jj_3R_16())
return true;
if (jj_scan_token(COMMA))
return true;
return false;
}
private boolean jj_3R_44() {
if (jj_3R_37())
return true;
return false;
}
private boolean jj_3R_89() {
if (jj_scan_token(QUEM))
return true;
if (jj_3R_37())
return true;
if (jj_scan_token(COLON))
return true;
if (jj_3R_37())
return true;
return false;
}
private boolean jj_3R_43() {
if (jj_3R_10())
return true;
if (jj_3R_37())
return true;
return false;
}
private boolean jj_3R_42() {
if (jj_scan_token(THROW))
return true;
return false;
}
private boolean jj_3R_41() {
if (jj_scan_token(EXIT))
return true;
return false;
}
private boolean jj_3R_24() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_41()) {
jj_scanpos = xsp;
if (jj_3R_42())
return true;
}
xsp = jj_scanpos;
if (jj_3R_43()) {
jj_scanpos = xsp;
if (jj_3R_44())
return true;
}
return false;
}
private boolean jj_3R_40() {
if (jj_scan_token(ELSE))
return true;
if (jj_3R_38())
return true;
return false;
}
private boolean jj_3R_88() {
Token xsp;
xsp = jj_scanpos;
if (jj_scan_token(45)) {
jj_scanpos = xsp;
if (jj_scan_token(46)) {
jj_scanpos = xsp;
if (jj_scan_token(47)) {
jj_scanpos = xsp;
if (jj_scan_token(48)) {
jj_scanpos = xsp;
if (jj_scan_token(49)) {
jj_scanpos = xsp;
if (jj_scan_token(50)) {
jj_scanpos = xsp;
if (jj_scan_token(51)) {
jj_scanpos = xsp;
if (jj_scan_token(52)) {
jj_scanpos = xsp;
if (jj_scan_token(53)) {
jj_scanpos = xsp;
if (jj_scan_token(54)) {
jj_scanpos = xsp;
if (jj_scan_token(55)) {
jj_scanpos = xsp;
if (jj_scan_token(56)) {
jj_scanpos = xsp;
if (jj_scan_token(57)) {
jj_scanpos = xsp;
if (jj_scan_token(58)) {
jj_scanpos = xsp;
if (jj_scan_token(59)) {
jj_scanpos = xsp;
if (jj_scan_token(60)) {
jj_scanpos = xsp;
if (jj_scan_token(61)) {
jj_scanpos = xsp;
if (jj_scan_token(62)) {
jj_scanpos = xsp;
if (jj_scan_token(63)) {
jj_scanpos = xsp;
if (jj_scan_token(64))
return true;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
if (jj_3R_37())
return true;
return false;
}
private boolean jj_3R_39() {
if (jj_scan_token(ELSEIF))
return true;
if (jj_scan_token(OPAR))
return true;
if (jj_3R_37())
return true;
if (jj_scan_token(CPAR))
return true;
if (jj_3R_38())
return true;
return false;
}
private boolean jj_3R_85() {
if (jj_3R_89())
return true;
return false;
}
private boolean jj_3R_22() {
if (jj_scan_token(IF))
return true;
if (jj_scan_token(OPAR))
return true;
if (jj_3R_37())
return true;
if (jj_scan_token(CPAR))
return true;
if (jj_3R_38())
return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3R_39()) {
jj_scanpos = xsp;
break;
}
}
xsp = jj_scanpos;
if (jj_3R_40())
jj_scanpos = xsp;
if (jj_scan_token(END))
return true;
return false;
}
private boolean jj_3R_84() {
if (jj_3R_88())
return true;
return false;
}
private boolean jj_3R_80() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_84()) {
jj_scanpos = xsp;
if (jj_3R_85())
return true;
}
return false;
}
/** Generated Token Manager. */
public DataQLParserTokenManager token_source;
JavaCharStream jj_input_stream;
/** Current token. */
public Token token;
/** Next token. */
public Token jj_nt;
private int jj_ntk;
private Token jj_scanpos, jj_lastpos;
private int jj_la;
private int jj_gen;
final private int[] jj_la1 = new int[40];
static private int[] jj_la1_0;
static private int[] jj_la1_1;
static private int[] jj_la1_2;
static {
jj_la1_init_0();
jj_la1_init_1();
jj_la1_init_2();
}
private static void jj_la1_init_0() {
jj_la1_0 = new int[] { 0x0, 0x0, 0xc000000, 0x1f000, 0x40000000, 0x0, 0x80000000, 0x40000000, 0x80000000, 0x0, 0x0, 0x0, 0x0, 0x1c01f000, 0x0, 0x0, 0x0, 0x0, 0x1c01f000, 0x1c01f000, 0x1e01f000, 0x40000000, 0x1e01f000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40000000, 0x0, 0x1e01f000, 0x40000, 0x80000, 0xc00000, 0x1c01f000, 0x1e20000, 0x1e20000, 0x0, 0x20000000, 0x0, };
}
private static void jj_la1_init_1() {
jj_la1_1 = new int[] { 0x400, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0, 0x0, 0x200, 0xffffe001, 0xffffe001, 0x20, 0x680, 0x5000, 0xffffe001, 0xffffe000, 0x20, 0x680, 0x0, 0x56a0, 0x0, 0x56e0, 0x0, 0x0, 0x20, 0x280, 0x0, 0x0, 0x200, 0x56a0, 0x0, 0x0, 0x0, 0x56a0, 0x0, 0x0, 0x2, 0x0, 0x2, };
}
private static void jj_la1_init_2() {
jj_la1_2 = new int[] { 0x400, 0xd0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1, 0x0, 0x4d0, 0x0, 0x1, 0x1, 0x800, 0x4d0, 0xd0, 0x4d0, 0x0, 0x4d0, 0x800, 0xd0, 0x800, 0x1000, 0x400, 0x0, 0x0, 0x4d0, 0x0, 0x0, 0x0, 0x4d0, 0x0, 0x0, 0x0, 0x0, 0x0, };
}
final private JJCalls[] jj_2_rtns = new JJCalls[5];
private boolean jj_rescan = false;
private int jj_gc = 0;
/** Constructor with InputStream. */
public DataQLParser(java.io.InputStream stream) {
this(stream, null);
}
/** Constructor with InputStream and supplied encoding */
public DataQLParser(java.io.InputStream stream, String encoding) {
try {
jj_input_stream = new JavaCharStream(stream, encoding, 1, 1);
} catch (java.io.UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
token_source = new DataQLParserTokenManager(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 40; i++)
jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++)
jj_2_rtns[i] = new JJCalls();
}
/** Reinitialise. */
public void ReInit(java.io.InputStream stream) {
ReInit(stream, null);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream stream, String encoding) {
try {
jj_input_stream.ReInit(stream, encoding, 1, 1);
} catch (java.io.UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
token_source.ReInit(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 40; i++)
jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++)
jj_2_rtns[i] = new JJCalls();
}
/** Constructor. */
public DataQLParser(java.io.Reader stream) {
jj_input_stream = new JavaCharStream(stream, 1, 1);
token_source = new DataQLParserTokenManager(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 40; i++)
jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++)
jj_2_rtns[i] = new JJCalls();
}
/** Reinitialise. */
public void ReInit(java.io.Reader stream) {
jj_input_stream.ReInit(stream, 1, 1);
token_source.ReInit(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 40; i++)
jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++)
jj_2_rtns[i] = new JJCalls();
}
/** Constructor with generated Token Manager. */
public DataQLParser(DataQLParserTokenManager tm) {
token_source = tm;
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 40; i++)
jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++)
jj_2_rtns[i] = new JJCalls();
}
/** Reinitialise. */
public void ReInit(DataQLParserTokenManager tm) {
token_source = tm;
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 40; i++)
jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++)
jj_2_rtns[i] = new JJCalls();
}
private Token jj_consume_token(int kind) throws ParseException {
Token oldToken;
if ((oldToken = token).next != null)
token = token.next;
else
token = token.next = token_source.getNextToken();
jj_ntk = -1;
if (token.kind == kind) {
jj_gen++;
if (++jj_gc > 100) {
jj_gc = 0;
for (int i = 0; i < jj_2_rtns.length; i++) {
JJCalls c = jj_2_rtns[i];
while (c != null) {
if (c.gen < jj_gen)
c.first = null;
c = c.next;
}
}
}
return token;
}
token = oldToken;
jj_kind = kind;
throw generateParseException();
}
@SuppressWarnings("serial")
static private final class LookaheadSuccess extends java.lang.Error {
}
final private LookaheadSuccess jj_ls = new LookaheadSuccess();
private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;
if (jj_scanpos.next == null) {
jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
} else {
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
} else {
jj_scanpos = jj_scanpos.next;
}
if (jj_rescan) {
int i = 0;
Token tok = token;
while (tok != null && tok != jj_scanpos) {
i++;
tok = tok.next;
}
if (tok != null)
jj_add_error_token(kind, i);
}
if (jj_scanpos.kind != kind)
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
throw jj_ls;
return false;
}
/** Get the next Token. */
final public Token getNextToken() {
if (token.next != null)
token = token.next;
else
token = token.next = token_source.getNextToken();
jj_ntk = -1;
jj_gen++;
return token;
}
/** Get the specific Token. */
final public Token getToken(int index) {
Token t = token;
for (int i = 0; i < index; i++) {
if (t.next != null)
t = t.next;
else
t = t.next = token_source.getNextToken();
}
return t;
}
private int jj_ntk_f() {
if ((jj_nt = token.next) == null)
return (jj_ntk = (token.next = token_source.getNextToken()).kind);
else
return (jj_ntk = jj_nt.kind);
}
private java.util.List jj_expentries = new java.util.ArrayList();
private int[] jj_expentry;
private int jj_kind = -1;
private int[] jj_lasttokens = new int[100];
private int jj_endpos;
private void jj_add_error_token(int kind, int pos) {
if (pos >= 100)
return;
if (pos == jj_endpos + 1) {
jj_lasttokens[jj_endpos++] = kind;
} else if (jj_endpos != 0) {
jj_expentry = new int[jj_endpos];
for (int i = 0; i < jj_endpos; i++) {
jj_expentry[i] = jj_lasttokens[i];
}
jj_entries_loop:
for (java.util.Iterator> it = jj_expentries.iterator(); it.hasNext(); ) {
int[] oldentry = (int[]) (it.next());
if (oldentry.length == jj_expentry.length) {
for (int i = 0; i < jj_expentry.length; i++) {
if (oldentry[i] != jj_expentry[i]) {
continue jj_entries_loop;
}
}
jj_expentries.add(jj_expentry);
break jj_entries_loop;
}
}
if (pos != 0)
jj_lasttokens[(jj_endpos = pos) - 1] = kind;
}
}
/** Generate ParseException. */
public ParseException generateParseException() {
jj_expentries.clear();
boolean[] la1tokens = new boolean[77];
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
}
for (int i = 0; i < 40; i++) {
if (jj_la1[i] == jj_gen) {
for (int j = 0; j < 32; j++) {
if ((jj_la1_0[i] & (1 << j)) != 0) {
la1tokens[j] = true;
}
if ((jj_la1_1[i] & (1 << j)) != 0) {
la1tokens[32 + j] = true;
}
if ((jj_la1_2[i] & (1 << j)) != 0) {
la1tokens[64 + j] = true;
}
}
}
}
for (int i = 0; i < 77; i++) {
if (la1tokens[i]) {
jj_expentry = new int[1];
jj_expentry[0] = i;
jj_expentries.add(jj_expentry);
}
}
jj_endpos = 0;
jj_rescan_token();
jj_add_error_token(0, 0);
int[][] exptokseq = new int[jj_expentries.size()][];
for (int i = 0; i < jj_expentries.size(); i++) {
exptokseq[i] = jj_expentries.get(i);
}
return new ParseException(token, exptokseq, tokenImage);
}
/** Enable tracing. */
final public void enable_tracing() {
}
/** Disable tracing. */
final public void disable_tracing() {
}
private void jj_rescan_token() {
jj_rescan = true;
for (int i = 0; i < 5; i++) {
try {
JJCalls p = jj_2_rtns[i];
do {
if (p.gen > jj_gen) {
jj_la = p.arg;
jj_lastpos = jj_scanpos = p.first;
switch (i) {
case 0:
jj_3_1();
break;
case 1:
jj_3_2();
break;
case 2:
jj_3_3();
break;
case 3:
jj_3_4();
break;
case 4:
jj_3_5();
break;
}
}
p = p.next;
} while (p != null);
} catch (LookaheadSuccess ls) {
}
}
jj_rescan = false;
}
private void jj_save(int index, int xla) {
JJCalls p = jj_2_rtns[index];
while (p.gen > jj_gen) {
if (p.next == null) {
p = p.next = new JJCalls();
break;
}
p = p.next;
}
p.gen = jj_gen + xla - jj_la;
p.first = token;
p.arg = xla;
}
static final class JJCalls {
int gen;
Token first;
int arg;
JJCalls next;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy