private void printErrorQuietly(Exception e) throws EOFException, IOException {

        final ITextRegion offset;
        if ( e instanceof ParseException ) {
            offset = ((ParseException) e).getRegion();
        } 
        else 
        {
            offset = new TextRegion(lexer.currentOffset(),0);
        }

        final StringBuffer src = new StringBuffer();
        try ( BufferedReader reader = new BufferedReader( new InputStreamReader( this.inputProvider.createInputStream() ) ) ) 
        {
            // advance to error offset
            int i = offset.getStartingOffset();
            while ( i > 0 ) {
                if ( reader.read() == -1 ) {
                    throw new EOFException("Bad offset "+offset.getStartingOffset());
                }
                i--;
            }

            // get 20 characters of context
            i = 20;
            while( i > 0 ) 
            {
                int val = reader.read();
                if ( val == -1 || ( ( (char) val) == '\n' ) ) {
                    break;
                }
                src.append( (char) val);
                i--;
            }
            System.out.println( src );
            int len = offset.getLength() == 0 ? 1 : offset.getLength();
            for ( i = 0 ; i < len ; i++ ) {
                System.out.print("^");
            }
            System.err.println( " "+e.getMessage() );
            e.printStackTrace();
        }
    }