FAUST compiler  0.9.9.6b8
Functions | Variables
prim2.cpp File Reference
#include "prim2.hh"
#include "stdlib.h"
Include dependency graph for prim2.cpp:

Go to the source code of this file.

Functions

Tree ffunction (Tree signature, Tree incfile, Tree libfile)
 
bool isffunction (Tree t)
 
Tree ffsignature (Tree ff)
 
const char * ffincfile (Tree ff)
 
const char * fflibfile (Tree ff)
 
int ffrestype (Tree t)
 
const char * ffname (Tree t)
 
int ffarity (Tree t)
 
int ffargtype (Tree t, int i)
 

Variables

int gFloatSize
 
Sym FFUN = symbol ("ForeignFunction")
 

Function Documentation

int ffargtype ( Tree  t,
int  i 
)

Definition at line 72 of file prim2.cpp.

References ffsignature(), nth(), and tree2int().

Referenced by boxpp::print().

73 {
74  return tree2int(nth(ffsignature(t), i+2));
75 }
int tree2int(Tree t)
if t has a node of type int, return it otherwise error
Definition: tree.cpp:230
Tree ffsignature(Tree ff)
Definition: prim2.cpp:40
Tree nth(Tree l, int i)
Definition: list.cpp:182

Here is the call graph for this function:

Here is the caller graph for this function:

int ffarity ( Tree  t)

Definition at line 67 of file prim2.cpp.

References ffsignature(), and len().

Referenced by ScalarCompiler::generateFFun(), DocCompiler::generateFFun(), generateInsideSchema(), infereBoxType(), infereFFType(), boxpp::print(), and realPropagate().

68 {
69  return len(ffsignature(t))-2;
70 }
Tree ffsignature(Tree ff)
Definition: prim2.cpp:40
int len(Tree l)
Definition: list.cpp:198

Here is the call graph for this function:

Here is the caller graph for this function:

const char* ffincfile ( Tree  ff)

Definition at line 45 of file prim2.cpp.

References CTree::branch(), and tree2str().

Referenced by ScalarCompiler::generateFFun(), and boxpp::print().

46 {
47  return tree2str(ff->branch(1));
48 }
const char * tree2str(Tree t)
if t has a node of type symbol, return its name otherwise error
Definition: tree.cpp:278
Tree branch(int i) const
return the ith branch (subtree) of a tree
Definition: tree.hh:145

Here is the call graph for this function:

Here is the caller graph for this function:

const char* fflibfile ( Tree  ff)

Definition at line 50 of file prim2.cpp.

References CTree::branch(), and tree2str().

Referenced by ScalarCompiler::generateFFun(), and boxpp::print().

51 {
52  return tree2str(ff->branch(2));
53 }
const char * tree2str(Tree t)
if t has a node of type symbol, return its name otherwise error
Definition: tree.cpp:278
Tree branch(int i) const
return the ith branch (subtree) of a tree
Definition: tree.hh:145

Here is the call graph for this function:

Here is the caller graph for this function:

const char* ffname ( Tree  t)

Definition at line 60 of file prim2.cpp.

References ffsignature(), gFloatSize, nth(), and tree2str().

Referenced by ScalarCompiler::generateFFun(), DocCompiler::generateFFun(), generateInsideSchema(), and ppsig::printff().

61 {
62  Tree namelist = nth(ffsignature(t),1);
63  //cerr << "ffname " << tree2str(nth(namelist,gFloatSize-1)) << endl;
64  return tree2str(nth(namelist,gFloatSize-1));
65 }
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
Tree ffsignature(Tree ff)
Definition: prim2.cpp:40
int gFloatSize
Definition: main.cpp:153
const char * tree2str(Tree t)
if t has a node of type symbol, return its name otherwise error
Definition: tree.cpp:278
Tree nth(Tree l, int i)
Definition: list.cpp:182

Here is the call graph for this function:

Here is the caller graph for this function:

int ffrestype ( Tree  t)

Definition at line 55 of file prim2.cpp.

References ffsignature(), hd(), and tree2int().

Referenced by infereFFType(), and boxpp::print().

56 {
57  return tree2int(hd(ffsignature(t)));
58 }
int tree2int(Tree t)
if t has a node of type int, return it otherwise error
Definition: tree.cpp:230
Tree hd(Tree l)
Definition: list.hh:133
Tree ffsignature(Tree ff)
Definition: prim2.cpp:40

Here is the call graph for this function:

Here is the caller graph for this function:

Tree ffsignature ( Tree  ff)

Definition at line 40 of file prim2.cpp.

References CTree::branch().

Referenced by ffargtype(), ffarity(), ffname(), ffrestype(), and boxpp::print().

41 {
42  return ff->branch(0);
43 }
Tree branch(int i) const
return the ith branch (subtree) of a tree
Definition: tree.hh:145

Here is the call graph for this function:

Here is the caller graph for this function:

Tree ffunction ( Tree  signature,
Tree  incfile,
Tree  libfile 
)

Definition at line 30 of file prim2.cpp.

References tree().

Referenced by yyparse().

31 {
32  return tree(FFUN, signature, incfile, libfile);
33 }
Sym FFUN
Definition: prim2.cpp:28
Tree tree(const Node &n)
Definition: tree.hh:186

Here is the call graph for this function:

Here is the caller graph for this function:

bool isffunction ( Tree  t)

Definition at line 35 of file prim2.cpp.

References CTree::node().

36 {
37  return t->node() == Node(FFUN);
38 }
Sym FFUN
Definition: prim2.cpp:28
Class Node = (type x (int + double + Sym + void*))
Definition: node.hh:75
const Node & node() const
return the content of the tree
Definition: tree.hh:143

Here is the call graph for this function:

Variable Documentation

Sym FFUN = symbol ("ForeignFunction")

Definition at line 28 of file prim2.cpp.

int gFloatSize

Definition at line 153 of file main.cpp.

Referenced by ffname(), and process_cmdline().