Ejemplo n.º 1
0
 private void tokenExpected(TokenType type, String text) {
   myLexer.nextToken();
   if (type != myLexer.getTokenType()) {
     throw new ParsingException(type.getName() + " expected but " + myLexer.getToken() + " found");
   }
   if (text != null && !text.equals(myLexer.getToken())) {
     throw new ParsingException(text + " expected but " + myLexer.getToken() + " found");
   }
 }