Merge pull request #7 from sharwell/9c554a002b8fd9f72a0005c90cb83ac757076a3a

Small fixes, plus ability to copy LexerATNSimulator state from one simulator to another
This commit is contained in:
Terence Parr 2012-02-10 10:31:39 -08:00
commit 46094f57ba
2 changed files with 16 additions and 1 deletions

View File

@ -139,6 +139,21 @@ public class LexerATNSimulator extends ATNSimulator {
this.recog = recog;
}
public void copyState(@NotNull LexerATNSimulator simulator) {
this.charPositionInLine = simulator.charPositionInLine;
this.line = simulator.line;
this.mode = simulator.mode;
this.startIndex = simulator.startIndex;
this.trace = simulator.trace;
this.traceStream = simulator.traceStream;
this.traceFailed = simulator.traceFailed;
}
public OutputStream getTraceStream() {
return this.traceStream;
}
public void setTraceStream(OutputStream traceStream) {
this.traceStream = traceStream;
this.trace = traceStream != null;

View File

@ -22,7 +22,7 @@ public class TestLexerAttributes extends BaseTest {
int start = output.indexOf('#');
int end = output.lastIndexOf('#');
String snippet = output.substring(start+1,end);
assertEquals("type = 101;", snippet);
assertEquals("_type = 101;", snippet);
}
}