Home | History | Annotate | Download | only in Antlr3.Runtime.Tests

Lines Matching refs:inputStream

78 			ANTLRInputStream inputStream = new ANTLRInputStream(grammarStream, Encoding.Unicode);
79 Assert.AreEqual(0, inputStream.Count);
89 ANTLRInputStream inputStream = new ANTLRInputStream(grammarStream, Encoding.Unicode);
90 Assert.AreEqual(grammarStr.Length, inputStream.Count);
100 ANTLRInputStream inputStream = new ANTLRInputStream(grammarStream, Encoding.Unicode);
101 Assert.AreEqual(0, inputStream.Index);
103 inputStream.Consume();
104 Assert.AreEqual(1, inputStream.Index);
106 inputStream.Consume();
107 Assert.AreEqual(2, inputStream.Index);
109 while (inputStream.Index < inputStream.Count)
111 inputStream.Consume();
113 Assert.AreEqual(inputStream.Index, inputStream.Count);
123 ANTLRInputStream inputStream = new ANTLRInputStream(grammarStream, Encoding.Unicode);
124 while (inputStream.Index < inputStream.Count)
126 Console.Out.Write((char)inputStream.LA(1));
127 inputStream.Consume();
129 Assert.AreEqual(inputStream.Index, inputStream.Count);
139 ANTLRInputStream inputStream = new ANTLRInputStream(grammarStream, Encoding.Unicode);
140 Assert.AreEqual(0, inputStream.Index);
141 Assert.AreEqual(0, inputStream.CharPositionInLine);
142 Assert.AreEqual(1, inputStream.Line);
144 inputStream.Consume(); // O
145 Assert.AreEqual(1, inputStream.Index);
146 Assert.AreEqual(1, inputStream.CharPositionInLine);
147 Assert.AreEqual(1, inputStream.Line);
149 inputStream.Consume(); // n
150 Assert.AreEqual(2, inputStream.Index);
151 Assert.AreEqual(2, inputStream.CharPositionInLine);
152 Assert.AreEqual(1, inputStream.Line);
154 inputStream.Consume(); // e
155 Assert.AreEqual(3, inputStream.Index);
156 Assert.AreEqual(3, inputStream.CharPositionInLine);
157 Assert.AreEqual(1, inputStream.Line);
159 inputStream.Consume(); // \r
160 Assert.AreEqual(4, inputStream.Index);
161 Assert.AreEqual(4, inputStream.CharPositionInLine);
162 Assert.AreEqual(1, inputStream.Line);
164 inputStream.Consume(); // \n
165 Assert.AreEqual(5, inputStream.Index);
166 Assert.AreEqual(0, inputStream.CharPositionInLine);
167 Assert.AreEqual(2, inputStream.Line);
169 inputStream.Consume(); // T
170 Assert.AreEqual(6, inputStream.Index);
171 Assert.AreEqual(1, inputStream.CharPositionInLine);
172 Assert.AreEqual(2, inputStream.Line);
174 inputStream.Consume(); // w
175 Assert.AreEqual(7, inputStream.Index);
176 Assert.AreEqual(2, inputStream.CharPositionInLine);
177 Assert.AreEqual(2, inputStream.Line);
179 inputStream.Consume(); // o
180 Assert.AreEqual(8, inputStream.Index);
181 Assert.AreEqual(3, inputStream.CharPositionInLine);
182 Assert.AreEqual(2, inputStream.Line);
184 inputStream.Consume(); // EOF
185 Assert.AreEqual(8, inputStream.Index);
186 Assert.AreEqual(3, inputStream.CharPositionInLine);
187 Assert.AreEqual(2, inputStream.Line);
189 inputStream.Consume(); // EOF
190 Assert.AreEqual(8, inputStream.Index);
191 Assert.AreEqual(3, inputStream.CharPositionInLine);
192 Assert.AreEqual(2, inputStream.Line);
202 ANTLRInputStream inputStream = new ANTLRInputStream(grammarStream, encoding);
203 Assert.AreEqual(0, inputStream.Index);
204 Assert.AreEqual(0, inputStream.CharPositionInLine);
205 Assert.AreEqual(1, inputStream.Line);
207 inputStream.Consume(); // O
208 inputStream.Consume(); // n
210 Assert.AreEqual('e', inputStream.LA(1));
211 Assert.AreEqual(2, inputStream.Index);
213 inputStream.Reset();
214 Assert.AreEqual('O', inputStream.LA(1));
215 Assert.AreEqual(0, inputStream.Index);
216 Assert.AreEqual(0, inputStream.CharPositionInLine);
217 Assert.AreEqual(1, inputStream.Line);
218 inputStream.Consume(); // O
220 Assert.AreEqual('n', inputStream.LA(1));
221 Assert.AreEqual(1, inputStream.Index);
222 Assert.AreEqual(1, inputStream.CharPositionInLine);
223 Assert.AreEqual(1, inputStream.Line);
224 inputStream.Consume(); // n
226 Assert.AreEqual('e', inputStream.LA(1));
227 Assert.AreEqual(2, inputStream.Index);
228 Assert.AreEqual(2, inputStream.CharPositionInLine);
229 Assert.AreEqual(1, inputStream.Line);
230 inputStream.Consume(); // e