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

📄 rcparser.java

📁 外国人写的c#语法解析器
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST unaryExpression_AST = null;
		Token  minus = null;
		AST minus_AST = null;
		Token  plus = null;
		AST plus_AST = null;
		
		try {      // for error handling
			switch ( LA(1)) {
			case INC:
			{
				AST tmp32_AST = null;
				tmp32_AST = astFactory.create(LT(1));
				astFactory.makeASTRoot(currentAST, tmp32_AST);
				match(INC);
				unaryExpression();
				astFactory.addASTChild(currentAST, returnAST);
				unaryExpression_AST = (AST)currentAST.root;
				break;
			}
			case DEC:
			{
				AST tmp33_AST = null;
				tmp33_AST = astFactory.create(LT(1));
				astFactory.makeASTRoot(currentAST, tmp33_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 LONG_LITERAL:
			case LEFT_PARENTHESE:
			case LOGICAL_NOT:
			case BITWISE_NOT:
			case STRING_LITERAL:
			case NUMERAL:
			case IDENTIFIER:
			case HEX_LITERAL:
			case OCTAL_LITERAL:
			case LITERAL_not:
			case LITERAL_l:
			{
				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_22);
		}
		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 tmp34_AST = null;
				tmp34_AST = astFactory.create(LT(1));
				astFactory.makeASTRoot(currentAST, tmp34_AST);
				match(BITWISE_NOT);
				unaryExpression();
				astFactory.addASTChild(currentAST, returnAST);
				unaryExpressionNotPlusMinus_AST = (AST)currentAST.root;
				break;
			}
			case LOGICAL_NOT:
			{
				AST tmp35_AST = null;
				tmp35_AST = astFactory.create(LT(1));
				astFactory.makeASTRoot(currentAST, tmp35_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 LONG_LITERAL:
			case LEFT_PARENTHESE:
			case STRING_LITERAL:
			case NUMERAL:
			case IDENTIFIER:
			case HEX_LITERAL:
			case OCTAL_LITERAL:
			case LITERAL_l:
			{
				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_22);
		}
		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 LONG_LITERAL:
			case RIGHT_PARENTHESE:
			case LEFT_BRACE:
			case RIGHT_BRACE:
			case COMMA:
			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:
			case STRING_LITERAL:
			case NUMERAL:
			case IDENTIFIER:
			case HEX_LITERAL:
			case OCTAL_LITERAL:
			case LITERAL_begin:
			case LITERAL_end:
			case LITERAL_l:
			case LITERAL_language:
			case LITERAL_characteristics:
			case LITERAL_version:
			case LITERAL_caption:
			case LITERAL_class:
			case LITERAL_style:
			case LITERAL_exstyle:
			case LITERAL_font:
			case LITERAL_menu:
			case LITERAL_control:
			case LITERAL_ltext:
			case LITERAL_rtext:
			case LITERAL_ctext:
			case 135:
			case LITERAL_autocheckbox:
			case LITERAL_autoradiobutton:
			case LITERAL_checkbox:
			case LITERAL_pushbox:
			case LITERAL_pushbutton:
			case LITERAL_defpushbutton:
			case LITERAL_radiobutton:
			case 143:
			case LITERAL_groupbox:
			case LITERAL_userbutton:
			case LITERAL_edittext:
			case LITERAL_bedit:
			case LITERAL_hedit:
			case LITERAL_iedit:
			case LITERAL_combobox:
			case LITERAL_listbox:
			case LITERAL_icon:
			case LITERAL_scrollbar:
			case LITERAL_menuitem:
			case LITERAL_separator:
			case LITERAL_popup:
			case LITERAL_fileversion:
			case LITERAL_productversion:
			case LITERAL_fileflagsmask:
			case LITERAL_fileflags:
			case LITERAL_fileos:
			case LITERAL_filetype:
			case LITERAL_filesubtype:
			case LITERAL_button:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			postfixExpression_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_22);
		}
		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 LONG_LITERAL:
			case STRING_LITERAL:
			case NUMERAL:
			case HEX_LITERAL:
			case OCTAL_LITERAL:
			case LITERAL_l:
			{
				literal();
				astFactory.addASTChild(currentAST, returnAST);
				primaryExpression_AST = (AST)currentAST.root;
				break;
			}
			case IDENTIFIER:
			{
				AST tmp36_AST = null;
				tmp36_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp36_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;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_23);
		}
		returnAST = primaryExpression_AST;
	}
	
	public final void open_definition() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST open_definition_AST = null;
		
		try {      // for error handling
			switch ( LA(1)) {
			case LEFT_BRACE:
			{
				AST tmp39_AST = null;
				tmp39_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp39_AST);
				match(LEFT_BRACE);
				open_definition_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_begin:
			{
				AST tmp40_AST = null;
				tmp40_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp40_AST);
				match(LITERAL_begin);
				open_definition_AST = (AST)currentAST.root;
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_24);
		}
		returnAST = open_definition_AST;
	}
	
	public final void close_definition() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST close_definition_AST = null;
		
		try {      // for error handling
			switch ( LA(1)) {
			case RIGHT_BRACE:
			{
				AST tmp41_AST = null;
				tmp41_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp41_AST);
				match(RIGHT_BRACE);
				close_definition_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_end:
			{
				AST tmp42_AST = null;
				tmp42_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp42_AST);
				match(LITERAL_end);
				close_definition_AST = (AST)currentAST.root;
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_25);
		}
		returnAST = close_definition_AST;
	}
	
	public final void language_entry() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST language_entry_AST = null;
		
		try {      // for error handling
			AST tmp43_AST = null;
			tmp43_AST = astFactory.create(LT(1));
			astFactory.makeASTRoot(currentAST, tmp43_AST);
			match(LITERAL_language);
			resource_identifier();
			astFactory.addASTChild(currentAST, returnAST);
			match(COMMA);
			resource_identifier();
			astFactory.addASTChild(currentAST, returnAST);
			language_entry_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_26);
		}
		returnAST = language_entry_AST;
	}
	
	public final void string_table() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST string_table_AST = null;
		
		try {      // for error handling
			AST tmp45_AST = null;
			tmp45_AST = astFactory.create(LT(1));
			astFactory.makeASTRoot(currentAST, tmp45_AST);
			match(LITERAL_stringtable);
			{
			switch ( LA(1)) {
			case LITERAL_preload:
			case LITERAL_loadoncall:
			case LITERAL_fixed:
			case LITERAL_moveable:
			case LITERAL_discardable:
			case LITERAL_pure:
			case LITERAL_impure:
			case LITERAL_shared:
			case LITERAL_nonshared:
			{
				common_resource_attributes();
				astFactory.addASTChild(currentAST, returnAST);
				break;
			}
			case LEFT_BRACE:
			case LITERAL_begin:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			open_definition();
			{
			_loop67:
			do {
				if ((_tokenSet_27.member(LA(1)))) {
					string_table_entry();
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop67;
				}
				
			} while (true);
			}
			close_definition();
			string_table_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_2);
		}
		returnAST = string_table_AST;
	}
	
	public final void named_entry() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST named_entry_AST = null;
		
		try {      // for error handling
			switch ( LA(1)) {
			case LITERAL_accelerators:
			{
				accelerator_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_bitmap:
			{
				bitmap_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_cursor:

⌨️ 快捷键说明

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