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.
15 /// Represents a span of raw text (concrete syntax) between tags in a tree
18 class ANTLR4CPP_PUBLIC TextChunk : public Chunk {
21 /// This is the backing field for <seealso cref="#getText"/>.
23 const std::string text;
26 /// Constructs a new instance of <seealso cref="TextChunk"/> with the specified text.
28 /// <param name="text"> The text of this chunk. </param>
29 /// <exception cref="IllegalArgumentException"> if {@code text} is {@code null}. </exception>
31 TextChunk(const std::string &text);
35 /// Gets the raw text of this chunk.
37 /// <returns> The text of the chunk. </returns>
38 std::string getText();
43 /// The implementation for <seealso cref="TextChunk"/> returns the result of
44 /// <seealso cref="#getText()"/> in single quotes.
46 virtual std::string toString() override;
49 } // namespace pattern