forked from jasder/antlr
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:
commit
46094f57ba
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue