1 /************************************************************************
2 ************************************************************************
4 Copyright (C) 2003-2004 GRAME, Centre National de Creation Musicale
5 ---------------------------------------------------------------------
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 ************************************************************************
20 ************************************************************************/
27 /**********************************************************************
28 - ppsig.h : pretty print signals expressions (projet FAUST) -
33 05-07-2006 first implementation (yo)
35 ***********************************************************************/
43 //void fppbox (FILE* fout, Tree box, int priority=0);
45 // box pretty printer.
46 // usage : out << boxpp(aBoxExp);
51 Tree fEnv; ///< recursive environment stack
52 int fPriority; ///< priority context
53 bool fHideRecursion; ///<
55 ppsig(Tree s) : sig(s), fEnv(nil), fPriority(0), fHideRecursion(false) {}
56 ostream& print (ostream& fout) const;
59 ppsig(Tree s, Tree env, int priority=0) : sig(s), fEnv(env), fPriority(priority), fHideRecursion(false) {}
60 ostream& printinfix (ostream& fout, const string& opname, int priority, Tree x, Tree y) const;
61 ostream& printfun (ostream& fout, const string& funame, Tree x) const;
62 ostream& printfun (ostream& fout, const string& funame, Tree x, Tree y) const;
63 ostream& printfun (ostream& fout, const string& funame, Tree x, Tree y, Tree z) const;
64 ostream& printfun (ostream& fout, const string& funame, Tree x, Tree y, Tree z, Tree zz) const;
65 ostream& printfun (ostream& fout, const string& funame, Tree x, Tree y, Tree z, Tree z2, Tree z3) const;
66 ostream& printout (ostream& fout, int i, Tree x) const;
67 ostream& printlist (ostream& fout, Tree largs) const;
68 ostream& printff (ostream& fout, Tree ff, Tree largs) const;
69 ostream& printrec (ostream& fout, Tree var, Tree lexp, bool hide) const;
70 ostream& printrec (ostream& fout, Tree lexp, bool hide) const;
71 ostream& printextended (ostream& fout, Tree sig) const;
72 ostream& printui (ostream& fout, const string& funame, Tree label) const;
73 ostream& printui (ostream& fout, const string& funame, Tree label, Tree lo, Tree hi, Tree step) const;
74 ostream& printui (ostream& fout, const string& funame, Tree label, Tree cur, Tree lo, Tree hi, Tree step) const;
75 ostream& printlabel (ostream& fout, Tree pathname) const;
76 ostream& printFixDelay (ostream& fout, Tree exp, Tree delay) const;
80 inline ostream& operator << (ostream& file, const ppsig& pp) { return pp.print(file); }