gmplTypesStatement

Types Statement Summary

Types is a nonterminal metalanguage statement that initiates the definition of the low level data types to be used by the parser. gmBasic has highly optimized retrieval algorithms that restrict the number of simultaneous retrieval sequences that can be occurring. The lowest level component of the compiler is the parser that converts the individual lexemes, the actual words and punctuation marks, in the source statements into token type, lexeme pairs. Tokens are language independent codes that identify the actual roles of lexemes. To do the parse gmBasic needs to do a retrieval that takes a lexeme and looks up its token type. A separate simple data type is needed to do this retrieval so that the low level parsing operation is guaranteed not to interfere with the higher level symbol table retrievals being performed by the compiler. This data type is referred to as a "standard list" which contains a simple collection of name, integer value pairs. The Types statement creates a set of standard lists that contain these lists of information needed by the parser. They are as follows:

List Description of use
Types The names and codes of the basic binary types recognized by the metalanguage. The names of the lists below are also considered to be "user types" within this list.
ReservedWords The Vb6 reserved words like And, As, ByRef, ByVal, DoEvents, etc. and their associated token type codes.
Symbols The VB6 symbols like +, _, ^, etc. and their associated token type codes.
JscriptWords The JavaScript reserved words and their associated token type codes.
JscriptSymbols The JavaScript symbols and their associated token type codes.
VbsWords The VbScript reserved words and their associated token type codes.
VbsSymbols The VbScript symbols and their associated token type codes

The Types statement has no attributes.

The substatements of the Types statement are as follows:

Substatement Description
Type This substatement defines either a simple entry in the Types list or introduces one of the secondary lists.


Type Substatement Summary

Type is a terminal, or nonterminal metalanguage substatement that occurs within the Types statement. Both forms of the statement add an entry to the list of basic binary types recognized in the metalanguage. The nonterminal form adds a secondary list to the type.

The attributes of the Type statement are as follows:

Attribute Description
Id This attribute is the name of the name, value pair being entered into the Types list. These names must be unique within the list. They are not case sensitive.
Index This attribute is the value of the name, value pair being entered into the Types list. It must be an integer value between 0 and 255. It need not be unique.

If the statement is not terminal it introduces a secondary list that is accessible via the name. The substatements of the Type statement are as follows:

Substatement Description
Entry This substatement defines a simple entry in the secondary list.

The attributes of the Entry statement are as follows:

Attribute Description
Id This attribute is the name of the name, value pair being entered into the secondary list. These names must be unique within the list. They are not case sensitive.
Index This attribute is the value of the name, value pair being entered into the secondary list. It must be an integer value between 0 and 255. It need not be unique.

The script errors associated with the Type statement are as follows:

Error Description
1087 The list member identifier must be specified.
1088 Illegal statement in Types block: %1d


Table of Contents