Navigation.jrag 2.54 KB
Newer Older
Johannes Mey's avatar
Johannes Mey committed
1
2
aspect Navigation {

3
  // --- program ---
4
5
  eq RagConnect.getChild().program() = getProgram();
  eq MRagConnect.getChild().program() = getRagConnect().program();
Johannes Mey's avatar
Johannes Mey committed
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
19
  eq RagConnect.getChild().containedFileName() = getFileName();
  eq MRagConnect.getChild().containedFileName() = null;
René Schöne's avatar
René Schöne committed
20

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

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

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

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

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

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

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

56
57
58
  // --- isDefaultMappingDefinition ---
  syn boolean MappingDefinition.isDefaultMappingDefinition() = false;
  eq DefaultMappingDefinition.isDefaultMappingDefinition() = true;
Johannes Mey's avatar
Johannes Mey committed
59
}