Package wycc.lang

Examples of wycc.lang.SyntaxError


      if(index > 0) {
        syntaxError("unexpected end-of-file",tokens.get(index-1));
      } else {
        // I believe this is actually dead-code, since heckNotEof()
        // won't be called before at least one token is matched.
        throw new SyntaxError("unexpected end-of-file", filename,
            0,0);
      }
    }
  }
View Full Code Here


    return new Attribute.Source(t1.start, t2.end(), 0);
  }

  private void syntaxError(String msg, SyntacticElement e) {
    Attribute.Source loc = e.attribute(Attribute.Source.class);
    throw new SyntaxError(msg, filename, loc.start, loc.end);
  }
View Full Code Here

    Attribute.Source loc = e.attribute(Attribute.Source.class);
    throw new SyntaxError(msg, filename, loc.start, loc.end);
  }

  private void syntaxError(String msg, Token t) {
    throw new SyntaxError(msg, filename, t.start, t.start + t.text.length()
        - 1);
  }
View Full Code Here

      if(index > 0) {
        syntaxError("unexpected end-of-file",tokens.get(index-1));
      } else {
        // I believe this is actually dead-code, since heckNotEof()
        // won't be called before at least one token is matched.
        throw new SyntaxError("unexpected end-of-file", filename,
            0,0);
      }
    }
  }
View Full Code Here

    return new Attribute.Source(t1.start, t2.end(), 0);
  }

  private void syntaxError(String msg, SyntacticElement e) {
    Attribute.Source loc = e.attribute(Attribute.Source.class);
    throw new SyntaxError(msg, filename, loc.start, loc.end);
  }
View Full Code Here

    Attribute.Source loc = e.attribute(Attribute.Source.class);
    throw new SyntaxError(msg, filename, loc.start, loc.end);
  }

  private void syntaxError(String msg, Token t) {
    throw new SyntaxError(msg, filename, t.start, t.start + t.text.length()
        - 1);
  }
View Full Code Here

   *            --- message to raise.
   * @param index
   *            --- index position to associate the error with.
   */
  private void syntaxError(String msg, int index) {
    throw new SyntaxError(msg, filename, index, index);
  }
View Full Code Here

   * called from contexts where we are expecting something to follow.
   */
  private void checkNotEof() {
    skipWhiteSpace();
    if (index >= tokens.size()) {
      throw new SyntaxError("unexpected end-of-file", filename,
          index - 1, index - 1);
    }
  }
View Full Code Here

    return new Attribute.Source(t1.start, t2.end(), 0);
  }

  private void syntaxError(String msg, SyntacticElement e) {
    Attribute.Source loc = e.attribute(Attribute.Source.class);
    throw new SyntaxError(msg, filename, loc.start, loc.end);
  }
View Full Code Here

    Attribute.Source loc = e.attribute(Attribute.Source.class);
    throw new SyntaxError(msg, filename, loc.start, loc.end);
  }

  private void syntaxError(String msg, Token t) {
    throw new SyntaxError(msg, filename, t.start, t.start + t.text.length()
        - 1);
  }
View Full Code Here

TOP

Related Classes of wycc.lang.SyntaxError

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.