]> gitweb.ps.run Git - toc/blob - antlr4-cpp-runtime-4.9.2-source/runtime/src/atn/WildcardTransition.cpp
add antlr source code and ReadMe
[toc] / antlr4-cpp-runtime-4.9.2-source / runtime / src / atn / WildcardTransition.cpp
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.
4  */
5
6 #include "atn/ATNState.h"
7
8 #include "atn/WildcardTransition.h"
9
10 using namespace antlr4::atn;
11
12 WildcardTransition::WildcardTransition(ATNState *target) : Transition(target) {
13 }
14
15 Transition::SerializationType WildcardTransition::getSerializationType() const {
16   return WILDCARD;
17 }
18
19 bool WildcardTransition::matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const {
20   return symbol >= minVocabSymbol && symbol <= maxVocabSymbol;
21 }
22
23 std::string WildcardTransition::toString() const {
24   return "WILDCARD " + Transition::toString() + " {}";
25 }