]> gitweb.ps.run Git - toc/blob - antlr4-cpp-runtime-4.9.2-source/runtime/src/atn/EpsilonTransition.cpp
add antlr source code and ReadMe
[toc] / antlr4-cpp-runtime-4.9.2-source / runtime / src / atn / EpsilonTransition.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/EpsilonTransition.h"
7
8 using namespace antlr4::atn;
9
10 EpsilonTransition::EpsilonTransition(ATNState *target) : EpsilonTransition(target, INVALID_INDEX) {
11 }
12
13 EpsilonTransition::EpsilonTransition(ATNState *target, size_t outermostPrecedenceReturn)
14   : Transition(target), _outermostPrecedenceReturn(outermostPrecedenceReturn) {
15 }
16
17 size_t EpsilonTransition::outermostPrecedenceReturn() {
18   return _outermostPrecedenceReturn;
19 }
20
21 Transition::SerializationType EpsilonTransition::getSerializationType() const {
22   return EPSILON;
23 }
24
25 bool EpsilonTransition::isEpsilon() const {
26   return true;
27 }
28
29 bool EpsilonTransition::matches(size_t /*symbol*/, size_t /*minVocabSymbol*/, size_t /*maxVocabSymbol*/) const {
30   return false;
31 }
32
33 std::string EpsilonTransition::toString() const {
34   return "EPSILON " + Transition::toString() + " {}";
35 }