{"record":{"id":"0bc0eae90ef76f01","repo":"antlr/antlr4","slug":"precpred-ctx-0","errorCode":null,"errorMessage":"precpred(_ctx, {0})","messagePattern":"precpred\\(_ctx, (.+?)\\)","errorType":"exception","errorClass":"FailedPredicateException","httpStatus":null,"severity":"error","filePath":"runtime/CSharp/src/ParserInterpreter.cs","lineNumber":270,"sourceCode":"\t\t\t\t\tif (!Sempred(RuleContext, predicateTransition.ruleIndex, predicateTransition.predIndex))\n                    {\n                        throw new FailedPredicateException(this);\n                    }\n                    break;\n                }\n\n                case TransitionType.ACTION:\n                {\n                    ActionTransition actionTransition = (ActionTransition)transition;\n\t\t\t\t\tAction(RuleContext, actionTransition.ruleIndex, actionTransition.actionIndex);\n                    break;\n                }\n\n                case TransitionType.PRECEDENCE:\n                {\n\t\t\t\t\tif (!Precpred(RuleContext, ((PrecedencePredicateTransition)transition).precedence))\n                    {\n                        throw new FailedPredicateException(this, string.Format(\"precpred(_ctx, {0})\", ((PrecedencePredicateTransition)transition).precedence));\n                    }\n                    break;\n                }\n\n                default:\n                {\n                    throw new NotSupportedException(\"Unrecognized ATN transition type.\");\n                }\n            }\n            State = transition.target.stateNumber;\n        }\n\n        protected internal virtual void VisitRuleStopState(ATNState p)\n        {\n            RuleStartState ruleStartState = _atn.ruleToStartState[p.ruleIndex];\n            if (ruleStartState.isPrecedenceRule)\n            {\n                Tuple<ParserRuleContext, int> parentContext = _parentContextStack.Pop();","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/antlr/antlr4/blob/7d5770395bb7b02eb56e7c62662cb1d7c08f42a3/runtime/CSharp/src/ParserInterpreter.cs#L252-L288","documentation":"Error \"precpred(_ctx, {0})\" thrown in antlr/antlr4.","triggerScenarios":"ParserInterpreter evaluates a precedence predicate via precpred(_ctx, precedence) during adaptive prediction.","commonSituations":"Indicates left-recursive rule precedence checks; ensure the ATN matches the grammar's left-recursive rules.","solutions":["This is an internal ATN simulation failure; regenerate the parser with an up-to-date ANTLR tool matching the runtime version.","If triggered by a grammar construct, simplify left-recursive rules using precedence predicates and report the grammar to the ANTLR project."],"exampleFix":"// regenerate: antlr4 -Dlanguage=CSharp MyGrammar.g4 with matching tool/runtime versions","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"}