In Spoofax, I based some concrete syntax on the example for Tiger shown here:

http://hydra.nixos.org/build/654980/download/1/manual/chunk-chapter/stratego-concrete-syntax.html

However this didn’t work at all. Using https://mailman.st.ewi.tudelft.nl/pipermail/users/2010-June/000182.html and some hints from Lennart on IRC I rewrote the meta syntax definition.

Now it looks more like this (to stay in the Tiger domain):


module Stratego-Tiger
imports
StrategoMix[StrategoHost]
Tiger
Tiger-Variables
exports
context-free start-symbols ModuleStrategoHost
context-free syntax
“|[" Dec "]|” -> TermStrategoHost {cons(“ToTerm”),prefer}
“|[" TypeDec "]|” -> TermStrategoHost {cons(“ToTerm”),prefer}
%% etc.

In particular the start-symbols appears to be important now, while it isn’t present in the documentation. Also the [[StrategoHost]] “attribute” is new.

I don’t know whether this is because the semantics wrt meta syntax have changed over time, or whether it’s different in the Java stratego and the C stratego, but it looks to me that the documentation is out of date.

Submitted by Tobi Vollebregt on 4 October 2010 at 12:54

On 6 October 2010 at 16:19 Tobi Vollebregt commented:

I understand from Lennart that it may have to do with the Stratego start-symbols being exported in an older version of Stratego, and them now being hidden.

Still it leaves the new (?) way of importing syntax with the [StrategoHost] annotation unexplained.

Log in to post comments