add getLeft/getRight helper predicates to disjunction/conjunction

This commit is contained in:
Erik Krogh Kristensen
2021-11-18 12:10:31 +01:00
parent 9d308ba0bd
commit 84d277dc94

View File

@@ -1125,9 +1125,15 @@ class Conjunction extends TConjunction, AstNode, Formula {
override string getAPrimaryQlClass() { result = "Conjunction" }
/** Gets an operand to this formula. */
/** Gets an operand to this conjunction. */
Formula getAnOperand() { toQL(result) in [conj.getLeft(), conj.getRight()] }
/** Gets the left operand to this conjunction. */
Formula getLeft() { toQL(result) = conj.getLeft() }
/** Gets the right operand to this conjunction. */
Formula getRight() { toQL(result) = conj.getRight() }
override AstNode getAChild(string pred) {
result = super.getAChild(pred)
or
@@ -1143,9 +1149,15 @@ class Disjunction extends TDisjunction, AstNode, Formula {
override string getAPrimaryQlClass() { result = "Disjunction" }
/** Gets an operand to this formula. */
/** Gets an operand to this disjunction. */
Formula getAnOperand() { toQL(result) in [disj.getLeft(), disj.getRight()] }
/** Gets the left operand to this disjunction */
Formula getLeft() { toQL(result) = disj.getLeft() }
/** Gets the right operand to this disjunction */
Formula getRight() { toQL(result) = disj.getRight() }
override AstNode getAChild(string pred) {
result = super.getAChild(pred)
or