Progress of Scala for NetBeans - with a New Written Lexer and Parser
According to this post:
I talked to Jetbrains about this, and they told me that they stopped working on the Scala plugin for the time being, because - demand for Groovy/Ruby was higher - the language was moving too fast - Scala is a terribly difficult language for compiler/tool writers, and the only good way to analyze Scala programs might be through the official compiler, which didn't yet support this
It's true that "Scala is a terribly difficult language for compiler/tool writers", but I'm trying to bypass "the only good way to analyze Scala programs might be through the official compiler"
Before rewriting Scala for NetBeans, I considered some parser choices, one was Scala's native compiler, which is good for compiling/building Scala project, but not suitable for Editor. And JavaCC, ANTLR, which may be good enough, but it's not natural to express Scala's grammar.
Then I found Rats! which is used by Fortress, a very very clean, powerful parser generator. After couple of days working, I got an incremental lexer for Scala, and a parser for Scala that with Scala's grammar being naturally expressed (the grammar definition is ParserScala.rats). The benefit of a complete controllable parser is that I can now do some type inference and wholly semantic analysis freely and immediately.
Another progress is that I've decoupled the Scala project's dependency on Java.source's classpath in NetBeans, instead, GSF's classpath is used in Scala project module now. That means, I can begin the indexer for Scala's standard library and project source files.
The next steps will be type inference; smart completion with type inferred information; indexer for later refectory and usages searching; parsing error recover etc.
Posted at 07:20AM Apr 13, 2008 by dcaoyuan in NetBeans | Comments[4]


Great start. I eagerly await further progress.
-Harshad
Posted by 122.167.107.117 on April 13, 2008 at 04:32 PM PDT #
I really appreciate the fact that you are working this problem. don't give up!
I'm not really a Netbeans guy but I would learn it in a second if it had a good IDE.
how would I go about installing what you've got now?
Posted by Collin on April 15, 2008 at 07:29 PM PDT #
To install, please see:
http://wiki.netbeans.org/Scala
Posted by Caoyuan on April 15, 2008 at 08:07 PM PDT #
Great news!
Rats! for parsing sounds really like a good idea to keep the Plugin up2date with the Scala Language..
Posted by Michael Nischt on April 17, 2008 at 10:01 AM PDT #