Package com.puppetlabs.geppetto.ruby

Examples of com.puppetlabs.geppetto.ruby.RubyDocProcessor$RubyDocLexer$Token


    assertEquals(Joiner.on("").join(content4Expected), result);
  }

  @Test
  public void testRubyDocprocessor_5() {
    String result = new RubyDocProcessor().asHTML(Joiner.on("").join(content5));
    assertEquals(Joiner.on("").join(content5Expected), result);
  }
View Full Code Here


    assertEquals(Joiner.on("").join(content5Expected), result);
  }

  @Test
  public void testRubyDocprocessor_5a() {
    String result = new RubyDocProcessor().asHTML(Joiner.on("").join(content5a));
    assertEquals(Joiner.on("").join(content5Expected), result);
  }
View Full Code Here

    assertEquals(Joiner.on("").join(content5Expected), result);
  }

  @Test
  public void testRubyDocprocessor_6() {
    String result = new RubyDocProcessor().asHTML(Joiner.on("").join(content6));
    assertEquals(Joiner.on("").join(content6Expected), result);
  }
View Full Code Here

    }

    private Token buildTokenModel(TokenInfo token) throws CloudException {
        Preconditions.checkNotNull(token);

        Token response = new Token();

        response.expires = TokenAuth.getExpiration(token);

        UserData user = authRepository.getUsers().find(token.getUserId());
        if (user == null) {
View Full Code Here

    return new JAVACCParser(reader, new SPARQLParser(reader));
  }

  @Override
  public TOKEN getNextToken() {
    final Token token = this.parser.getNextToken();
    if(token==null){
      return null;
    } else {
      return new SPARQLToken(token);
    }
View Full Code Here

    int type = adaptor.getType(t);
    buf.append("\t");
    buf.append(ID);
    buf.append("\t");
    buf.append(type);
    Token token = adaptor.getToken(t);
    int line = -1;
    int pos = -1;
    if ( token!=null ) {
      line = token.getLine();
      pos = token.getCharPositionInLine();
    }
    buf.append("\t");
    buf.append(line);
    buf.append("\t");
    buf.append(pos);
View Full Code Here

  /** Get num hidden tokens between i..j inclusive */
  public int getNumberOfHiddenTokens(int i, int j) {
    int n = 0;
    TokenStream input = parser.getTokenStream();
    for (int ti = i; ti<input.size() && ti <= j; ti++) {
      Token t = input.get(ti);
      if ( t.getChannel()!=Token.DEFAULT_CHANNEL ) {
        n++;
      }
    }
    return n;
  }
View Full Code Here

      }
      previousTokenIndex = t.getTokenIndex();
      listener.consumeHiddenToken(t);
    }
    else if ( elements[0].equals("LT") ) {
      Token t = deserializeToken(elements, 2);
      listener.LT(Integer.parseInt(elements[1]), t);
    }
    else if ( elements[0].equals("mark") ) {
      listener.mark(Integer.parseInt(elements[1]));
    }
View Full Code Here

  public void setTokenStopIndex(int index) {
  }

  public String toString() {
    if ( payload instanceof Token ) {
      Token t = (Token)payload;
      if ( t.getType() == Token.EOF ) {
        return "<EOF>";
      }
      return t.getText();
    }
    return payload.toString();
  }
View Full Code Here

   */
  public String toStringWithHiddenTokens() {
    StringBuffer buf = new StringBuffer();
    if ( hiddenTokens!=null ) {
      for (int i = 0; i < hiddenTokens.size(); i++) {
        Token hidden = (Token) hiddenTokens.get(i);
        buf.append(hidden.getText());
      }
    }
    String nodeText = this.toString();
    if ( !nodeText.equals("<EOF>") ) buf.append(nodeText);
    return buf.toString();
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.ruby.RubyDocProcessor$RubyDocLexer$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.