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

📄 rcparser.java

📁 外国人写的c#语法解析器
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
			{
				cursor_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_dialog:
			{
				dialog_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_dialogex:
			{
				dialogex_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_font:
			{
				font_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_icon:
			{
				icon_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_menu:
			{
				menu_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_menuex:
			{
				menuex_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_messagetable:
			{
				messagetable_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_rcdata:
			{
				rcdata_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_versioninfo:
			{
				versioninfo_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_textinclude:
			{
				textinclude_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LONG_LITERAL:
			case NUMERAL:
			case IDENTIFIER:
			case HEX_LITERAL:
			case OCTAL_LITERAL:
			{
				user_defined_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_designinfo:
			{
				design_info();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_toolbar:
			{
				toolbar_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_dlginit:
			{
				dialog_init_resource();
				astFactory.addASTChild(currentAST, returnAST);
				named_entry_AST = (AST)currentAST.root;
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_2);
		}
		returnAST = named_entry_AST;
	}
	
	public final void common_resource_attributes() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST common_resource_attributes_AST = null;
		
		try {      // for error handling
			{
			int _cnt58=0;
			_loop58:
			do {
				switch ( LA(1)) {
				case LITERAL_preload:
				case LITERAL_loadoncall:
				{
					load_attribute();
					astFactory.addASTChild(currentAST, returnAST);
					break;
				}
				case LITERAL_fixed:
				case LITERAL_moveable:
				case LITERAL_discardable:
				case LITERAL_pure:
				case LITERAL_impure:
				case LITERAL_shared:
				case LITERAL_nonshared:
				{
					memory_attribute();
					astFactory.addASTChild(currentAST, returnAST);
					break;
				}
				default:
				{
					if ( _cnt58>=1 ) { break _loop58; } else {throw new NoViableAltException(LT(1), getFilename());}
				}
				}
				_cnt58++;
			} while (true);
			}
			common_resource_attributes_AST = (AST)currentAST.root;
			common_resource_attributes_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(RESOURCE_ATTRIBUTES,"resource attributes")).add(common_resource_attributes_AST));
			currentAST.root = common_resource_attributes_AST;
			currentAST.child = common_resource_attributes_AST!=null &&common_resource_attributes_AST.getFirstChild()!=null ?
				common_resource_attributes_AST.getFirstChild() : common_resource_attributes_AST;
			currentAST.advanceChildToEnd();
			common_resource_attributes_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_28);
		}
		returnAST = common_resource_attributes_AST;
	}
	
	public final void load_attribute() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST load_attribute_AST = null;
		
		try {      // for error handling
			switch ( LA(1)) {
			case LITERAL_preload:
			{
				AST tmp46_AST = null;
				tmp46_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp46_AST);
				match(LITERAL_preload);
				load_attribute_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_loadoncall:
			{
				AST tmp47_AST = null;
				tmp47_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp47_AST);
				match(LITERAL_loadoncall);
				load_attribute_AST = (AST)currentAST.root;
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_29);
		}
		returnAST = load_attribute_AST;
	}
	
	public final void memory_attribute() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST memory_attribute_AST = null;
		
		try {      // for error handling
			switch ( LA(1)) {
			case LITERAL_fixed:
			{
				AST tmp48_AST = null;
				tmp48_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp48_AST);
				match(LITERAL_fixed);
				memory_attribute_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_moveable:
			{
				AST tmp49_AST = null;
				tmp49_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp49_AST);
				match(LITERAL_moveable);
				memory_attribute_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_discardable:
			{
				AST tmp50_AST = null;
				tmp50_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp50_AST);
				match(LITERAL_discardable);
				memory_attribute_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_pure:
			{
				AST tmp51_AST = null;
				tmp51_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp51_AST);
				match(LITERAL_pure);
				memory_attribute_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_impure:
			{
				AST tmp52_AST = null;
				tmp52_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp52_AST);
				match(LITERAL_impure);
				memory_attribute_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_shared:
			{
				AST tmp53_AST = null;
				tmp53_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp53_AST);
				match(LITERAL_shared);
				memory_attribute_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_nonshared:
			{
				AST tmp54_AST = null;
				tmp54_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp54_AST);
				match(LITERAL_nonshared);
				memory_attribute_AST = (AST)currentAST.root;
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_29);
		}
		returnAST = memory_attribute_AST;
	}
	
	public final void string_table_entry() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST string_table_entry_AST = null;
		
		try {      // for error handling
			expression();
			astFactory.addASTChild(currentAST, returnAST);
			{
			switch ( LA(1)) {
			case COMMA:
			{
				match(COMMA);
				break;
			}
			case STRING_LITERAL:
			case LITERAL_l:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			resource_string();
			astFactory.addASTChild(currentAST, returnAST);
			string_table_entry_AST = (AST)currentAST.root;
			string_table_entry_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(STRING_TABLE_ENTRY,"string table entry")).add(string_table_entry_AST));
			currentAST.root = string_table_entry_AST;
			currentAST.child = string_table_entry_AST!=null &&string_table_entry_AST.getFirstChild()!=null ?
				string_table_entry_AST.getFirstChild() : string_table_entry_AST;
			currentAST.advanceChildToEnd();
			string_table_entry_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_30);
		}
		returnAST = string_table_entry_AST;
	}
	
	public final void file_name() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST file_name_AST = null;
		
		try {      // for error handling
			switch ( LA(1)) {
			case STRING_LITERAL:
			{
				AST tmp56_AST = null;
				tmp56_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp56_AST);
				match(STRING_LITERAL);
				file_name_AST = (AST)currentAST.root;
				break;
			}
			case IDENTIFIER:
			{
				AST tmp57_AST = null;
				tmp57_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp57_AST);
				match(IDENTIFIER);
				{
				_loop72:
				do {
					if ((LA(1)==PATH_SEPARATOR)) {
						AST tmp58_AST = null;
						tmp58_AST = astFactory.create(LT(1));
						astFactory.addASTChild(currentAST, tmp58_AST);
						match(PATH_SEPARATOR);
						AST tmp59_AST = null;
						tmp59_AST = astFactory.create(LT(1));
						astFactory.addASTChild(currentAST, tmp59_AST);
						match(IDENTIFIER);
					}
					else {
						break _loop72;
					}
					
				} while (true);
				}
				file_name_AST = (AST)currentAST.root;
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_2);
		}
		returnAST = file_name_AST;
	}
	
	public final void accelerator_resource() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST accelerator_resource_AST = null;
		
		try {      // for error handling
			AST tmp60_AST = null;
			tmp60_AST = astFactory.create(LT(1));
			astFactory.makeASTRoot(currentAST, tmp60_AST);
			match(LITERAL_accelerators);
			{
			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:
			case LITERAL_language:
			case LITERAL_characteristics:
			case LITERAL_version:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			{
			_loop89:
			do {
				if ((_tokenSet_31.member(LA(1)))) {
					common_resource_info();
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop89;
				}
				
			} while (true);
			}
			open_definition();
			{
			_loop91:
			do {
				if ((_tokenSet_32.member(LA(1)))) {
					accelerator_entry();
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop91;
				}
				
			} while (true);
			}
			close_definition();
			accelerator_resource_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_2);
		}
		returnAST = accelerator_resource_AST;
	}
	
	public final void bitmap_resource() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST bitmap_resource_AST = null;
		
		try {      // for error handling
			AST tmp61_AST = null;
			tmp61_AST = astFactory.create(LT(1));
			astFactory.makeASTRoot(currentAST, tmp61_AST);
			match(LITERAL_bitmap);
			{
			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 STRING_LITERAL:
			case IDENTIFIER:
			case LITERAL_begin:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			data_block();
			astFactory.addASTChild(currentAST, returnAST);
			bitmap_resource_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {

⌨️ 快捷键说明

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