Use ATNDeserializer methods instead of deprecated ATNSimulator methods

This commit is contained in:
Sam Harwell 2013-11-21 13:08:27 -06:00
parent 7f15889d92
commit bc59f30857
2 changed files with 4 additions and 4 deletions

View File

@ -49,7 +49,7 @@ import org.antlr.v4.runtime.TokenSource;
import org.antlr.v4.runtime.TokenStream;
import org.antlr.v4.runtime.WritableToken;
import org.antlr.v4.runtime.atn.ATN;
import org.antlr.v4.runtime.atn.ATNSimulator;
import org.antlr.v4.runtime.atn.ATNDeserializer;
import org.antlr.v4.runtime.atn.ATNState;
import org.antlr.v4.runtime.atn.DecisionState;
import org.antlr.v4.runtime.atn.LexerATNSimulator;
@ -185,7 +185,7 @@ public abstract class BaseTest {
ATN atn = g.atn;
if (useSerializer) {
char[] serialized = ATNSerializer.getSerializedAsChars(g, atn);
return ATNSimulator.deserialize(serialized);
return new ATNDeserializer().deserialize(serialized);
}
return atn;

View File

@ -33,7 +33,7 @@ package org.antlr.v4.test;
import org.antlr.v4.automata.ATNSerializer;
import org.antlr.v4.misc.Utils;
import org.antlr.v4.runtime.atn.ATN;
import org.antlr.v4.runtime.atn.ParserATNSimulator;
import org.antlr.v4.runtime.atn.ATNDeserializer;
import org.antlr.v4.tool.Grammar;
import org.antlr.v4.tool.LexerGrammar;
import org.junit.Test;
@ -179,7 +179,7 @@ public class TestATNDeserialization extends BaseTest {
ATN atn = createATN(g, false);
char[] data = Utils.toCharArray(ATNSerializer.getSerialized(g, atn));
String atnData = ATNSerializer.getDecoded(g, atn);
ATN atn2 = ParserATNSimulator.deserialize(data);
ATN atn2 = new ATNDeserializer().deserialize(data);
String atn2Data = ATNSerializer.getDecoded(g, atn2);
assertEquals(atnData, atn2Data);