FAUST compiler  0.9.9.6b8
Functions
occurences.cpp File Reference
#include <assert.h>
#include <stdlib.h>
#include "recursivness.hh"
#include "occurences.hh"
#include "sigtype.hh"
#include "sigtyperules.hh"
#include <iostream>
Include dependency graph for occurences.cpp:

Go to the source code of this file.

Functions

static int xVariability (int v, int r)
 Extended Variability with recursiveness indication.
static int position (Tree env, Tree t, int p)
 return the position of a signal in the current recursive environment

Function Documentation

static int position ( Tree  env,
Tree  t,
int  p 
) [static]

return the position of a signal in the current recursive environment

Parameters:
envthe current recursive environment of the signal
tsignal we want to know the position
Returns:
the position in the recursive environment

Definition at line 168 of file occurences.cpp.

References hd(), isNil(), and tl().

{
    if (isNil(env)) return 0;   // was not in the environment
    if (hd(env) == t) return p;
    else return position (tl(env), t, p+1);
}

Here is the call graph for this function:

static int xVariability ( int  v,
int  r 
) [static]

Extended Variability with recursiveness indication.

Definition at line 14 of file occurences.cpp.

References min().

Referenced by Occurences::incOccurences().

{
    //cerr << "xVariability (" << v << ", " <<  r << ")" << endl;
    //assert (v < 3);               // kKonst=0, kBlock=1, kSamp=2
    //assert(r==0 | v==2);
    if (r>1) r=1;
    return min(3, v + r);
}

Here is the call graph for this function:

Here is the caller graph for this function: