1111 */
1212import cpp
1313
14+ /**
15+ * Gets a string describing the kind of a `Class`.
16+ */
1417string kindstr ( Class c )
1518{
1619 exists ( int kind | usertypes ( unresolveElement ( c ) , _, kind ) |
@@ -20,13 +23,20 @@ string kindstr(Class c)
2023 )
2124}
2225
26+ /**
27+ * Holds if the arguments correspond to information about a `VariableDeclarationEntry`.
28+ */
2329predicate vdeInfo ( VariableDeclarationEntry vde , Class c , File f , int line )
2430{
2531 c = vde .getVariable ( ) .getDeclaringType ( ) and
2632 f = vde .getLocation ( ) .getFile ( ) and
2733 line = vde .getLocation ( ) .getStartLine ( )
2834}
2935
36+ /**
37+ * Holds if `previous` describes a `VariableDeclarationEntry` occurring soon before
38+ * `vde` (this may have many results).
39+ */
3040predicate previousVde ( VariableDeclarationEntry previous , VariableDeclarationEntry vde )
3141{
3242 exists ( Class c , File f , int line | vdeInfo ( vde , c , f , line ) |
@@ -40,12 +50,19 @@ predicate previousVde(VariableDeclarationEntry previous, VariableDeclarationEntr
4050 )
4151}
4252
53+ /**
54+ * The first `VariableDeclarationEntry` in a group.
55+ */
4356predicate masterVde ( VariableDeclarationEntry master , VariableDeclarationEntry vde )
4457{
4558 ( not previousVde ( _, vde ) and master = vde ) or
4659 exists ( VariableDeclarationEntry previous | previousVde ( previous , vde ) and masterVde ( master , previous ) )
4760}
4861
62+ /**
63+ * A group of `VariableDeclaratinEntry`'s in the same class and in close proximity
64+ * to each other.
65+ */
4966class VariableDeclarationGroup extends ElementBase {
5067 VariableDeclarationGroup ( ) {
5168 this instanceof VariableDeclarationEntry and
0 commit comments