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 "misc/IntervalSet.h"
7 #include "atn/Transition.h"
9 #include "atn/AtomTransition.h"
11 using namespace antlr4::misc;
12 using namespace antlr4::atn;
14 AtomTransition::AtomTransition(ATNState *target, size_t label) : Transition(target), _label(label) {
17 Transition::SerializationType AtomTransition::getSerializationType() const {
21 IntervalSet AtomTransition::label() const {
22 return IntervalSet::of((int)_label);
25 bool AtomTransition::matches(size_t symbol, size_t /*minVocabSymbol*/, size_t /*maxVocabSymbol*/) const {
26 return _label == symbol;
29 std::string AtomTransition::toString() const {
30 return "ATOM " + Transition::toString() + " { label: " + std::to_string(_label) + " }";