/** a relational nta collection attribute to compute the scope tree */
/** a relational nta collection attribute to compute the scope tree */
coll Scope ASTNode.scope() [asScope()] with addElement root Program;
coll Scope ASTNode.scope() [asScope()] with addElement root Program;
coll TypeDeclScope ClassDecl.packageScope() [asPackageScope()] with addElement root Program;
coll TypeDeclScope ClassDecl.protectedScope() [asProtectedScope()] with addElement root Program;
coll TypeDeclScope ClassDecl.publicScope() [asPublicScope()] with addElement root Program;
// collect all scopes
// collect all scopes
TypeDecl contributes scope() to ASTNode.scope() for containingScope();
TypeDecl contributes scope() when !isClassDecl() to ASTNode.scope() for containingScope();
ClassDecl contributes publicScope() to ASTNode.scope() for containingScope();
Block contributes scope() to ASTNode.scope() for containingScope();
Block contributes scope() to ASTNode.scope() for containingScope();
ForStmt contributes scope() when !(getStmt() instanceof Block) to ASTNode.scope() for containingScope();
ForStmt contributes scope() when !(getStmt() instanceof Block) to ASTNode.scope() for containingScope();
EnhancedForStmt contributes scope() when !(getStmt() instanceof Block) to ASTNode.scope() for containingScope();
EnhancedForStmt contributes scope() when !(getStmt() instanceof Block) to ASTNode.scope() for containingScope();
// collect all elements
// collect all elements
Declarator contributes asDeclaration() to ASTNode.scope() for containingScope();
Declarator contributes asDeclaration() when !isField() || isPrivate() to ASTNode.scope() for containingScope();
Declarator contributes asDeclaration() when isField() && !(isPrivate() || isProtected() || isPublic()) to ClassDecl.packageScope() for containingScope();
Declarator contributes asDeclaration() when isField() && isProtected() to ClassDecl.protectedScope() for containingScope();
Declarator contributes asDeclaration() when isField() && isPublic() to ClassDecl.publicScope() for containingScope();
ParameterDeclaration contributes asDeclaration() to ASTNode.scope() for containingScope();
ParameterDeclaration contributes asDeclaration() to ASTNode.scope() for containingScope();