If a template definition has attributes - e.g. prefer or right - and this definition is referenced by sort and constructor name in a context-free priorities section, then these are not repeated in the context-free priorities section of the generated sdf.

Associativity should not be a problem, but I haven’t been able to find an alternative way to mark a rule prefer except to use the classical, SDF-style syntax

e.g. if we have the following in a.tmpl:

templates
    A.Y = <<E><F>> 
    A.X = <<C><D>> {prefer}
context-free priorities
    A.Y > A.X

then in agenerated.sdf, we will have: (omitting content completion stuff)

context-free syntax
    E F -> A {cons("Y")}
    C D -> A {cons("X"), prefer}
context-free priorities
    { E F -> A } >
    { C D -> A }
Submitted by Barnabás Králik on 8 April 2013 at 18:04

On 17 April 2013 at 11:25 Gabriël Konat tagged error

On 21 September 2013 at 09:40 Guido Wachsmuth tagged sdf

On 21 September 2013 at 09:40 Guido Wachsmuth commented:

If I remember correctly, rules share their annotations between different instances of a rule. Can someone verify this?

Log in to post comments