当前位置: 首页>>代码示例>>C++>>正文


C++ PySmtAstNode函数代码示例

本文整理汇总了C++中PySmtAstNode函数的典型用法代码示例。如果您正苦于以下问题:C++ PySmtAstNode函数的具体用法?C++ PySmtAstNode怎么用?C++ PySmtAstNode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PySmtAstNode函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PySmtAstNode_AsSmtAstNode

static PyObject *SmtAstNode_getChilds(PyObject *self, PyObject *noarg) {
  PyObject *childs;
  smt2lib::smtAstAbstractNode *node = PySmtAstNode_AsSmtAstNode(self);

  uint64 size = node->getChilds().size();
  childs = xPyList_New(size);
  uint64 index = 0;
  for ( ; index < size; index++)
    PyList_SetItem(childs, index, PySmtAstNode(node->getChilds()[index]));

  return childs;
}
开发者ID:v0re,项目名称:Triton,代码行数:12,代码来源:PySmtAstNode.cpp

示例2: PyErr_Format

static PyObject *Triton_getFullExpression(PyObject *self, PyObject *node)
{
  smt2lib::smtAstAbstractNode *fullExpr;

  if (!PySmtAstNode_Check(node))
    return PyErr_Format(PyExc_TypeError, "getFullSymExpr(): expected an SmtAstNode node as argument");

  fullExpr = ap.getFullExpression(PySmtAstNode_AsSmtAstNode(node));
  if (fullExpr == nullptr)
    return Py_None;

  return PySmtAstNode(fullExpr);
}
开发者ID:sigma-random,项目名称:Triton,代码行数:13,代码来源:tritonCallbacks.cpp

示例3: PyArg_ParseTuple

static PyObject *smt2lib_bvlshr(PyObject *self, PyObject *args) {
  PyObject *op1 = nullptr;
  PyObject *op2 = nullptr;

  /* Extract arguments */
  PyArg_ParseTuple(args, "O|O", &op1, &op2);

  if (op1 == nullptr || !PySmtAstNode_Check(op1))
    return PyErr_Format(PyExc_TypeError, "bvlshr(): expected a SmtAstNode as first argument");

  if (op2 == nullptr || !PySmtAstNode_Check(op2))
    return PyErr_Format(PyExc_TypeError, "bvlshr(): expected a SmtAstNode as second argument");

  return PySmtAstNode(smt2lib::bvlshr(PySmtAstNode_AsSmtAstNode(op1), PySmtAstNode_AsSmtAstNode(op2)));
}
开发者ID:v0re,项目名称:Triton,代码行数:15,代码来源:smt2libCallbacks.cpp

示例4: PyArg_ParseTuple

static PyObject *smt2lib_bv(PyObject *self, PyObject *args) {
  PyObject *op1 = nullptr;
  PyObject *op2 = nullptr;

  /* Extract arguments */
  PyArg_ParseTuple(args, "|OO", &op1, &op2);

  if (op1 == nullptr || (!PyLong_Check(op1) && !PyInt_Check(op1)))
    return PyErr_Format(PyExc_TypeError, "bv(): expected an integer as first argument");

  if (op2 == nullptr || (!PyLong_Check(op2) && !PyInt_Check(op2)))
    return PyErr_Format(PyExc_TypeError, "bv(): expected an integer as second argument");

  return PySmtAstNode(smt2lib::bv(PyLongObjectToUint128(op1), PyLong_AsLongLong(op2)));
}
开发者ID:shenyanjun,项目名称:Triton,代码行数:15,代码来源:smt2libCallbacks.cpp

示例5: PyErr_Format

static PyObject *smt2lib_compound(PyObject *self, PyObject *exprsList) {
  std::vector<smt2lib::smtAstAbstractNode *> exprs;

  if (exprsList == nullptr || !PyList_Check(exprsList))
    return PyErr_Format(PyExc_TypeError, "compound(): expected a list of SmtAstNodes as first argument");

  /* Check if the mems list contains only integer item and craft a std::list */
  for (Py_ssize_t i = 0; i < PyList_Size(exprsList); i++){
    PyObject *item = PyList_GetItem(exprsList, i);

    if (!PySmtAstNode_Check(item))
      return PyErr_Format(PyExc_TypeError, "compound(): Each element from the list must be a SmtAstNode");

    exprs.push_back(PySmtAstNode_AsSmtAstNode(item));
  }

  return PySmtAstNode(smt2lib::compound(exprs));
}
开发者ID:v0re,项目名称:Triton,代码行数:18,代码来源:smt2libCallbacks.cpp

示例6: PyArg_ParseTuple

static PyObject *smt2lib_extract(PyObject *self, PyObject *args) {
  PyObject *op1 = nullptr;
  PyObject *op2 = nullptr;
  PyObject *op3 = nullptr;

  /* Extract arguments */
  PyArg_ParseTuple(args, "|OOO", &op1, &op2, &op3);

  if (op1 == nullptr || (!PyLong_Check(op1) && !PyInt_Check(op1)))
    return PyErr_Format(PyExc_TypeError, "extract(): expected an integer as first argument");

  if (op2 == nullptr || (!PyLong_Check(op2) && !PyInt_Check(op2)))
    return PyErr_Format(PyExc_TypeError, "extract(): expected an integer as second argument");

  if (op3 == nullptr || !PySmtAstNode_Check(op3))
    return PyErr_Format(PyExc_TypeError, "extract(): expected a SmtAstNode as third argument");

  return PySmtAstNode(smt2lib::extract(PyLong_AsUint(op1), PyLong_AsUint(op2), PySmtAstNode_AsSmtAstNode(op3)));
}
开发者ID:YHVHvx,项目名称:Triton,代码行数:19,代码来源:smt2libCallbacks.cpp

示例7: PySymbolicExpression_AsSymbolicExpression

static PyObject *SymbolicExpression_getNewAst(PyObject *self, PyObject *noarg) {
  SymbolicExpression *expression = PySymbolicExpression_AsSymbolicExpression(self);
  return PySmtAstNode(smt2lib::newInstance(expression->getExpression()));
}
开发者ID:shenyanjun,项目名称:Triton,代码行数:4,代码来源:PySymbolicExpression.cpp

示例8: PySmtAstNode

static PyObject *smt2lib_bvfalse(PyObject *self, PyObject *args) {
  return PySmtAstNode(smt2lib::bvfalse());
}
开发者ID:v0re,项目名称:Triton,代码行数:3,代码来源:smt2libCallbacks.cpp


注:本文中的PySmtAstNode函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。