Errors.connect 2.68 KB
Newer Older
1
2
3
4
// --- update receive definitions ---
// Error: there must not be two receive definitions for the same token
receive B.DoubledValue ;
receive B.DoubledValue using IntToInt ;
René Schöne's avatar
René Schöne committed
5
6

// NOT HANDLED \\ Error: the token must be resolvable within the parent type
7
// NOT HANDLED \\ receive B.NonExisting ;
René Schöne's avatar
René Schöne committed
8
9

// Error: the Token must not be a TokenNTA (i.e., check for !Token.getNTA())
10
receive B.ErrorNTA ;
René Schöne's avatar
René Schöne committed
11
12

// Error: from-type of first mapping must be byte[] or a supported primitive type
13
receive B.ErrorTypeOfFirstMapping using ListToList ;
René Schöne's avatar
René Schöne committed
14
15

// Error: to-type of last mapping must be type of the Token
16
receive B.ErrorTypeOfLastMapping using StringToList ;
René Schöne's avatar
René Schöne committed
17
18

// Error: types of mappings must match (modulo inheritance)
19
receive B.ErrorTypeMismatch using StringToList, IntToInt ;
René Schöne's avatar
René Schöne committed
20

21
// --- update send definitions ---
René Schöne's avatar
René Schöne committed
22
// NOT HANDLED \\ Error: the token must be resolvable within the parent type
23
// NOT HANDLED \\ receive C.NonExisting ;
René Schöne's avatar
René Schöne committed
24
25

// Error: Token must be a TokenNTA (i.e., check for Token.getNTA())
26
send C.ErrorNotNTA ;
René Schöne's avatar
René Schöne committed
27
28

// Error: from-type of first mapping must be type of Token
29
send C.ErrorTypeOfFirstMapping using IntToInt ;
René Schöne's avatar
René Schöne committed
30
31

// Error: to-type of last mapping must be byte[] or a supported primitive type
32
33
send C.ErrorTypeOfLastMapping1 using StringToList ;
send C.ErrorTypeOfLastMapping2 ;
René Schöne's avatar
René Schöne committed
34
35

// Error: types of mappings must match (modulo inheritance)
36
send C.ErrorTypeMismatch using StringToList, IntToInt ;
René Schöne's avatar
René Schöne committed
37

38
39
40
// Error: no more than one send mapping for each TokenComponent
send C.DoubledValue ;
send C.DoubledValue using IntToInt ;
René Schöne's avatar
René Schöne committed
41
42
43
44
45
46

// --- dependency definitions ---
// NOT HANDLED \\ Error: Both, source and target must be resolvable within the parent type
// NOT HANDLED \\ D.SourceNonExistingTarget canDependOn D.NonExisting as NonExistingTarget ;
// NOT HANDLED \\ D.NonExisting canDependOn D.TargetNonExistingSource as NonExistingSource ;

47
// Error: There must be a send update definition for the target token
René Schöne's avatar
René Schöne committed
48
49
50
51
D.SourceNoWriteDef canDependOn D.TargetNoWriteDef as NoWriteDef ;

// Error: The name of a dependency definition must not be equal to a list-node on the source
D.SourceSameAsListNode canDependOn D.TargetSameAsListNode as MyList ;
52
send D.TargetSameAsListNode;
René Schöne's avatar
René Schöne committed
53
54
55
56

// Error: There must not be two dependency definitions with the same name
D.SourceDoubledValue canDependOn D.TargetDoubledValue as DoubledValue ;
D.SourceDoubledValue canDependOn D.TargetDoubledValue as DoubledValue ;
57
send D.TargetDoubledValue;
René Schöne's avatar
René Schöne committed
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

// --- mapping definitions ---
ListToList maps java.util.List<String> list to java.util.List<String> {:
  return list;
:}

StringToList maps String s to List<String> {:
  java.util.List<String> result = new java.util.ArrayList<>();
  result.add(s);
  return result;
:}

IntToInt maps int number to int {:
  return number + 1;
:}