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/ActionTransition.h"
8 using namespace antlr4::atn;
10 ActionTransition::ActionTransition(ATNState *target, size_t ruleIndex)
11 : Transition(target), ruleIndex(ruleIndex), actionIndex(INVALID_INDEX), isCtxDependent(false) {
14 ActionTransition::ActionTransition(ATNState *target, size_t ruleIndex, size_t actionIndex, bool isCtxDependent)
15 : Transition(target), ruleIndex(ruleIndex), actionIndex(actionIndex), isCtxDependent(isCtxDependent) {
18 Transition::SerializationType ActionTransition::getSerializationType() const {
22 bool ActionTransition::isEpsilon() const {
23 return true; // we are to be ignored by analysis 'cept for predicates
26 bool ActionTransition::matches(size_t /*symbol*/, size_t /*minVocabSymbol*/, size_t /*maxVocabSymbol*/) const {
30 std::string ActionTransition::toString() const {
31 return " ACTION " + Transition::toString() + " { ruleIndex: " + std::to_string(ruleIndex) + ", actionIndex: " +
32 std::to_string(actionIndex) + ", isCtxDependent: " + std::to_string(isCtxDependent) + " }";