std::string FunctionCall::ToString( const PrintingContext& pctx ) const { std::string tabs = pctx.Tabs(); std::string str; if( !pctx.inlineWriting ) str += tabs; str += myCalledFunction->GetName() + "( "; if( mySubOps.size() > 0 ) { for( size_t i = 0; i < mySubOps.size()-1; i++ ) str += mySubOps[i]->ToString( pctx.InlineWriting() ) + ", "; str += mySubOps[ mySubOps.size() - 1 ]->ToString( pctx.InlineWriting() ); } str += " )"; if( !pctx.inlineWriting ) str += ";\n"; return str; }
std::string Substraction::ToString(const PrintingContext& pctx) const { return "(" + mySubOps[0]->ToString(pctx.InlineWriting()) + "-" + mySubOps[1]->ToString(pctx.InlineWriting()) + ")"; }
std::string Power::ToString(const PrintingContext& pctx) const { return "(" + mySubOps[0]->ToString(pctx.InlineWriting()) + "^" + mySubOps[1]->ToString(pctx.InlineWriting()) + ")"; }