1 /* 2 * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 3 * Use of this file is governed by the BSD 3-clause license that 4 * can be found in the LICENSE.txt file in the project root. 5 */ 6 7 package org.antlr.v4.runtime.atn; 8 9 /** */ 10 public final class RuleTransition extends Transition { 11 /** Ptr to the rule definition object for this rule ref */ 12 public final int ruleIndex; // no Rule object at runtime 13 14 public final int precedence; 15 16 /** What node to begin computations following ref to rule */ 17 public ATNState followState; 18 19 /** 20 * @deprecated Use 21 * {@link #RuleTransition(RuleStartState, int, int, ATNState)} instead. 22 */ 23 @Deprecated RuleTransition(RuleStartState ruleStart, int ruleIndex, ATNState followState)24 public RuleTransition(RuleStartState ruleStart, 25 int ruleIndex, 26 ATNState followState) 27 { 28 this(ruleStart, ruleIndex, 0, followState); 29 } 30 RuleTransition(RuleStartState ruleStart, int ruleIndex, int precedence, ATNState followState)31 public RuleTransition(RuleStartState ruleStart, 32 int ruleIndex, 33 int precedence, 34 ATNState followState) 35 { 36 super(ruleStart); 37 this.ruleIndex = ruleIndex; 38 this.precedence = precedence; 39 this.followState = followState; 40 } 41 42 @Override getSerializationType()43 public int getSerializationType() { 44 return RULE; 45 } 46 47 @Override isEpsilon()48 public boolean isEpsilon() { return true; } 49 50 @Override matches(int symbol, int minVocabSymbol, int maxVocabSymbol)51 public boolean matches(int symbol, int minVocabSymbol, int maxVocabSymbol) { 52 return false; 53 } 54 } 55