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
0cf3aab
..
a30e269
100644
(file)
--- a/
src/edu/berkeley/sbp/tib/Tib.java
+++ b/
src/edu/berkeley/sbp/tib/Tib.java
@@
-83,9
+83,9
@@
public class Tib implements Input<Character> {
return null;
}
c = (char)i;
return null;
}
c = (char)i;
+ if (c=='\n') { _row++; _col=0; }
+ else _col++;
}
}
- if (c=='\n') { _row++; _col=0; }
- else _col++;
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 (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'; }
@@
-135,10
+135,10
@@
public class Tib implements Input<Character> {
// Grammar //////////////////////////////////////////////////////////////////////////////
// Grammar //////////////////////////////////////////////////////////////////////////////
- public static class Grammar extends MetaGrammar {
+ public static class Grammar extends ReflectiveGrammar {
private int anon = 0;
private int anon = 0;
- private final Element ws = Repeat.maximal0(getNonTerminal("w"));
- public Grammar() { dropAll.add(ws); }
+ private final Element ws = Sequence.maximal0(getNonTerminal("w"));
+ public Grammar(Class c) { super(c); dropAll.add(ws); }
public Object walk(Tree<String> tree) {
String head = tree.head();
if (tree.numChildren()==0) return super.walk(tree);
public Object walk(Tree<String> tree) {
String head = tree.head();
if (tree.numChildren()==0) return super.walk(tree);