8 // predefined visit scheme
11 // Unrecognized signal (default handler)
12 virtual void visitError (Tree sig);
14 virtual ~sigvisitor() {}
16 //---------------abstract methods---------------
18 virtual void visitInt (Tree sig, int i) = 0;
19 virtual void visitReal (Tree sig, double r) = 0;
21 // audio inputs-outputs
22 virtual void visitInput (Tree sig, int i) = 0;
23 virtual void visitOutput (Tree sig, int i, Tree s) = 0;
26 virtual void visitDelay1 (Tree sig, Tree s) = 0;
27 virtual void visitPrefix (Tree sig, Tree s1, Tree s2) = 0;
28 virtual void visitFixDelay (Tree sig, Tree s1, Tree s2) = 0;
30 // numerical operations
31 virtual void visitBinOp (Tree sig, int opcode, Tree s1, Tree s2) = 0;
32 virtual void visitIntCast (Tree sig, Tree s) = 0;
33 virtual void visitFloatCast (Tree sig, Tree s) = 0;
34 virtual void visitFFun (Tree sig, Tree ff, Tree ls) = 0;
35 virtual void visitFConst (Tree sig, Tree type, Tree name, Tree file) = 0;
36 virtual void visitFVar (Tree sig, Tree type, Tree name, Tree file) = 0;
39 virtual void visitButton (Tree sig, Tree label) = 0;
40 virtual void visitCheckbox (Tree sig, Tree label) = 0;
41 virtual void visitVSlider (Tree sig, Tree label, Tree cur, Tree min, Tree max, Tree step) = 0;
42 virtual void visitHSlider (Tree sig, Tree label, Tree cur, Tree min, Tree max, Tree step) = 0;
43 virtual void visitNumEntry (Tree sig, Tree label, Tree cur, Tree min, Tree max, Tree step) = 0;
44 virtual void visitVBargraph (Tree sig, Tree label, Tree min, Tree max, Tree s1) = 0;
45 virtual void visitHBargraph (Tree sig, Tree label, Tree min, Tree max, Tree s1) = 0;
46 virtual void visitAttach (Tree sig, Tree s1, Tree s2) = 0;
49 virtual void visitRec (Tree sig, Tree var, Tree body) = 0;
50 virtual void visitRef (Tree sig, Tree var) = 0;
51 virtual void visitProj (Tree sig, int i, Tree s1) = 0;
54 virtual void visitTable (Tree sig, Tree id, Tree s1, Tree s2) = 0;
55 virtual void visitWRTbl (Tree sig, Tree id, Tree s1, Tree s2, Tree s3) = 0;
56 virtual void visitRDTbl (Tree sig, Tree s1, Tree s2) = 0;
57 virtual void visitGen (Tree sig, Tree s1) = 0;
59 virtual void visitDocConstantTbl (Tree sig, Tree s1, Tree s2) = 0;
60 virtual void visitDocWriteTbl (Tree sig, Tree s1, Tree s2, Tree s3, Tree s4) = 0;
61 virtual void visitDocAccessTbl (Tree sig, Tree s1, Tree s2) = 0;
64 virtual void visitSelect2 (Tree sig, Tree sel, Tree s1, Tree s2) = 0;
65 virtual void visitSelect3 (Tree sig, Tree sel, Tree s1, Tree s2, Tree s3) = 0;
68 virtual void visitTuple (Tree sig, int mod, Tree ls) = 0;
69 virtual void visitTupleAccess (Tree sig, Tree ts, Tree idx) = 0;
72 virtual void visitList (Tree lsig) = 0;
75 struct fullvisitor : sigvisitor
78 virtual void visitInt (Tree sig, int i) {}
79 virtual void visitReal (Tree sig, double r) {}
81 // audio inputs-outputs
82 virtual void visitInput (Tree sig, int i) {}
83 virtual void visitOutput (Tree sig, int i, Tree s) { visit(s);}
86 virtual void visitDelay1 (Tree sig, Tree s) { visit(s);}
87 virtual void visitPrefix (Tree sig, Tree s1, Tree s2) { visit(s1); visit(s2); }
88 virtual void visitFixDelay (Tree sig, Tree s1, Tree s2) { visit(s1); visit(s2); }
90 // numerical operations
91 virtual void visitIntCast (Tree sig, Tree s) { visit(s);}
92 virtual void visitFloatCast (Tree sig, Tree s) { visit(s);}
93 virtual void visitBinOp (Tree sig, int op, Tree s1, Tree s2) { visit(s1); visit(s2); }
94 virtual void visitFFun (Tree sig, Tree ff, Tree ls) { visit(ls); }
95 virtual void visitFConst (Tree sig, Tree type, Tree name, Tree file) {}
96 virtual void visitFVar (Tree sig, Tree type, Tree name, Tree file) {}
99 virtual void visitButton (Tree sig, Tree label) {}
100 virtual void visitCheckbox (Tree sig, Tree label) {}
101 virtual void visitVSlider (Tree sig, Tree label, Tree cur, Tree min, Tree max, Tree step) {}
102 virtual void visitHSlider (Tree sig, Tree label, Tree cur, Tree min, Tree max, Tree step) {}
103 virtual void visitNumEntry (Tree sig, Tree label, Tree cur, Tree min, Tree max, Tree step) {}
104 virtual void visitVBargraph (Tree sig, Tree label, Tree min, Tree max, Tree s) { visit(s);}
105 virtual void visitHBargraph (Tree sig, Tree label, Tree min, Tree max, Tree s) { visit(s);}
106 virtual void visitAttach (Tree sig, Tree s1, Tree s2) { visit(s1); visit(s2); }
109 virtual void visitRec (Tree sig, Tree var, Tree body) { visit(body); }
110 virtual void visitRef (Tree sig, Tree var) { }
111 virtual void visitProj (Tree sig, int i, Tree s) { visit(s); }
114 virtual void visitTable (Tree sig, Tree id, Tree s1, Tree s2) { visit(s1); visit(s2); }
115 virtual void visitWRTbl (Tree sig, Tree id, Tree s1, Tree s2, Tree s3) { visit(s1); visit(s2); visit(s3); }
116 virtual void visitRDTbl (Tree sig, Tree s1, Tree s2) { visit(s1); visit(s2); }
117 virtual void visitGen (Tree sig, Tree s1) { visit(s1); }
120 virtual void visitSelect2 (Tree sig, Tree sel, Tree s1, Tree s2) { visit(sel); visit(s1); visit(s2); }
121 virtual void visitSelect3 (Tree sig, Tree sel, Tree s1, Tree s2, Tree s3) { visit(sel); visit(s1); visit(s2); visit(s3); }
124 virtual void visitTuple (Tree sig, int mod, Tree ls) { visit(ls); }
125 virtual void visitTupleAccess (Tree sig, Tree ts, Tree idx) { visit(ts); visit(idx); }
128 virtual void visitList (Tree lsig) { while (!isNil(lsig)) { visit(hd(lsig)); lsig=tl(lsig); }}