예제 #1
0
 /* consume all initial off-channel tokens */
 protected void consumeInitialHiddenTokens() {
   int firstOnChannelTokenIndex = input.index();
   for (int i = 0; i < firstOnChannelTokenIndex; i++) {
     dbg.consumeHiddenToken(input.get(i));
   }
   initialStreamState = false;
 }
예제 #2
0
 @Override
 public int LA(int i) {
   if (initialStreamState) {
     consumeInitialHiddenTokens();
   }
   dbg.LT(i, input.LT(i));
   return input.LA(i);
 }
예제 #3
0
 public DebugTokenStream(TokenStream input, DebugEventListener dbg) {
   this.input = input;
   setDebugListener(dbg);
   // force TokenStream to get at least first valid token
   // so we know if there are any hidden tokens first in the stream
   input.LT(1);
 }
예제 #4
0
 @Override
 public void consume() {
   if (initialStreamState) {
     consumeInitialHiddenTokens();
   }
   int a = input.index();
   Token t = input.LT(1);
   input.consume();
   int b = input.index();
   dbg.consumeToken(t);
   if (b > a + 1) {
     // then we consumed more than one token; must be off channel tokens
     for (int i = a + 1; i < b; i++) {
       dbg.consumeHiddenToken(input.get(i));
     }
   }
 }
예제 #5
0
 @Override
 public String toString(int start, int stop) {
   return input.toString(start, stop);
 }
예제 #6
0
 @Override
 public String toString(Token start, Token stop) {
   return input.toString(start, stop);
 }
예제 #7
0
 @Override
 public TokenSource getTokenSource() {
   return input.getTokenSource();
 }
예제 #8
0
 @Override
 public int index() {
   return input.index();
 }
예제 #9
0
 @Override
 public void seek(int index) {
   // TODO: implement seek in dbg interface
   // db.seek(index);
   input.seek(index);
 }
예제 #10
0
 @Override
 public int size() {
   return input.size();
 }
예제 #11
0
 @Override
 public void rewind() {
   dbg.rewind();
   input.rewind(lastMarker);
 }
예제 #12
0
 @Override
 public void rewind(int marker) {
   dbg.rewind(marker);
   input.rewind(marker);
 }
예제 #13
0
 @Override
 public int range() {
   return input.range();
 }
예제 #14
0
 @Override
 public Token get(int i) {
   return input.get(i);
 }
예제 #15
0
 @Override
 public String toString() {
   return input.toString();
 }
예제 #16
0
    public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
      TokenStream input = (TokenStream) _input;
      int _s = s;
      switch (s) {
        case 0:
          int LA5_1 = input.LA(1);

          int index5_1 = input.index();
          input.rewind();
          s = -1;
          if ((LA5_1 == 8) && ((input.LT(1).getText().charAt(0) == 'D'))) {
            s = 2;
          } else if ((LA5_1 == WS)
              && ((CLASSPATH.equals(input.LT(1).getText())
                  || CLASSPATH_LONG.equals(input.LT(1).getText())))) {
            s = 3;
          } else if (((switchOptions.contains(input.LT(1).getText())))) {
            s = 4;
          } else if (((VERBOSE.equals(input.LT(1).getText())
              || input.LT(1).getText().startsWith(VERBOSE + ':')))) {
            s = 5;
          } else if (((VERSION.equals(input.LT(1).getText())
              || input.LT(1).getText().startsWith(VERSION + ':')))) {
            s = 6;
          } else if (((input.LT(1).getText().startsWith(XSHARE + ':')))) {
            s = 7;
          } else if (((input.LT(1).getText().startsWith(XCJNI + ':')))) {
            s = 8;
          } else if (((isParamOption(input.LT(1).getText())))) {
            s = 9;
          } else if (((memOptions.matcher(input.LT(1).getText()).matches()))) {
            s = 10;
          } else if ((true)) {
            s = 11;
          }

          input.seek(index5_1);
          if (s >= 0) return s;
          break;
      }
      NoViableAltException nvae = new NoViableAltException(getDescription(), 5, _s, input);
      error(nvae);
      throw nvae;
    }
예제 #17
0
 @Override
 public int mark() {
   lastMarker = input.mark();
   dbg.mark(lastMarker);
   return lastMarker;
 }