FAUST compiler  0.9.9.6b8
occurences.hh
Go to the documentation of this file.
1 #ifndef __OCCURENCES__
2 #define __OCCURENCES__
3 
4 #include "tlib.hh"
5 
6 
7 class Occurences
8 {
9  const int fXVariability;
10  int fOccurences[4];
11  bool fMultiOcc;
12  bool fOutDelayOcc;
13  int fMinDelay;
14  int fMaxDelay;
15 
16  public:
17  Occurences(int v, int r);
18 
19  Occurences* incOccurences(int v, int r, int d);
20 
21  bool hasMultiOccurences() const;
22  bool hasOutDelayOccurences() const;
23  int getMaxDelay() const;
24  int getMinDelay() const;
25 };
26 
27 
32 class OccMarkup
33 {
36 
37  void incOcc (Tree env, int v, int r, int d, Tree t);
38  Occurences* getOcc (Tree t);
39  void setOcc (Tree t, Occurences* occ);
40 
41  public:
42  void mark(Tree root);
44 };
45 
46 
47 
48 #endif
void incOcc(Tree env, int v, int r, int d, Tree t)
inc the occurence of t in context v,r
Definition: occurences.cpp:95
Occurences(int v, int r)
Definition: occurences.cpp:27
bool hasOutDelayOccurences() const
true if has occurences outside a a delay
Definition: occurences.cpp:52
Tree fRootTree
occurences computed within this tree
Definition: occurences.hh:34
int getMinDelay() const
return the minimal delay collected
Tree fPropKey
key used to store occurences property
Definition: occurences.hh:35
void mark(Tree root)
start markup of root tree with new unique key
Definition: occurences.cpp:63
const int fXVariability
Extended Variability of the expression.
Definition: occurences.hh:9
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
int fOccurences[4]
Occurences count according to Contexts.
Definition: occurences.hh:10
Occurences * retrieve(Tree t)
occurences of subtree t within root tree
Definition: occurences.cpp:81
bool hasMultiOccurences() const
true if multiple occurences or occ. in higher ctxt
Definition: occurences.cpp:50
void setOcc(Tree t, Occurences *occ)
set Occurences property of t
Definition: occurences.cpp:155
bool fMultiOcc
True when exp has multiple occ. or occ. in higher ctxt.
Definition: occurences.hh:11
int fMinDelay
Minimal fix delay usage.
Definition: occurences.hh:13
Occurences Markup of a root tree.
Definition: occurences.hh:32
Occurences * incOccurences(int v, int r, int d)
inc occurences in context v,r,d
Definition: occurences.cpp:34
Occurences * getOcc(Tree t)
get Occurences property of t or null
Definition: occurences.cpp:144
int getMaxDelay() const
return the maximal delay collected
Definition: occurences.cpp:54
int fMaxDelay
Maximal fix delay usage.
Definition: occurences.hh:14
bool fOutDelayOcc
True when exp has at least one occ. outside a delay.
Definition: occurences.hh:12