@@ -17,7 +17,6 @@ public class Tokenizer extends StreamTokenizer
17
17
private final Reader theReader ;
18
18
private final String source ;
19
19
20
- private int prevLineNo ;
21
20
private int lineNumberAdd ;
22
21
private boolean autoPop ;
23
22
@@ -52,7 +51,6 @@ public Tokenizer(Reader reader, String source)
52
51
this .theReader = reader ;
53
52
this .source = source ;
54
53
55
- this .prevLineNo = 0 ;
56
54
this .lineNumberAdd = 0 ;
57
55
this .autoPop = true ;
58
56
}
@@ -75,15 +73,6 @@ public String getSource()
75
73
return this .source ;
76
74
}
77
75
78
- /**
79
- * Gets the line number that a token was read from previously.
80
- * @return the line number that a token was read from previously
81
- */
82
- public int linenoprev ()
83
- {
84
- return this .prevLineNo ;
85
- }
86
-
87
76
/**
88
77
* Returns the current line number.
89
78
* @return the current line number
@@ -226,7 +215,7 @@ public String readUntil(String match)
226
215
* Gets the next token.
227
216
* @return <code>true</code> if there was another token
228
217
*/
229
- public boolean tokenNext () throws NslExpectedException , NslException
218
+ public boolean tokenNext ()
230
219
{
231
220
return this .tokenNext (null );
232
221
}
@@ -236,9 +225,8 @@ public boolean tokenNext() throws NslExpectedException, NslException
236
225
* @param expected the message of the exception to throw if no token exists
237
226
* @return <code>true</code> if there was another token
238
227
*/
239
- public boolean tokenNext (String expected ) throws NslExpectedException , NslException
228
+ public boolean tokenNext (String expected )
240
229
{
241
- this .prevLineNo = lineno ();
242
230
try
243
231
{
244
232
boolean result = this .nextToken () != TT_EOF ;
@@ -310,7 +298,7 @@ public boolean tokenNext(String expected) throws NslExpectedException, NslExcept
310
298
* Returns the current token as a string.
311
299
* @return the current token as a string
312
300
*/
313
- public String tokenToString ()
301
+ /* public String tokenToString()
314
302
{
315
303
if (this.tokenIsWord())
316
304
return this.sval;
@@ -319,13 +307,13 @@ public String tokenToString()
319
307
if (this.tokenIsString())
320
308
return '"' + this.sval + '"';
321
309
return Character.toString((char)this.ttype);
322
- }
310
+ }*/
323
311
324
312
/**
325
313
* Matches the given character and prints an error otherwise.
326
314
* @param c the character to match
327
315
*/
328
- public void matchOrDie (char c ) throws NslExpectedException , NslException
316
+ public void matchOrDie (char c )
329
317
{
330
318
if (!this .tokenIs (c ))
331
319
throw new NslExpectedException ("\" " + c + "\" " );
@@ -336,7 +324,7 @@ public void matchOrDie(char c) throws NslExpectedException, NslException
336
324
* Matches the given word and prints an error otherwise.
337
325
* @param word the word to match
338
326
*/
339
- public void matchOrDie (String word ) throws NslExpectedException , NslException
327
+ public void matchOrDie (String word )
340
328
{
341
329
if (!this .tokenIs (word ))
342
330
throw new NslExpectedException ("\" " + word + "\" " );
@@ -348,7 +336,7 @@ public void matchOrDie(String word) throws NslExpectedException, NslException
348
336
* @param c the character to match
349
337
* @return <code>true</code> on success
350
338
*/
351
- public boolean match (char c ) throws NslException
339
+ public boolean match (char c )
352
340
{
353
341
if (this .tokenIs (c ))
354
342
{
@@ -363,7 +351,7 @@ public boolean match(char c) throws NslException
363
351
* @param word the word to match
364
352
* @return <code>true</code> on success
365
353
*/
366
- public boolean match (String word ) throws NslException
354
+ public boolean match (String word )
367
355
{
368
356
if (this .tokenIs (word ))
369
357
{
@@ -377,9 +365,9 @@ public boolean match(String word) throws NslException
377
365
* Matches a semicolon on the end of the current line or prints an error
378
366
* otherwise.
379
367
*/
380
- public void matchEolOrDie () throws NslExpectedException , NslException
368
+ public void matchEolOrDie ()
381
369
{
382
- if (!this .tokenIs (';' ) || this . lineno () != this . prevLineNo )
370
+ if (!this .tokenIs (';' ))
383
371
throw new NslExpectedException ("\" ;\" " );
384
372
this .tokenNext ();
385
373
}
@@ -389,7 +377,7 @@ public void matchEolOrDie() throws NslExpectedException, NslException
389
377
* @return the word if the current token was a word, or <code>null</code>
390
378
* otherwise
391
379
*/
392
- public String matchAWord () throws NslException
380
+ public String matchAWord ()
393
381
{
394
382
return this .matchAWord (null );
395
383
}
@@ -400,7 +388,7 @@ public String matchAWord() throws NslException
400
388
* @return the word if the current token was a word, or <code>null</code>
401
389
* otherwise
402
390
*/
403
- public String matchAWord (String expected ) throws NslException
391
+ public String matchAWord (String expected )
404
392
{
405
393
if (this .tokenIsWord ())
406
394
{
@@ -418,7 +406,7 @@ public String matchAWord(String expected) throws NslException
418
406
* @return the string if the current token was a string, or <code>null</code>
419
407
* otherwise
420
408
*/
421
- public String matchAString () throws NslException
409
+ public String matchAString ()
422
410
{
423
411
return this .matchAString (null );
424
412
}
@@ -429,7 +417,7 @@ public String matchAString() throws NslException
429
417
* @return the string if the current token was a string, or <code>null</code>
430
418
* otherwise
431
419
*/
432
- public String matchAString (String expected ) throws NslException
420
+ public String matchAString (String expected )
433
421
{
434
422
if (this .tokenIsString ())
435
423
{
0 commit comments