Object addParserHighlight(ParserNotice notice,HighlightPainter p) throws BadLocationException {
  Document doc=textArea.getDocument();
  TextUI mapper=textArea.getUI();
  int start=notice.getOffset();
  int end=0;
  if (start == -1) {
    int line=notice.getLine();
    Element root=doc.getDefaultRootElement();
    if (line >= 0 && line < root.getElementCount()) {
      Element elem=root.getElement(line);
      start=elem.getStartOffset();
      end=elem.getEndOffset();
    }
  }
 else {
    end=start + notice.getLength();
  }
  HighlightInfo i=new LayeredHighlightInfo();
  i.painter=p;
  i.p0=doc.createPosition(start);
  i.p1=doc.createPosition(end);
  i.notice=notice;
  parserHighlights.add(i);
  mapper.damageRange(textArea,start,end);
  return i;
}

Object addParserHighlight ( ParserNotice notice , HighlightPainter p ) throws BadLocationException { Document doc = textArea . getDocument ( ) ; TextUI mapper = textArea . getUI ( ) ; int start = notice . getOffset ( ) ; int end = 0 ; if ( start == - 1 ) { int line = notice . getLine ( ) ; Element root = doc . getDefaultRootElement ( ) ; if ( line >= 0 && line < root . getElementCount ( ) ) { Element elem = root . getElement ( line ) ; start = elem . getStartOffset ( ) ; end = elem . getEndOffset ( ) ; } } else { end = start + notice . getLength ( ) ; } HighlightInfo i = new LayeredHighlightInfo ( ) ; i . painter = p ; i . p0 = doc . createPosition ( start ) ; i . p1 = doc . createPosition ( end ) ; i . notice = notice ; parserHighlights . add ( i ) ; mapper . damageRange ( textArea , start , end ) ; return i ; }
adds a special " marked occurrence " highlight .
