When generating a type term in TS or NaBL, the resulting term does not contain any name or type annotations, which makes any subsequent name or type rules applications on this term fail.

An example where these kind of type terms are generated is typing literals in TS:

Bool(_)   : Boolean()
String(_) : RefType(TypeName("String"), None())

This also happens in NaBL, for example in the rule for Java class declarations:

ClassDec(ClassDecHead(m*, c, tp*, SuperDec(pct@ClassType(pc, _)), _), _):
  defines Type c 
    of type RefType(TypeName(c), None())
  implicitly defines Field "this"
    of type RefType(TypeName(c), None())
  implicitly defines Field "super"
    of type RefType(pc, None())

A possible solution for these cases is to perform name and type collection on these type terms, since they are generated completely from the AST, without using any results of tasks.

However, In general, these terms could be constructed using results of tasks, which means these terms are tasks themselves, so we cannot annotate them during collection. But it might be possible to run the collection on the results of these task in a higher-order task.


PS/offtopic: Posted in Spoofax project because it is an issue concerning both TS and NaBL. Maybe these should not be separate projects but tags instead?

Submitted by Gabriël Konat on 13 March 2014 at 15:47

On 13 March 2014 at 15:47 Gabriël Konat tagged nabl

Log in to post comments