31
31
* Represents an API for object's using {@link PerlLexHelper}
32
32
*/
33
33
interface PerlLexListener {
34
- void pushState (int state );
35
- void popState () throws IOException ;
36
- void switchState (int state );
34
+ void yypush (int state );
35
+ void yypop () throws IOException ;
36
+ void yybegin (int state );
37
+ void yypushback (int numChars );
38
+
37
39
void maybeIntraState ();
38
40
void take (String value ) throws IOException ;
39
41
void takeNonword (String value ) throws IOException ;
@@ -62,20 +64,14 @@ boolean takeSymbol(String value, int captureOffset, boolean ignoreKwd)
62
64
*/
63
65
void takeKeyword (String value ) throws IOException ;
64
66
65
- void doStartNewLine () throws IOException ;
67
+ void startNewLine () throws IOException ;
66
68
67
69
/**
68
70
* Indicates that a premature end of quoting occurred. Everything up to the
69
71
* causal character has been written, and anything following will be
70
- * indicated via {@link pushback }.
72
+ * indicated via {@link yypushback }.
71
73
*/
72
74
void abortQuote () throws IOException ;
73
-
74
- /**
75
- * Pushes back to the scanner a specified number of characters
76
- * @param numChars
77
- */
78
- void pushback (int numChars );
79
75
}
80
76
81
77
/**
@@ -244,7 +240,7 @@ public void setState(String ltpostop, boolean nointerp) {
244
240
state = nolink ? QUOxL : QUO ;
245
241
}
246
242
listener .maybeIntraState ();
247
- listener .pushState (state );
243
+ listener .yypush (state );
248
244
}
249
245
250
246
/**
@@ -332,7 +328,7 @@ private void takeWhitespace(String whsp) throws IOException {
332
328
++numlf ;
333
329
off = i + 1 ;
334
330
}
335
- while (numlf -- > 0 ) listener .doStartNewLine ();
331
+ while (numlf -- > 0 ) listener .startNewLine ();
336
332
if (off < whsp .length ()) listener .take (whsp .substring (off ));
337
333
}
338
334
}
@@ -416,7 +412,7 @@ public void hop(String capture) throws IOException {
416
412
public boolean maybeStartHere () throws IOException {
417
413
if (hereSettings != null && hereSettings .size () > 0 ) {
418
414
HereDocSettings settings = hereSettings .peek ();
419
- listener .pushState (settings .state );
415
+ listener .yypush (settings .state );
420
416
listener .take (Consts .SS );
421
417
return true ;
422
418
}
@@ -443,11 +439,11 @@ public boolean maybeEndHere(String capture) throws IOException {
443
439
444
440
if (hereSettings .size () > 0 ) {
445
441
settings = hereSettings .peek ();
446
- listener .switchState (settings .state );
442
+ listener .yybegin (settings .state );
447
443
if (didZspan ) listener .take (Consts .SS );
448
444
return false ;
449
445
} else {
450
- listener .popState ();
446
+ listener .yypop ();
451
447
return true ;
452
448
}
453
449
}
@@ -467,7 +463,7 @@ public void sigilID(String capture) throws IOException {
467
463
listener .skipSymbol ();
468
464
listener .takeNonword (sigil );
469
465
if (isQuoteEnding (sigil )) listener .abortQuote ();
470
- listener .pushback (capture .length () - 1 );
466
+ listener .yypushback (capture .length () - 1 );
471
467
return ;
472
468
}
473
469
@@ -504,7 +500,7 @@ public void sigilID(String capture) throws IOException {
504
500
}
505
501
listener .takeNonword (p0 );
506
502
if (isQuoteEnding (p0 )) listener .abortQuote ();
507
- listener .pushback (w1 .length ());
503
+ listener .yypushback (w1 .length ());
508
504
}
509
505
}
510
506
@@ -564,7 +560,7 @@ public void specialID(String capture) throws IOException {
564
560
listener .takeNonword (w );
565
561
if (isQuoteEnding (w )) {
566
562
listener .abortQuote ();
567
- listener .pushback (capture .length () - i - 1 );
563
+ listener .yypushback (capture .length () - i - 1 );
568
564
break ;
569
565
}
570
566
}
0 commit comments