[erlang-questions] Erlang AST with locations

Vlad Dumitrescu <>
Wed Oct 10 23:39:57 CEST 2007


On 10/10/07, Kenneth Lundin <> wrote:
> I think we should have a scanner which supports "Locations" in the
> original distribution so that Editor and IDE projects as ErlIde don't
> need to invent their
> own special scanner.
> It will happen quite soon but I can't make any promises regarding when.

This is great!

As a side note, but related, it should be remembered that the scanner
and especially the parser that is needed by a code processing tool
(like Erlide) has somewhat different requirements from when used
inside a compiler. Namely, in an IDE they should reflect the code as
it is written as opposed to its meaning.

So for example, in an IDE one also needs whitespace and comments, but
they have to be easy to discard. Preprocessing directives are also
significant in an IDE, while the "real" parser doesn't ever sees
those. Furthermore, in an IDE these tools have to be fault tolerant
(code in the process of being written shouldn't cause errors) and

How to fulfill the requirements of both kinds of tools in the same
scanner/parser is a quite difficult question. I think it is possible
for the scanner, but not for the parser. The future will tell.

best regards,

More information about the erlang-questions mailing list