void drawSchema(Tree bd, const char *projname, const char *dev)
The entry point to generate from a block diagram as a set of svg files stored in the directory "
schema * makeCutSchema()
Creates a new Cut schema.
bool isBoxSplit(Tree t, Tree &x, Tree &y)
virtual void draw(device &dev)=0
Tree(* prim4)(Tree w, Tree x, Tree y, Tree z)
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
const char * ffname(Tree t)
static schema * generateUserInterfaceSchema(Tree t)
Generate a 0->1 block schema for a user interface element.
schema * makeParSchema(schema *s1, schema *s2)
static schema * addSchemaInputs(int ins, schema *x)
bool isBoxHBargraph(Tree s)
virtual void collectTraits(collector &c)=0
Count subtree occurences Count the number of occurences of each subtree of a root tree...
bool isBoxRec(Tree t, Tree &x, Tree &y)
static schema * generateOutputSlotSchema(Tree a)
Generate a 0->1 block schema for an output slot.
schema * makeConnectorSchema()
Connectors are used to ensure unused inputs and outputs are drawn.
double max(double x, double y)
Tree(* prim3)(Tree x, Tree y, Tree z)
Tree(* prim5)(Tree v, Tree w, Tree x, Tree y, Tree z)
static set< Tree > gDrawnExp
schema * makeRecSchema(schema *s1, schema *s2)
Creates a new recursive schema (s1 ~ s2).
bool isBoxSymbolic(Tree t)
Tree sigSub(Tree x, Tree y)
static schema * addSchemaOutputs(int outs, schema *x)
schema * makeInverterSchema(const string &color)
Build n cables in parallel.
schema * makeSplitSchema(schema *s1, schema *s2)
Creates a new split schema.
schema * makeDecorateSchema(schema *s, double margin, const string &text)
Creates a new decorated schema.
int boxComplexity(Tree box)
Return the complexity propety of a box expression tree.
static string gSchemaFileName
static schema * generateDiagramSchema(Tree bd)
Generate an appropriate schema according to the type of block diagram.
static Occurrences * gOccurrences
bool isBoxPar(Tree t, Tree &x, Tree &y)
bool isBoxHSlider(Tree s)
schema * makeTopSchema(schema *s1, double margin, const string &text, const string &link)
Creates a new top schema.
static bool isInverter(Tree t)
bool isBoxVBargraph(Tree s)
static stack< Tree > gPendingExp
Tree gInverter[6]
isInverter(t) returns true if t == '*(-1)'.
static void scheduleDrawing(Tree t)
Schedule a makeBlockSchema diagram to be drawn.
bool isBoxWaveform(Tree s)
bool isBoxCheckbox(Tree s)
static bool isPureRouting(Tree t)
static char * legalFileName(Tree t, int n, char *dst)
Transform the definition name property of tree into a legal file name.
property< bool > gPureRoutingProperty
Compute the Pure Routing property, that is expressions only made of cut, wires and slots...
static const char * gDevSuffix
virtual void place(double x, double y, int orientation)=0
virtual unsigned int arity()=0
string extractName(Tree fulllabel)
Tree boxSeq(Tree x, Tree y)
const char * name(Symbol *sym)
Returns the name of a symbol.
An abstract block diagram schema.
static void UserInterfaceDescription(Tree box, string &d)
Convert User interface element into a textual representation.
static map< Tree, string > gBackLink
bool isBoxVSlider(Tree s)
bool isBoxNumEntry(Tree s)
Tree boxPar(Tree x, Tree y)
static schema * generateAbstractionSchema(schema *x, Tree t)
Generate an abstraction schema by placing in sequence the input slots and the body.
void * getUserData(Symbol *sym)
Returns user data.
Tree sigMul(Tree x, Tree y)
schema * makeCableSchema(unsigned int n)
Build n cables in parallel.
const char * prim5name(CTree *(*ptr)(CTree *, CTree *, CTree *, CTree *, CTree *))
schema * makeBlockSchema(unsigned int inputs, unsigned int outputs, const string &text, const string &color, const string &link)
Build a simple colored blockSchema with a certain number of inputs and outputs, a text to be displaye...
Interface for names management.
const char * prim1name(CTree *(*ptr)(CTree *))
bool isBoxMerge(Tree t, Tree &x, Tree &y)
static schema * generateInsideSchema(Tree t)
Generate the inside schema of a block diagram according to its type.
static void writeSchemaFile(Tree bd)
Write a top level diagram.
schema * makeSeqSchema(schema *s1, schema *s2)
Make a sequential schema.
double min(double x, double y)
const char * prim0name(CTree *(*ptr)())
const char * tree2str(Tree t)
if t has a node of type symbol, return its name otherwise error
const char * prim4name(CTree *(*ptr)(CTree *, CTree *, CTree *, CTree *))
bool getBoxType(Tree box, int *inum, int *onum)
Return the type (number of inputs and outputs) of a box or false if undefined.
void print(Tree t, FILE *out)