private void printError(RecognitionError le, String message, String key, LineMap map) {
   int pos = -1;
   if (le.getLine() > 0) {
     pos = map.getStartPosition(le.getLine()) + le.getCharacterInLine();
   }
   log.error(pos, key, message);
 }
Exemplo n.º 2
0
 private void printError(RecognitionError le, String message, String key, LineMap map) {
   int pos = -1;
   if (le.getLine() > 0) {
     /* does not seem to be a way to determine the max line number so we do an ugly try-catch */
     try {
       pos = map.getStartPosition(le.getLine()) + le.getCharacterInLine();
     } catch (Exception e) {
     }
   }
   log.error(pos, key, message);
 }