@@ -2,48 +2,13 @@ private import codeql.actions.ast.internal.Actions
2
2
private import codeql.Locations
3
3
4
4
/**
5
- * Base class for the AST tree.
6
- * Based on YamlNode from the Yaml library but making mapping values children of the mapping keys:
7
- * eg: top:
8
- * key: value
9
- * According to the Yaml library, both `key` and `value` are direct children of `top`
10
- * This Tree implementation makes `key` child od `top` and `value` child of `key`
5
+ * Base class for the AST tree. Based on YamlNode from the Yaml library.
11
6
*/
12
7
class AstNode instanceof YamlNode {
13
8
AstNode getParentNode ( ) { result = super .getParentNode ( ) }
14
9
15
- // AstNode getParentNode() {
16
- // if exists(YamlMapping m | m.maps(_, this))
17
- // then exists(YamlMapping m | m.maps(result, this))
18
- // else result = super.getParentNode()
19
- // }
20
10
AstNode getAChildNode ( ) { result = super .getAChildNode ( ) }
21
11
22
- // AstNode getAChildNode() {
23
- // if this instanceof YamlMapping
24
- // then this.(YamlMapping).maps(result, _)
25
- // else
26
- // if this instanceof YamlCollection
27
- // then result = super.getChildNode(_)
28
- // else
29
- // if this instanceof YamlScalar and exists(YamlMapping m | m.maps(this, _))
30
- // then exists(YamlMapping m | m.maps(this, result))
31
- // else none()
32
- // }
33
- // /**
34
- // * This should be getAChildNode(int i)
35
- // */
36
- // AstNode getChildNodeByOrder(int i) {
37
- // result =
38
- // rank[i](Expression child, Location l |
39
- // child = this.getAChildNode() and
40
- // child.getLocation() = l
41
- // |
42
- // child
43
- // order by
44
- // l.getStartLine(), l.getStartColumn(), l.getEndColumn(), l.getEndLine(), child.toString()
45
- // )
46
- // }
47
12
string toString ( ) { result = super .toString ( ) }
48
13
49
14
string getAPrimaryQlClass ( ) { result = super .getAPrimaryQlClass ( ) }
0 commit comments