Select Git revision
TypeReferences.jrag
Forked from
Anders Blomdell / LabComm
277 commits behind the upstream repository.

Sven Gestegård Robertz authored
pruned and grafted the refactored compiler from the metadata branch. Tests run, but code needs cleanup
TypeReferences.jrag 1.26 KiB
aspect User_Types {
syn String Type.getTypeName();
eq Type.getTypeName() = getClass().getName();
eq PrimType.getTypeName() = getName();
eq UserType.getTypeName() = getName();
syn boolean Type.isUserType();
eq Type.isUserType() = false;
eq UserType.isUserType() = true;
}
aspect Type_References {
// The dependencies on other type declarations for a Decl.
coll Set<Decl> Decl.type_dependencies() [new HashSet<Decl>()] with add;
Field contributes ((UserType)getType()).decl()
when parentDecl() != null && getType().isUserType()
to Decl.type_dependencies()
for parentDecl();
UserType contributes decl()
when parentDecl() != null
to Decl.type_dependencies()
for parentDecl();
/*
Field contributes getType().decl()
when parentDecl() != null && getType().isLeafType()
to Decl.type_dependencies()
for parentDecl();
*/
// The references from other type declarations to a Decl.
coll Set<Decl> Decl.type_references() [new HashSet<Decl>()] with add;
Decl contributes this
to Decl.type_references()
for each type_dependencies();
syn boolean Decl.hasDependencies();
eq Decl.hasDependencies() = !type_dependencies().isEmpty();
syn boolean Decl.isReferenced();
eq Decl.isReferenced() = !type_references().isEmpty();
}