gnuclexer.java
来自「plugin for eclipse」· Java 代码 · 共 2,396 行 · 第 1/5 页
JAVA
2,396 行
} while (true);
}
{
_loop2426:
do {
if ((_tokenSet_4.member(LA(1)))) {
mIntSuffix(false);
}
else {
break _loop2426;
}
} while (true);
}
}
else if ((LA(1)=='.') && (true)) {
match('.');
if ( inputState.guessing==0 ) {
_ttype = DOT;
}
{
if (((LA(1) >= '0' && LA(1) <= '9'))) {
{
int _cnt2410=0;
_loop2410:
do {
if (((LA(1) >= '0' && LA(1) <= '9'))) {
mDigit(false);
}
else {
if ( _cnt2410>=1 ) { break _loop2410; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
_cnt2410++;
} while (true);
}
{
if ((LA(1)=='E'||LA(1)=='e')) {
mExponent(false);
}
else {
}
}
if ( inputState.guessing==0 ) {
_ttype = Number;
}
{
_loop2413:
do {
if ((_tokenSet_3.member(LA(1)))) {
mNumberSuffix(false);
}
else {
break _loop2413;
}
} while (true);
}
}
else {
}
}
}
else if ((LA(1)=='0') && (true) && (true)) {
match('0');
{
_loop2415:
do {
if (((LA(1) >= '0' && LA(1) <= '7'))) {
matchRange('0','7');
}
else {
break _loop2415;
}
} while (true);
}
{
_loop2417:
do {
if ((_tokenSet_3.member(LA(1)))) {
mNumberSuffix(false);
}
else {
break _loop2417;
}
} while (true);
}
}
else if (((LA(1) >= '1' && LA(1) <= '9')) && (true) && (true)) {
matchRange('1','9');
{
_loop2419:
do {
if (((LA(1) >= '0' && LA(1) <= '9'))) {
mDigit(false);
}
else {
break _loop2419;
}
} while (true);
}
{
_loop2421:
do {
if ((_tokenSet_3.member(LA(1)))) {
mNumberSuffix(false);
}
else {
break _loop2421;
}
} while (true);
}
}
else {
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
}
_returnToken = _token;
}
protected final void mExponent(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = Exponent;
int _saveIndex;
{
switch ( LA(1)) {
case 'e':
{
match('e');
break;
}
case 'E':
{
match('E');
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
}
{
switch ( LA(1)) {
case '+':
{
match('+');
break;
}
case '-':
{
match('-');
break;
}
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
case '8': case '9':
{
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
}
{
int _cnt2544=0;
_loop2544:
do {
if (((LA(1) >= '0' && LA(1) <= '9'))) {
mDigit(false);
}
else {
if ( _cnt2544>=1 ) { break _loop2544; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
_cnt2544++;
} while (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 mIDMEAT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = IDMEAT;
int _saveIndex;
Token i=null;
mID(true);
i=_returnToken;
if ( inputState.guessing==0 ) {
if ( i.getType() == LITERAL___extension__ ) {
_ttype = Token.SKIP;
}
else {
_ttype = i.getType();
}
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
}
_returnToken = _token;
}
protected final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = ID;
int _saveIndex;
{
switch ( LA(1)) {
case 'a': case 'b': case 'c': case 'd':
case 'e': case 'f': case 'g': case 'h':
case 'i': case 'j': case 'k': case 'l':
case 'm': case 'n': case 'o': case 'p':
case 'q': case 'r': case 's': case 't':
case 'u': case 'v': case 'w': case 'x':
case 'y': case 'z':
{
matchRange('a','z');
break;
}
case 'A': case 'B': case 'C': case 'D':
case 'E': case 'F': case 'G': case 'H':
case 'I': case 'J': case 'K': case 'L':
case 'M': case 'N': case 'O': case 'P':
case 'Q': case 'R': case 'S': case 'T':
case 'U': case 'V': case 'W': case 'X':
case 'Y': case 'Z':
{
matchRange('A','Z');
break;
}
case '_':
{
match('_');
break;
}
case '$':
{
match('$');
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
}
{
_loop2431:
do {
if (((LA(1) >= 'a' && LA(1) <= 'z')) && (true) && (true)) {
matchRange('a','z');
}
else if (((LA(1) >= 'A' && LA(1) <= 'Z')) && (true) && (true)) {
matchRange('A','Z');
}
else if ((LA(1)=='_') && (true) && (true)) {
match('_');
}
else if ((LA(1)=='$') && (true) && (true)) {
match('$');
}
else if (((LA(1) >= '0' && LA(1) <= '9')) && (true) && (true)) {
matchRange('0','9');
}
else {
break _loop2431;
}
} while (true);
}
_ttype = testLiteralsTable(new String(text.getBuffer(),_begin,text.length()-_begin),_ttype);
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 mWideCharLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = WideCharLiteral;
int _saveIndex;
match('L');
mCharLiteral(false);
if ( inputState.guessing==0 ) {
_ttype = CharLiteral;
}
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 mCharLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = CharLiteral;
int _saveIndex;
match('\'');
{
if ((LA(1)=='\\') && ((LA(2) >= '\u0000' && LA(2) <= '\u00ff')) && (_tokenSet_5.member(LA(3)))) {
mEscape(false);
}
else if ((_tokenSet_6.member(LA(1))) && (LA(2)=='\'') && (true)) {
{
match(_tokenSet_6);
}
}
else {
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
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 mWideStringLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = WideStringLiteral;
int _saveIndex;
match('L');
mStringLiteral(false);
if ( inputState.guessing==0 ) {
_ttype = StringLiteral;
}
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 mStringLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = StringLiteral;
int _saveIndex;
match('"');
{
_loop2441:
do {
boolean synPredMatched2438 = false;
if (((LA(1)=='\\') && ((LA(2) >= '\u0000' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0000' && LA(3) <= '\u00ff')))) {
int _m2438 = mark();
synPredMatched2438 = true;
inputState.guessing++;
try {
{
match('\\');
{
match(_tokenSet_7);
}
}
}
catch (RecognitionException pe) {
synPredMatched2438 = false;
}
rewind(_m2438);
inputState.guessing--;
}
if ( synPredMatched2438 ) {
mEscape(false);
}
else if ((LA(1)=='\n'||LA(1)=='\r'||LA(1)=='\\') && ((LA(2) >= '\u0000' && LA(2) <= '\u00ff')) && (true)) {
{
switch ( LA(1)) {
case '\r':
{
match('\r');
if ( inputState.guessing==0 ) {
newline();
}
break;
}
case '\n':
{
match('\n');
if ( inputState.guessing==0 ) {
newline();
}
break;
}
case '\\':
{
match('\\');
match('\n');
if ( inputState.guessing==0 ) {
newline();
}
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
}
}
else if ((_tokenSet_8.member(LA(1)))) {
{
match(_tokenSet_8);
}
}
else {
break _loop2441;
}
} while (true);
}
match('"');
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
}
_returnToken = _token;
}
protected final void mVocabulary(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = Vocabulary;
int _saveIndex;
matchRange('\3','\377');
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 mASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = ASSIGN;
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 mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?