Package wyc.io.WhileyFileLexer

Examples of wyc.io.WhileyFileLexer.Token


   * @param kind
   * @return
   */
  private Token eventuallyMatch(Token.Kind kind) {
    checkNotEof();
    Token token = tokens.get(index);
    if (token.kind != kind) {
      return null;
    } else {
      index = index + 1;
      return token;
View Full Code Here


   */
  private Token tryAndMatchAtIndent(boolean terminated, Indent indent, Token.Kind... kinds) {
    int start = index;
    Indent r = getIndent();
    if(r != null && r.equivalent(indent)) {
      Token t = tryAndMatch(terminated,kinds);
      if(t != null) {
        return r;
      }
    }
    // backtrack in all failing cases.
View Full Code Here

    // skip all whitespace. Otherwise, we can't skip newlines as these are
    // significant.
    int next = terminated ? skipWhiteSpace(index) : skipLineSpace(index);

    if (next < tokens.size()) {
      Token t = tokens.get(next);
      for (int i = 0; i != kinds.length; ++i) {
        if (t.kind == kinds[i]) {
          index = next + 1;
          return t;
        }
View Full Code Here

   * @return
   */
  private Token tryAndMatchOnLine(Token.Kind kind) {
    int next = skipLineSpace(index);
    if (next < tokens.size()) {
      Token t = tokens.get(next);
      if (t.kind == kind) {
        index = next + 1;
        return t;
      }
    }
View Full Code Here

    }
    return (byte) val;
  }

  private Attribute.Source sourceAttr(int start, int end) {
    Token t1 = tokens.get(start);
    Token t2 = tokens.get(end);
    // FIXME: problem here with the line numbering ?
    return new Attribute.Source(t1.start, t2.end(), 0);
  }
View Full Code Here

TOP

Related Classes of wyc.io.WhileyFileLexer.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.