File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
swift/ql/lib/codeql/swift/elements/expr Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,32 @@ private import codeql.swift.generated.expr.BinaryExpr
22private import codeql.swift.elements.expr.Expr
33private import codeql.swift.elements.decl.AbstractFunctionDecl
44
5+ /**
6+ * A Swift binary expression, that is, an expression that appears between its
7+ * two operands. For example:
8+ * ```
9+ * x + y
10+ * ```
11+ */
512class BinaryExpr extends Generated:: BinaryExpr {
13+ /**
14+ * Gets the left operand (left expression) of this binary expression.
15+ */
616 Expr getLeftOperand ( ) { result = this .getArgument ( 0 ) .getExpr ( ) }
717
18+ /**
19+ * Gets the right operand (right expression) of this binary expression.
20+ */
821 Expr getRightOperand ( ) { result = this .getArgument ( 1 ) .getExpr ( ) }
922
23+ /**
24+ * Gets the operator of this binary expression (the function that is called).
25+ */
1026 AbstractFunctionDecl getOperator ( ) { result = this .getStaticTarget ( ) }
1127
28+ /**
29+ * Gets an operand of this binary expression (left or right).
30+ */
1231 Expr getAnOperand ( ) { result = [ this .getLeftOperand ( ) , this .getRightOperand ( ) ] }
1332
1433 override string toString ( ) { result = "... " + this .getFunction ( ) .toString ( ) + " ..." }
You can’t perform that action at this time.
0 commit comments