boolangstudio /Dependencies/boo/lib/antlr-2.7.5/lib/csharp/src/antlr/LexerSharedInputState.cs

Language C# Lines 88
MD5 Hash 361c4741366d3ffb8e9a65939d82dac8 Estimated Cost $1,310 (why?)
Repository https://github.com/w4x/boolangstudio.git View Raw File View Project SPDX
 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using System;
using Stream			= System.IO.Stream;
using TextReader		= System.IO.TextReader;

namespace antlr
{
	/*ANTLR Translator Generator
	* Project led by Terence Parr at http://www.jGuru.com
	* Software rights: http://www.antlr.org/license.html
	*
	* $Id:$
	*/
	
	//
	// ANTLR C# Code Generator by Micheal Jordan
	//                            Kunle Odutola       : kunle UNDERSCORE odutola AT hotmail DOT com
	//                            Anthony Oguntimehin
	//
	// With many thanks to Eric V. Smith from the ANTLR list.
	//

	/*This object contains the data associated with an
	*  input stream of characters.  Multiple lexers
	*  share a single LexerSharedInputState to lex
	*  the same input stream.
	*/
	public class LexerSharedInputState
	{
		protected internal int column;
		protected internal int line;
		protected internal int tokenStartColumn;
		protected internal int tokenStartLine;
		protected internal InputBuffer input;
		
		/*What file (if known) caused the problem? */
		protected internal string filename;
		
		public int guessing;
		
		public LexerSharedInputState(InputBuffer inbuf)
		{
			initialize();
			input = inbuf;
		}
		
		public LexerSharedInputState(Stream inStream) : this(new ByteBuffer(inStream))
		{
		}
		
		public LexerSharedInputState(TextReader inReader) : this(new CharBuffer(inReader))
		{
		}
		
		private void initialize()
		{
			column = 1;
			line = 1;
			tokenStartColumn = 1;
			tokenStartLine = 1;
			guessing = 0;
			filename = null;
		}
		
		public virtual void reset()
		{
			initialize();
			input.reset();
		}

		public virtual void resetInput(InputBuffer ib)
		{
			reset();
			input = ib;
		}

		public virtual void resetInput(Stream s)
		{
			reset();
			input = new ByteBuffer(s);
		}

		public virtual void resetInput(TextReader tr)
		{
			reset();
			input = new CharBuffer(tr);
		}
	}
}
Back to Top