summaryrefslogtreecommitdiff
path: root/src/printer
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2016-09-30 13:25:57 -0600
committerTuowen Zhao <ztuowen@gmail.com>2016-09-30 13:25:57 -0600
commit87e7538503756d036fec4c2b18a9c19d126626a4 (patch)
tree9a3832c1dda7c785905cbcc619bacfbd07d8bf2a /src/printer
parentf00e425e1d6ee51027e6ba66d0a82355fd788f9e (diff)
downloadchill-87e7538503756d036fec4c2b18a9c19d126626a4.tar.gz
chill-87e7538503756d036fec4c2b18a9c19d126626a4.tar.bz2
chill-87e7538503756d036fec4c2b18a9c19d126626a4.zip
Binary Ternary
Diffstat (limited to 'src/printer')
-rw-r--r--src/printer/cfamily.cpp10
-rw-r--r--src/printer/dump.cpp10
2 files changed, 10 insertions, 10 deletions
diff --git a/src/printer/cfamily.cpp b/src/printer/cfamily.cpp
index 299c81c..8aa6e62 100644
--- a/src/printer/cfamily.cpp
+++ b/src/printer/cfamily.cpp
@@ -56,10 +56,10 @@ int CFamily::getPrecS(chillAST_BinaryOperator *n) {
void CFamily::printS(std::string ident, chillAST_BinaryOperator *n, std::ostream &o) {
int prec = getPrec(n);
- if (n->lhs) printPrec(ident, n->lhs, o, prec);
+ if (n->getLHS()) printPrec(ident, n->getLHS(), o, prec);
else o << "(NULL)";
o << " " << n->op << " ";
- if (n->rhs) printPrec(ident, n->rhs, o, prec);
+ if (n->getRHS()) printPrec(ident, n->getRHS(), o, prec);
else o << "(NULL)";
}
@@ -347,11 +347,11 @@ int CFamily::getPrecS(chillAST_TernaryOperator *n) {
void CFamily::printS(std::string ident, chillAST_TernaryOperator *n, std::ostream &o) {
int prec = getPrec(n);
- printPrec(ident, n->condition, o, prec);
+ printPrec(ident, n->getCond(), o, prec);
o << "" << n->op << "";
- printPrec(ident, n->lhs, o, prec);
+ printPrec(ident, n->getLHS(), o, prec);
o << ":";
- printPrec(ident, n->rhs, o, prec);
+ printPrec(ident, n->getRHS(), o, prec);
}
const char *unaryPrec[] = {
diff --git a/src/printer/dump.cpp b/src/printer/dump.cpp
index c7abc63..066a2fe 100644
--- a/src/printer/dump.cpp
+++ b/src/printer/dump.cpp
@@ -63,9 +63,9 @@ void Dump::printS(std::string ident, chillAST_ArraySubscriptExpr *n, std::ostrea
void Dump::printS(std::string ident, chillAST_BinaryOperator *n, std::ostream &o) {
o << n->op << " ";
- if (n->lhs) print(ident, n->lhs, o);
+ if (n->getLHS()) print(ident, n->getLHS(), o);
else o << "(NULL) ";
- if (n->rhs) print(ident, n->rhs, o);
+ if (n->getRHS()) print(ident, n->getRHS(), o);
else o << "(NULL) ";
}
@@ -209,9 +209,9 @@ void Dump::printS(std::string ident, chillAST_TypedefDecl *n, std::ostream &o) {
void Dump::printS(std::string ident, chillAST_TernaryOperator *n, std::ostream &o) {
o << n->op << " ";
- print(ident, n->condition, o);
- print(ident, n->lhs, o);
- print(ident, n->rhs, o);
+ print(ident, n->getCond(), o);
+ print(ident, n->getLHS(), o);
+ print(ident, n->getRHS(), o);
}
void Dump::printS(std::string ident, chillAST_UnaryOperator *n, std::ostream &o) {