projects
/
sbp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rename Node->StateNode
[sbp.git]
/
src
/
edu
/
berkeley
/
sbp
/
ParseFailed.java
diff --git
a/src/edu/berkeley/sbp/ParseFailed.java
b/src/edu/berkeley/sbp/ParseFailed.java
index
7a3416e
..
872ffac
100644
(file)
--- a/
src/edu/berkeley/sbp/ParseFailed.java
+++ b/
src/edu/berkeley/sbp/ParseFailed.java
@@
-5,7
+5,7
@@
import edu.berkeley.sbp.*;
import edu.berkeley.sbp.Sequence.Pos;
import edu.berkeley.sbp.Sequence.Pos;
import edu.berkeley.sbp.GSS.Phase;
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.*;
import edu.berkeley.sbp.util.*;
import java.io.*;
import java.util.*;
@@
-47,23
+47,23
@@
public class ParseFailed extends Exception {
return (c >= 'A' && c <= 'Z');
}
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
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());
*/
}
}
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 += " ";
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;
boolean done = false;
boolean alldone = false;
boolean go = false;
@@
-102,8
+102,8
@@
public class ParseFailed extends Exception {
// FIXME
// 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()) {
if (touched.contains(n)) return;
touched.add(n);
for(Pos p : (Iterable<Pos>)n.state()) {
@@
-112,7
+112,7
@@
public class ParseFailed extends Exception {
!important(p)) {
/*
FIXME: removed
!important(p)) {
/*
FIXME: removed
- for(Node n2 : n.parents())
+ for(StateNode n2 : n.parents())
complain(n2, errors, force
//| p.isFirst()
, indent);
complain(n2, errors, force
//| p.isFirst()
, indent);
@@
-150,7
+150,7
@@
public class ParseFailed extends Exception {
}
private static void error(String message,
Object token,
}
private static void error(String message,
Object token,
- Iterable<Node> nodes,
+ Iterable<StateNode> nodes,
Input.Region region,
Input input,
GSS gss) throws ParseFailed{
Input.Region region,
Input input,
GSS gss) throws ParseFailed{
@@
-184,7
+184,7
@@
public class ParseFailed extends Exception {
*/
}
HashMap<Element,Input.Location> hm = new HashMap<Element,Input.Location>();
*/
}
HashMap<Element,Input.Location> hm = new HashMap<Element,Input.Location>();
- for(Node no : nodes)
+ for(StateNode no : nodes)
barf(hm, no, 0, false, region.getStart());
ret.append("\n expected: ");
Set<Element> hs = hm.keySet();
barf(hm, no, 0, false, region.getStart());
ret.append("\n expected: ");
Set<Element> hs = hm.keySet();
@@
-207,7
+207,7
@@
public class ParseFailed extends Exception {
/*
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>>();
/*
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);
}
//System.out.println(n.state);
complain(n, errors, false, 0);
}