public virtual ATN GetATNWithBypassAlts() { string serializedAtn = SerializedAtn; if (serializedAtn == null) { throw new NotSupportedException("The current parser does not support an ATN with bypass alternatives."); } lock (bypassAltsAtnCache) { ATN result = bypassAltsAtnCache.Get(serializedAtn); if (result == null) { ATNDeserializationOptions deserializationOptions = new ATNDeserializationOptions(); deserializationOptions.SetGenerateRuleBypassTransitions(true); result = new ATNDeserializer(deserializationOptions).Deserialize(serializedAtn.ToCharArray()); bypassAltsAtnCache.Put(serializedAtn, result); } return result; } }
public virtual ATN GetATNWithBypassAlts() { int[] serializedAtn = SerializedAtn; if (serializedAtn == null) { throw new NotSupportedException("The current parser does not support an ATN with bypass alternatives."); } lock (this) { if (bypassAltsAtnCache != null) { return(bypassAltsAtnCache); } ATNDeserializationOptions deserializationOptions = new ATNDeserializationOptions(); deserializationOptions.GenerateRuleBypassTransitions = true; bypassAltsAtnCache = new ATNDeserializer(deserializationOptions).Deserialize(serializedAtn); return(bypassAltsAtnCache); } }