1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* 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.
*/
using Antlr4.Runtime;
using Antlr4.Runtime.Misc;
using Antlr4.Runtime.Sharpen;
namespace Antlr4.Runtime
{
/// <summary>A source of characters for an ANTLR lexer.</summary>
/// <remarks>A source of characters for an ANTLR lexer.</remarks>
public interface ICharStream : IIntStream
{
/// <summary>
/// This method returns the text for a range of characters within this input
/// stream.
/// </summary>
/// <remarks>
/// This method returns the text for a range of characters within this input
/// stream. This method is guaranteed to not throw an exception if the
/// specified
/// <paramref name="interval"/>
/// lies entirely within a marked range. For more
/// information about marked ranges, see
/// <see cref="IIntStream.Mark()"/>
/// .
/// </remarks>
/// <param name="interval">an interval within the stream</param>
/// <returns>the text of the specified interval</returns>
/// <exception cref="System.ArgumentNullException">
/// if
/// <paramref name="interval"/>
/// is
/// <see langword="null"/>
/// </exception>
/// <exception cref="System.ArgumentException">
/// if
/// <c>interval.a < 0</c>
/// , or if
/// <c>interval.b < interval.a - 1</c>
/// , or if
/// <c>interval.b</c>
/// lies at or
/// past the end of the stream
/// </exception>
/// <exception cref="System.NotSupportedException">
/// if the stream does not support
/// getting the text of the specified interval
/// </exception>
[return: NotNull]
string GetText(Interval interval);
}
}