Using <0> in a priority rule is not supported by the pretty printer:

[ TemplateLang | error ] No pp entry found for: (1,["simpleRefGroup"])
[ TemplateLang | error ] Cannot rewrite to box: 
        simpleRefGroup(sortConsRef(sort("Expr"),term(appl(unquoted("cons"),[fun(quoted("\"IfThenElse\""))]))))
[ TemplateLang | error ] Cannot rewrite to box: 
        with-arguments(simpleRefGroup(sortConsRef(sort("Expr"),term(appl(unquoted("cons"),[fun(quoted("\"IfThenElse\""))])))),default(["2"]))

Example code:

module A
imports
  Common
context-free start-symbols
  Expr
context-free syntax
  Expr = [([Expr])] {bracket}
  Expr.IfThenElse = [if [Expr] then [Expr] else [Expr]]
  Expr.Seq = [[Expr]; [Expr]] {right}
  Expr.IntLit = INT
context-free priorities
  Expr.IfThenElse <2> > Expr.Seq

And this error is ignored when you’ve built the SDF3 successfully before, which makes it harder to find out what’s going on!
Other things that fail:

  • Expr = "if" Expr "then" Expr "else" Expr <2> > Expr.Seq (full rule on one side, productive form)
  • "if" Expr "then" Expr "else" Expr -> Expr <2> > Expr.Seq (full rule on one side, SDF2 form)
  • Expr = "if" Expr "then" Expr "else" Expr <2> > Expr = Expr ";" Expr (full rules on either side, productive form)
  • "if" Expr "then" Expr "else" Expr -> Expr <2> > Expr ";" Expr -> Expr (full rules on either side, SDF2 form)

The last one in particular worked in Spoofax 1.2.

Submitted by Jeff Smits on 11 January 2015 at 15:40

On 12 January 2015 at 10:34 Eduardo Amorim commented:

I was not able to reproduce it here. I tested it using Spoofax 1.3.1 with all your examples and all succeeded.
The first thing that came to my mind was that your file was not analysed yet. Does it happen all the time?
If you try Generate -> SDF -> Generate SDF (concrete) it just fails with the error above?


On 12 January 2015 at 10:58 Jeff Smits commented:

Yes, manually choosing generate fails too, with the same error. But I see now that I was still using Spoofax 1.3(.0). After updating to 1.3.1 the problems went away. Sorry for the false alarm. You can close this issue


On 12 January 2015 at 11:08 Eduardo Amorim commented:

Yes. I fixed it for 1.3.1. :)


On 12 January 2015 at 11:08 Eduardo Amorim closed this issue.

Log in to post comments