antlrlexer.java
来自「SRI international 发布的OAA框架软件」· Java 代码 · 共 1,637 行 · 第 1/3 页
JAVA
1,637 行
_returnToken = _token;
}
public final void mCLOSE_ELEMENT_OPTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = CLOSE_ELEMENT_OPTION;
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;
}
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 mTREE_BEGIN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = TREE_BEGIN;
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 ( _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 ( _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 mSTAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = STAR;
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 mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = PLUS;
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 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 mIMPLIES(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = IMPLIES;
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 mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = SEMI;
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 mCARET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = CARET;
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 mBANG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = BANG;
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 mOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = OR;
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 mWILDCARD(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = WILDCARD;
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 mRANGE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = RANGE;
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 mNOT_OP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = NOT_OP;
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 mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = RCURLY;
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 mCHAR_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = CHAR_LITERAL;
int _saveIndex;
match('\'');
{
switch ( LA(1)) {
case '\\':
{
mESC(false);
break;
}
case '\u0003': case '\u0004': case '\u0005': case '\u0006':
case '\u0007': case '\u0008': case '\t': case '\n':
case '\u000b': case '\u000c': case '\r': case '\u000e':
case '\u000f': case '\u0010': case '\u0011': case '\u0012':
case '\u0013': case '\u0014': case '\u0015': case '\u0016':
case '\u0017': case '\u0018': case '\u0019': case '\u001a':
case '\u001b': case '\u001c': case '\u001d': case '\u001e':
case '\u001f': case ' ': case '!': case '"':
case '#': case '$': case '%': case '&':
case '(': case ')': case '*': case '+':
case ',': case '-': case '.': case '/':
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
case '8': case '9': case ':': case ';':
case '<': case '=': case '>': case '?':
case '@': 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': case '[':
case ']': case '^': case '_': case '`':
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': case '{': case '|':
case '}': case '~':
{
matchNot('\'');
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
}
}
}
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 mESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = ESC;
int _saveIndex;
match('\\');
{
switch ( LA(1)) {
case 'n':
{
match('n');
break;
}
case 'r':
{
match('r');
break;
}
case 't':
{
match('t');
break;
}
case 'b':
{
match('b');
break;
}
case 'f':
{
match('f');
break;
}
case 'w':
{
match('w');
break;
}
case 'a':
{
match('a');
break;
}
case '"':
{
match('"');
break;
}
case '\'':
{
match('\'');
break;
}
case '\\':
{
match('\\');
break;
}
case '0': case '1': case '2': case '3':
{
{
matchRange('0','3');
}
{
if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) {
{
matchRange('0','9');
}
{
if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) {
matchRange('0','9');
}
else if (((LA(1) >= '\u0003' && LA(1) <= '~')) && (true)) {
}
else {
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
}
}
}
else if (((LA(1) >= '\u0003' && LA(1) <= '~')) && (true)) {
}
else {
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
}
}
break;
}
case '4': case '5': case '6': case '7':
{
{
matchRange('4','7');
}
{
if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) {
{
matchRange('0','9');
}
}
else if (((LA(1) >= '\u0003' && LA(1) <= '~')) && (true)) {
}
else {
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
}
}
break;
}
case 'u':
{
match('u');
mXDIGIT(false);
mXDIGIT(false);
mXDIGIT(false);
mXDIGIT(false);
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
}
}
}
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 mSTRING_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = STRING_LITERAL;
int _saveIndex;
match('"');
{
_loop184:
do {
switch ( LA(1)) {
case '\\':
{
mESC(false);
break;
}
case '\u0003': case '\u0004': case '\u0005': case '\u0006':
case '\u0007': case '\u0008': case '\t': case '\n':
case '\u000b': case '\u000c': case '\r': case '\u000e':
case '\u000f': case '\u0010': case '\u0011': case '\u0012':
case '\u0013': case '\u0014': case '\u0015': case '\u0016':
case '\u0017': case '\u0018': case '\u0019': case '\u001a':
case '\u001b': case '\u001c': case '\u001d': case '\u001e':
case '\u001f': case ' ': case '!': case '#':
case '$': case '%': case '&': case '\'':
case '(': case ')': case '*': case '+':
case ',': case '-': case '.': case '/':
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
case '8': case '9': case ':': case ';':
case '<': case '=': case '>': case '?':
case '@': 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': case '[':
case ']': case '^': case '_': case '`':
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': case '{': case '|':
case '}': case '~':
{
matchNot('"');
break;
}
default:
{
break _loop184;
}
}
} 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 mXDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = XDIGIT;
int _saveIndex;
switch ( LA(1)) {
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
case '8': case '9':
{
matchRange('0','9');
break;
}
case 'a': case 'b': case 'c': case 'd':
case 'e': case 'f':
{
matchRange('a','f');
break;
}
case 'A': case 'B': case 'C': case 'D':
case 'E': case 'F':
{
matchRange('A','F');
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
}
}
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 mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?