Sunday Mar 16, 2008

Fortress for NetBeans Screenshot#1: Syntax Highlighting

>>> Updated Mar 19:
The outline navigator will do some unicode rendering; Brace matching works.
===

I'm planning to re-write Scala editor module, based on a new parser (maybe Tor from Sun and Carl from Google will help this project too). But before that, I'd like to prove some thoughts. That comes Fortress for NetBeans.

To know more about Fortress, please go to http://projectfortress.sun.com/Projects/Community/

Fortress's grammar is expressed in PEG (Parsing Expression Grammars), and is implemented on Rats!, a clean PEG parser generator.

I got some interesting experiences on how to let Rats! become a simple lexical token stream generator, of course, it has some limits, but these lexical tokens are used only for basic/quick highlighting, brace-matching etc, I do not use it for syntax parsing and semantic analysis, so the limits are not an effect. The syntax parsing, semantic analysis and grammar checking will be from original Fortress parser.

Here's a screenshot of my experimental work:

nn

Actually I've done a bit of semantic works too, thus you can see the function definitions were bold highlighted and the outline navigator window was almost there.

Comments:

Incredibly awesome. Whenever I try to break into a new language like Fortress, I get hung up on the syntax for a little while, and thus appreciate aids like syntax highlighting. I tried to implement such a highlighter myself, but I was not familiar enough with NetBeans module programming to get it to work, so I appreciate it all the more.

Posted by Chris Granade on March 17, 2008 at 06:33 PM PST #

Post a Comment:
Comments are closed for this entry.