From c3630843d2e30a10d1c15bc6affe0b6db4e430b9 Mon Sep 17 00:00:00 2001 From: parrt Date: Sun, 11 Dec 2011 11:23:42 -0800 Subject: [PATCH] add convenience method [git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9558] --- runtime/Java/src/org/antlr/v4/runtime/atn/ATN.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/ATN.java b/runtime/Java/src/org/antlr/v4/runtime/atn/ATN.java index e66dc941c..279a50ef2 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/ATN.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/ATN.java @@ -118,6 +118,13 @@ public class ATN { return s.decision; } + public DecisionState getDecisionState(int decision) { + if ( decisionToState.size()>0 ) { + return decisionToState.get(decision); + } + return null; + } + public int getNumberOfDecisions() { return decisionToState.size(); }