{"record":{"id":"ebb20f9efcd1287b","repo":"antlr/antlr4","slug":"there-is-no-serialized-atn-ebb20f","errorCode":null,"errorMessage":"there is no serialized ATN","messagePattern":"there is no serialized ATN","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"runtime/CSharp/src/Recognizer.cs","lineNumber":140,"sourceCode":"            return TokenConstants.InvalidType;\n        }\n\n        /// <summary>\n        /// If this recognizer was generated, it will have a serialized ATN\n        /// representation of the grammar.\n        /// </summary>\n        /// <remarks>\n        /// If this recognizer was generated, it will have a serialized ATN\n        /// representation of the grammar.\n        /// <p>For interpreters, we don't know their serialized ATN despite having\n        /// created the interpreter from it.</p>\n        /// </remarks>\n        public virtual int[] SerializedAtn\n        {\n            [return: NotNull]\n            get\n            {\n                throw new NotSupportedException(\"there is no serialized ATN\");\n            }\n        }\n\n        /// <summary>For debugging and other purposes, might want the grammar name.</summary>\n        /// <remarks>\n        /// For debugging and other purposes, might want the grammar name.\n        /// Have ANTLR generate an implementation for this method.\n        /// </remarks>\n        public abstract string GrammarFileName\n        {\n            get;\n        }\n\n        /// <summary>\n        /// Get the\n        /// <see cref=\"Antlr4.Runtime.Atn.ATN\"/>\n        /// used by the recognizer for prediction.\n        /// </summary>","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/antlr/antlr4/blob/7d5770395bb7b02eb56e7c62662cb1d7c08f42a3/runtime/CSharp/src/Recognizer.cs#L122-L158","documentation":"Error \"there is no serialized ATN\" thrown in antlr/antlr4.","triggerScenarios":"Recognizer.SerializedAtn accessed but the recognizer has no serialized ATN data.","commonSituations":"Ensure the generated recognizer includes _serializedATN; use the ATNDeserializer only when serialized ATN exists.","solutions":["Construct the recognizer with a serialized ATN (generated code does this); do not call ATN accessors on a recognizer built without one.","Regenerate the recognizer with the ANTLR tool so the static _ATN field is initialized."],"exampleFix":"// use generated parser; it passes 'new ATNDeserializer().Deserialize(_serializedATN)' to base","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"}