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 "Exceptions.h"
7 #include "support/Arrays.h"
9 #include "atn/Transition.h"
11 using namespace antlr4;
12 using namespace antlr4::atn;
14 using namespace antlrcpp;
16 const std::vector<std::string> Transition::serializationNames = {
17 "INVALID", "EPSILON", "RANGE", "RULE", "PREDICATE", "ATOM", "ACTION", "SET", "NOT_SET", "WILDCARD", "PRECEDENCE"
20 Transition::Transition(ATNState *target) {
21 if (target == nullptr) {
22 throw NullPointerException("target cannot be null.");
25 this->target = target;
28 Transition::~Transition() {
31 bool Transition::isEpsilon() const {
35 misc::IntervalSet Transition::label() const {
36 return misc::IntervalSet::EMPTY_SET;
39 std::string Transition::toString() const {
41 ss << "(Transition " << std::hex << this << ", target: " << std::hex << target << ')';