Go to the source code of this file.
|
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.
◆ inicbufs()
Creates a new compiler buffer and returns its ID number.
- Returns
- The ID number for the new compiler buffer.
Definition at line 47 of file comtool.c.
◆ finishcbuf()
void finishcbuf |
( |
WORD |
num | ) |
|
Frees a compiler buffer.
- Parameters
-
num | The ID number for the buffer to be freed. |
Definition at line 89 of file comtool.c.
◆ clearcbuf()
void clearcbuf |
( |
WORD |
num | ) |
|
Clears contents in a compiler buffer.
- Parameters
-
num | The ID number for the buffer to be cleared. |
Definition at line 116 of file comtool.c.
◆ DoubleCbuffer()
WORD* DoubleCbuffer |
( |
int |
num, |
|
|
WORD * |
w, |
|
|
int |
par |
|
) |
| |
Doubles a compiler buffer.
- Parameters
-
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.
◆ AddLHS()
Adds an LHS to a compiler buffer and returns the pointer to a buffer for the new LHS.
- Parameters
-
num | The ID number for the buffer to get another LHS. |
Definition at line 188 of file comtool.c.
◆ AddRHS()
WORD* AddRHS |
( |
int |
num, |
|
|
int |
type |
|
) |
| |
Adds an RHS to a compiler buffer and returns the pointer to a buffer for the new RHS.
- Parameters
-
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.
◆ AddNtoL()
int AddNtoL |
( |
int |
n, |
|
|
WORD * |
array |
|
) |
| |
Adds an LHS with the given data to the current compiler buffer.
- Parameters
-
n | The length of the data. |
array | The data to be added. |
- Returns
- 0 if succeeds.
Definition at line 288 of file comtool.c.
◆ AddNtoC()
int AddNtoC |
( |
int |
bufnum, |
|
|
int |
n, |
|
|
WORD * |
array, |
|
|
int |
par |
|
) |
| |
Adds the given data to the last LHS/RHS in a compiler buffer.
- Parameters
-
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. |
- Returns
- 0 if succeeds.
Definition at line 317 of file comtool.c.
◆ IniFbuffer()
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.