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.
7 #include "misc/IntervalSet.h"
9 #include "atn/SetTransition.h"
11 using namespace antlr4;
12 using namespace antlr4::atn;
14 SetTransition::SetTransition(ATNState *target, const misc::IntervalSet &aSet)
15 : Transition(target), set(aSet.isEmpty() ? misc::IntervalSet::of(Token::INVALID_TYPE) : aSet) {
18 Transition::SerializationType SetTransition::getSerializationType() const {
22 misc::IntervalSet SetTransition::label() const {
26 bool SetTransition::matches(size_t symbol, size_t /*minVocabSymbol*/, size_t /*maxVocabSymbol*/) const {
27 return set.contains(symbol);
30 std::string SetTransition::toString() const {
31 return "SET " + Transition::toString() + " { set: " + set.toString() + "}";