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

📄 assigntokentypeswalker.java

📁 ANTLR(ANother Tool for Language Recognition)它是这样的一种工具
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
			case EOR:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			GrammarAST tmp22_AST_in = (GrammarAST)_t;			match(_t,EOR);			_t = _t.getNextSibling();			trackTokenRule(id,m,b);			_t = __t40;			_t = _t.getNextSibling();		}		catch (RecognitionException ex) {			reportError(ex);			if (_t!=null) {_t = _t.getNextSibling();}		}		_retTree = _t;	}		public final void modifier(AST _t) throws RecognitionException {				GrammarAST modifier_AST_in = (_t == ASTNULL) ? null : (GrammarAST)_t;				try {      // for error handling			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case LITERAL_protected:			{				GrammarAST tmp23_AST_in = (GrammarAST)_t;				match(_t,LITERAL_protected);				_t = _t.getNextSibling();				break;			}			case LITERAL_public:			{				GrammarAST tmp24_AST_in = (GrammarAST)_t;				match(_t,LITERAL_public);				_t = _t.getNextSibling();				break;			}			case LITERAL_private:			{				GrammarAST tmp25_AST_in = (GrammarAST)_t;				match(_t,LITERAL_private);				_t = _t.getNextSibling();				break;			}			case FRAGMENT:			{				GrammarAST tmp26_AST_in = (GrammarAST)_t;				match(_t,FRAGMENT);				_t = _t.getNextSibling();				break;			}			default:			{				throw new NoViableAltException(_t);			}			}		}		catch (RecognitionException ex) {			reportError(ex);			if (_t!=null) {_t = _t.getNextSibling();}		}		_retTree = _t;	}		public final void ruleScopeSpec(AST _t) throws RecognitionException {				GrammarAST ruleScopeSpec_AST_in = (_t == ASTNULL) ? null : (GrammarAST)_t;				try {      // for error handling			AST __t53 = _t;			GrammarAST tmp27_AST_in = (GrammarAST)_t;			match(_t,SCOPE);			_t = _t.getFirstChild();			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case ACTION:			{				GrammarAST tmp28_AST_in = (GrammarAST)_t;				match(_t,ACTION);				_t = _t.getNextSibling();				break;			}			case 3:			case ID:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			{			_loop56:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==ID)) {					GrammarAST tmp29_AST_in = (GrammarAST)_t;					match(_t,ID);					_t = _t.getNextSibling();				}				else {					break _loop56;				}							} while (true);			}			_t = __t53;			_t = _t.getNextSibling();		}		catch (RecognitionException ex) {			reportError(ex);			if (_t!=null) {_t = _t.getNextSibling();}		}		_retTree = _t;	}		public final void block(AST _t) throws RecognitionException {				GrammarAST block_AST_in = (_t == ASTNULL) ? null : (GrammarAST)_t;				try {      // for error handling			AST __t58 = _t;			GrammarAST tmp30_AST_in = (GrammarAST)_t;			match(_t,BLOCK);			_t = _t.getFirstChild();			{			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case OPTIONS:			{				optionsSpec(_t);				_t = _retTree;				break;			}			case ALT:			{				break;			}			default:			{				throw new NoViableAltException(_t);			}			}			}			{			int _cnt61=0;			_loop61:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==ALT)) {					alternative(_t);					_t = _retTree;					rewrite(_t);					_t = _retTree;				}				else {					if ( _cnt61>=1 ) { break _loop61; } else {throw new NoViableAltException(_t);}				}								_cnt61++;			} while (true);			}			GrammarAST tmp31_AST_in = (GrammarAST)_t;			match(_t,EOB);			_t = _t.getNextSibling();			_t = __t58;			_t = _t.getNextSibling();		}		catch (RecognitionException ex) {			reportError(ex);			if (_t!=null) {_t = _t.getNextSibling();}		}		_retTree = _t;	}		public final void exceptionGroup(AST _t) throws RecognitionException {				GrammarAST exceptionGroup_AST_in = (_t == ASTNULL) ? null : (GrammarAST)_t;				try {      // for error handling			{			int _cnt68=0;			_loop68:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==LITERAL_exception)) {					exceptionSpec(_t);					_t = _retTree;				}				else {					if ( _cnt68>=1 ) { break _loop68; } else {throw new NoViableAltException(_t);}				}								_cnt68++;			} while (true);			}		}		catch (RecognitionException ex) {			reportError(ex);			if (_t!=null) {_t = _t.getNextSibling();}		}		_retTree = _t;	}		public final void alternative(AST _t) throws RecognitionException {				GrammarAST alternative_AST_in = (_t == ASTNULL) ? null : (GrammarAST)_t;				try {      // for error handling			AST __t63 = _t;			GrammarAST tmp32_AST_in = (GrammarAST)_t;			match(_t,ALT);			_t = _t.getFirstChild();			{			int _cnt65=0;			_loop65:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==BLOCK||_t.getType()==OPTIONAL||_t.getType()==CLOSURE||_t.getType()==POSITIVE_CLOSURE||_t.getType()==SYNPRED||_t.getType()==RANGE||_t.getType()==CHAR_RANGE||_t.getType()==EPSILON||_t.getType()==SET||_t.getType()==GATED_SEMPRED||_t.getType()==SYN_SEMPRED||_t.getType()==ACTION||_t.getType()==ASSIGN||_t.getType()==STRING_LITERAL||_t.getType()==CHAR_LITERAL||_t.getType()==TOKEN_REF||_t.getType()==PLUS_ASSIGN||_t.getType()==SEMPRED||_t.getType()==NOT||_t.getType()==TREE_BEGIN||_t.getType()==RULE_REF||_t.getType()==WILDCARD)) {					element(_t);					_t = _retTree;				}				else {					if ( _cnt65>=1 ) { break _loop65; } else {throw new NoViableAltException(_t);}				}								_cnt65++;			} while (true);			}			GrammarAST tmp33_AST_in = (GrammarAST)_t;			match(_t,EOA);			_t = _t.getNextSibling();			_t = __t63;			_t = _t.getNextSibling();		}		catch (RecognitionException ex) {			reportError(ex);			if (_t!=null) {_t = _t.getNextSibling();}		}		_retTree = _t;	}		public final void rewrite(AST _t) throws RecognitionException {				GrammarAST rewrite_AST_in = (_t == ASTNULL) ? null : (GrammarAST)_t;				try {      // for error handling			{			_loop81:			do {				if (_t==null) _t=ASTNULL;				if ((_t.getType()==REWRITE)) {					AST __t78 = _t;					GrammarAST tmp34_AST_in = (GrammarAST)_t;					match(_t,REWRITE);					_t = _t.getFirstChild();					{					if (_t==null) _t=ASTNULL;					switch ( _t.getType()) {					case SEMPRED:					{						GrammarAST tmp35_AST_in = (GrammarAST)_t;						match(_t,SEMPRED);						_t = _t.getNextSibling();						break;					}					case ALT:					case TEMPLATE:					case ACTION:					{						break;					}					default:					{						throw new NoViableAltException(_t);					}					}					}					{					if (_t==null) _t=ASTNULL;					switch ( _t.getType()) {					case ALT:					{						GrammarAST tmp36_AST_in = (GrammarAST)_t;						match(_t,ALT);						_t = _t.getNextSibling();						break;					}					case TEMPLATE:					{						GrammarAST tmp37_AST_in = (GrammarAST)_t;						match(_t,TEMPLATE);						_t = _t.getNextSibling();						break;					}					case ACTION:					{						GrammarAST tmp38_AST_in = (GrammarAST)_t;						match(_t,ACTION);						_t = _t.getNextSibling();						break;					}					default:					{						throw new NoViableAltException(_t);					}					}					}					_t = __t78;					_t = _t.getNextSibling();				}				else {					break _loop81;				}							} while (true);			}		}		catch (RecognitionException ex) {			reportError(ex);			if (_t!=null) {_t = _t.getNextSibling();}		}		_retTree = _t;	}		public final void element(AST _t) throws RecognitionException {				GrammarAST element_AST_in = (_t == ASTNULL) ? null : (GrammarAST)_t;				try {      // for error handling			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case SET:			case STRING_LITERAL:			case CHAR_LITERAL:			case TOKEN_REF:			case RULE_REF:			case WILDCARD:			{				atom(_t);				_t = _retTree;				break;			}			case NOT:			{				AST __t83 = _t;				GrammarAST tmp39_AST_in = (GrammarAST)_t;				match(_t,NOT);				_t = _t.getFirstChild();				atom(_t);				_t = _retTree;				_t = __t83;				_t = _t.getNextSibling();				break;			}			case RANGE:			{				AST __t84 = _t;				GrammarAST tmp40_AST_in = (GrammarAST)_t;				match(_t,RANGE);				_t = _t.getFirstChild();				atom(_t);				_t = _retTree;				atom(_t);				_t = _retTree;				_t = __t84;				_t = _t.getNextSibling();				break;			}			case CHAR_RANGE:			{				AST __t85 = _t;				GrammarAST tmp41_AST_in = (GrammarAST)_t;				match(_t,CHAR_RANGE);				_t = _t.getFirstChild();				atom(_t);				_t = _retTree;				atom(_t);				_t = _retTree;				_t = __t85;				_t = _t.getNextSibling();				break;			}			case ASSIGN:			{				AST __t86 = _t;				GrammarAST tmp42_AST_in = (GrammarAST)_t;				match(_t,ASSIGN);				_t = _t.getFirstChild();				GrammarAST tmp43_AST_in = (GrammarAST)_t;				match(_t,ID);				_t = _t.getNextSibling();				{				if (_t==null) _t=ASTNULL;				switch ( _t.getType()) {				case NOT:				{					AST __t88 = _t;					GrammarAST tmp44_AST_in = (GrammarAST)_t;					match(_t,NOT);					_t = _t.getFirstChild();					atom(_t);					_t = _retTree;					_t = __t88;					_t = _t.getNextSibling();					break;				}				case SET:				case STRING_LITERAL:				case CHAR_LITERAL:				case TOKEN_REF:				case RULE_REF:				case WILDCARD:				{					atom(_t);					_t = _retTree;					break;				}				default:				{					throw new NoViableAltException(_t);				}				}				}				_t = __t86;				_t = _t.getNextSibling();				break;			}			case PLUS_ASSIGN:			{				AST __t89 = _t;				GrammarAST tmp45_AST_in = (GrammarAST)_t;				match(_t,PLUS_ASSIGN);				_t = _t.getFirstChild();				GrammarAST tmp46_AST_in = (GrammarAST)_t;				match(_t,ID);				_t = _t.getNextSibling();				atom(_t);				_t = _retTree;				_t = __t89;				_t = _t.getNextSibling();				break;			}			case BLOCK:			case OPTIONAL:			case CLOSURE:			case POSITIVE_CLOSURE:			{				ebnf(_t);				_t = _retTree;				break;			}			case TREE_BEGIN:			{				tree(_t);				_t = _retTree;				break;			}			case SYNPRED:			{				AST __t90 = _t;				GrammarAST tmp47_AST_in = (GrammarAST)_t;				match(_t,SYNPRED);				_t = _t.getFirstChild();				block(_t);				_t = _retTree;				_t = __t90;				_t = _t.getNextSibling();				break;			}			case ACTION:			{				GrammarAST tmp48_AST_in = (GrammarAST)_t;				match(_t,ACTION);				_t = _t.getNextSibling();				break;			}			case SEMPRED:			{				GrammarAST tmp49_AST_in = (GrammarAST)_t;				match(_t,SEMPRED);				_t = _t.getNextSibling();				break;			}			case SYN_SEMPRED:			{				GrammarAST tmp50_AST_in = (GrammarAST)_t;				match(_t,SYN_SEMPRED);				_t = _t.getNextSibling();				break;			}			case GATED_SEMPRED:			{				GrammarAST tmp51_AST_in = (GrammarAST)_t;				match(_t,GATED_SEMPRED);				_t = _t.getNextSibling();				break;			}			case EPSILON:			{				GrammarAST tmp52_AST_in = (GrammarAST)_t;				match(_t,EPSILON);				_t = _t.getNextSibling();				break;			}			default:			{				throw new NoViableAltException(_t);			}			}		}		catch (RecognitionException ex) {

⌨️ 快捷键说明

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