Compile

Description:              This function compiles text and creates a new function; its type of return value is determined by its input parameters.

Warning:               This function may cause irrecoverable alteration of your application. It should be used only by advanced programmers.

Returns:                    Varies

Usage:                   Script

Format:                      Compile(FuncNames, OpCodes, Number, Module, Script, Sense, Stream, ClassBuffer, NumClass, TStateBuffer, TActionBuffer, NumTokens, CStateBuffer, CActionBuffer, CDataBuffer, Error, ParserStack, LineCount, Column, Count)

Parameters:             FuncNames    { array of text }  { required }  { no default: }

                                                Any array expression for the function names list.

                                    OpCodes    { array of numeric }  { required }  { no default: }

                                                Any array expression for the OpCodes that correspond to the names in FuncNames.

                                    Number    { numeric }  { required }  { no default: }

                                                Any numeric expression for the number of FuncNames/OpCodes pairs.

                                    Module    { Module }  { required }  { no default: }

                                                Any expression that returns a module value. This is the context where the compile takes place.

                                    Script    { Boolean }  { required }  { no default: }

                                                Any logical expression. If true, the text will be compiled as a script statement; if false, it will be compiled as a normal statement.

                                    Sense    { Boolean }  { required }  { no default: }

                                                Any logical expression. If true, this statement will be compiled as case-sensitive; otherwise, this will be case-insensitive.

                                    Stream    { stream }  { required }  { no default: }

                                                Any expression for the input stream to read.

                                    ClassBuffer    { text }  { required }  { no default: }

                                                Any text expression that provides the tokenizer look-up table.

                                    NumClass    { numeric }  { required }  { no default: }

                                                Any numeric expression for the number of character classes in the tokenizer state table.

                                    TStateBuffer    { numeric }  { required }  { no default: }

                                                Any expression for the tokenizer state table. The tokenizer begins in state 0.

                                    TActionBuffer    { array }  { required }  { no default: }

                                                Any two-dimensional array expression for the tokenizer action table.

                                    NumTokens    { numeric }  { required }  { no default: }

                                                Any numeric expression for the number of tokens in the compiler table.

                                    CStateBuffer    { text }  { required }  { no default: }

                                                Any text expression for the compiler state table. The compiler begins in state 0.

                                    CActionBuffer    { text }  { required }  { no default: }

                                                Any text expression for the compiler action table.

                                    CDataBuffer    { array }  { required }  { no default: }

                                                Any two-dimensional array expression for the compiler data table.

                                    Error    { numeric }  { required }  { no default: }

                                                Must be a variable into which the resulting error code will be stored. The error code has the following meaning:

Error

Description

0

No error.

-1

Operation code in OpCode table is not defined.

-2

Parameter must be a constant.

-3

Too many parameters.

-4

Compiler table index past the end of the table.

-5

Token type is < 0 or > max_token.

-6 

illegal attempt to add op code from built-in function.

-7

Op code array entry is invalid.

-8

Illegal attempt to add variable parameter.

-9

Too many parameters.

-10

Illegal radix in compiler data table.

-11

Illegal digit in integer.

-12

Illegal action in CActionBuffer.

-13

No DAG specified.

-14

Not enough parameters.

-15

Does not have a single parameter.

-16

Compiler stack is too deep (> 1000)

-17

Infinite loop detected.

-18

Suspending and exiting at the same time.

 

                                    ParserStack    { stack }  { required }  { no default: }

                                                Any stack used to govern the compile.

                                    LineCount    { numeric }  { required }  { no default: }

                                                Must be a variable. The current line (number of carriage returns) will be stored here.

                                    Column    { numeric }  { required }  { no default: }

                                                Must be a variable. The current column will be stored here.

                                    Count    { numeric }  { required }  { no default: }

                                                Must be a variable. The number of characters processed is stored here.

Comments:               This function is used when compiling text statements. The syntax of the statements is described by the table parameters that are not fully described here. This function compiles text to create a new function, but doesn't add the new function.