{"record":{"id":"0d9825c48942d0e1","repo":"antlr/antlr4","slug":"the-current-parser-does-not-support-an-atn-with-by-0d9825","errorCode":null,"errorMessage":"The current parser does not support an ATN with bypass alternatives.","messagePattern":"The current parser does not support an ATN with bypass alternatives\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"runtime/CSharp/src/Parser.cs","lineNumber":569,"sourceCode":"        /// lazily.\n        /// </summary>\n        /// <remarks>\n        /// The ATN with bypass alternatives is expensive to create so we create it\n        /// lazily.\n        /// </remarks>\n        /// <exception cref=\"System.NotSupportedException\">\n        /// if the current parser does not\n        /// implement the\n        /// <see cref=\"Recognizer{Symbol, ATNInterpreter}.SerializedAtn()\"/>\n        /// method.\n        /// </exception>\n        [return: NotNull]\n        public virtual ATN GetATNWithBypassAlts()\n        {\n            int[] serializedAtn = SerializedAtn;\n            if (serializedAtn == null)\n            {\n                throw new NotSupportedException(\"The current parser does not support an ATN with bypass alternatives.\");\n            }\n            lock (this)\n            {\n                if ( bypassAltsAtnCache!=null ) {\n                    return bypassAltsAtnCache;\n                }\n                ATNDeserializationOptions deserializationOptions = new ATNDeserializationOptions();\n                deserializationOptions.GenerateRuleBypassTransitions = true;\n                bypassAltsAtnCache = new ATNDeserializer(deserializationOptions).Deserialize(serializedAtn);\n                return bypassAltsAtnCache;\n            }\n        }\n\n        /// <summary>The preferred method of getting a tree pattern.</summary>\n        /// <remarks>\n        /// The preferred method of getting a tree pattern. For example, here's a\n        /// sample use:\n        /// <pre>","sourceCodeStart":551,"sourceCodeEnd":587,"githubUrl":"https://github.com/antlr/antlr4/blob/7d5770395bb7b02eb56e7c62662cb1d7c08f42a3/runtime/CSharp/src/Parser.cs#L551-L587","documentation":"Error \"The current parser does not support an ATN with bypass alternatives.\" thrown in antlr/antlr4.","triggerScenarios":"Parser created with an ATN containing bypass alternatives (generated with -atn), which the standard parser cannot simulate.","commonSituations":"Do not generate the grammar with the -atn bypass option when using the standard Parser; use ParserInterpreter for such ATNs.","solutions":["Remove the bypassAlternatives option from the grammar (options { contextSuperClass=...; }) or use the full Parser instead of the interpreter/optimized path that rejects bypass ATNs.","Regenerate the parser without bypass alternatives when using this runtime path."],"exampleFix":"// grammar MyGrammar; // remove: options { contextSuperClass=...; }","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d5770395bb7b02eb56e7c62662cb1d7c08f42a3","analyzedAt":"2026-08-14T14:47:56.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}