📄 csharplexer.cs
字号:
theRetToken = returnToken_;
break;
}
case ';':
{
mSEMI(true);
theRetToken = returnToken_;
break;
}
case '?':
{
mQUESTION(true);
theRetToken = returnToken_;
break;
}
default:
if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='>') && (LA(4)=='='))
{
mBSR_ASN(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='<') && (LA(2)=='<') && (LA(3)=='=')) {
mSL_ASN(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='=')) {
mSR_ASN(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='>') && (true)) {
mBSR(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='/') && (LA(2)=='/')) {
mSINGLE_LINE_COMMENT(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='/') && (LA(2)=='*')) {
mDELIMITED_COMMENT(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='0') && (LA(2)=='X'||LA(2)=='x')) {
mHEXADECIMAL_INTEGER_LITERAL(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='"'||LA(1)=='@') && (tokenSet_0_.member(LA(2)))) {
mSTRING_LITERAL(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='+') && (LA(2)=='=')) {
mPLUS_ASN(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='-') && (LA(2)=='=')) {
mMINUS_ASN(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='*') && (LA(2)=='=')) {
mSTAR_ASN(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='/') && (LA(2)=='=')) {
mDIV_ASN(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='%') && (LA(2)=='=')) {
mMOD_ASN(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='+') && (LA(2)=='+')) {
mINC(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='-') && (LA(2)=='-')) {
mDEC(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='<') && (LA(2)=='<') && (true)) {
mSL(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='>') && (LA(2)=='>') && (true)) {
mSR(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='&') && (LA(2)=='=')) {
mBAND_ASN(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='|') && (LA(2)=='=')) {
mBOR_ASN(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='^') && (LA(2)=='=')) {
mBXOR_ASN(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='=') && (LA(2)=='=')) {
mEQUAL(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='<') && (LA(2)=='=')) {
mLE(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='>') && (LA(2)=='=')) {
mGE(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='!') && (LA(2)=='=')) {
mNOT_EQUAL(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='|') && (LA(2)=='|')) {
mLOR(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='&') && (LA(2)=='&')) {
mLAND(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='#') && (tokenSet_1_.member(LA(2)))) {
mPP_DIRECTIVE(true);
theRetToken = returnToken_;
}
else if ((tokenSet_2_.member(LA(1))) && (true)) {
mNUMERIC_LITERAL(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)) {
mDIV(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='%') && (true)) {
mMOD(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='&') && (true)) {
mBAND(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='|') && (true)) {
mBOR(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='^') && (true)) {
mBXOR(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='=') && (true)) {
mASSIGN(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='<') && (true)) {
mLTHAN(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='>') && (true)) {
mGTHAN(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='!') && (true)) {
mLNOT(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='#') && (true)) {
mHASH(true);
theRetToken = returnToken_;
}
else if ((LA(1)=='"') && (true)) {
mQUOTE(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());}
}
break; }
if ( null==returnToken_ ) goto tryAgain; // found SKIP token
_ttype = returnToken_.Type;
returnToken_.Type = _ttype;
return returnToken_;
}
catch (RecognitionException e) {
throw new TokenStreamRecognitionException(e);
}
}
catch (CharStreamException cse) {
if ( cse is CharStreamIOException ) {
throw new TokenStreamIOException(((CharStreamIOException)cse).io);
}
else {
throw new TokenStreamException(cse.Message);
}
}
}
}
protected void mNEW_LINE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
int _ttype; Token _token=null; int _begin=text.Length;
_ttype = NEW_LINE;
{
switch ( LA(1) )
{
case '\n':
{
match('\u000A');
break;
}
case '\u2028':
{
match('\u2028');
break;
}
case '\u2029':
{
match('\u2029');
break;
}
default:
if (((LA(1)=='\r') && (LA(2)=='\n') && (true) && (true))&&( LA(2)=='\u000A' ))
{
match('\u000D');
match('\u000A');
}
else if ((LA(1)=='\r') && (true) && (true) && (true)) {
match('\u000D');
}
else
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
break; }
}
if (0==inputState.guessing)
{
newline();
}
if (_createToken && (null == _token) && (_ttype != Token.SKIP))
{
_token = makeToken(_ttype);
_token.setText(text.ToString(_begin, text.Length-_begin));
}
returnToken_ = _token;
}
protected void mNEW_LINE_CHARACTER(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
int _ttype; Token _token=null; int _begin=text.Length;
_ttype = NEW_LINE_CHARACTER;
{
switch ( LA(1) )
{
case '\r':
{
match('\u000D');
break;
}
case '\n':
{
match('\u000A');
break;
}
case '\u2028':
{
match('\u2028');
break;
}
case '\u2029':
{
match('\u2029');
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
}
if (_createToken && (null == _token) && (_ttype != Token.SKIP))
{
_token = makeToken(_ttype);
_token.setText(text.ToString(_begin, text.Length-_begin));
}
returnToken_ = _token;
}
protected void mNOT_NEW_LINE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
int _ttype; Token _token=null; int _begin=text.Length;
_ttype = NOT_NEW_LINE;
{
match(tokenSet_0_);
}
if (_createToken && (null == _token) && (_ttype != Token.SKIP))
{
_token = makeToken(_ttype);
_token.setText(text.ToString(_begin, text.Length-_begin));
}
returnToken_ = _token;
}
public void mWHITESPACE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
int _ttype; Token _token=null; int _begin=text.Length;
_ttype = WHITESPACE;
{ // ( ... )+
int _cnt526=0;
for (;;)
{
switch ( LA(1) )
{
case ' ':
{
match(' ');
break;
}
case '\t':
{
match('\u0009');
break;
}
case '\u000b':
{
match('\u000B');
break;
}
case '\u000c':
{
match('\u000C');
break;
}
case '\n': case '\r': case '\u2028': case '\u2029':
{
mNEW_LINE(false);
break;
}
default:
{
if (_cnt526 >= 1) { goto _loop526_breakloop; } else { throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());; }
}
break; }
_cnt526++;
}
_loop526_breakloop: ;
} // ( ... )+
if (0==inputState.guessing)
{
_ttype = Token.SKIP;
}
if (_createToken && (null == _token) && (_ttype != Token.SKIP))
{
_token = makeToken(_ttype);
_token.setText(text.ToString(_begin, text.Length-_begin));
}
returnToken_ = _token;
}
public void mSINGLE_LINE_COMMENT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
int _ttype; Token _token=null; int _begin=text.Length;
_ttype = SINGLE_LINE_COMMENT;
match("//");
{ // ( ... )*
for (;;)
{
if ((tokenSet_0_.member(LA(1))))
{
mNOT_NEW_LINE(false);
}
else
{
goto _loop529_breakloop;
}
}
_loop529_breakloop: ;
} // ( ... )*
{
if ((tokenSet_3_.member(LA(1))))
{
mNEW_LINE(false);
}
else {
}
}
if (0==inputState.guessing)
{
_ttype = Token.SKIP;
}
if (_createToken && (null == _token) && (_ttype != Token.SKIP))
{
_token = makeToken(_ttype);
_token.setText(text.ToString(_begin, text.Length-_begin));
}
returnToken_ = _token;
}
public void mDELIMITED_COMMENT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
int _ttype; Token _token=null; int _begin=text.Length;
_ttype = DELIMITED_COMMENT;
match("/*");
{ // ( ... )*
for (;;)
{
if (((LA(1)=='*') && ((LA(2) >= '\u0003' && LA(2) <= '\u7fff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u7fff')))&&( LA(2)!='/' ))
{
match('*');
}
else if ((tokenSet_3_.member(LA(1)))) {
mNEW_LINE(false);
}
else if ((tokenSet_4_.member(LA(1)))) {
{
match(tokenSet_4_);
}
}
else
{
goto _loop534_breakloop;
}
}
_loop534_breakloop: ;
} // ( ... )*
match("*/");
if (0==inputState.guessing)
{
_ttype = Token.SKIP;
}
if (_createToken && (null == _token) && (_ttype != Token.SKIP))
{
_token = makeToken(_ttype);
_token.setText(text.ToString(_begin, text.Length-_begin));
}
returnToken_ = _token;
}
public void mUNICODE_ESCAPE_SEQUENCE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
int _ttype; Token _token=null; int _begin=text.Length;
_ttype = UNICODE_ESCAPE_SEQUENCE;
if ((LA(1)=='\\') && (LA(2)=='u'))
{
{
match('\\');
match('u');
mHEX_DIGIT(false);
mHEX_DIGIT(false);
mHEX_DIGIT(false);
mHEX_DIGIT(false);
}
}
else if ((LA(1)=='\\') && (LA(2)=='U')) {
{
match('\\');
match('U');
mHEX_DIGIT(false);
mHEX_DIGIT(false);
mHEX_DIGIT(false);
mHEX_DIGIT(false);
mHEX_DIGIT(false);
mHEX_DIGIT(false);
mHEX_DIGIT(false);
mHEX_DIGIT(false);
}
}
else
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
if (_createToken && (null == _token) && (_ttype != Token.SKIP))
{
_token = makeToken(_ttype);
_token.setText(text.ToString(_begin, text.Length-_begin));
}
returnToken_ = _token;
}
protected void mHEX_DIGIT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
{
int _ttype; Token _token=null; int _begin=text.Length;
_ttype = HEX_DIGIT;
switch ( LA(1) )
{
case '0':
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -