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
The correct way is using the marker interface.
Markers are essentially a model that maps marker objects to locations in your source code, so this makes sense in situations where you can have errors in multiple files. (see the IMarker interface)
A cheaper option if you want to add markup to your current editor but not to all the project is using Annotations, which you can add an remove yourself.
Markers are represented in the UI as annotations but Eclipse adds and removes the annotations itself. With direct annotations, you're in control.