An update on the IntelliJ plugin and parsing Dylan

Bruce Mitchener <[email protected]> Fri, 4 Oct 2013 20:29:06 +0700
Newsgroups gmane.comp.lang.dylan.gwydion.devel
Message-ID <CA+esKjNCwDFtZ_ikFTPAKzpmdhMG5MswwfhLuWA5+pdEr20rcw@mail.gmail.com>
Hello all,

Last week, we had a discussion thread about a plugin for IntelliJ to add
support for Dylan.

Since then, Francesco has started helping out and we've made some good
progress in the last week.  The plugin is named DeftIDEA (Deft => Dylan
Environment For Tools, IDEA is part of the IntelliJ name) and it is already
available on the official plugins site, so it is easy to download and
install like any other IntelliJ plugin.

Now, we're working on parsing Dylan (among other things).  I'm tossing this
out there in case someone has a better idea or has something useful to
contribute...

Right now, there's a lexer and the start of a parser (based on the one
written long ago by Paul Haahr for yacc).  But this doesn't actually handle
Dylan level constructs, like "define class" or "define constant".

In the real Dylan parser in dylan-compiler, these constructs are handed in
sources/dfmc/definitions/ (grep -A 2 "define &definition"  *.dylan in that
directory).  There are also some things define via &macro, especially in
C-FFI, and other things defined via regular macros (in particular, a bunch
of stuff in sources/dylan/macros.dylan, like unless, case, select, iterate,
and when).  Finally, a few things are handled in sources/dfmc/conversion,
particularly in sources/dfmc/conversion/convert-loops.dylan which handles
for, while, until loops.

In my mind, we should hard-code almost all of the above things in our
parser in the plugin and at some point, implement real macro expansion for
other things (and perhaps retrofit it back to handle the things defined in
sources/dylan/macros.dylan and other normal macros).  This lets us
represent things on the Java side very exactly, set up symbol completion,
and begin doing inspections and other error detection / handling things.
 This lets us make immediate progress with a Dylan parser that will handle
most things today and we can improve it over time to handle macros better.

The emacs mode does things in a pretty ad-hoc way. The other editor plugins
do a fairly ad-hoc lexing as well, with Pygments probably being the most
complex / accurate to date.

Does that seem like a sensible path forward to others?

 - Bruce

_______________________________________________
hackers mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/hackers