FORM 4.3
|
#include "form3.h"
Go to the source code of this file.
Data Structures | |
struct | SuBbUf |
Macros | |
#define | OPTION0 1 |
#define | OPTION1 2 |
#define | OPTION2 3 |
#define | REDUCESUBEXPBUFFERS |
Typedefs | |
typedef struct SuBbUf | SUBBUF |
Functions | |
VOID | inictable () |
KEYWORD * | findcommand (UBYTE *in) |
int | ParenthesesTest (UBYTE *sin) |
UBYTE * | SkipAName (UBYTE *s) |
UBYTE * | IsRHS (UBYTE *s, UBYTE c) |
int | IsIdStatement (UBYTE *s) |
int | CompileAlgebra (UBYTE *s, int leftright, WORD *prototype) |
int | CompileStatement (UBYTE *in) |
int | TestTables () |
int | CompileSubExpressions (SBYTE *tokens) |
int | CodeGenerator (SBYTE *tokens) |
int | CompleteTerm (WORD *term, UWORD *numer, UWORD *denom, WORD nnum, WORD nden, int sign) |
int | CodeFactors (SBYTE *tokens) |
WORD | GenerateFactors (WORD n, WORD inc) |
Variables | |
int | alfatable1 [27] |
SUBBUF * | subexpbuffers = 0 |
SUBBUF * | topsubexpbuffers = 0 |
LONG | insubexpbuffers = 0 |
The heart of the compiler. It contains the tables of statements. It finds the statements in the tables and calls the proper routines. For algebraic expressions it runs the compilation by first calling the tokenizer, splitting things into subexpressions and generating the code. There is a system for recognizing already existing subexpressions. This economizes on the length of the output.
Note: the compiler of FORM doesn't attempt to normalize the input. Hence x+1 and 1+x are different objects during compilation. Similarly (a+b-b) will not be simplified to (a).
Definition in file compiler.c.
#define OPTION0 1 |
Definition at line 235 of file compiler.c.
#define OPTION1 2 |
Definition at line 236 of file compiler.c.
#define OPTION2 3 |
Definition at line 237 of file compiler.c.
#define REDUCESUBEXPBUFFERS |
Definition at line 248 of file compiler.c.
VOID inictable | ( | ) |
Definition at line 292 of file compiler.c.
KEYWORD * findcommand | ( | UBYTE * | in | ) |
Definition at line 318 of file compiler.c.
int ParenthesesTest | ( | UBYTE * | sin | ) |
Definition at line 362 of file compiler.c.
UBYTE * SkipAName | ( | UBYTE * | s | ) |
Definition at line 412 of file compiler.c.
UBYTE * IsRHS | ( | UBYTE * | s, |
UBYTE | c | ||
) |
Definition at line 440 of file compiler.c.
int IsIdStatement | ( | UBYTE * | s | ) |
Definition at line 486 of file compiler.c.
int CompileAlgebra | ( | UBYTE * | s, |
int | leftright, | ||
WORD * | prototype | ||
) |
Definition at line 500 of file compiler.c.
int CompileStatement | ( | UBYTE * | in | ) |
Definition at line 536 of file compiler.c.
int TestTables | ( | ) |
Definition at line 650 of file compiler.c.
int CompileSubExpressions | ( | SBYTE * | tokens | ) |
Definition at line 694 of file compiler.c.
int CodeGenerator | ( | SBYTE * | tokens | ) |
Definition at line 829 of file compiler.c.
int CompleteTerm | ( | WORD * | term, |
UWORD * | numer, | ||
UWORD * | denom, | ||
WORD | nnum, | ||
WORD | nden, | ||
int | sign | ||
) |
Definition at line 1874 of file compiler.c.
int CodeFactors | ( | SBYTE * | tokens | ) |
Definition at line 1911 of file compiler.c.
WORD GenerateFactors | ( | WORD | n, |
WORD | inc | ||
) |
Definition at line 2208 of file compiler.c.
int alfatable1[27] |
Definition at line 233 of file compiler.c.
SUBBUF* subexpbuffers = 0 |
Definition at line 244 of file compiler.c.
SUBBUF* topsubexpbuffers = 0 |
Definition at line 245 of file compiler.c.
LONG insubexpbuffers = 0 |
Definition at line 246 of file compiler.c.