Navigation.jrag 2.61 KB
Newer Older
1
2
aspect Navigation {

3
  // --- program ---
4
5
  eq RagConnect.getChild().program() = getProgram();
  eq MRagConnect.getChild().program() = getRagConnect().program();
6

7
8
9
10
  // --- ragconnect ---
  inh RagConnect ASTNode.ragconnect();
  eq RagConnect.getChild().ragconnect() = this;
  eq MRagConnect.getChild().ragconnect() = getRagConnect();
11

12
  // --- containedFile
René Schöne's avatar
René Schöne committed
13
  eq Grammar.getChild().containedFile() = null;
14
  eq RagConnect.getChild().containedFile() = null;
René Schöne's avatar
René Schöne committed
15
  eq MRagConnect.getChild().containedFile() = null;
René Schöne's avatar
René Schöne committed
16

17
  // --- containedFileName ---
18
  eq Grammar.getChild().containedFileName() = null;  // should be in PP
19
20
  eq RagConnect.getChild().containedFileName() = getFileName();
  eq MRagConnect.getChild().containedFileName() = null;
René Schöne's avatar
René Schöne committed
21

22
23
24
  // --- isTokenEndpointDefinition ---
  syn boolean EndpointDefinition.isTokenEndpointDefinition() = false;
  eq TokenEndpointDefinition.isTokenEndpointDefinition() = true;
René Schöne's avatar
René Schöne committed
25

26
27
28
  // --- asTokenEndpointDefinition ---
  syn TokenEndpointDefinition EndpointDefinition.asTokenEndpointDefinition() = null;
  eq TokenEndpointDefinition.asTokenEndpointDefinition() = this;
René Schöne's avatar
René Schöne committed
29

René Schöne's avatar
René Schöne committed
30
31
32
  // --- isSendTokenEndpointDefinition ---
  syn boolean EndpointDefinition.isSendTokenEndpointDefinition() = false;
  eq SendTokenEndpointDefinition.isSendTokenEndpointDefinition() = true;
René Schöne's avatar
René Schöne committed
33

René Schöne's avatar
René Schöne committed
34
35
36
  // --- asSendTokenEndpointDefinition ---
  syn SendTokenEndpointDefinition EndpointDefinition.asSendTokenEndpointDefinition() = null;
  eq SendTokenEndpointDefinition.asSendTokenEndpointDefinition() = this;
René Schöne's avatar
René Schöne committed
37

René Schöne's avatar
René Schöne committed
38
39
40
  // --- asReceiveTokenEndpointDefinition ---
  syn ReceiveTokenEndpointDefinition EndpointDefinition.asReceiveTokenEndpointDefinition() = null;
  eq ReceiveTokenEndpointDefinition.asReceiveTokenEndpointDefinition() = this;
René Schöne's avatar
René Schöne committed
41

42
  // --- targetEndpointDefinition ---
René Schöne's avatar
René Schöne committed
43
  syn SendTokenEndpointDefinition DependencyDefinition.targetEndpointDefinition() {
René Schöne's avatar
René Schöne committed
44
    // resolve definition in here, as we do not need resolveMethod in any other place (yet)
45
    for (EndpointDefinition endpointDefinition : ragconnect().getEndpointDefinitionList()) {
René Schöne's avatar
René Schöne committed
46
47
48
      if (endpointDefinition.isSendTokenEndpointDefinition() &&
          endpointDefinition.asSendTokenEndpointDefinition().getToken().equals(this.getTarget())) {
        return endpointDefinition.asSendTokenEndpointDefinition();
René Schöne's avatar
René Schöne committed
49
50
51
52
      }
    }
    return null;
  }
53

René Schöne's avatar
René Schöne committed
54
55
56
  // --- effectiveJavaTypeUse (should be in preprocessor) ---
  syn lazy JavaTypeUse TokenComponent.effectiveJavaTypeUse() = hasJavaTypeUse() ? getJavaTypeUse() : new SimpleJavaTypeUse("String");

57
58
59
  // --- isDefaultMappingDefinition ---
  syn boolean MappingDefinition.isDefaultMappingDefinition() = false;
  eq DefaultMappingDefinition.isDefaultMappingDefinition() = true;
60
}