@@ -12,6 +12,33 @@ class AttributeName = Internal::ContentName;
12
12
/** Either an attribute name, or the empty string (representing no attribute). */
13
13
class OptionalAttributeName = Internal:: OptionalContentName ;
14
14
15
+ /**
16
+ * Summary of the steps needed to track a value to a given dataflow node.
17
+ *
18
+ * This can be used to track objects that implement a certain API in order to
19
+ * recognize calls to that API. Note that type-tracking does not by itself provide a
20
+ * source/sink relation, that is, it may determine that a node has a given type,
21
+ * but it won't determine where that type came from.
22
+ *
23
+ * It is recommended that all uses of this type are written in the following form,
24
+ * for tracking some type `myType`:
25
+ * ```ql
26
+ * DataFlow::LocalSourceNode myType(DataFlow::TypeTracker t) {
27
+ * t.start() and
28
+ * result = < source of myType >
29
+ * or
30
+ * exists (DataFlow::TypeTracker t2 |
31
+ * result = myType(t2).track(t2, t)
32
+ * )
33
+ * }
34
+ *
35
+ * DataFlow::LocalSourceNode myType() { myType(DataFlow::TypeTracker::end()) }
36
+ * ```
37
+ *
38
+ * Instead of `result = myType(t2).track(t2, t)`, you can also use the equivalent
39
+ * `t = t2.step(myType(t2), result)`. If you additionally want to track individual
40
+ * intra-procedural steps, use `t = t2.smallstep(myCallback(t2), result)`.
41
+ */
15
42
class TypeTracker extends Internal:: TypeTracker {
16
43
/**
17
44
* Holds if this is the starting point of type tracking, and the value starts in the attribute named `attrName`.
0 commit comments