projects
/
sbp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
checkpoint
[sbp.git]
/
src
/
edu
/
berkeley
/
sbp
/
tib
/
Tib.java
diff --git
a/src/edu/berkeley/sbp/tib/Tib.java
b/src/edu/berkeley/sbp/tib/Tib.java
index
a30e269
..
64acbbf
100644
(file)
--- a/
src/edu/berkeley/sbp/tib/Tib.java
+++ b/
src/edu/berkeley/sbp/tib/Tib.java
@@
-42,7
+42,7
@@
public class Tib implements Input<Character> {
int _row = 1;
int _col = 0;
int _row = 1;
int _col = 0;
- public Input.Location getLocation() { return new CartesianLocation(_row, _col); }
+ public Input.Location getLocation() { return new Cartesian.Location(_col, _row); }
private BufferedReader br;
char left = CharRange.left;
private BufferedReader br;
char left = CharRange.left;
@@
-53,8
+53,8
@@
public class Tib implements Input<Character> {
boolean indenting = true;
int indentation = 0;
private ArrayList<Integer> istack = new ArrayList<Integer>();
boolean indenting = true;
int indentation = 0;
private ArrayList<Integer> istack = new ArrayList<Integer>();
- public Character next(int numstates, int resets, int waits) throws IOException {
- Character ret = nextc(numstates, resets);
+ public Character next() throws IOException {
+ Character ret = nextc();
if (ret==null) return null;
else if (ret==left) System.out.print("\033[31m{\033[0m");
else if (ret==right) System.out.print("\033[31m}\033[0m");
if (ret==null) return null;
else if (ret==left) System.out.print("\033[31m{\033[0m");
else if (ret==right) System.out.print("\033[31m}\033[0m");
@@
-63,7
+63,7
@@
public class Tib implements Input<Character> {
}
Character waitingBrace = null;
}
Character waitingBrace = null;
- public Character nextc(int numstates, int resets) throws IOException {
+ public Character nextc() throws IOException {
char c;
if (waitingBrace != null) {
Character ret = waitingBrace;
char c;
if (waitingBrace != null) {
Character ret = waitingBrace;
@@
-88,7
+88,7
@@
public class Tib implements Input<Character> {
}
if (indenting) {
if (c==' ') { indentation++; return done(c); }
}
if (indenting) {
if (c==' ') { indentation++; return done(c); }
- if (c=='\n') { indentation = 0; if (blank) return nextc(numstates, resets); blank = true; waiting = true; waitingChar='\n'; return '\n'; }
+ if (c=='\n') { indentation = 0; if (blank) return nextc(); blank = true; waiting = true; waitingChar='\n'; return '\n'; }
int last = istack.size()==0 ? -1 : istack.get(istack.size()-1);
if (indentation==last) {
if (blank) {
int last = istack.size()==0 ? -1 : istack.get(istack.size()-1);
if (indentation==last) {
if (blank) {
@@
-135,6
+135,7
@@
public class Tib implements Input<Character> {
// Grammar //////////////////////////////////////////////////////////////////////////////
// Grammar //////////////////////////////////////////////////////////////////////////////
+ /*
public static class Grammar extends ReflectiveGrammar {
private int anon = 0;
private final Element ws = Sequence.maximal0(getNonTerminal("w"));
public static class Grammar extends ReflectiveGrammar {
private int anon = 0;
private final Element ws = Sequence.maximal0(getNonTerminal("w"));
@@
-160,6
+161,7
@@
public class Tib implements Input<Character> {
return super.walk(tree);
}
}
return super.walk(tree);
}
}
+ */
/*
public class Braces extends Union {
/*
public class Braces extends Union {