import edu.berkeley.sbp.Sequence.Pos;
import edu.berkeley.sbp.Sequence.Pos;
import edu.berkeley.sbp.GSS.Phase;
-import edu.berkeley.sbp.Node;
+import edu.berkeley.sbp.StateNode;
import edu.berkeley.sbp.util.*;
import java.io.*;
import java.util.*;
return (c >= 'A' && c <= 'Z');
}
- static <Tok> void barf(HashMap<Element,Input.Location> sb, Node n, int indent, boolean skip, int count, Input.Location loc) {
+ static <Tok> void barf(HashMap<Element,Input.Location> sb, StateNode n, int indent, boolean skip, int count, Input.Location loc) {
if (count <= 0) {
barf(sb, n, indent, skip, loc);
} else {
/*
FIXME: removed
- for(Node nn : (Iterable<Node>)n.parents())
+ for(StateNode nn : (Iterable<StateNode>)n.parents())
barf(sb, nn, indent, skip, count-1, n.phase().getLocation());
*/
}
}
- static <Tok> void barf(HashMap<Element,Input.Location> sb, Node n, int indent, boolean skip, Input.Location loc) {
+ static <Tok> void barf(HashMap<Element,Input.Location> sb, StateNode n, int indent, boolean skip, Input.Location loc) {
if (touched.contains(n)) return;
touched.add(n);
String s = "";
for(int i=0; i< indent; i++) s += " ";
- Node parent = n;
+ StateNode parent = n;
boolean done = false;
boolean alldone = false;
boolean go = false;
// FIXME
- private static HashSet<Node> touched = new HashSet<Node>();
- static <Tok> void complain(Node n, HashMap<String,HashSet<String>> errors, boolean force, int indent) {
+ private static HashSet<StateNode> touched = new HashSet<StateNode>();
+ static <Tok> void complain(StateNode n, HashMap<String,HashSet<String>> errors, boolean force, int indent) {
if (touched.contains(n)) return;
touched.add(n);
for(Pos p : (Iterable<Pos>)n.state()) {
!important(p)) {
/*
FIXME: removed
- for(Node n2 : n.parents())
+ for(StateNode n2 : n.parents())
complain(n2, errors, force
//| p.isFirst()
, indent);
static void error(String message, GSS.Phase phase, Object token, Input.Region region) throws ParseFailed {
error(message,
token,
- phase,
+ /*phase*/null,
region,
phase.getGSS().getInput(),
phase.getGSS());
}
private static void error(String message,
Object token,
- Iterable<Node> nodes,
+ Iterable<StateNode> nodes,
Input.Region region,
Input input,
GSS gss) throws ParseFailed{
*/
}
HashMap<Element,Input.Location> hm = new HashMap<Element,Input.Location>();
- for(Node no : nodes)
- barf(hm, no, 0, false, region.getStart());
+ if (nodes!=null)
+ for(StateNode no : nodes)
+ barf(hm, no, 0, false, region.getStart());
ret.append("\n expected: ");
Set<Element> hs = hm.keySet();
if (hs.size() == 1) {
/*
ret.append("\n The author of SBP apologizes for the these nearly-useless error messages:\n\n");
HashMap<String,HashSet<String>> errors = new HashMap<String,HashSet<String>>();
- for(Node n : nodes) {
+ for(StateNode n : nodes) {
//System.out.println(n.state);
complain(n, errors, false, 0);
}