How can I indicate syntax errors (e.g. an illegal sequence of tokens) in an eclipse editor plugin just like in the eclipse Java editor, i.e. by red wriggly underlines, a red mar
You should be using Markers.
An example derived from "The Java Developer's Guide to Eclipse" follows:
IMarker marker = res.createMarker("com.ibm.tool.resources.snakesyntax");
marker.setAttribute(IMarker.SEVERITY, 0);
marker.setAttribute(IMarker.CHAR_START, startOfSyntaxError);
marker.setAttribute(IMarker.CHAR_END, endOfSyntaxError);
marker.setAttribute(IMarker.LOCATION, "Snake file");
marker.setAttribute(IMarker.MESSAGE, "Syntax error");