• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PySmtAstNode函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PySmtAstNode_AsSmtAstNode函数代码示例发布时间:2022-05-30
下一篇:
C++ PySequence_Size函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap