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"
15 /// A chunk is either a token tag, a rule tag, or a span of literal text within a
18 /// The method <seealso cref="ParseTreePatternMatcher#split(String)"/> returns a list of
19 /// chunks in preparation for creating a token stream by
20 /// <seealso cref="ParseTreePatternMatcher#tokenize(String)"/>. From there, we get a parse
21 /// tree from with <seealso cref="ParseTreePatternMatcher#compile(String, int)"/>. These
22 /// chunks are converted to <seealso cref="RuleTagToken"/>, <seealso cref="TokenTagToken"/>, or the
23 /// regular tokens of the text surrounding the tags.
25 class ANTLR4CPP_PUBLIC Chunk {
28 Chunk(Chunk const&) = default;
31 Chunk& operator=(Chunk const&) = default;
33 /// This method returns a text representation of the tag chunk. Labeled tags
34 /// are returned in the form {@code label:tag}, and unlabeled tags are
35 /// returned as just the tag name.
36 virtual std::string toString() {
42 } // namespace pattern