summaryrefslogtreecommitdiff
path: root/src/expr/expr_template.cpp
diff options
context:
space:
mode:
authorChristopher L. Conway <christopherleeconway@gmail.com>2010-05-31 21:55:40 +0000
committerChristopher L. Conway <christopherleeconway@gmail.com>2010-05-31 21:55:40 +0000
commitcfb3b789e26fdab73e733825950b24492c6c5e4c (patch)
treedec99da95dd6c1dd0def3adaa46d5e7e9e94b4e6 /src/expr/expr_template.cpp
parentaa21ac1746612b646e464615d4eeb07586f4ed36 (diff)
First draft implementation of mkAssociative
Diffstat (limited to 'src/expr/expr_template.cpp')
-rw-r--r--src/expr/expr_template.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/expr/expr_template.cpp b/src/expr/expr_template.cpp
index 5c4e30a0c..edd49f032 100644
--- a/src/expr/expr_template.cpp
+++ b/src/expr/expr_template.cpp
@@ -140,6 +140,13 @@ size_t Expr::getNumChildren() const {
return d_node->getNumChildren();
}
+Expr Expr::getChild(unsigned int i) const {
+ ExprManagerScope ems(*this);
+ Assert(d_node != NULL, "Unexpected NULL expression pointer!");
+ Assert(i >= 0 && i < d_node->getNumChildren(), "Child index out of bounds");
+ return Expr(d_exprManager,new Node((*d_node)[i]));
+}
+
bool Expr::hasOperator() const {
ExprManagerScope ems(*this);
Assert(d_node != NULL, "Unexpected NULL expression pointer!");
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback