Example #1
0
  public final void mINT(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = INT;
    int _saveIndex;

    {
      int _cnt23 = 0;
      _loop23:
      do {
        if (((LA(1) >= '0' && LA(1) <= '9'))) {
          matchRange('0', '9');
        } else {
          if (_cnt23 >= 1) {
            break _loop23;
          } else {
            throw new NoViableAltForCharException(
                (char) LA(1), getFilename(), getLine(), getColumn());
          }
        }

        _cnt23++;
      } 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 mFIELDTYPE(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = FIELDTYPE;
    int _saveIndex;

    {
      int _cnt33 = 0;
      _loop33:
      do {
        if ((_tokenSet_0.member(LA(1)))) {
          mLETTER(false);
        } else {
          if (_cnt33 >= 1) {
            break _loop33;
          } else {
            throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
          }
        }

        _cnt33++;
      } while (true);
    }
    _ttype = testLiteralsTable(_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 mSTRING(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = STRING;
    int _saveIndex;

    _saveIndex = text.length();
    mQUOTE(false);
    text.setLength(_saveIndex);
    {
      _loop28:
      do {
        if ((_tokenSet_1.member(LA(1)))) {
          matchNot('"');
        } else {
          break _loop28;
        }

      } while (true);
    }
    _saveIndex = text.length();
    mQUOTE(false);
    text.setLength(_saveIndex);
    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 mWS(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = WS;

    int _saveIndex;

    {
      switch (LA(1)) {
        case ' ':
          {
            match(' ');
            break;
          }
        case '\t':
          {
            match('\t');
            break;
          }
        default:
          {
            throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
          }
      }
    }
    _ttype = Token.SKIP;
    if (_createToken && _token == null && _ttype != Token.SKIP) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
  }
Example #5
0
  protected final void mHEX_DIGIT(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = HEX_DIGIT;
    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(), getColumn());
          }
      }
    }
    if (_createToken && _token == null && _ttype != Token.SKIP) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
  }
Example #6
0
  public final void mSL_COMMENT(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = SL_COMMENT;
    int _saveIndex;

    match("#");
    {
      _loop56:
      do {
        if ((_tokenSet_0.member(LA(1)))) {
          {
            match(_tokenSet_0);
          }
        } else {
          break _loop56;
        }

      } while (true);
    }
    {
      switch (LA(1)) {
        case '\n':
          {
            match('\n');
            break;
          }
        case '\r':
          {
            match('\r');
            {
              if ((LA(1) == '\n')) {
                match('\n');
              } else {
              }
            }
            break;
          }
        default:
          {
            throw new NoViableAltForCharException(
                (char) LA(1), getFilename(), getLine(), getColumn());
          }
      }
    }
    _ttype = Token.SKIP;
    newline();
    if (_createToken && _token == null && _ttype != Token.SKIP) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
  }
Example #7
0
  public final void mWS(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = WS;
    int _saveIndex;

    {
      int _cnt14 = 0;
      _loop14:
      do {
        switch (LA(1)) {
          case ' ':
            {
              match(' ');
              break;
            }
          case '\t':
            {
              match('\t');
              break;
            }
          case '\n':
            {
              match('\n');
              newline();
              break;
            }
          case '\r':
            {
              match('\r');
              break;
            }
          default:
            {
              if (_cnt14 >= 1) {
                break _loop14;
              } else {
                throw new NoViableAltForCharException(
                    (char) LA(1), getFilename(), getLine(), getColumn());
              }
            }
        }
        _cnt14++;
      } while (true);
    }
    if (_createToken && _token == null && _ttype != Token.SKIP) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
  }
Example #8
0
  protected final void mEXPONENT(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = EXPONENT;
    int _saveIndex;

    {
      match('e');
    }
    {
      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());
          }
      }
    }
    mINTEGER(false);
    if (_createToken && _token == null && _ttype != Token.SKIP) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
  }
Example #9
0
  protected final void mINTEGER(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = INTEGER;
    int _saveIndex;

    switch (LA(1)) {
      case '0':
        {
          mZERO(false);
          break;
        }
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7':
      case '8':
      case '9':
        {
          mNONZERO(false);
          {
            _loop38:
            do {
              if (((LA(1) >= '0' && LA(1) <= '9'))) {
                mDIGIT(false);
              } else {
                break _loop38;
              }

            } while (true);
          }
          break;
        }
      default:
        {
          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;
  }
  public final void mCONJ(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = CONJ;
    int _saveIndex;

    match("CONJ");
    if (_createToken && _token == null && _ttype != Token.SKIP) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
  }
Example #11
0
  protected final void mNONZERO(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = NONZERO;
    int _saveIndex;

    matchRange('1', '9');
    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 mLETTER(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = LETTER;
    int _saveIndex;

    {
      match(_tokenSet_0);
    }
    _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;
  }
Example #13
0
  public final void mSTRING(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = STRING;
    int _saveIndex;
    Token escaped = null;
    char normal = '\0';
    StringBuilder lBuf = new StringBuilder();

    match('"');
    {
      _loop26:
      do {
        if ((LA(1) == '\\')) {
          mESC(true);
          escaped = _returnToken;
          lBuf.append(escaped.getText());
        } else if ((_tokenSet_1.member(LA(1)))) {
          {
            normal = LA(1);
            match(_tokenSet_1);
          }
          lBuf.append(normal);
        } else {
          break _loop26;
        }

      } while (true);
    }
    match('"');
    text.setLength(_begin);
    text.append(lBuf.toString());
    if (_createToken && _token == null && _ttype != Token.SKIP) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
  }
Example #14
0
  public final void mNUMBER(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = NUMBER;
    int _saveIndex;

    {
      switch (LA(1)) {
        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());
          }
      }
    }
    mINTEGER(false);
    {
      if ((LA(1) == 'e')) {
        mEXPONENT(false);
      } else {
        {
          if ((LA(1) == '.')) {
            match('.');
            {
              int _cnt44 = 0;
              _loop44:
              do {
                if (((LA(1) >= '0' && LA(1) <= '9'))) {
                  mDIGIT(false);
                } else {
                  if (_cnt44 >= 1) {
                    break _loop44;
                  } else {
                    throw new NoViableAltForCharException(
                        (char) LA(1), getFilename(), getLine(), getColumn());
                  }
                }

                _cnt44++;
              } while (true);
            }
            {
              if ((LA(1) == 'e')) {
                mEXPONENT(false);
              } else {
              }
            }
          } else {
          }
        }
      }
    }
    if (_createToken && _token == null && _ttype != Token.SKIP) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
  }
Example #15
0
  protected final void mESC(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = ESC;
    int _saveIndex;
    Token i = null;
    Token j = null;
    Token k = null;
    Token l = null;

    match('\\');
    {
      switch (LA(1)) {
        case 'n':
          {
            match('n');
            text.setLength(_begin);
            text.append("\n");
            break;
          }
        case 'r':
          {
            match('r');
            text.setLength(_begin);
            text.append("\r");
            break;
          }
        case 't':
          {
            match('t');
            text.setLength(_begin);
            text.append("\t");
            break;
          }
        case 'b':
          {
            match('b');
            text.setLength(_begin);
            text.append("\b");
            break;
          }
        case 'f':
          {
            match('f');
            text.setLength(_begin);
            text.append("\f");
            break;
          }
        case '"':
          {
            match('"');
            text.setLength(_begin);
            text.append("\"");
            break;
          }
        case '\'':
          {
            match('\'');
            text.setLength(_begin);
            text.append("\'");
            break;
          }
        case '/':
          {
            match('/');
            text.setLength(_begin);
            text.append("/");
            break;
          }
        case '\\':
          {
            match('\\');
            text.setLength(_begin);
            text.append("\\");
            break;
          }
        case 'u':
          {
            {
              int _cnt30 = 0;
              _loop30:
              do {
                if ((LA(1) == 'u')) {
                  match('u');
                } else {
                  if (_cnt30 >= 1) {
                    break _loop30;
                  } else {
                    throw new NoViableAltForCharException(
                        (char) LA(1), getFilename(), getLine(), getColumn());
                  }
                }

                _cnt30++;
              } while (true);
            }
            mHEX_DIGIT(true);
            i = _returnToken;
            mHEX_DIGIT(true);
            j = _returnToken;
            mHEX_DIGIT(true);
            k = _returnToken;
            mHEX_DIGIT(true);
            l = _returnToken;
            text.setLength(_begin);
            text.append(ParserUtil.hexToChar(i.getText(), j.getText(), k.getText(), l.getText()));
            break;
          }
        default:
          {
            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;
  }
Example #16
0
  public final void mID(boolean _createToken)
      throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = ID;
    int _saveIndex;

    {
      int _cnt26 = 0;
      _loop26:
      do {
        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;
            }
          default:
            {
              if (_cnt26 >= 1) {
                break _loop26;
              } else {
                throw new NoViableAltForCharException(
                    (char) LA(1), getFilename(), getLine(), getColumn());
              }
            }
        }
        _cnt26++;
      } while (true);
    }
    if (_createToken && _token == null && _ttype != Token.SKIP) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
  }