Package org.jostraca.comp.antlr

Examples of org.jostraca.comp.antlr.Token


    }
    _returnToken = _token;
  }
 
  protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = DIGIT;
    int _saveIndex;
   
    matchRange('0','9');
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
View Full Code Here


    }
    _returnToken = _token;
  }
 
  public final void mINT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = INT;
    int _saveIndex;
   
    {
    int _cnt196=0;
    _loop196:
    do {
      if (((LA(1) >= '0' && LA(1) <= '9'))) {
        matchRange('0','9');
      }
      else {
        if ( _cnt196>=1 ) { break _loop196; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
      }
     
      _cnt196++;
    } while (true);
    }
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
View Full Code Here

    }
    _returnToken = _token;
  }
 
  public final void mARG_ACTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = ARG_ACTION;
    int _saveIndex;
   
    mNESTED_ARG_ACTION(false);
    setText(StringUtils.stripFrontBack(getText(), "[", "]"));
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
View Full Code Here

    }
    _returnToken = _token;
  }
 
  protected final void mNESTED_ARG_ACTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = NESTED_ARG_ACTION;
    int _saveIndex;
   
    match('[');
    {
    _loop200:
    do {
      switch ( LA(1)) {
      case '[':
      {
        mNESTED_ARG_ACTION(false);
        break;
      }
      case '\n':
      {
        match('\n');
        newline();
        break;
      }
      case '\'':
      {
        mCHAR_LITERAL(false);
        break;
      }
      case '"':
      {
        mSTRING_LITERAL(false);
        break;
      }
      default:
        if ((LA(1)=='\r') && (LA(2)=='\n')) {
          match('\r');
          match('\n');
          newline();
        }
        else if ((LA(1)=='\r') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff'))) {
          match('\r');
          newline();
        }
        else if ((_tokenSet_3.member(LA(1)))) {
          matchNot(']');
        }
      else {
        break _loop200;
      }
      }
    } 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;
  }
View Full Code Here

    }
    _returnToken = _token;
  }
 
  public final void mACTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = ACTION;
    int _saveIndex;
    int actionLine=getLine(); int actionColumn = getColumn();
   
    mNESTED_ACTION(false);
    {
    if ((LA(1)=='?')) {
      match('?');
      _ttype = SEMPRED;
    }
    else {
    }
   
    }
   
          if ( _ttype==ACTION ) {
            setText(StringUtils.stripFrontBack(getText(), "{", "}"));
          }
          else {
            setText(StringUtils.stripFrontBack(getText(), "{", "}?"));
          }
          CommonToken t = new CommonToken(_ttype,new String(text.getBuffer(),_begin,text.length()-_begin));
          t.setLine(actionLine);      // set action line to start
          t.setColumn(actionColumn);
          _token = t;
       
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
View Full Code Here

    }
    _returnToken = _token;
  }
 
  protected final void mNESTED_ACTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = NESTED_ACTION;
    int _saveIndex;
   
    match('{');
    {
    _loop206:
    do {
      // nongreedy exit test
      if ((LA(1)=='}') && (true)) break _loop206;
      if ((LA(1)=='\n'||LA(1)=='\r') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff'))) {
        {
        if ((LA(1)=='\r') && (LA(2)=='\n')) {
          match('\r');
          match('\n');
          newline();
        }
        else if ((LA(1)=='\r') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff'))) {
          match('\r');
          newline();
        }
        else if ((LA(1)=='\n')) {
          match('\n');
          newline();
        }
        else {
          throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
        }
       
        }
      }
      else if ((LA(1)=='{') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff'))) {
        mNESTED_ACTION(false);
      }
      else if ((LA(1)=='\'') && (_tokenSet_4.member(LA(2)))) {
        mCHAR_LITERAL(false);
      }
      else if ((LA(1)=='/') && (LA(2)=='*'||LA(2)=='/')) {
        mCOMMENT(false);
      }
      else if ((LA(1)=='"') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff'))) {
        mSTRING_LITERAL(false);
      }
      else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff'))) {
        matchNot(EOF_CHAR);
      }
      else {
        break _loop206;
      }
     
    } 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;
  }
View Full Code Here

    }
    _returnToken = _token;
  }
 
  public final void mTOKEN_REF(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = TOKEN_REF;
    int _saveIndex;
   
    matchRange('A','Z');
    {
    _loop209:
    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;
      }
      case '_':
      {
        match('_');
        break;
      }
      case '0'case '1'case '2'case '3':
      case '4'case '5'case '6'case '7':
      case '8'case '9':
      {
        matchRange('0','9');
        break;
      }
      default:
      {
        break _loop209;
      }
      }
    } 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;
  }
View Full Code Here

    }
    _returnToken = _token;
  }
 
  public final void mRULE_REF(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = RULE_REF;
    int _saveIndex;
   
      int t=0;
   
   
    t=mINTERNAL_RULE_REF(false);
    _ttype=t;
    {
    if (( true )&&(t==LITERAL_options)) {
      mWS_LOOP(false);
      {
      if ((LA(1)=='{')) {
        match('{');
        _ttype = OPTIONS;
      }
      else {
      }
     
      }
    }
    else if (( true )&&(t==LITERAL_tokens)) {
      mWS_LOOP(false);
      {
      if ((LA(1)=='{')) {
        match('{');
        _ttype = TOKENS;
      }
      else {
      }
     
      }
    }
    else {
    }
   
    }
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
View Full Code Here

    _returnToken = _token;
  }
 
  protected final int  mINTERNAL_RULE_REF(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int t;
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = INTERNAL_RULE_REF;
    int _saveIndex;
   
      t = RULE_REF;
   
   
    matchRange('a','z');
    {
    _loop219:
    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;
      }
      case '_':
      {
        match('_');
        break;
      }
      case '0'case '1'case '2'case '3':
      case '4'case '5'case '6'case '7':
      case '8'case '9':
      {
        matchRange('0','9');
        break;
      }
      default:
      {
        break _loop219;
      }
      }
    } while (true);
    }
    t = testLiteralsTable(t);
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
    return t;
  }
View Full Code Here

    _returnToken = _token;
    return t;
  }
 
  protected final void mWS_LOOP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype; Token _token=null; int _begin=text.length();
    _ttype = WS_LOOP;
    int _saveIndex;
   
    {
    _loop216:
    do {
      switch ( LA(1)) {
      case '\t'case '\n'case '\r'case ' ':
      {
        mWS(false);
        break;
      }
      case '/':
      {
        mCOMMENT(false);
        break;
      }
      default:
      {
        break _loop216;
      }
      }
    } while (true);
    }
    if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
      _token = makeToken(_ttype);
      _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
    }
    _returnToken = _token;
  }
View Full Code Here

TOP

Related Classes of org.jostraca.comp.antlr.Token

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.