Once you have a ParserResult, as described yesterday, you also
need to have access to some kind of AST node, i.e., not only
tokens. Tokens let you distinguish between individual characters in
a document, but that's not enough if you want to create code
folding for your editor. Below you see code folding
for PowerJava,
which is an extension to Java 1.5 for role programming. It has
about 8 special keywords, which in my editor are shown in orange,
as can be seen for two of them...