javarecognizer.java

来自「Groovy动态语言 运行在JVM中的动态语言 可以方便的处理业务逻辑变化大的业」· Java 代码 · 共 2,519 行 · 第 1/5 页

JAVA
2,519
字号
		case LITERAL_false:		case LITERAL_null:		case LITERAL_new:		case NUM_INT:		case STRING_LITERAL:		case NUM_FLOAT:		case NUM_LONG:		case NUM_DOUBLE:		{			conditionalExpression();			astFactory.addASTChild(currentAST, returnAST);			annotationMemberValueInitializer_AST = (AST)currentAST.root;			break;		}		case AT:		{			annotation();			astFactory.addASTChild(currentAST, returnAST);			annotationMemberValueInitializer_AST = (AST)currentAST.root;			break;		}		case LCURLY:		{			annotationMemberArrayInitializer();			astFactory.addASTChild(currentAST, returnAST);			annotationMemberValueInitializer_AST = (AST)currentAST.root;			break;		}		default:		{			throw new NoViableAltException(LT(1), getFilename());		}		}		returnAST = annotationMemberValueInitializer_AST;	}		public final void anntotationMemberValuePairs() throws RecognitionException, TokenStreamException {				returnAST = null;		ASTPair currentAST = new ASTPair();		AST anntotationMemberValuePairs_AST = null;				annotationMemberValuePair();		astFactory.addASTChild(currentAST, returnAST);		{		_loop66:		do {			if ((LA(1)==COMMA)) {				match(COMMA);				annotationMemberValuePair();				astFactory.addASTChild(currentAST, returnAST);			}			else {				break _loop66;			}					} while (true);		}		anntotationMemberValuePairs_AST = (AST)currentAST.root;		returnAST = anntotationMemberValuePairs_AST;	}		public final void annotationMemberValuePair() throws RecognitionException, TokenStreamException {				returnAST = null;		ASTPair currentAST = new ASTPair();		AST annotationMemberValuePair_AST = null;		Token  i = null;		AST i_AST = null;		AST v_AST = null;		Token first = LT(1);				i = LT(1);		i_AST = astFactory.create(i);		match(IDENT);		match(ASSIGN);		annotationMemberValueInitializer();		v_AST = (AST)returnAST;		if ( inputState.guessing==0 ) {			annotationMemberValuePair_AST = (AST)currentAST.root;			annotationMemberValuePair_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(ANNOTATION_MEMBER_VALUE_PAIR,"ANNOTATION_MEMBER_VALUE_PAIR",first,LT(1))).add(i_AST).add(v_AST));			currentAST.root = annotationMemberValuePair_AST;			currentAST.child = annotationMemberValuePair_AST!=null &&annotationMemberValuePair_AST.getFirstChild()!=null ?				annotationMemberValuePair_AST.getFirstChild() : annotationMemberValuePair_AST;			currentAST.advanceChildToEnd();		}		returnAST = annotationMemberValuePair_AST;	}		public final void conditionalExpression() throws RecognitionException, TokenStreamException {				returnAST = null;		ASTPair currentAST = new ASTPair();		AST conditionalExpression_AST = null;				logicalOrExpression();		astFactory.addASTChild(currentAST, returnAST);		{		switch ( LA(1)) {		case QUESTION:		{			AST tmp63_AST = null;			tmp63_AST = astFactory.create(LT(1));			astFactory.makeASTRoot(currentAST, tmp63_AST);			match(QUESTION);			assignmentExpression();			astFactory.addASTChild(currentAST, returnAST);			match(COLON);			conditionalExpression();			astFactory.addASTChild(currentAST, returnAST);			break;		}		case SEMI:		case RBRACK:		case COMMA:		case RPAREN:		case ASSIGN:		case RCURLY:		case COLON:		case PLUS_ASSIGN:		case MINUS_ASSIGN:		case STAR_ASSIGN:		case DIV_ASSIGN:		case MOD_ASSIGN:		case SR_ASSIGN:		case BSR_ASSIGN:		case SL_ASSIGN:		case BAND_ASSIGN:		case BXOR_ASSIGN:		case BOR_ASSIGN:		{			break;		}		default:		{			throw new NoViableAltException(LT(1), getFilename());		}		}		}		conditionalExpression_AST = (AST)currentAST.root;		returnAST = conditionalExpression_AST;	}		public final void annotationMemberArrayInitializer() throws RecognitionException, TokenStreamException {				returnAST = null;		ASTPair currentAST = new ASTPair();		AST annotationMemberArrayInitializer_AST = null;		Token  lc = null;		AST lc_AST = null;				lc = LT(1);		lc_AST = astFactory.create(lc);		astFactory.makeASTRoot(currentAST, lc_AST);		match(LCURLY);		if ( inputState.guessing==0 ) {			lc_AST.setType(ANNOTATION_ARRAY_INIT);		}		{		switch ( LA(1)) {		case IDENT:		case LITERAL_super:		case LT:		case LITERAL_void:		case LITERAL_boolean:		case LITERAL_byte:		case LITERAL_char:		case LITERAL_short:		case LITERAL_int:		case LITERAL_float:		case LITERAL_long:		case LITERAL_double:		case AT:		case LPAREN:		case LITERAL_this:		case PLUS:		case MINUS:		case INC:		case DEC:		case BNOT:		case LNOT:		case LITERAL_true:		case LITERAL_false:		case LITERAL_null:		case LITERAL_new:		case NUM_INT:		case STRING_LITERAL:		case NUM_FLOAT:		case NUM_LONG:		case NUM_DOUBLE:		{			annotationMemberArrayValueInitializer();			astFactory.addASTChild(currentAST, returnAST);			{			_loop72:			do {				if ((LA(1)==COMMA) && (_tokenSet_12.member(LA(2)))) {					match(COMMA);					annotationMemberArrayValueInitializer();					astFactory.addASTChild(currentAST, returnAST);				}				else {					break _loop72;				}							} while (true);			}			{			switch ( LA(1)) {			case COMMA:			{				match(COMMA);				break;			}			case RCURLY:			{				break;			}			default:			{				throw new NoViableAltException(LT(1), getFilename());			}			}			}			break;		}		case RCURLY:		{			break;		}		default:		{			throw new NoViableAltException(LT(1), getFilename());		}		}		}		match(RCURLY);		annotationMemberArrayInitializer_AST = (AST)currentAST.root;		returnAST = annotationMemberArrayInitializer_AST;	}		public final void annotationMemberArrayValueInitializer() throws RecognitionException, TokenStreamException {				returnAST = null;		ASTPair currentAST = new ASTPair();		AST annotationMemberArrayValueInitializer_AST = null;				switch ( LA(1)) {		case IDENT:		case LITERAL_super:		case LT:		case LITERAL_void:		case LITERAL_boolean:		case LITERAL_byte:		case LITERAL_char:		case LITERAL_short:		case LITERAL_int:		case LITERAL_float:		case LITERAL_long:		case LITERAL_double:		case LPAREN:		case LITERAL_this:		case PLUS:		case MINUS:		case INC:		case DEC:		case BNOT:		case LNOT:		case LITERAL_true:		case LITERAL_false:		case LITERAL_null:		case LITERAL_new:		case NUM_INT:		case STRING_LITERAL:		case NUM_FLOAT:		case NUM_LONG:		case NUM_DOUBLE:		{			conditionalExpression();			astFactory.addASTChild(currentAST, returnAST);			annotationMemberArrayValueInitializer_AST = (AST)currentAST.root;			break;		}		case AT:		{			annotation();			astFactory.addASTChild(currentAST, returnAST);			annotationMemberArrayValueInitializer_AST = (AST)currentAST.root;			break;		}		default:		{			throw new NoViableAltException(LT(1), getFilename());		}		}		returnAST = annotationMemberArrayValueInitializer_AST;	}		public final void superClassClause() throws RecognitionException, TokenStreamException {				returnAST = null;		ASTPair currentAST = new ASTPair();		AST superClassClause_AST = null;		AST c_AST = null;		Token first = LT(1);				{		switch ( LA(1)) {		case LITERAL_extends:		{			match(LITERAL_extends);			classOrInterfaceType(false);			c_AST = (AST)returnAST;			break;		}		case LCURLY:		case LITERAL_implements:		{			break;		}		default:		{			throw new NoViableAltException(LT(1), getFilename());		}		}		}		if ( inputState.guessing==0 ) {			superClassClause_AST = (AST)currentAST.root;			superClassClause_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(EXTENDS_CLAUSE,"EXTENDS_CLAUSE",first,LT(1))).add(c_AST));			currentAST.root = superClassClause_AST;			currentAST.child = superClassClause_AST!=null &&superClassClause_AST.getFirstChild()!=null ?				superClassClause_AST.getFirstChild() : superClassClause_AST;			currentAST.advanceChildToEnd();		}		returnAST = superClassClause_AST;	}		public final void typeParameters() throws RecognitionException, TokenStreamException {				returnAST = null;		ASTPair currentAST = new ASTPair();		AST typeParameters_AST = null;		int currentLtLevel = 0; Token first = LT(1);				if ( inputState.guessing==0 ) {			currentLtLevel = ltCounter;		}		match(LT);		if ( inputState.guessing==0 ) {			ltCounter++;		}		typeParameter();		astFactory.addASTChild(currentAST, returnAST);		{		_loop85:		do {			if ((LA(1)==COMMA)) {				match(COMMA);				typeParameter();				astFactory.addASTChild(currentAST, returnAST);			}			else {				break _loop85;			}					} while (true);		}		{		switch ( LA(1)) {		case GT:		case SR:		case BSR:		{			typeArgumentsOrParametersEnd();			astFactory.addASTChild(currentAST, returnAST);			break;		}		case IDENT:		case LITERAL_extends:		case LITERAL_void:		case LITERAL_boolean:		case LITERAL_byte:		case LITERAL_char:		case LITERAL_short:		case LITERAL_int:		case LITERAL_float:		case LITERAL_long:		case LITERAL_double:		case LCURLY:		case LITERAL_implements:		{			break;		}		default:		{			throw new NoViableAltException(LT(1), getFilename());		}		}		}		if (!((currentLtLevel != 0) || ltCounter == currentLtLevel))		  throw new SemanticException("(currentLtLevel != 0) || ltCounter == currentLtLevel");		if ( inputState.guessing==0 ) {			typeParameters_AST = (AST)currentAST.root;			typeParameters_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_PARAMETERS,"TYPE_PARAMETERS",first,LT(1))).add(typeParameters_AST));			currentAST.root = typeParameters_AST;			currentAST.child = typeParameters_AST!=null &&typeParameters_AST.getFirstChild()!=null ?				typeParameters_AST.getFirstChild() : typeParameters_AST;			currentAST.advanceChildToEnd();		}		typeParameters_AST = (AST)currentAST.root;		returnAST = typeParameters_AST;	}		public final void implementsClause() throws RecognitionException, TokenStreamException {				returnAST = null;		ASTPair currentAST = new ASTPair();		AST implementsClause_AST = null;		Token  i = null;		AST i_AST = null;		Token first = LT(1);				{		switch ( LA(1)) {		case LITERAL_implements:		{			i = LT(1);			i_AST = astFactory.create(i);			match(LITERAL_implements);			classOrInterfaceType(false);			astFactory.addASTChild(currentAST, returnAST);			{			_loop133:			do {				if ((LA(1)==COMMA)) {					match(COMMA);					classOrInterfaceType(false);					astFactory.addASTChild(currentAST, returnAST);				}				else {					break _loop133;				}							} while (true);			}			break;		}		case LCURLY:		{			break;		}		default:		{			throw new NoViableAltException(LT(1), getFilename());		}		}		}		if ( inputState.guessing==0 ) {			implementsClause_AST = (AST)currentAST.root;			implementsClause_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(IMPLEMENTS_CLAUSE,"IMPLEMENTS_CLAUSE",first,LT(1))).add(implementsClause_AST));			currentAST.root = implementsClause_AST;			currentAST.child = implementsClause_AST!=null &&implementsClause_AST.getFirstChild()!=null ?				implementsClause_AST.getFirstChild() : implementsClause_AST;			currentAST.advanceChildToEnd();		}		implementsClause_AST = (AST)currentAST.root;		returnAST = implementsClause_AST;	}		public final void classBlock() throws RecognitionException, TokenStreamException {				returnAST = null;		ASTPair currentAST = new ASTPair();		AST classBlock_AST = null;				match(LCURLY);		{		_loop95:		do {			switch ( LA(1)) {			case FINAL:			case ABSTRACT:			case STRICTFP:			case LITERAL_static:			case IDENT:			case LT:			case LITERAL_void:			case LITERAL_boolean:			case LITERAL_byte:			case LITERAL_char:			case LITERAL_short:			case LITERAL_int:			case LITERAL_float:			case LITERAL_long:			case LITERAL_double:			case LITERAL_private:			case LITERAL_public:			case LITERAL_protected:			case LITERAL_transient:			case LITERAL_native:			case LITERAL_threadsafe:			case LITERAL_synchronized:			

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?