FORM 4.3
|
#include "form3.h"
Go to the source code of this file.
Functions | |
int | inicbufs (VOID) |
void | finishcbuf (WORD num) |
void | clearcbuf (WORD num) |
WORD * | DoubleCbuffer (int num, WORD *w, int par) |
WORD * | AddLHS (int num) |
WORD * | AddRHS (int num, int type) |
int | AddNtoL (int n, WORD *array) |
int | AddNtoC (int bufnum, int n, WORD *array, int par) |
int | InsTree (int bufnum, int h) |
int | FindTree (int bufnum, WORD *subexpr) |
void | RedoTree (CBUF *C, int size) |
void | ClearTree (int i) |
int | IniFbuffer (WORD bufnum) |
LONG | numcommute (WORD *terms, LONG *numterms) |
Utility routines for the compiler.
Definition in file comtool.c.
int inicbufs | ( | VOID | ) |
Creates a new compiler buffer and returns its ID number.
Definition at line 47 of file comtool.c.
References CbUf::boomlijst, CbUf::Buffer, CbUf::BufferSize, CbUf::CanCommu, CbUf::dimension, CbUf::lhs, CbUf::numdum, CbUf::NumTerms, CbUf::Pointer, CbUf::rhs, and CbUf::Top.
Referenced by AddRHS(), and StartVariables().
void finishcbuf | ( | WORD | num | ) |
Frees a compiler buffer.
num | The ID number for the buffer to be freed. |
Definition at line 89 of file comtool.c.
References CbUf::boomlijst, CbUf::Buffer, CbUf::BufferSize, CbUf::CanCommu, CbUf::lhs, CbUf::NumTerms, CbUf::Pointer, CbUf::rhs, and CbUf::Top.
Referenced by PF_BroadcastCBuf().
void clearcbuf | ( | WORD | num | ) |
Clears contents in a compiler buffer.
num | The ID number for the buffer to be cleared. |
Definition at line 116 of file comtool.c.
References CbUf::boomlijst, CbUf::Buffer, CbUf::Pointer, and CbUf::rhs.
WORD * DoubleCbuffer | ( | int | num, |
WORD * | w, | ||
int | par | ||
) |
Doubles a compiler buffer.
num | The ID number for the buffer to be doubled. |
w | The pointer to the end (exclusive) of the current buffer. The contents in the range of [cbuf[num].Buffer,w) will be kept. |
Definition at line 143 of file comtool.c.
References CbUf::Buffer, CbUf::BufferSize, CbUf::lhs, CbUf::Pointer, CbUf::rhs, and CbUf::Top.
WORD * AddLHS | ( | int | num | ) |
Adds an LHS to a compiler buffer and returns the pointer to a buffer for the new LHS.
num | The ID number for the buffer to get another LHS. |
Definition at line 188 of file comtool.c.
References CbUf::lhs, and CbUf::Pointer.
Referenced by AddNtoL().
WORD * AddRHS | ( | int | num, |
int | type | ||
) |
Adds an RHS to a compiler buffer and returns the pointer to a buffer for the new RHS.
num | The ID number for the buffer to get another RHS. |
type | If 0, the subexpression tree will be reallocated. |
Definition at line 214 of file comtool.c.
References TaBlEs::buffers, TaBlEs::buffersfill, TaBlEs::bufferssize, TaBlEs::bufnum, CbUf::CanCommu, CbUf::dimension, inicbufs(), CbUf::numdum, CbUf::NumTerms, CbUf::Pointer, and CbUf::rhs.
Referenced by InsertArg(), StartVariables(), TestMatch(), and TestSub().
int AddNtoL | ( | int | n, |
WORD * | array | ||
) |
Adds an LHS with the given data to the current compiler buffer.
n | The length of the data. |
array | The data to be added. |
Definition at line 288 of file comtool.c.
References AddLHS(), DoubleCbuffer(), CbUf::Pointer, and CbUf::Top.
int AddNtoC | ( | int | bufnum, |
int | n, | ||
WORD * | array, | ||
int | par | ||
) |
Adds the given data to the last LHS/RHS in a compiler buffer.
bufnum | The ID number for the buffer where the data will be added. |
n | The length of the data. |
array | The data to be added. |
Definition at line 317 of file comtool.c.
References DoubleCbuffer(), CbUf::Pointer, and CbUf::Top.
Referenced by InsertArg(), and StartVariables().
int IniFbuffer | ( | WORD | bufnum | ) |
Initialize a factorization cache buffer. We set the size of the rhs and boomlijst buffers immediately to their final values.
Definition at line 614 of file comtool.c.
References tree::blnce, CbUf::boomlijst, CbUf::CanCommu, CbUf::dimension, tree::left, CbUf::numdum, CbUf::NumTerms, tree::parent, CbUf::rhs, tree::right, tree::usage, and tree::value.