In the upcoming version of Spoofax (the new-term branch), JSGLR can directly create abstract syntax trees, avoiding the (significant) overhead of creating parse trees with character branches and then imploding them.

To make use of this in WebDSL, two things must change:

  • WebDSL still uses one of the parse-pt strategies to first create a parse tree and then implode it. It should use a parse alternative instead to directly get the AST.

  • WebDSL also uses asfix-anno-location to annotate the parse tree with location information. Instead, it should use the origin-line and origin-column strategies to add these annotations directly to the AST.

Perhaps parse-pt + implode-asfix can be efficiently supported in the future with some runtime tricks, but asfix-anno-location will likely remain as is.

Submitted by Lennart Kats on 1 February 2011 at 18:33

On 1 February 2011 at 18:33 Lennart Kats removed tag error

On 9 February 2011 at 09:54 Lennart Kats commented:

At this point calling implode-asfix in 0.6.1 uses the Stratego implementation of the imploder, which doesn’t support origin tracking or position information. Another reason not to use it anymore ;) Just do something like topdown(!<id>{At(filename, <origin-line>, <origin-column>)}) to get the annotations.

On 23 May 2011 at 14:50 Lennart Kats commented:

Note that WebDSL seems to be incompatible with Spoofax 0.6.1 at this point because of this issue.

On 8 June 2012 at 11:38 chris melman commented:

fixed in the editor however since , are not available in the compiler it is hard refactor it there

Log in to post comments