⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 groovyrecognizer.java

📁 大名鼎鼎的java动态脚本语言。已经通过了sun的认证
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
		case LITERAL_switch:		case LITERAL_for:		case LITERAL_return:		case LITERAL_break:		case LITERAL_continue:		case LITERAL_throw:		case LITERAL_assert:		case PLUS:		case MINUS:		case LITERAL_try:		case INC:		case DEC:		case BNOT:		case LNOT:		case DOLLAR:		case STRING_CTOR_START:		case LITERAL_new:		case LITERAL_true:		case LITERAL_false:		case LITERAL_null:		case NUM_INT:		case NUM_FLOAT:		case NUM_LONG:		case NUM_DOUBLE:		case NUM_BIG_INT:		case NUM_BIG_DECIMAL:		{			break;		}		default:		{			throw new NoViableAltException(LT(1), getFilename());		}		}		}		nls();		{		boolean synPredMatched5 = false;		if (((LA(1)==LITERAL_package||LA(1)==AT) && (LA(2)==IDENT) && (_tokenSet_0.member(LA(3))))) {			int _m5 = mark();			synPredMatched5 = true;			inputState.guessing++;			try {				{				annotationsOpt();				match(LITERAL_package);				}			}			catch (RecognitionException pe) {				synPredMatched5 = false;			}			rewind(_m5);			inputState.guessing--;		}		if ( synPredMatched5 ) {			packageDefinition();			astFactory.addASTChild(currentAST, returnAST);		}		else if ((_tokenSet_1.member(LA(1))) && (_tokenSet_2.member(LA(2))) && (_tokenSet_3.member(LA(3)))) {			{			switch ( LA(1)) {			case FINAL:			case ABSTRACT:			case STRICTFP:			case LITERAL_import:			case LITERAL_static:			case LITERAL_def:			case AT:			case IDENT:			case LBRACK:			case LPAREN:			case LITERAL_class:			case LITERAL_interface:			case LITERAL_enum:			case LITERAL_super:			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_any:			case STAR:			case LITERAL_private:			case LITERAL_public:			case LITERAL_protected:			case LITERAL_transient:			case LITERAL_native:			case LITERAL_threadsafe:			case LITERAL_synchronized:			case LITERAL_volatile:			case LCURLY:			case LITERAL_this:			case STRING_LITERAL:			case LITERAL_if:			case LITERAL_while:			case LITERAL_with:			case LITERAL_switch:			case LITERAL_for:			case LITERAL_return:			case LITERAL_break:			case LITERAL_continue:			case LITERAL_throw:			case LITERAL_assert:			case PLUS:			case MINUS:			case LITERAL_try:			case INC:			case DEC:			case BNOT:			case LNOT:			case DOLLAR:			case STRING_CTOR_START:			case LITERAL_new:			case LITERAL_true:			case LITERAL_false:			case LITERAL_null:			case NUM_INT:			case NUM_FLOAT:			case NUM_LONG:			case NUM_DOUBLE:			case NUM_BIG_INT:			case NUM_BIG_DECIMAL:			{				statement(EOF);				astFactory.addASTChild(currentAST, returnAST);				break;			}			case EOF:			case SEMI:			case NLS:			{				break;			}			default:			{				throw new NoViableAltException(LT(1), getFilename());			}			}			}		}		else {			throw new NoViableAltException(LT(1), getFilename());		}				}		{		_loop9:		do {			if ((LA(1)==SEMI||LA(1)==NLS)) {				sep();				{				switch ( LA(1)) {				case FINAL:				case ABSTRACT:				case STRICTFP:				case LITERAL_import:				case LITERAL_static:				case LITERAL_def:				case AT:				case IDENT:				case LBRACK:				case LPAREN:				case LITERAL_class:				case LITERAL_interface:				case LITERAL_enum:				case LITERAL_super:				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_any:				case STAR:				case LITERAL_private:				case LITERAL_public:				case LITERAL_protected:				case LITERAL_transient:				case LITERAL_native:				case LITERAL_threadsafe:				case LITERAL_synchronized:				case LITERAL_volatile:				case LCURLY:				case LITERAL_this:				case STRING_LITERAL:				case LITERAL_if:				case LITERAL_while:				case LITERAL_with:				case LITERAL_switch:				case LITERAL_for:				case LITERAL_return:				case LITERAL_break:				case LITERAL_continue:				case LITERAL_throw:				case LITERAL_assert:				case PLUS:				case MINUS:				case LITERAL_try:				case INC:				case DEC:				case BNOT:				case LNOT:				case DOLLAR:				case STRING_CTOR_START:				case LITERAL_new:				case LITERAL_true:				case LITERAL_false:				case LITERAL_null:				case NUM_INT:				case NUM_FLOAT:				case NUM_LONG:				case NUM_DOUBLE:				case NUM_BIG_INT:				case NUM_BIG_DECIMAL:				{					statement(sepToken);					astFactory.addASTChild(currentAST, returnAST);					break;				}				case EOF:				case SEMI:				case NLS:				{					break;				}				default:				{					throw new NoViableAltException(LT(1), getFilename());				}				}				}			}			else {				break _loop9;			}					} while (true);		}		match(Token.EOF_TYPE);		compilationUnit_AST = (AST)currentAST.root;		returnAST = compilationUnit_AST;	}	/** Zero or more insignificant newlines, all gobbled up and thrown away. */	public final void nls() throws RecognitionException, TokenStreamException {				returnAST = null;		ASTPair currentAST = new ASTPair();		AST nls_AST = null;				{		if ((LA(1)==NLS) && (_tokenSet_4.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {			match(NLS);		}		else if ((_tokenSet_4.member(LA(1))) && (_tokenSet_5.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {		}		else {			throw new NoViableAltException(LT(1), getFilename());		}				}		returnAST = nls_AST;	}		public final void annotationsOpt() throws RecognitionException, TokenStreamException {				returnAST = null;		ASTPair currentAST = new ASTPair();		AST annotationsOpt_AST = null;		Token first = LT(1);				{		_loop79:		do {			if ((LA(1)==AT)) {				annotation();				astFactory.addASTChild(currentAST, returnAST);				nls();			}			else {				break _loop79;			}					} while (true);		}		if ( inputState.guessing==0 ) {			annotationsOpt_AST = (AST)currentAST.root;			annotationsOpt_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(ANNOTATIONS,"ANNOTATIONS",first,LT(1))).add(annotationsOpt_AST));			currentAST.root = annotationsOpt_AST;			currentAST.child = annotationsOpt_AST!=null &&annotationsOpt_AST.getFirstChild()!=null ?				annotationsOpt_AST.getFirstChild() : annotationsOpt_AST;			currentAST.advanceChildToEnd();		}		annotationsOpt_AST = (AST)currentAST.root;		returnAST = annotationsOpt_AST;	}		public final void packageDefinition() throws RecognitionException, TokenStreamException {				returnAST = null;		ASTPair currentAST = new ASTPair();		AST packageDefinition_AST = null;		Token  p = null;		AST p_AST = null;				annotationsOpt();		astFactory.addASTChild(currentAST, returnAST);		p = LT(1);		p_AST = astFactory.create(p);		astFactory.makeASTRoot(currentAST, p_AST);		match(LITERAL_package);		if ( inputState.guessing==0 ) {			p_AST.setType(PACKAGE_DEF);		}		identifier();		astFactory.addASTChild(currentAST, returnAST);		packageDefinition_AST = (AST)currentAST.root;		returnAST = packageDefinition_AST;	}	/** A statement is an element of a block. *  Typical statements are declarations (which are scoped to the block) *  and expressions. */	public final void statement(		int prevToken	) throws RecognitionException, TokenStreamException {				returnAST = null;		ASTPair currentAST = new ASTPair();		AST statement_AST = null;		AST pfx_AST = null;		AST m_AST = null;		Token  sp = null;		AST sp_AST = null;				switch ( LA(1)) {		case LITERAL_if:		{			AST tmp4_AST = null;			tmp4_AST = astFactory.create(LT(1));			astFactory.makeASTRoot(currentAST, tmp4_AST);			match(LITERAL_if);			match(LPAREN);			assignmentLessExpression();			astFactory.addASTChild(currentAST, returnAST);			match(RPAREN);			nlsWarn();			compatibleBodyStatement();			astFactory.addASTChild(currentAST, returnAST);			{			boolean synPredMatched272 = false;			if (((_tokenSet_6.member(LA(1))) && (_tokenSet_7.member(LA(2))) && (_tokenSet_8.member(LA(3))))) {				int _m272 = mark();				synPredMatched272 = true;				inputState.guessing++;				try {					{					{					switch ( LA(1)) {					case SEMI:					case NLS:					{						sep();						break;					}					case LITERAL_else:					{						break;					}					default:					{						throw new NoViableAltException(LT(1), getFilename());					}					}					}					match(LITERAL_else);					}				}				catch (RecognitionException pe) {					synPredMatched272 = false;				}				rewind(_m272);				inputState.guessing--;			}			if ( synPredMatched272 ) {				{				switch ( LA(1)) {				case SEMI:				case NLS:				{					sep();					break;				}				case LITERAL_else:				{					break;				}				default:				{					throw new NoViableAltException(LT(1), getFilename());				}				}				}				match(LITERAL_else);				nlsWarn();				compatibleBodyStatement();				astFactory.addASTChild(currentAST, returnAST);			}			else if ((_tokenSet_9.member(LA(1))) && (_tokenSet_10.member(LA(2))) && (_tokenSet_11.member(LA(3)))) {			}			else {				throw new NoViableAltException(LT(1), getFilename());			}						}			statement_AST = (AST)currentAST.root;			break;		}		case LITERAL_for:		{			forStatement();			astFactory.addASTChild(currentAST, returnAST);			statement_AST = (AST)currentAST.root;			break;		}		case LITERAL_while:		{			AST tmp8_AST = null;			tmp8_AST = astFactory.create(LT(1));			astFactory.makeASTRoot(currentAST, tmp8_AST);			match(LITERAL_while);			match(LPAREN);			strictContextExpression();			astFactory.addASTChild(currentAST, returnAST);			match(RPAREN);			nlsWarn();			compatibleBodyStatement();			astFactory.addASTChild(currentAST, returnAST);			statement_AST = (AST)currentAST.root;			break;		}		case LITERAL_with:		{			AST tmp11_AST = null;			tmp11_AST = astFactory.create(LT(1));			astFactory.makeASTRoot(currentAST, tmp11_AST);			match(LITERAL_with);			match(LPAREN);			strictContextExpression();			astFactory.addASTChild(currentAST, returnAST);			match(RPAREN);

⌨️ 快捷键说明

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