📄 expressionparser.java
字号:
{
AST tmp30_AST = null;
tmp30_AST = astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, tmp30_AST);
match(INC);
unaryExpression();
astFactory.addASTChild(currentAST, returnAST);
unaryExpression_AST = (AST)currentAST.root;
break;
}
case DEC:
{
AST tmp31_AST = null;
tmp31_AST = astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, tmp31_AST);
match(DEC);
unaryExpression();
astFactory.addASTChild(currentAST, returnAST);
unaryExpression_AST = (AST)currentAST.root;
break;
}
case MINUS:
{
minus = LT(1);
minus_AST = astFactory.create(minus);
astFactory.makeASTRoot(currentAST, minus_AST);
match(MINUS);
unaryExpression();
astFactory.addASTChild(currentAST, returnAST);
minus_AST.setType(UNARY_MINUS);
unaryExpression_AST = (AST)currentAST.root;
break;
}
case PLUS:
{
plus = LT(1);
plus_AST = astFactory.create(plus);
astFactory.makeASTRoot(currentAST, plus_AST);
match(PLUS);
unaryExpression();
astFactory.addASTChild(currentAST, returnAST);
plus_AST.setType(UNARY_PLUS);
unaryExpression_AST = (AST)currentAST.root;
break;
}
case BIGINT_LITERAL:
case LONG_LITERAL:
case INTEGER_LITERAL:
case SHORT_LITERAL:
case BYTE_LITERAL:
case LEFT_PARENTHESE:
case LOGICAL_NOT:
case BITWISE_NOT:
case CHARACTER_LITERAL:
case STRING_LITERAL:
case NUMERAL:
case IDENTIFIER:
case HEX_LITERAL:
case OCTAL_LITERAL:
case LITERAL_not:
case LITERAL_true:
case LITERAL_false:
{
unaryExpressionNotPlusMinus();
astFactory.addASTChild(currentAST, returnAST);
unaryExpression_AST = (AST)currentAST.root;
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
catch (RecognitionException ex) {
reportError(ex);
consume();
consumeUntil(_tokenSet_12);
}
returnAST = unaryExpression_AST;
}
public final void unaryExpressionNotPlusMinus() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
AST unaryExpressionNotPlusMinus_AST = null;
Token not = null;
AST not_AST = null;
try { // for error handling
switch ( LA(1)) {
case BITWISE_NOT:
{
AST tmp32_AST = null;
tmp32_AST = astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, tmp32_AST);
match(BITWISE_NOT);
unaryExpression();
astFactory.addASTChild(currentAST, returnAST);
unaryExpressionNotPlusMinus_AST = (AST)currentAST.root;
break;
}
case LOGICAL_NOT:
{
AST tmp33_AST = null;
tmp33_AST = astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, tmp33_AST);
match(LOGICAL_NOT);
unaryExpression();
astFactory.addASTChild(currentAST, returnAST);
unaryExpressionNotPlusMinus_AST = (AST)currentAST.root;
break;
}
case LITERAL_not:
{
not = LT(1);
not_AST = astFactory.create(not);
astFactory.makeASTRoot(currentAST, not_AST);
match(LITERAL_not);
not_AST.setType(BITWISE_NOT);
unaryExpression();
astFactory.addASTChild(currentAST, returnAST);
unaryExpressionNotPlusMinus_AST = (AST)currentAST.root;
break;
}
case BIGINT_LITERAL:
case LONG_LITERAL:
case INTEGER_LITERAL:
case SHORT_LITERAL:
case BYTE_LITERAL:
case LEFT_PARENTHESE:
case CHARACTER_LITERAL:
case STRING_LITERAL:
case NUMERAL:
case IDENTIFIER:
case HEX_LITERAL:
case OCTAL_LITERAL:
case LITERAL_true:
case LITERAL_false:
{
postfixExpression();
astFactory.addASTChild(currentAST, returnAST);
unaryExpressionNotPlusMinus_AST = (AST)currentAST.root;
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
catch (RecognitionException ex) {
reportError(ex);
consume();
consumeUntil(_tokenSet_12);
}
returnAST = unaryExpressionNotPlusMinus_AST;
}
public final void postfixExpression() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
AST postfixExpression_AST = null;
Token in = null;
AST in_AST = null;
Token de = null;
AST de_AST = null;
try { // for error handling
primaryExpression();
astFactory.addASTChild(currentAST, returnAST);
{
switch ( LA(1)) {
case INC:
{
in = LT(1);
in_AST = astFactory.create(in);
astFactory.makeASTRoot(currentAST, in_AST);
match(INC);
in_AST.setType(POST_INC);
break;
}
case DEC:
{
de = LT(1);
de_AST = astFactory.create(de);
astFactory.makeASTRoot(currentAST, de_AST);
match(DEC);
de_AST.setType(POST_DEC);
break;
}
case EOF:
case RIGHT_PARENTHESE:
case LOGICAL_AND:
case LOGICAL_OR:
case BITWISE_AND:
case BITWISE_OR:
case BITWISE_XOR:
case PLUS:
case MINUS:
case STAR:
case DIV:
case MOD:
case SHIFT_LEFT:
case SHIFT_RIGHT:
case EQUAL:
case UNEQUAL:
case LESS_THAN:
case GREATER_THAN:
case LESS_THAN_EQUAL:
case GREATER_THAN_EQUAL:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
postfixExpression_AST = (AST)currentAST.root;
}
catch (RecognitionException ex) {
reportError(ex);
consume();
consumeUntil(_tokenSet_12);
}
returnAST = postfixExpression_AST;
}
public final void primaryExpression() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
AST primaryExpression_AST = null;
try { // for error handling
switch ( LA(1)) {
case BIGINT_LITERAL:
case LONG_LITERAL:
case INTEGER_LITERAL:
case SHORT_LITERAL:
case BYTE_LITERAL:
case CHARACTER_LITERAL:
case STRING_LITERAL:
case NUMERAL:
case HEX_LITERAL:
case OCTAL_LITERAL:
{
literal();
astFactory.addASTChild(currentAST, returnAST);
primaryExpression_AST = (AST)currentAST.root;
break;
}
case IDENTIFIER:
{
AST tmp34_AST = null;
tmp34_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp34_AST);
match(IDENTIFIER);
primaryExpression_AST = (AST)currentAST.root;
break;
}
case LEFT_PARENTHESE:
{
match(LEFT_PARENTHESE);
assignmentExpression();
astFactory.addASTChild(currentAST, returnAST);
match(RIGHT_PARENTHESE);
primaryExpression_AST = (AST)currentAST.root;
break;
}
case LITERAL_true:
{
AST tmp37_AST = null;
tmp37_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp37_AST);
match(LITERAL_true);
primaryExpression_AST = (AST)currentAST.root;
break;
}
case LITERAL_false:
{
AST tmp38_AST = null;
tmp38_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp38_AST);
match(LITERAL_false);
primaryExpression_AST = (AST)currentAST.root;
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
catch (RecognitionException ex) {
reportError(ex);
consume();
consumeUntil(_tokenSet_0);
}
returnAST = primaryExpression_AST;
}
public static final String[] _tokenNames = {
"<0>",
"EOF",
"<2>",
"NULL_TREE_LOOKAHEAD",
"FLOAT_LITERAL",
"DOUBLE_LITERAL",
"BIGINT_LITERAL",
"LONG_LITERAL",
"INTEGER_LITERAL",
"SHORT_LITERAL",
"BYTE_LITERAL",
"EXPR",
"UNARY_MINUS",
"UNARY_PLUS",
"POST_INC",
"POST_DEC",
"UNICODE_LETTER",
"UNICODE_CHARACTER_DIGIT",
"LETTER",
"LETTER_OR_DIGIT",
"LEFT_PARENTHESE",
"RIGHT_PARENTHESE",
"LEFT_BRACE",
"RIGHT_BRACE",
"LEFT_BRACKET",
"RIGHT_BRACKET",
"SEMICOLON",
"COMMA",
"APOSTROPHE",
"DOT",
"COLON",
"LOGICAL_AND",
"LOGICAL_OR",
"BITWISE_AND",
"BITWISE_OR",
"LOGICAL_NOT",
"BITWISE_NOT",
"BITWISE_XOR",
"PLUS",
"MINUS",
"STAR",
"DIV",
"MOD",
"SHIFT_LEFT",
"SHIFT_RIGHT",
"EQUAL",
"UNEQUAL",
"LESS_THAN",
"GREATER_THAN",
"LESS_THAN_EQUAL",
"GREATER_THAN_EQUAL",
"INC",
"DEC",
"ASSIGN",
"HORIZONTAL_TABULATOR",
"VERTICAL_TABULATOR",
"LINE_FEED",
"FORM_FEED",
"CARRIAGE_RETURN",
"SPACE",
"LINE_SEPARATOR",
"PARAGRAPH_SEPARATOR",
"DIGIT",
"HEX_DIGIT",
"OCTAL_DIGIT",
"ZERO_TO_THREE",
"OCTAL_NUMERAL",
"EXPONENT_PART",
"FLOAT_SUFFIX",
"WHITE_SPACE",
"STRING_CHARACTER",
"CHARACTER_LITERAL",
"STRING_LITERAL_PART",
"STRING_LITERAL",
"NUMERAL",
"IDENTIFIER",
"HEX_LITERAL",
"OCTAL_LITERAL",
"\"not\"",
"\"true\"",
"\"false\""
};
protected void buildTokenTypeASTClassMap() {
tokenTypeToASTClassMap=null;
};
private static final long[] mk_tokenSet_0() {
long[] data = { 9007094030139394L, 0L};
return data;
}
public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
private static final long[] mk_tokenSet_1() {
long[] data = { 2L, 0L};
return data;
}
public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
private static final long[] mk_tokenSet_2() {
long[] data = { 2097154L, 0L};
return data;
}
public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
private static final long[] mk_tokenSet_3() {
long[] data = { 4297064450L, 0L};
return data;
}
public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
private static final long[] mk_tokenSet_4() {
long[] data = { 6444548098L, 0L};
return data;
}
public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
private static final long[] mk_tokenSet_5() {
long[] data = { 23624417282L, 0L};
return data;
}
public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5());
private static final long[] mk_tokenSet_6() {
long[] data = { 161063370754L, 0L};
return data;
}
public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6());
private static final long[] mk_tokenSet_7() {
long[] data = { 169653305346L, 0L};
return data;
}
public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7());
private static final long[] mk_tokenSet_8() {
long[] data = { 105722769571842L, 0L};
return data;
}
public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8());
private static final long[] mk_tokenSet_9() {
long[] data = { 2216785094901762L, 0L};
return data;
}
public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9());
private static final long[] mk_tokenSet_10() {
long[] data = { 2243173373968386L, 0L};
return data;
}
public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10());
private static final long[] mk_tokenSet_11() {
long[] data = { 2243998007689218L, 0L};
return data;
}
public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11());
private static final long[] mk_tokenSet_12() {
long[] data = { 2251694589083650L, 0L};
return data;
}
public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12());
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -