GitLab update scheduled for Friday, January 21th between 08:15 and 08:45 CET. If unpleasant, please contact René or Martin.

Navigation.jrag 2.14 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
13
  eq RagConnect.getChild().containedFile() = null;
René Schöne's avatar
René Schöne committed
14

15
  // --- containedFileName ---
16
17
  eq RagConnect.getChild().containedFileName() = getFileName();
  eq MRagConnect.getChild().containedFileName() = null;
René Schöne's avatar
René Schöne committed
18

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

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

27
28
29
  // --- isSendToMqttDefinition ---
  syn boolean EndpointDefinition.isSendToMqttDefinition() = false;
  eq SendToMqttDefinition.isSendToMqttDefinition() = true;
René Schöne's avatar
René Schöne committed
30

31
32
33
  // --- asSendToMqttDefinition ---
  syn SendToMqttDefinition EndpointDefinition.asSendToMqttDefinition() = null;
  eq SendToMqttDefinition.asSendToMqttDefinition() = this;
René Schöne's avatar
René Schöne committed
34

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

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

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