|
FORM v5.0.0-35-g6318119
|

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 (void) |
| 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 (void) |
| 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 260 of file compiler.c.
| #define OPTION1 2 |
Definition at line 261 of file compiler.c.
| #define OPTION2 3 |
Definition at line 262 of file compiler.c.
| #define REDUCESUBEXPBUFFERS |
Definition at line 273 of file compiler.c.
| void inictable | ( | void | ) |
Definition at line 315 of file compiler.c.
| KEYWORD * findcommand | ( | UBYTE * | in | ) |
Definition at line 341 of file compiler.c.
| int ParenthesesTest | ( | UBYTE * | sin | ) |
Definition at line 385 of file compiler.c.
| UBYTE * SkipAName | ( | UBYTE * | s | ) |
Skips a name and gives a pointer to the character after the name. If there is not a proper name, it emits a compiler message and then returns a null pointer. This function supports formal names (e.g., [x+a]) and $-variables in addition to ordinary identifiers.
| [in] | s | Pointer to a null-terminated input string that starts with a name. |
Definition at line 443 of file compiler.c.
| UBYTE * IsRHS | ( | UBYTE * | s, |
| UBYTE | c | ||
| ) |
Definition at line 476 of file compiler.c.
| int IsIdStatement | ( | UBYTE * | s | ) |
Definition at line 522 of file compiler.c.
| int CompileAlgebra | ( | UBYTE * | s, |
| int | leftright, | ||
| WORD * | prototype | ||
| ) |
Definition at line 536 of file compiler.c.
| int CompileStatement | ( | UBYTE * | in | ) |
Definition at line 572 of file compiler.c.
| int TestTables | ( | void | ) |
Definition at line 706 of file compiler.c.
| int CompileSubExpressions | ( | SBYTE * | tokens | ) |
Definition at line 750 of file compiler.c.
| int CodeGenerator | ( | SBYTE * | tokens | ) |
Definition at line 885 of file compiler.c.
| int CompleteTerm | ( | WORD * | term, |
| UWORD * | numer, | ||
| UWORD * | denom, | ||
| WORD | nnum, | ||
| WORD | nden, | ||
| int | sign | ||
| ) |
Definition at line 1948 of file compiler.c.
| int CodeFactors | ( | SBYTE * | tokens | ) |
Definition at line 1985 of file compiler.c.
| WORD GenerateFactors | ( | WORD | n, |
| WORD | inc | ||
| ) |
Definition at line 2282 of file compiler.c.
| int alfatable1[27] |
Definition at line 258 of file compiler.c.
| SUBBUF* subexpbuffers = 0 |
Definition at line 269 of file compiler.c.
| SUBBUF* topsubexpbuffers = 0 |
Definition at line 270 of file compiler.c.
| LONG insubexpbuffers = 0 |
Definition at line 271 of file compiler.c.