Lines Matching refs:stream

240 			ANTLRInputStream stream = new ANTLRInputStream(grammarStream, encoding);  in TestSubstringOnANTLRInputStream()
242 Assert.AreEqual("Two", stream.Substring(5, 7)); in TestSubstringOnANTLRInputStream()
243 Assert.AreEqual("One", stream.Substring(0, 2)); in TestSubstringOnANTLRInputStream()
244 Assert.AreEqual("Three", stream.Substring(10, 14)); in TestSubstringOnANTLRInputStream()
246 stream.Consume(); in TestSubstringOnANTLRInputStream()
248 Assert.AreEqual("Two", stream.Substring(5, 7)); in TestSubstringOnANTLRInputStream()
249 Assert.AreEqual("One", stream.Substring(0, 2)); in TestSubstringOnANTLRInputStream()
250 Assert.AreEqual("Three", stream.Substring(10, 14)); in TestSubstringOnANTLRInputStream()
260 ANTLRInputStream stream = new ANTLRInputStream(grammarStream, encoding); in TestSeekOnANTLRInputStream()
261 Assert.AreEqual('O', stream.LA(1)); in TestSeekOnANTLRInputStream()
262 Assert.AreEqual(0, stream.Index); in TestSeekOnANTLRInputStream()
263 Assert.AreEqual(0, stream.CharPositionInLine); in TestSeekOnANTLRInputStream()
264 Assert.AreEqual(1, stream.Line); in TestSeekOnANTLRInputStream()
266 stream.Seek(6); in TestSeekOnANTLRInputStream()
267 Assert.AreEqual('w', stream.LA(1)); in TestSeekOnANTLRInputStream()
268 Assert.AreEqual(6, stream.Index); in TestSeekOnANTLRInputStream()
269 Assert.AreEqual(1, stream.CharPositionInLine); in TestSeekOnANTLRInputStream()
270 Assert.AreEqual(2, stream.Line); in TestSeekOnANTLRInputStream()
272 stream.Seek(11); in TestSeekOnANTLRInputStream()
273 Assert.AreEqual('h', stream.LA(1)); in TestSeekOnANTLRInputStream()
274 Assert.AreEqual(11, stream.Index); in TestSeekOnANTLRInputStream()
275 Assert.AreEqual(1, stream.CharPositionInLine); in TestSeekOnANTLRInputStream()
276 Assert.AreEqual(3, stream.Line); in TestSeekOnANTLRInputStream()
279 stream.Seek(1); in TestSeekOnANTLRInputStream()
280 Assert.AreEqual('n', stream.LA(1)); in TestSeekOnANTLRInputStream()
281 Assert.AreEqual(1, stream.Index); in TestSeekOnANTLRInputStream()
282 Assert.AreEqual(1, stream.CharPositionInLine); in TestSeekOnANTLRInputStream()
283 Assert.AreEqual(3, stream.Line); in TestSeekOnANTLRInputStream()
315 ANTLRStringStream stream = new ANTLRStringStream("One\r\nTwo"); in TestConsumeOnANTLRStringStream()
316 Assert.AreEqual(0, stream.Index); in TestConsumeOnANTLRStringStream()
317 Assert.AreEqual(0, stream.CharPositionInLine); in TestConsumeOnANTLRStringStream()
318 Assert.AreEqual(1, stream.Line); in TestConsumeOnANTLRStringStream()
320 stream.Consume(); // O in TestConsumeOnANTLRStringStream()
321 Assert.AreEqual(1, stream.Index); in TestConsumeOnANTLRStringStream()
322 Assert.AreEqual(1, stream.CharPositionInLine); in TestConsumeOnANTLRStringStream()
323 Assert.AreEqual(1, stream.Line); in TestConsumeOnANTLRStringStream()
325 stream.Consume(); // n in TestConsumeOnANTLRStringStream()
326 Assert.AreEqual(2, stream.Index); in TestConsumeOnANTLRStringStream()
327 Assert.AreEqual(2, stream.CharPositionInLine); in TestConsumeOnANTLRStringStream()
328 Assert.AreEqual(1, stream.Line); in TestConsumeOnANTLRStringStream()
330 stream.Consume(); // e in TestConsumeOnANTLRStringStream()
331 Assert.AreEqual(3, stream.Index); in TestConsumeOnANTLRStringStream()
332 Assert.AreEqual(3, stream.CharPositionInLine); in TestConsumeOnANTLRStringStream()
333 Assert.AreEqual(1, stream.Line); in TestConsumeOnANTLRStringStream()
335 stream.Consume(); // \r in TestConsumeOnANTLRStringStream()
336 Assert.AreEqual(4, stream.Index); in TestConsumeOnANTLRStringStream()
337 Assert.AreEqual(4, stream.CharPositionInLine); in TestConsumeOnANTLRStringStream()
338 Assert.AreEqual(1, stream.Line); in TestConsumeOnANTLRStringStream()
340 stream.Consume(); // \n in TestConsumeOnANTLRStringStream()
341 Assert.AreEqual(5, stream.Index); in TestConsumeOnANTLRStringStream()
342 Assert.AreEqual(0, stream.CharPositionInLine); in TestConsumeOnANTLRStringStream()
343 Assert.AreEqual(2, stream.Line); in TestConsumeOnANTLRStringStream()
345 stream.Consume(); // T in TestConsumeOnANTLRStringStream()
346 Assert.AreEqual(6, stream.Index); in TestConsumeOnANTLRStringStream()
347 Assert.AreEqual(1, stream.CharPositionInLine); in TestConsumeOnANTLRStringStream()
348 Assert.AreEqual(2, stream.Line); in TestConsumeOnANTLRStringStream()
350 stream.Consume(); // w in TestConsumeOnANTLRStringStream()
351 Assert.AreEqual(7, stream.Index); in TestConsumeOnANTLRStringStream()
352 Assert.AreEqual(2, stream.CharPositionInLine); in TestConsumeOnANTLRStringStream()
353 Assert.AreEqual(2, stream.Line); in TestConsumeOnANTLRStringStream()
355 stream.Consume(); // o in TestConsumeOnANTLRStringStream()
356 Assert.AreEqual(8, stream.Index); in TestConsumeOnANTLRStringStream()
357 Assert.AreEqual(3, stream.CharPositionInLine); in TestConsumeOnANTLRStringStream()
358 Assert.AreEqual(2, stream.Line); in TestConsumeOnANTLRStringStream()
360 stream.Consume(); // EOF in TestConsumeOnANTLRStringStream()
361 Assert.AreEqual(8, stream.Index); in TestConsumeOnANTLRStringStream()
362 Assert.AreEqual(3, stream.CharPositionInLine); in TestConsumeOnANTLRStringStream()
363 Assert.AreEqual(2, stream.Line); in TestConsumeOnANTLRStringStream()
365 stream.Consume(); // EOF in TestConsumeOnANTLRStringStream()
366 Assert.AreEqual(8, stream.Index); in TestConsumeOnANTLRStringStream()
367 Assert.AreEqual(3, stream.CharPositionInLine); in TestConsumeOnANTLRStringStream()
368 Assert.AreEqual(2, stream.Line); in TestConsumeOnANTLRStringStream()
374 ANTLRStringStream stream = new ANTLRStringStream("One\r\nTwo"); in TestResetOnANTLRStringStream()
375 Assert.AreEqual(0, stream.Index); in TestResetOnANTLRStringStream()
376 Assert.AreEqual(0, stream.CharPositionInLine); in TestResetOnANTLRStringStream()
377 Assert.AreEqual(1, stream.Line); in TestResetOnANTLRStringStream()
379 stream.Consume(); // O in TestResetOnANTLRStringStream()
380 stream.Consume(); // n in TestResetOnANTLRStringStream()
382 Assert.AreEqual('e', stream.LA(1)); in TestResetOnANTLRStringStream()
383 Assert.AreEqual(2, stream.Index); in TestResetOnANTLRStringStream()
385 stream.Reset(); in TestResetOnANTLRStringStream()
386 Assert.AreEqual('O', stream.LA(1)); in TestResetOnANTLRStringStream()
387 Assert.AreEqual(0, stream.Index); in TestResetOnANTLRStringStream()
388 Assert.AreEqual(0, stream.CharPositionInLine); in TestResetOnANTLRStringStream()
389 Assert.AreEqual(1, stream.Line); in TestResetOnANTLRStringStream()
390 stream.Consume(); // O in TestResetOnANTLRStringStream()
392 Assert.AreEqual('n', stream.LA(1)); in TestResetOnANTLRStringStream()
393 Assert.AreEqual(1, stream.Index); in TestResetOnANTLRStringStream()
394 Assert.AreEqual(1, stream.CharPositionInLine); in TestResetOnANTLRStringStream()
395 Assert.AreEqual(1, stream.Line); in TestResetOnANTLRStringStream()
396 stream.Consume(); // n in TestResetOnANTLRStringStream()
398 Assert.AreEqual('e', stream.LA(1)); in TestResetOnANTLRStringStream()
399 Assert.AreEqual(2, stream.Index); in TestResetOnANTLRStringStream()
400 Assert.AreEqual(2, stream.CharPositionInLine); in TestResetOnANTLRStringStream()
401 Assert.AreEqual(1, stream.Line); in TestResetOnANTLRStringStream()
402 stream.Consume(); // e in TestResetOnANTLRStringStream()
408 ANTLRStringStream stream = new ANTLRStringStream("One\r\nTwo\r\nThree"); in TestSubstringOnANTLRStringStream()
410 Assert.AreEqual("Two", stream.Substring(5, 7)); in TestSubstringOnANTLRStringStream()
411 Assert.AreEqual("One", stream.Substring(0, 2)); in TestSubstringOnANTLRStringStream()
412 Assert.AreEqual("Three", stream.Substring(10, 14)); in TestSubstringOnANTLRStringStream()
414 stream.Consume(); in TestSubstringOnANTLRStringStream()
416 Assert.AreEqual("Two", stream.Substring(5, 7)); in TestSubstringOnANTLRStringStream()
417 Assert.AreEqual("One", stream.Substring(0, 2)); in TestSubstringOnANTLRStringStream()
418 Assert.AreEqual("Three", stream.Substring(10, 14)); in TestSubstringOnANTLRStringStream()