Sha256: 20b081f03da9ddb7da54c40a01cb6bf8b814f09ba0f498ef0759ecad5556143f

Contents?: true

Size: 995 Bytes

Versions: 3

Compression:

Stored size: 995 Bytes

Contents

/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
 * Use of this file is governed by the BSD 3-clause license that
 * can be found in the LICENSE.txt file in the project root.
 */

#include "tree/pattern/TokenTagToken.h"

using namespace antlr4::tree::pattern;

TokenTagToken::TokenTagToken(const std::string &/*tokenName*/, int type)
  : CommonToken(type), tokenName(""), label("") {
}

TokenTagToken::TokenTagToken(const std::string &tokenName, int type, const std::string &label)
  : CommonToken(type), tokenName(tokenName), label(label) {
}

std::string TokenTagToken::getTokenName() const {
  return tokenName;
}

std::string TokenTagToken::getLabel() const {
  return label;
}

std::string TokenTagToken::getText() const {
  if (!label.empty()) {
    return "<" + label + ":" + tokenName + ">";
  }

  return "<" + tokenName + ">";
}

std::string TokenTagToken::toString() const {
  return tokenName + ":" + std::to_string(_type);
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
expressir-0.2.6 ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp
expressir-0.2.5-x64-mingw32 ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp
expressir-0.2.4-x64-mingw32 ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp