[erlang-questions] Erlang AST with locations

Vlad Dumitrescu <>
Fri Oct 5 22:17:01 CEST 2007


On 10/5/07, Joel Reymont <> wrote:
> The result of erl_scan:string/1 has line numbers in it but these get
> lost once erl_parse:parse/1 runs.
> I would like to have an AST with locations, is there a way to
> accomplish that?

If the license fits with your purpose, you could look at erlide_scan
and erlide_parse -- in the erlide code, of course. They are modified
versions of the respective OTP modules, that return tokens in which
the position is {{line number, offset in file}, token length}. The
textual form of the token is also returned so that there is a
difference between scanning "15" and "16#F".

best regards,

More information about the erlang-questions mailing list