I installed Spoofax 1.2 in Eclipse 4.4 and played a bit with the demo project. When I tried to remove the module names, I got a code generation error:

    [java] ** Error in definition nabl-def-site:
    [java]    variable 'c-uri1__' used, but not bound
    [java] ** Error in definition nabl-def-site:
    [java]    variable 's-uri1__' used, but not bound


Start.Module = <
  <Definition*; separator="\n\n"> 
Definition.Entity = <test>


binding rules

Module(_) : 
	defines Module "default"

The static name triggers the error.

Submitted by Danny Groenewegen on 29 August 2014 at 16:23

On 29 August 2014 at 17:45 Gabriël Konat commented:

Definition clauses must be based on variables from the pattern, like

Module(x) : defines Module x

or use an implicit definition instead:

Module(x) : implicitly defines Module "default"

But implicit definitions cannot scope their subterms, if you want scoping as well you have to desugar the Module term and put "default" in there.

On 29 August 2014 at 18:24 Danny Groenewegen commented:

Why is the implicitly in the syntax, it seems superfluous because the quotes already indicate a static name. What else does it do besides breaking scoping?

I think this could either be desugared automatically, or there needs to be an error on defines Module "default".

On 4 November 2014 at 15:35 Gabriël Konat closed this issue.

Log in to post comments