Lexer for Scala

80 views
Skip to first unread message

Duke Normandin

unread,
Sep 7, 2012, 10:01:38 PM9/7/12
to scite-i...@googlegroups.com
I've decided to learn Scala. Is there an up-to-date SciTE lexer
kicking around for this language? Much obliged!!

--
Duke
“Tolerance becomes a crime when applied to evil.” ― Thomas Mann

Philippe Lhoste

unread,
Sep 10, 2012, 5:48:08 AM9/10/12
to scite-i...@googlegroups.com
On 08/09/2012 04:01, Duke Normandin wrote:
> I've decided to learn Scala. Is there an up-to-date SciTE lexer kicking around for this
> language? Much obliged!!

Not an official one.
I made one when I started to learn Scala, but it is a bit incomplete, that's why I haven't
submitted it to the Scintilla project yet.
For example, it doesn't support well the XML literals. Although these can be tricky, if
they have Scala code in them.
Otherwise, the support of the language is quite complete, I think (but I haven't looked at
macros yet, not even sure if there is a special syntax).

http://autohotkey.net/~PhiLho/SciTE4AHK.zip

You can find there, among others, the source code of the lexer, a relatively recent
version of SciLexer.dll (you have to compile the lexer yourself if you use a non-Windows
platform) and the scala.properties file.

I also have a test file where I tried to pack most of the syntax of Scala:

http://bazaar.launchpad.net/~philho/+junk/Scala/view/head:/TestLexer.scala

(It compiles, but it is nonsensical!)

--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --



Duke Normandin

unread,
Sep 10, 2012, 8:32:30 AM9/10/12
to scite-i...@googlegroups.com
On Monday, 10-Sep-12 3:48 AM, Philippe Lhoste wrote:
> On 08/09/2012 04:01, Duke Normandin wrote:
>> I've decided to learn Scala. Is there an up-to-date SciTE lexer
>> kicking around for this
>> language? Much obliged!!
>
> Not an official one.
> I made one when I started to learn Scala, but it is a bit
> incomplete, that's why I haven't submitted it to the Scintilla
> project yet.
> For example, it doesn't support well the XML literals. Although
> these can be tricky, if they have Scala code in them.
> Otherwise, the support of the language is quite complete, I think
> (but I haven't looked at macros yet, not even sure if there is a
> special syntax).
>
> http://autohotkey.net/~PhiLho/SciTE4AHK.zip
>
> You can find there, among others, the source code of the lexer, a
> relatively recent version of SciLexer.dll (you have to compile the
> lexer yourself if you use a non-Windows platform) and the
> scala.properties file.
>
> I also have a test file where I tried to pack most of the syntax of
> Scala:
>
> http://bazaar.launchpad.net/~philho/+junk/Scala/view/head:/TestLexer.scala
>
>
> (It compiles, but it is nonsensical!)
>

Thank you!! I'll be installing it ASAP
BTW, are you now a Scala guru? :?

Philippe Lhoste

unread,
Sep 11, 2012, 9:57:07 AM9/11/12
to scite-i...@googlegroups.com
On 10/09/2012 14:32, Duke Normandin wrote:
> Thank you!! I'll be installing it ASAP
> BTW, are you now a Scala guru? :?

I fear not, I am not very good at abstract things and the type system is hard to grok...
Beside, I hadn't time to spend on it lately, so I might have forgotten a lot already. But
from experience, re-learning something half-forgotten is good for the cognitive process...

I found interesting to code with SciTE and compile on the command line (or with Gradle):
it is lightweight and close to the bone. And IDE support was sketchy when I started.
But today, for serious coding or better learning (API discovery) perhaps using an IDE
(Eclipse, IntelliJ...) might help a lot too.

Currently, I code Java for a living, and use Eclipse a lot, but I still fire SciTE for
some tasks (the rectangular selection of Eclipse isn't as good as SciTE's one... And
Eclipse doesn't has (or no longer has) script support).

Duke Normandin

unread,
Sep 12, 2012, 8:56:26 AM9/12/12
to scite-i...@googlegroups.com
On Tuesday, 11-Sep-12 7:57 AM, Philippe Lhoste wrote:
> On 10/09/2012 14:32, Duke Normandin wrote:
>> Thank you!! I'll be installing it ASAP
>> BTW, are you now a Scala guru? :?
>
> I fear not, I am not very good at abstract things and the type
> system is hard to grok...

I hear you!! I'm still looking for "that perfect language for me" -
modern but not too abstract! :D

> Beside, I hadn't time to spend on it lately, so I might have
> forgotten a lot already. But from experience, re-learning something
> half-forgotten is good for the cognitive process...

I've experienced that as well ...

> I found interesting to code with SciTE and compile on the command
> line (or with Gradle): it is lightweight and close to the bone. And
> IDE support was sketchy when I started.

I enjoyed using SciTE with Ruby.
Reply all
Reply to author
Forward
0 new messages