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.
8 #include "antlr4-common.h"
12 class ANTLR4CPP_PUBLIC Arrays {
15 static std::string listToString(const std::vector<std::string> &list, const std::string &separator);
18 static bool equals(const std::vector<T> &a, const std::vector<T> &b) {
19 if (a.size() != b.size())
22 for (size_t i = 0; i < a.size(); ++i)
30 static bool equals(const std::vector<T *> &a, const std::vector<T *> &b) {
31 if (a.size() != b.size())
34 for (size_t i = 0; i < a.size(); ++i) {
37 if (!(*a[i] == *b[i]))
45 static bool equals(const std::vector<Ref<T>> &a, const std::vector<Ref<T>> &b) {
46 if (a.size() != b.size())
49 for (size_t i = 0; i < a.size(); ++i) {
57 if (!(*a[i] == *b[i]))
65 static std::string toString(const std::vector<T> &source) {
66 std::string result = "[";
67 bool firstEntry = true;
68 for (auto &value : source) {
69 result += value.toString();
79 static std::string toString(const std::vector<Ref<T>> &source) {
80 std::string result = "[";
81 bool firstEntry = true;
82 for (auto &value : source) {
83 result += value->toString();
93 static std::string toString(const std::vector<T *> &source) {
94 std::string result = "[";
95 bool firstEntry = true;
96 for (auto value : source) {
97 result += value->toString();
109 std::string Arrays::toString(const std::vector<antlr4::tree::ParseTree *> &source);