Node type only used as NTA treated as root

Issue #224 resolved
Jesper Mattsson created an issue

When a node type is only used in an NTA using the syn nta syntax, then any inherited equations not defined on it for its children will generate warnings, as if the node type was a root type.

Example: ex.ast:

A ::= C;
B ::= C;
C;

ex.jrag:

aspect ex {
  syn nta A.b() = new B(new C());
  inh int C.x();
  eq A.getChild().x() = 1;
}

This will give:

Warning at ex.jrag:3: missing inherited equation for attribute x in class C when being child of B (path: B->C)

This is likely related to issue #217.

Comments (8)

  1. Jesper Öqvist

    Improve synthesized NTA handling wrt inh attrs

    Pure synthesized NTAs are now treated more like child NTAs with respect to inherited attributes.

    A node type only used in synthesized NTA equations should no longer be treated as a root node, and warnings for missing inherited equations are reported for synthesized NTA children.

    fixes #224 (bitbucket) fixes #217 (bitbucket)

    → <<cset 219ce5df9e04>>

  2. Jesper Öqvist

    Improve synthesized NTA handling wrt inh attrs

    Pure synthesized NTAs are now treated more like child NTAs with respect to inherited attributes.

    A node type only used in synthesized NTA equations should no longer be treated as a root node, and warnings for missing inherited equations are reported for synthesized NTA children.

    fixes #224 and #217 (bitbucket)

    → <<cset 4aec461916dd>>

  3. Jesper Öqvist

    Improve synthesized NTA handling wrt inh attrs

    Pure synthesized NTAs are now treated more like child NTAs with respect to inherited attributes.

    A node type only used in synthesized NTA equations should no longer be treated as a root node, and warnings for missing inherited equations are reported for synthesized NTA children.

    fixes #224 fixes #217

    → <<cset f0af9897e5b2>>

  4. Jesper Öqvist

    Improve synthesized NTA handling wrt inh attrs

    Pure synthesized NTAs are now treated more like child NTAs with respect to inherited attributes.

    A node type only used in synthesized NTA equations should no longer be treated as a root node, and warnings for missing inherited equations are reported for synthesized NTA children.

    fixes #224 (bitbucket) fixes #217 (bitbucket)

    → <<cset 3dd5b3f12489>>

  5. Log in to comment