@@ -401,6 +401,10 @@ e.g: `(= expr1 epxr2)`.
401
401
Creates an `extract` node. The `high` and `low` fields represent the bits position.<br>
402
402
e.g: `((_ extract high low) expr1)`.
403
403
404
+ - <b>\ref py_AstNode_page iff(\ref py_AstNode_page expr1, \ref py_AstNode_page expr2)</b><br>
405
+ Creates an `iff` node (if and only if).<br>
406
+ e.g: `(iff expr1 expr2)`.
407
+
404
408
- <b>\ref py_AstNode_page ite(\ref py_AstNode_page ifExpr, \ref py_AstNode_page thenExpr, \ref py_AstNode_page elseExpr)</b><br>
405
409
Creates an `ite` node (if-then-else node).<br>
406
410
e.g: `(ite ifExpr thenExpr elseExpr)`.
@@ -1268,6 +1272,28 @@ namespace triton {
1268
1272
}
1269
1273
1270
1274
1275
+ static PyObject* AstContext_iff (PyObject* self, PyObject* args) {
1276
+ PyObject* op1 = nullptr ;
1277
+ PyObject* op2 = nullptr ;
1278
+
1279
+ /* Extract arguments */
1280
+ PyArg_ParseTuple (args, " |OO" , &op1, &op2);
1281
+
1282
+ if (op1 == nullptr || !PyAstNode_Check (op1))
1283
+ return PyErr_Format (PyExc_TypeError, " iff(): expected a AstNode as first argument" );
1284
+
1285
+ if (op2 == nullptr || !PyAstNode_Check (op2))
1286
+ return PyErr_Format (PyExc_TypeError, " iff(): expected a AstNode as second argument" );
1287
+
1288
+ try {
1289
+ return PyAstNode (PyAstContext_AsAstContext (self)->iff (PyAstNode_AsAstNode (op1), PyAstNode_AsAstNode (op2)));
1290
+ }
1291
+ catch (const triton::exceptions::Exception& e) {
1292
+ return PyErr_Format (PyExc_TypeError, " %s" , e.what ());
1293
+ }
1294
+ }
1295
+
1296
+
1271
1297
static PyObject* AstContext_ite (PyObject* self, PyObject* args) {
1272
1298
PyObject* op1 = nullptr ;
1273
1299
PyObject* op2 = nullptr ;
@@ -1508,6 +1534,7 @@ namespace triton {
1508
1534
{" duplicate" , AstContext_duplicate, METH_O, " " },
1509
1535
{" equal" , AstContext_equal, METH_VARARGS, " " },
1510
1536
{" extract" , AstContext_extract, METH_VARARGS, " " },
1537
+ {" iff" , AstContext_iff, METH_VARARGS, " " },
1511
1538
{" ite" , AstContext_ite, METH_VARARGS, " " },
1512
1539
{" land" , AstContext_land, METH_O, " " },
1513
1540
{" let" , AstContext_let, METH_VARARGS, " " },
0 commit comments