@@ -118,11 +118,13 @@ class Node extends TNode {
118118 Node track ( TypeTracker t2 , TypeTracker t ) { t = t2 .step ( this , result ) }
119119}
120120
121+ /** A data-flow node corresponding to an SSA variable. */
121122class EssaNode extends Node , TEssaNode {
122123 EssaVariable var ;
123124
124125 EssaNode ( ) { this = TEssaNode ( var ) }
125126
127+ /** Gets the `EssaVariable` represented by this data-flow node. */
126128 EssaVariable getVar ( ) { result = var }
127129
128130 override EssaVariable asVar ( ) { result = var }
@@ -135,11 +137,13 @@ class EssaNode extends Node, TEssaNode {
135137 override Location getLocation ( ) { result = var .getDefinition ( ) .getLocation ( ) }
136138}
137139
140+ /** A data-flow node corresponding to a control-flow node. */
138141class CfgNode extends Node , TCfgNode {
139142 ControlFlowNode node ;
140143
141144 CfgNode ( ) { this = TCfgNode ( node ) }
142145
146+ /** Gets the `ControlFlowNode` represented by this data-flow node. */
143147 ControlFlowNode getNode ( ) { result = node }
144148
145149 override ControlFlowNode asCfgNode ( ) { result = node }
@@ -352,39 +356,48 @@ class BarrierGuard extends GuardNode {
352356}
353357
354358/**
355- * A reference contained in an object. This is either a field or a property.
359+ * Algebraic datatype for tracking data content associated with values.
360+ * Content can be collection elements or object attributes.
356361 */
357362newtype TContent =
358363 /** An element of a list. */
359364 TListElementContent ( ) or
360365 /** An element of a set. */
361366 TSetElementContent ( ) or
362- /** An element of a tuple at a specifik index. */
367+ /** An element of a tuple at a specific index. */
363368 TTupleElementContent ( int index ) { exists ( any ( TupleNode tn ) .getElement ( index ) ) } or
364369 /** An element of a dictionary under a specific key. */
365370 TDictionaryElementContent ( string key ) {
366371 key = any ( KeyValuePair kvp ) .getKey ( ) .( StrConst ) .getS ( )
367372 or
368373 key = any ( Keyword kw ) .getArg ( )
369374 } or
370- /** An element of a dictionary at any key. */
375+ /** An element of a dictionary under any key. */
371376 TDictionaryElementAnyContent ( ) or
372377 /** An object attribute. */
373378 TAttributeContent ( string attr ) { attr = any ( Attribute a ) .getName ( ) }
374379
380+ /**
381+ * A data-flow value can have associated content.
382+ * If the value is a collection, it can have elements,
383+ * if it is an object, it can have attribute values.
384+ */
375385class Content extends TContent {
376386 /** Gets a textual representation of this element. */
377387 string toString ( ) { result = "Content" }
378388}
379389
390+ /** An element of a list. */
380391class ListElementContent extends TListElementContent , Content {
381392 override string toString ( ) { result = "List element" }
382393}
383394
395+ /** An element of a set. */
384396class SetElementContent extends TSetElementContent , Content {
385397 override string toString ( ) { result = "Set element" }
386398}
387399
400+ /** An element of a tuple at a specific index. */
388401class TupleElementContent extends TTupleElementContent , Content {
389402 int index ;
390403
@@ -396,6 +409,7 @@ class TupleElementContent extends TTupleElementContent, Content {
396409 override string toString ( ) { result = "Tuple element at index " + index .toString ( ) }
397410}
398411
412+ /** An element of a dictionary under a specific key. */
399413class DictionaryElementContent extends TDictionaryElementContent , Content {
400414 string key ;
401415
@@ -407,10 +421,12 @@ class DictionaryElementContent extends TDictionaryElementContent, Content {
407421 override string toString ( ) { result = "Dictionary element at key " + key }
408422}
409423
424+ /** An element of a dictionary under any key. */
410425class DictionaryElementAnyContent extends TDictionaryElementAnyContent , Content {
411426 override string toString ( ) { result = "Any dictionary element" }
412427}
413428
429+ /** An object attribute. */
414430class AttributeContent extends TAttributeContent , Content {
415431 private string attr ;
416432
0 commit comments