Examples of CommonToken


Examples of org.antlr.v4.runtime.CommonToken

  public void testSingleEOF() throws Exception {
    TokenSource lexer = new TokenSource() {

      @Override
      public Token nextToken() {
        return new CommonToken(Token.EOF);
      }

      @Override
      public int getLine() {
        return 0;
View Full Code Here

Examples of org.antlr.v4.runtime.CommonToken

  public void testCannotConsumeEOF() throws Exception {
    TokenSource lexer = new TokenSource() {

      @Override
      public Token nextToken() {
        return new CommonToken(Token.EOF);
      }

      @Override
      public int getLine() {
        return 0;
View Full Code Here

Examples of org.antlr.v4.runtime.CommonToken

      return UNKNOWN_SOURCE_NAME;
    }

    @Override
    public Token LT(int i) {
      CommonToken t;
      int rawIndex = p + i - 1;
      if ( rawIndex>=types.size() ) t = new CommonToken(Token.EOF);
      else t = new CommonToken(types.get(rawIndex));
      t.setTokenIndex(rawIndex);
      return t;
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.antlr.runtime.CommonToken

   *
   *  If you care what the token payload objects' type is, you should
   *  override this method and any other createToken variant.
   */
  public Token createToken(int tokenType, String text) {
    return new CommonToken(tokenType, text);
  }
View Full Code Here

Examples of org.jostraca.comp.antlr.CommonToken

            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));
View Full Code Here

Examples of persistence.antlr.CommonToken

            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));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.