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

📄 nesctreeparser.java

📁 plugin for eclipse
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
				TNode a_AST_in = null;
				a_AST = (TNode)astFactory.create(a);
				astFactory.addASTChild(currentAST, a_AST);
				match(_t,LITERAL_auto);
				_t = _t.getNextSibling();
				storageClassSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_register:
			{
				b = (TNode)_t;
				TNode b_AST_in = null;
				b_AST = (TNode)astFactory.create(b);
				astFactory.addASTChild(currentAST, b_AST);
				match(_t,LITERAL_register);
				_t = _t.getNextSibling();
				storageClassSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_typedef:
			{
				c = (TNode)_t;
				TNode c_AST_in = null;
				c_AST = (TNode)astFactory.create(c);
				astFactory.addASTChild(currentAST, c_AST);
				match(_t,LITERAL_typedef);
				_t = _t.getNextSibling();
				storageClassSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_norace:
			{
				d = (TNode)_t;
				TNode d_AST_in = null;
				d_AST = (TNode)astFactory.create(d);
				astFactory.addASTChild(currentAST, d_AST);
				match(_t,LITERAL_norace);
				_t = _t.getNextSibling();
				storageClassSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_extern:
			case LITERAL_static:
			case LITERAL_default:
			case LITERAL_inline:
			case LITERAL_async:
			case LITERAL_command:
			case LITERAL_event:
			case LITERAL_task:
			{
				functionStorageClassSpecifier(_t);
				_t = _retTree;
				astFactory.addASTChild(currentAST, returnAST);
				storageClassSpecifier_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 = storageClassSpecifier_AST;
		_retTree = _t;
	}
	
	public final void typeQualifier(AST _t) throws RecognitionException {
		
		TNode typeQualifier_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		TNode typeQualifier_AST = null;
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case LITERAL_const:
			{
				TNode tmp21_AST = null;
				TNode tmp21_AST_in = null;
				tmp21_AST = (TNode)astFactory.create((TNode)_t);
				tmp21_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp21_AST);
				match(_t,LITERAL_const);
				_t = _t.getNextSibling();
				typeQualifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_volatile:
			{
				TNode tmp22_AST = null;
				TNode tmp22_AST_in = null;
				tmp22_AST = (TNode)astFactory.create((TNode)_t);
				tmp22_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp22_AST);
				match(_t,LITERAL_volatile);
				_t = _t.getNextSibling();
				typeQualifier_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 = typeQualifier_AST;
		_retTree = _t;
	}
	
	public final void typeSpecifier(AST _t) throws RecognitionException {
		
		TNode typeSpecifier_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		TNode typeSpecifier_AST = null;
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case LITERAL_void:
			{
				TNode tmp23_AST = null;
				TNode tmp23_AST_in = null;
				tmp23_AST = (TNode)astFactory.create((TNode)_t);
				tmp23_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp23_AST);
				match(_t,LITERAL_void);
				_t = _t.getNextSibling();
				typeSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_char:
			{
				TNode tmp24_AST = null;
				TNode tmp24_AST_in = null;
				tmp24_AST = (TNode)astFactory.create((TNode)_t);
				tmp24_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp24_AST);
				match(_t,LITERAL_char);
				_t = _t.getNextSibling();
				typeSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_short:
			{
				TNode tmp25_AST = null;
				TNode tmp25_AST_in = null;
				tmp25_AST = (TNode)astFactory.create((TNode)_t);
				tmp25_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp25_AST);
				match(_t,LITERAL_short);
				_t = _t.getNextSibling();
				typeSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_int:
			{
				TNode tmp26_AST = null;
				TNode tmp26_AST_in = null;
				tmp26_AST = (TNode)astFactory.create((TNode)_t);
				tmp26_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp26_AST);
				match(_t,LITERAL_int);
				_t = _t.getNextSibling();
				typeSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_long:
			{
				TNode tmp27_AST = null;
				TNode tmp27_AST_in = null;
				tmp27_AST = (TNode)astFactory.create((TNode)_t);
				tmp27_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp27_AST);
				match(_t,LITERAL_long);
				_t = _t.getNextSibling();
				typeSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_float:
			{
				TNode tmp28_AST = null;
				TNode tmp28_AST_in = null;
				tmp28_AST = (TNode)astFactory.create((TNode)_t);
				tmp28_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp28_AST);
				match(_t,LITERAL_float);
				_t = _t.getNextSibling();
				typeSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_double:
			{
				TNode tmp29_AST = null;
				TNode tmp29_AST_in = null;
				tmp29_AST = (TNode)astFactory.create((TNode)_t);
				tmp29_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp29_AST);
				match(_t,LITERAL_double);
				_t = _t.getNextSibling();
				typeSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_signed:
			{
				TNode tmp30_AST = null;
				TNode tmp30_AST_in = null;
				tmp30_AST = (TNode)astFactory.create((TNode)_t);
				tmp30_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp30_AST);
				match(_t,LITERAL_signed);
				_t = _t.getNextSibling();
				typeSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_unsigned:
			{
				TNode tmp31_AST = null;
				TNode tmp31_AST_in = null;
				tmp31_AST = (TNode)astFactory.create((TNode)_t);
				tmp31_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp31_AST);
				match(_t,LITERAL_unsigned);
				_t = _t.getNextSibling();
				typeSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_struct:
			{
				structSpecifier(_t);
				_t = _retTree;
				astFactory.addASTChild(currentAST, returnAST);
				{
				_loop3517:
				do {
					if (_t==null) _t=ASTNULL;
					if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) {
						attributeDecl(_t);
						_t = _retTree;
						astFactory.addASTChild(currentAST, returnAST);
					}
					else {
						break _loop3517;
					}
					
				} while (true);
				}
				typeSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_union:
			{
				unionSpecifier(_t);
				_t = _retTree;
				astFactory.addASTChild(currentAST, returnAST);
				{
				_loop3519:
				do {
					if (_t==null) _t=ASTNULL;
					if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) {
						attributeDecl(_t);
						_t = _retTree;
						astFactory.addASTChild(currentAST, returnAST);
					}
					else {
						break _loop3519;
					}
					
				} while (true);
				}
				typeSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_enum:
			{
				enumSpecifier(_t);
				_t = _retTree;
				astFactory.addASTChild(currentAST, returnAST);
				typeSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case NTypedefName:
			{
				typedefName(_t);
				_t = _retTree;
				astFactory.addASTChild(currentAST, returnAST);
				typeSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_typeof:
			{
				AST __t3520 = _t;
				TNode tmp32_AST = null;
				TNode tmp32_AST_in = null;
				tmp32_AST = (TNode)astFactory.create((TNode)_t);
				tmp32_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp32_AST);
				ASTPair __currentAST3520 = currentAST.copy();
				currentAST.root = currentAST.child;
				currentAST.child = null;
				match(_t,LITERAL_typeof);
				_t = _t.getFirstChild();
				TNode tmp33_AST = null;
				TNode tmp33_AST_in = null;
				tmp33_AST = (TNode)astFactory.create((TNode)_t);
				tmp33_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp33_AST);
				match(_t,LPAREN);
				_t = _t.getNextSibling();
				{
				if (_t==null) _t=ASTNULL;
				switch ( _t.getType()) {
				case LITERAL_volatile:
				case LITERAL_struct:
				case LITERAL_union:
				case LITERAL_enum:
				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 NTypedefName:
				case LITERAL_typeof:
				case LITERAL___complex:
				{
					typeName(_t);
					_t = _retTree;
					astFactory.addASTChild(currentAST, returnAST);
					break;
				}
				case ID:
				case ASSIGN:
				case STAR:
				case LPAREN:
				case DIV_ASSIGN:
				case PLUS_ASSIGN:
				case MINUS_ASSIGN:
				case STAR_ASSIGN:
				case MOD_ASSIGN:
				case RSHIFT_ASSIGN:
				case LSHIFT_ASSIGN:
				case BAND_ASSIGN:
				case BOR_ASSIGN:
				case BXOR_ASSIGN:
				case QUESTION:
				case LOR:
				case LAND:
				case BOR:
				case BXOR:
				case BAND:
				case EQUAL:
				case NOT_EQUAL:
				case LT:
				case LTE:
				case GT:
				case GTE:
				case LSHIFT:
				case RSHIFT:
				case PLUS:
				case MINUS:
				case DIV:
				case MOD:
				case INC:
				case DEC:
				case LITERAL_sizeof:
				case CharLiteral:
				case NCast:
				case NExpressionGroup:
				case NInitializer:
				case NEmptyExpression:
				case NCommaExpr:
				case NUnaryExpr:
				case NPostfixExpr:
				case NRangeExpr:
				case NStringSeq:
				case NLcurlyInitializer:
				case NGnuAsmExpr:
				case Number:
				case LITERAL___alignof:
				{
					expr(_t);
					_t = _retTree;
					astFactory.addASTChild(currentAST, returnAST);
					break;
				}
				default:
				{
					throw new NoViableAltException(_t);
				}
				}
				}
				TNode tmp34_AST = null;
				TNode tmp34_AST_in = null;
				tmp34_AST = (TNode)astFactory.create((TNode)_t);
				tmp34_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp34_AST);
				match(_t,RPAREN);
				_t = _t.getNextSibling();
				currentAST = __currentAST3520;
				_t = __t3520;
				_t = _t.getNextSibling();
				typeSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL___complex:
			{
				TNode tmp35_AST = null;
				TNode tmp35_AST_in = null;
				tmp35_AST = (TNode)astFactory.create((TNode)_t);
				tmp35_AST_in = (TNode)_t;
				astFactory.addASTChild(currentAST, tmp35_AST);
				match(_t,LITERAL___complex);
				_t = _t.getNextSibling();
				typeSpecifier_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 = typeSpecifier_AST;
		_retTree = _t;
	}
	
	public final void functionStorageClassSpecifier(AST _t) throws RecognitionException {
		
		TNode functionStorageClassSpecifier_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		TNode functionStorageClassSpecifier_AST = null;
		TNode a = null;
		TNode a_AST = null;
		TNode b = null;
		TNode b_AST = null;
		TNode c = null;
		TNode c_AST = null;
		TNode d = null;
		TNode d_AST = null;
		TNode e = null;
		TNode e_AST = null;
		TNode f = null;
		TNode f_AST = null;
		TNode g = null;
		TNode g_AST = null;
		TNode h = null;
		TNode h_AST = null;
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case LITERAL_extern:
			{
				a = (TNode)_t;
				TNode a_AST_in = null;
				a_AST = (TNode)astFactory.create(a);
				astFactory.addASTChild(currentAST, a_AST);
				match(_t,LITERAL_extern);
				_t = _t.getNextSibling();
				functionStorageClassSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_static:
			{
				b = (TNode)_t;
				TNode b_AST_in = null;
				b_AST = (TNode)astFactory.create(b);
				astFactory.addASTChild(currentAST, b_AST);
				match(_t,LITERAL_static);
				_t = _t.getNextSibling();
				functionStorageClassSpecifier_AST = (TNode)currentAST.root;
				break;
			}
			case LITERAL_inline:
			{
				c

⌨️ 快捷键说明

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