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

📄 nesctreeparser.java

📁 plugin for eclipse
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
			{
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case NInitDecl:
			{
				initDeclList(_t);
				_t = _retTree;
				astFactory.addASTChild(currentAST, returnAST);
				break;
			}
			case SEMI:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
			}
			{
			int _cnt3508=0;
			_loop3508:
			do {
				if (_t==null) _t=ASTNULL;
				if ((_t.getType()==SEMI)) {
					TNode tmp6_AST = null;
					TNode tmp6_AST_in = null;
					tmp6_AST = (TNode)astFactory.create((TNode)_t);
					tmp6_AST_in = (TNode)_t;
					astFactory.addASTChild(currentAST, tmp6_AST);
					match(_t,SEMI);
					_t = _t.getNextSibling();
				}
				else {
					if ( _cnt3508>=1 ) { break _loop3508; } else {throw new NoViableAltException(_t);}
				}
				
				_cnt3508++;
			} while (true);
			}
			currentAST = __currentAST3505;
			_t = __t3505;
			_t = _t.getNextSibling();
			declaration_AST = (TNode)currentAST.root;
		}
		catch (RecognitionException ex) {
			if (inputState.guessing==0) {
				reportError(ex);
				if (_t!=null) {_t = _t.getNextSibling();}
			} else {
			  throw ex;
			}
		}
		returnAST = declaration_AST;
		_retTree = _t;
	}
	
	public final void interfaceIdentifier(AST _t) throws RecognitionException {
		
		TNode interfaceIdentifier_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		TNode interfaceIdentifier_AST = null;
		TNode i = null;
		TNode i_AST = null;
		TNode a = null;
		TNode a_AST = null;
		TNode r = null;
		TNode r_AST = null;
		
		try {      // for error handling
			{
			i = (TNode)_t;
			TNode i_AST_in = null;
			i_AST = (TNode)astFactory.create(i);
			astFactory.addASTChild(currentAST, i_AST);
			match(_t,ID);
			_t = _t.getNextSibling();
			{
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case LITERAL_as:
			{
				a = (TNode)_t;
				TNode a_AST_in = null;
				a_AST = (TNode)astFactory.create(a);
				astFactory.addASTChild(currentAST, a_AST);
				match(_t,LITERAL_as);
				_t = _t.getNextSibling();
				r = (TNode)_t;
				TNode r_AST_in = null;
				r_AST = (TNode)astFactory.create(r);
				astFactory.addASTChild(currentAST, r_AST);
				match(_t,ID);
				_t = _t.getNextSibling();
				break;
			}
			case 3:
			case RCURLY:
			case LBRACKET:
			case NDeclaration:
			case LITERAL_interface:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
			}
			}
			interfaceIdentifier_AST = (TNode)currentAST.root;
		}
		catch (RecognitionException ex) {
			if (inputState.guessing==0) {
				reportError(ex);
				if (_t!=null) {_t = _t.getNextSibling();}
			} else {
			  throw ex;
			}
		}
		returnAST = interfaceIdentifier_AST;
		_retTree = _t;
	}
	
	public final void interfaceParameters(AST _t) throws RecognitionException {
		
		TNode interfaceParameters_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		TNode interfaceParameters_AST = null;
		TNode l = null;
		TNode l_AST = null;
		TNode r = null;
		TNode r_AST = null;
		
		try {      // for error handling
			l = (TNode)_t;
			TNode l_AST_in = null;
			l_AST = (TNode)astFactory.create(l);
			astFactory.addASTChild(currentAST, l_AST);
			match(_t,LBRACKET);
			_t = _t.getNextSibling();
			parameterTypeList(_t);
			_t = _retTree;
			astFactory.addASTChild(currentAST, returnAST);
			r = (TNode)_t;
			TNode r_AST_in = null;
			r_AST = (TNode)astFactory.create(r);
			astFactory.addASTChild(currentAST, r_AST);
			match(_t,RBRACKET);
			_t = _t.getNextSibling();
			interfaceParameters_AST = (TNode)currentAST.root;
		}
		catch (RecognitionException ex) {
			if (inputState.guessing==0) {
				reportError(ex);
				if (_t!=null) {_t = _t.getNextSibling();}
			} else {
			  throw ex;
			}
		}
		returnAST = interfaceParameters_AST;
		_retTree = _t;
	}
	
	public final void parameterTypeList(AST _t) throws RecognitionException {
		
		TNode parameterTypeList_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		TNode parameterTypeList_AST = null;
		
		try {      // for error handling
			{
			int _cnt3616=0;
			_loop3616:
			do {
				if (_t==null) _t=ASTNULL;
				if ((_t.getType()==NParameterDeclaration)) {
					parameterDeclaration(_t);
					_t = _retTree;
					astFactory.addASTChild(currentAST, returnAST);
					{
					if (_t==null) _t=ASTNULL;
					switch ( _t.getType()) {
					case COMMA:
					{
						TNode tmp7_AST = null;
						TNode tmp7_AST_in = null;
						tmp7_AST = (TNode)astFactory.create((TNode)_t);
						tmp7_AST_in = (TNode)_t;
						astFactory.addASTChild(currentAST, tmp7_AST);
						match(_t,COMMA);
						_t = _t.getNextSibling();
						break;
					}
					case SEMI:
					{
						TNode tmp8_AST = null;
						TNode tmp8_AST_in = null;
						tmp8_AST = (TNode)astFactory.create((TNode)_t);
						tmp8_AST_in = (TNode)_t;
						astFactory.addASTChild(currentAST, tmp8_AST);
						match(_t,SEMI);
						_t = _t.getNextSibling();
						break;
					}
					case RPAREN:
					case RBRACKET:
					case VARARGS:
					case NParameterDeclaration:
					{
						break;
					}
					default:
					{
						throw new NoViableAltException(_t);
					}
					}
					}
				}
				else {
					if ( _cnt3616>=1 ) { break _loop3616; } else {throw new NoViableAltException(_t);}
				}
				
				_cnt3616++;
			} while (true);
			}
			{
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case VARARGS:
			{
				TNode tmp9_AST = null;
				TNode tmp9_AST_in = null;
				tmp9_AST = (TNode)astFactory.create((TNode)_t);
				tmp9_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp9_AST);
				match(_t,VARARGS);
				_t = _t.getNextSibling();
				break;
			}
			case RPAREN:
			case RBRACKET:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
			}
			parameterTypeList_AST = (TNode)currentAST.root;
		}
		catch (RecognitionException ex) {
			if (inputState.guessing==0) {
				reportError(ex);
				if (_t!=null) {_t = _t.getNextSibling();}
			} else {
			  throw ex;
			}
		}
		returnAST = parameterTypeList_AST;
		_retTree = _t;
	}
	
	public final void externalDef(AST _t) throws RecognitionException {
		
		TNode externalDef_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		TNode externalDef_AST = null;
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case NDeclaration:
			{
				declaration(_t);
				_t = _retTree;
				astFactory.addASTChild(currentAST, returnAST);
				externalDef_AST = (TNode)currentAST.root;
				break;
			}
			case NFunctionDef:
			{
				functionDef(_t);
				_t = _retTree;
				astFactory.addASTChild(currentAST, returnAST);
				externalDef_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_asm:
			{
				asm_expr(_t);
				_t = _retTree;
				astFactory.addASTChild(currentAST, returnAST);
				externalDef_AST = (TNode)currentAST.root;
				break;
			}
			case SEMI:
			{
				TNode tmp10_AST = null;
				TNode tmp10_AST_in = null;
				tmp10_AST = (TNode)astFactory.create((TNode)_t);
				tmp10_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp10_AST);
				match(_t,SEMI);
				_t = _t.getNextSibling();
				externalDef_AST = (TNode)currentAST.root;
				break;
			}
			case NTypeMissing:
			{
				typelessDeclaration(_t);
				_t = _retTree;
				astFactory.addASTChild(currentAST, returnAST);
				externalDef_AST = (TNode)currentAST.root;
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			if (inputState.guessing==0) {
				reportError(ex);
				if (_t!=null) {_t = _t.getNextSibling();}
			} else {
			  throw ex;
			}
		}
		returnAST = externalDef_AST;
		_retTree = _t;
	}
	
	public final void textNode(AST _t) throws RecognitionException {
		
		TNode textNode_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		TNode textNode_AST = null;
		
		try {      // for error handling
			TNode tmp11_AST = null;
			TNode tmp11_AST_in = null;
			tmp11_AST = (TNode)astFactory.create((TNode)_t);
			tmp11_AST_in = (TNode)_t;
			astFactory.addASTChild(currentAST, tmp11_AST);
			match(_t,NText);
			_t = _t.getNextSibling();
			textNode_AST = (TNode)currentAST.root;
		}
		catch (RecognitionException ex) {
			if (inputState.guessing==0) {
				reportError(ex);
				if (_t!=null) {_t = _t.getNextSibling();}
			} else {
			  throw ex;
			}
		}
		returnAST = textNode_AST;
		_retTree = _t;
	}
	
	public final void functionDef(AST _t) throws RecognitionException {
		
		TNode functionDef_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		TNode functionDef_AST = null;
		
		try {      // for error handling
			AST __t3622 = _t;
			TNode tmp12_AST = null;
			TNode tmp12_AST_in = null;
			tmp12_AST = (TNode)astFactory.create((TNode)_t);
			tmp12_AST_in = (TNode)_t;
			astFactory.addASTChild(currentAST, tmp12_AST);
			ASTPair __currentAST3622 = currentAST.copy();
			currentAST.root = currentAST.child;
			currentAST.child = null;
			match(_t,NFunctionDef);
			_t = _t.getFirstChild();
			{
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case LITERAL_volatile:
			case LITERAL_struct:
			case LITERAL_union:
			case LITERAL_enum:
			case LITERAL_extern:
			case LITERAL_static:
			case LITERAL_const:
			case LITERAL_void:
			case LITERAL_char:
			case LITERAL_short:
			case LITERAL_int:
			case LITERAL_long:
			case LITERAL_float:
			case LITERAL_double:
			case LITERAL_signed:
			case LITERAL_unsigned:
			case LITERAL_default:
			case NTypedefName:
			case LITERAL_inline:
			case LITERAL_typeof:
			case LITERAL___complex:
			case LITERAL_async:
			case LITERAL_command:
			case LITERAL_event:
			case LITERAL_task:
			{
				functionDeclSpecifiers(_t);
				_t = _retTree;
				astFactory.addASTChild(currentAST, returnAST);
				break;
			}
			case NDeclarator:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
			}
			declarator(_t);
			_t = _retTree;
			astFactory.addASTChild(currentAST, returnAST);
			{
			_loop3625:
			do {
				if (_t==null) _t=ASTNULL;
				switch ( _t.getType()) {
				case NDeclaration:
				{
					declaration(_t);
					_t = _retTree;
					astFactory.addASTChild(currentAST, returnAST);
					break;
				}
				case VARARGS:
				{
					TNode tmp13_AST = null;
					TNode tmp13_AST_in = null;
					tmp13_AST = (TNode)astFactory.create((TNode)_t);
					tmp13_AST_in = (TNode)_t;
					astFactory.addASTChild(currentAST, tmp13_AST);
					match(_t,VARARGS);
					_t = _t.getNextSibling();
					break;
				}
				default:
				{
					break _loop3625;
				}
				}
			} while (true);
			}
			{
			_loop3627:
			do {
				if (_t==null) _t=ASTNULL;
				if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) {
					attributeDecl(_t);
					_t = _retTree;
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop3627;
				}
				
			} while (true);
			}
			compoundStatement(_t);
			_t = _retTree;
			astFactory.addASTChild(currentAST, returnAST);
			currentAST = __currentAST3622;
			_t = __t3622;
			_t = _t.getNextSibling();
			functionDef_AST = (TNode)currentAST.root;
		}
		catch (RecognitionException ex) {
			if (inputState.guessing==0) {
				reportError(ex);
				if (_t!=null) {_t = _t.getNextSibling();}
			} else {
			  throw ex;
			}
		}
		returnAST = functionDef_AST;
		_retTree = _t;
	}
	
	public final void asm_expr(AST _t) throws RecognitionException {
		
		TNode asm_expr_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		TNode asm_expr_AST = null;
		
		try {      // for error handling

⌨️ 快捷键说明

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