@Override public Token LT(int i) { CommonToken t; int rawIndex = p + i - 1; if (rawIndex >= types.size()) t = new CommonToken(Token.EOF); else t = new CommonToken(types.get(rawIndex)); t.setTokenIndex(rawIndex); return t; }
public SerializedATN(OutputModelFactory factory, ATN atn) { super(factory); IntegerList data = ATNSerializer.getSerialized(atn); serialized = new ArrayList<String>(data.size()); for (int c : data.toArray()) { String encoded = factory .getGenerator() .getTarget() .encodeIntAsCharEscape(c == -1 ? Character.MAX_VALUE : c); serialized.add(encoded); } // System.out.println(ATNSerializer.getDecoded(factory.getGrammar(), atn)); }
@Override public int size() { return types.size(); }