Lines Matching refs:Stream
47 Stream: IANTLRStringStream;
49 Stream := TANTLRStringStream.Create('One'#13#10'Two');
50 CheckEquals(0, Stream.Index);
51 CheckEquals(0, Stream.CharPositionInLine);
52 CheckEquals(1, Stream.Line);
54 Stream.Consume; // O
55 CheckEquals(1, Stream.Index);
56 CheckEquals(1, Stream.CharPositionInLine);
57 CheckEquals(1, Stream.Line);
59 Stream.Consume; // n
60 CheckEquals(2, Stream.Index);
61 CheckEquals(2, Stream.CharPositionInLine);
62 CheckEquals(1, Stream.Line);
64 Stream.Consume; // e
65 CheckEquals(3, Stream.Index);
66 CheckEquals(3, Stream.CharPositionInLine);
67 CheckEquals(1, Stream.Line);
69 Stream.Consume; // #13
70 CheckEquals(4, Stream.Index);
71 CheckEquals(4, Stream.CharPositionInLine);
72 CheckEquals(1, Stream.Line);
74 Stream.Consume; // #10
75 CheckEquals(5, Stream.Index);
76 CheckEquals(0, Stream.CharPositionInLine);
77 CheckEquals(2, Stream.Line);
79 Stream.Consume; // T
80 CheckEquals(6, Stream.Index);
81 CheckEquals(1, Stream.CharPositionInLine);
82 CheckEquals(2, Stream.Line);
84 Stream.Consume; // w
85 CheckEquals(7, Stream.Index);
86 CheckEquals(2, Stream.CharPositionInLine);
87 CheckEquals(2, Stream.Line);
89 Stream.Consume; // o
90 CheckEquals(8, Stream.Index);
91 CheckEquals(3, Stream.CharPositionInLine);
92 CheckEquals(2, Stream.Line);
94 Stream.Consume; // EOF
95 CheckEquals(8, Stream.Index);
96 CheckEquals(3, Stream.CharPositionInLine);
97 CheckEquals(2, Stream.Line);
99 Stream.Consume; // EOF
100 CheckEquals(8, Stream.Index);
101 CheckEquals(3, Stream.CharPositionInLine);
102 CheckEquals(2, Stream.Line);
107 Stream: IANTLRStringStream;
109 Stream := TANTLRStringStream.Create('One'#13#10'Two');
110 CheckEquals(0, Stream.Index);
111 CheckEquals(0, Stream.CharPositionInLine);
112 CheckEquals(1, Stream.Line);
114 Stream.Consume; // O
115 Stream.Consume; // n
117 CheckEquals(Ord('e'), Stream.LA(1));
118 CheckEquals(2, Stream.Index);
120 Stream.Reset;
121 CheckEquals(Ord('O'), Stream.LA(1));
122 CheckEquals(0, Stream.Index);
123 CheckEquals(0, Stream.CharPositionInLine);
124 CheckEquals(1, Stream.Line);
125 Stream.Consume; // O
127 CheckEquals(Ord('n'), Stream.LA(1));
128 CheckEquals(1, Stream.Index);
129 CheckEquals(1, Stream.CharPositionInLine);
130 CheckEquals(1, Stream.Line);
131 Stream.Consume; // n
133 CheckEquals(Ord('e'), Stream.LA(1));
134 CheckEquals(2, Stream.Index);
135 CheckEquals(2, Stream.CharPositionInLine);
136 CheckEquals(1, Stream.Line);
137 Stream.Consume; // n
165 Stream: IANTLRStringStream;
167 Stream := TANTLRStringStream.Create('One'#13#10'Two'#13#10'Three');
169 CheckEquals('Two', Stream.Substring(5, 7));
170 CheckEquals('One', Stream.Substring(0, 2));
171 CheckEquals('Three', Stream.Substring(10, 14));
173 Stream.Consume;
175 CheckEquals('Two', Stream.Substring(5, 7));
176 CheckEquals('One', Stream.Substring(0, 2));
177 CheckEquals('Three', Stream.Substring(10, 14));