groovylexer.java

来自「大名鼎鼎的java动态脚本语言。已经通过了sun的认证」· Java 代码 · 共 2,085 行 · 第 1/5 页

JAVA
2,085
字号
					theRetToken=_returnToken;					break;				}				case '~':				{					mBNOT(true);					theRetToken=_returnToken;					break;				}				case ';':				{					mSEMI(true);					theRetToken=_returnToken;					break;				}				case '$':				{					mDOLLAR(true);					theRetToken=_returnToken;					break;				}				case '\t':  case '\u000c':  case ' ':  case '\\':				{					mWS(true);					theRetToken=_returnToken;					break;				}				case '\n':  case '\r':				{					mNLS(true);					theRetToken=_returnToken;					break;				}				case '"':  case '\'':				{					mSTRING_LITERAL(true);					theRetToken=_returnToken;					break;				}				case '0':  case '1':  case '2':  case '3':				case '4':  case '5':  case '6':  case '7':				case '8':  case '9':				{					mNUM_INT(true);					theRetToken=_returnToken;					break;				}				case '@':				{					mAT(true);					theRetToken=_returnToken;					break;				}				default:					if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='>') && (LA(4)=='=')) {						mBSR_ASSIGN(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='<') && (LA(2)=='=') && (LA(3)=='>')) {						mCOMPARE_TO(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='=')) {						mSR_ASSIGN(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='>') && (true)) {						mBSR(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='<') && (LA(2)=='<') && (LA(3)=='=')) {						mSL_ASSIGN(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='.') && (LA(2)=='.') && (LA(3)=='<')) {						mRANGE_EXCLUSIVE(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='.') && (LA(2)=='.') && (LA(3)=='.')) {						mTRIPLE_DOT(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='=') && (LA(2)=='=') && (LA(3)=='~')) {						mREGEX_MATCH(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='*') && (LA(2)=='*') && (LA(3)=='=')) {						mSTAR_STAR_ASSIGN(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='=') && (LA(2)=='=') && (true)) {						mEQUAL(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='!') && (LA(2)=='=')) {						mNOT_EQUAL(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='+') && (LA(2)=='=')) {						mPLUS_ASSIGN(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='+') && (LA(2)=='+')) {						mINC(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='-') && (LA(2)=='=')) {						mMINUS_ASSIGN(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='-') && (LA(2)=='-')) {						mDEC(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='*') && (LA(2)=='=')) {						mSTAR_ASSIGN(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='%') && (LA(2)=='=')) {						mMOD_ASSIGN(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='>') && (LA(2)=='>') && (true)) {						mSR(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='>') && (LA(2)=='=')) {						mGE(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='<') && (LA(2)=='<') && (true)) {						mSL(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='<') && (LA(2)=='=') && (true)) {						mLE(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='^') && (LA(2)=='=')) {						mBXOR_ASSIGN(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='|') && (LA(2)=='=')) {						mBOR_ASSIGN(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='|') && (LA(2)=='|')) {						mLOR(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='&') && (LA(2)=='=')) {						mBAND_ASSIGN(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='&') && (LA(2)=='&')) {						mLAND(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='.') && (LA(2)=='.') && (true)) {						mRANGE_INCLUSIVE(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='*') && (LA(2)=='.')) {						mSPREAD_DOT(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='?') && (LA(2)=='.')) {						mOPTIONAL_DOT(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='.') && (LA(2)=='&')) {						mMEMBER_POINTER(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='=') && (LA(2)=='~')) {						mREGEX_FIND(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='*') && (LA(2)=='*') && (true)) {						mSTAR_STAR(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='-') && (LA(2)=='>')) {						mCLOSURE_OP(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='/') && (LA(2)=='/')) {						mSL_COMMENT(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='/') && (LA(2)=='*')) {						mML_COMMENT(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='?') && (true)) {						mQUESTION(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='.') && (true)) {						mDOT(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='=') && (true)) {						mASSIGN(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='!') && (true)) {						mLNOT(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='+') && (true)) {						mPLUS(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='-') && (true)) {						mMINUS(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='*') && (true)) {						mSTAR(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='%') && (true)) {						mMOD(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='>') && (true)) {						mGT(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='<') && (true)) {						mLT(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='^') && (true)) {						mBXOR(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='|') && (true)) {						mBOR(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='&') && (true)) {						mBAND(true);						theRetToken=_returnToken;					}					else if (((LA(1)=='#'))&&(getLine() == 1 && getColumn() == 1)) {						mSH_COMMENT(true);						theRetToken=_returnToken;					}					else if ((LA(1)=='/') && (true)) {						mREGEXP_LITERAL(true);						theRetToken=_returnToken;					}					else if ((_tokenSet_0.member(LA(1)))) {						mIDENT(true);						theRetToken=_returnToken;					}				else {					if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);}				else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}				}				}				if ( _returnToken==null ) continue tryAgain; // found SKIP token				_ttype = _returnToken.getType();				_returnToken.setType(_ttype);				return _returnToken;			}			catch (RecognitionException e) {				throw new TokenStreamRecognitionException(e);			}		}		catch (CharStreamException cse) {			if ( cse instanceof CharStreamIOException ) {				throw new TokenStreamIOException(((CharStreamIOException)cse).io);			}			else {				throw new TokenStreamException(cse.getMessage());			}		}	}}	public final void mQUESTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {		int _ttype; Token _token=null; int _begin=text.length();		_ttype = QUESTION;		int _saveIndex;				match('?');		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {			_token = makeToken(_ttype);			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));		}		_returnToken = _token;	}		public final void mLPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {		int _ttype; Token _token=null; int _begin=text.length();		_ttype = LPAREN;		int _saveIndex;				match('(');		if ( inputState.guessing==0 ) {			++parenLevel;		}		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {			_token = makeToken(_ttype);			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));		}		_returnToken = _token;	}		public final void mRPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {		int _ttype; Token _token=null; int _begin=text.length();		_ttype = RPAREN;		int _saveIndex;				match(')');		if ( inputState.guessing==0 ) {			--parenLevel;		}		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {			_token = makeToken(_ttype);			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));		}		_returnToken = _token;	}		public final void mLBRACK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {		int _ttype; Token _token=null; int _begin=text.length();		_ttype = LBRACK;		int _saveIndex;				match('[');		if ( inputState.guessing==0 ) {			++parenLevel;		}		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {			_token = makeToken(_ttype);			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));		}		_returnToken = _token;	}		public final void mRBRACK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {		int _ttype; Token _token=null; int _begin=text.length();		_ttype = RBRACK;		int _saveIndex;				match(']');		if ( inputState.guessing==0 ) {			--parenLevel;		}		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {			_token = makeToken(_ttype);			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));		}		_returnToken = _token;	}		public final void mLCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {		int _ttype; Token _token=null; int _begin=text.length();		_ttype = LCURLY;		int _saveIndex;				match('{');		if ( inputState.guessing==0 ) {			pushParenLevel();		}		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {			_token = makeToken(_ttype);			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));		}		_returnToken = _token;	}		public final void mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {		int _ttype; Token _token=null; int _begin=text.length();		_ttype = RCURLY;		int _saveIndex;				match('}');		if ( inputState.guessing==0 ) {			popParenLevel(); if(stringCtorState!=0) restartStringCtor(true);		}		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {			_token = makeToken(_ttype);			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));		}		_returnToken = _token;	}		public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {		int _ttype; Token _token=null; int _begin=text.length();		_ttype = COLON;		int _saveIndex;				match(':');		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {			_token = makeToken(_ttype);			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));		}		_returnToken = _token;	}		public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {		int _ttype; Token _token=null; int _begin=text.length();		_ttype = COMMA;		int _saveIndex;				match(',');		if ( _createToken && _token==null && _ttype!=Token.SKIP ) {			_token = makeToken(_ttype);			_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));		}		_returnToken = _token;	}

⌨️ 快捷键说明

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