From f4474891acec5918f94bc126fed8eb9bb2792912 Mon Sep 17 00:00:00 2001 From: Tuowen Zhao <ztuowen@gmail.com> Date: Mon, 26 Sep 2016 10:06:01 -0600 Subject: set printS getPrecS to protected --- include/printer/cfamily.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'include/printer/cfamily.h') diff --git a/include/printer/cfamily.h b/include/printer/cfamily.h index 83e7765..0426ded 100644 --- a/include/printer/cfamily.h +++ b/include/printer/cfamily.h @@ -7,23 +7,19 @@ #include "printer/generic.h" -/*! - * \file - */ - namespace chill { namespace printer { /*! - * \brief Print the AST for C like syntax, This replace the old print function + * \brief Print the AST in a C-like syntax. + * + * This replace the old print function. * Custom multiplexer should not be needed. This version should calculate the correct precedence for expressions. * Expression should be encapsulated in {} or () or ended with ; with heuristics at the parent node * * All precedence calculation taken from http://en.cppreference.com/w/cpp/language/operator_precedence */ class CFamily : public GenericPrinter { - public: - CFamily() {} - + protected: virtual int getPrecS(chillAST_BinaryOperator *n); virtual int getPrecS(chillAST_CallExpr *n); @@ -109,6 +105,8 @@ namespace chill { virtual void printS(std::string ident, chillAST_UnaryOperator *n, std::ostream &o); virtual void printS(std::string ident, chillAST_VarDecl *n, std::ostream &o); + public: + CFamily() {} }; } } -- cgit v1.2.3-70-g09d2