1 package edu.berkeley.sbp;
2 import edu.berkeley.sbp.*;
3 import edu.berkeley.sbp.util.*;
7 /** thrown when the parser arrives at a state from which it is clear that no valid parse can result */
8 public class ParseFailed extends RuntimeException {
9 private final Token.Location location;
10 private final String message;
11 public ParseFailed() { this("", null); }
12 public ParseFailed(String message, Token.Location loc) { this.location = loc; this.message = message; }
13 public Token.Location getLocation() { return location; }
14 public String toString() { return message/* + (location==null ? "" : (" at " + location))*/; }