Compile

(Engine-Level Function)

Description: Compiles text and creates a new function. The type of return value is determined by the input parameters.
Warning: This function should be used only by advanced programmers.
Returns: Varies
Usage: Script Only.
Function Groups: Compilation and On-Line Modifications
Related to:  
Format: Compile(FuncNames, OpCodes, Number, Module, Script, Sense, Stream, ClassBuffer, NumClass, TStateBuffer, TActionBuffer, NumTokens, CStateBuffer, CActionBuffer, CDataBuffer, Error, ParserStack, LineCount, Column, Count)
Parameters:  
FuncNames
Required. Any array expression for the function names list.
OpCodes
Required. Any array expression for the Operational Codes that correspond to the names in FuncNames.
Number
Required. Any numeric expression for the number of FuncNames/OpCodes pairs.
Module
Required. Any expression that returns a module value. This is the context where the compile takes place.
Script
Required. 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
Required. Any logical expression. If true, this statement will be compiled as case-sensitive, otherwise, this will be case-insensitive.
Stream
Required. Any expression for the input stream to read.
ClassBuffer
Required. Any text expression that provides the tokenizer look-up table.
NumClass
Required. Any numeric expression for the number of character classes in the tokenizer state table.
TStateBuffer
Required. Any expression for the tokenizer state table. The tokenizer begins in state 0.
TActionBuffer
Required. Any two-dimensional array expression for the tokenizer action table.
NumTokens
Required. Any numeric expression for the number of tokens in the compiler table.
CStateBuffer
Required. Any text expression for the compiler state table. The compiler begins in state 0.
CActionBuffer
Required. Any text expression for the compiler action table.
CDataBuffer
Required. Any two-dimensional array expression for the compiler data table.
Error

Required. Must be a variable into which the resulting error code will be stored. The error code may be any of the following:

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 function 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
Required. Any stack used to govern the compile.
LineCount
Required. Must be a variable. The current line (number of carriage returns) will be stored here.
Column
Required. Must be a variable. The current column will be stored here.
Count
Required. 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.