1 /* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
2 * Use of this file is governed by the BSD 3-clause license that
3 * can be found in the LICENSE.txt file in the project root.
6 #include "atn/RuleStartState.h"
7 #include "atn/RuleTransition.h"
9 using namespace antlr4::atn;
11 RuleTransition::RuleTransition(RuleStartState *ruleStart, size_t ruleIndex, ATNState *followState)
12 : RuleTransition(ruleStart, ruleIndex, 0, followState) {
15 RuleTransition::RuleTransition(RuleStartState *ruleStart, size_t ruleIndex, int precedence, ATNState *followState)
16 : Transition(ruleStart), ruleIndex(ruleIndex), precedence(precedence) {
17 this->followState = followState;
20 Transition::SerializationType RuleTransition::getSerializationType() const {
24 bool RuleTransition::isEpsilon() const {
28 bool RuleTransition::matches(size_t /*symbol*/, size_t /*minVocabSymbol*/, size_t /*maxVocabSymbol*/) const {
32 std::string RuleTransition::toString() const {
34 ss << "RULE " << Transition::toString() << " { ruleIndex: " << ruleIndex << ", precedence: " << precedence <<
35 ", followState: " << std::hex << followState << " }";