gmplStatementsStatement
- Mark Juras
Owned by Mark Juras
Statements Statement Summary
Statements is a nonterminal metalanguage statement that initiates the definition of the statements within an XML-style language to be processed. The actual languages are the actual gmPL language and the Html language that embeds the ASP pages. Not all statements in the gmPL are defined in this way and the Html language statements are not fully parsed by the Asp compiler. However, the bulk of the statements in both languages are described via a Statements specification. The attributes of the Statements statement are as follows:Attribute | Description |
Id | This attribute is the identifier of the set of statements being defined. In the case of gmBasic they are toollang and htmllang. |
The substatements of the Statements statement are as follows:
Substatement | Description |
Statement | This substatement defines the attributes of a statement within the XML-style language being defined. |
The script errors associated with the Statements statement are as follows:
Error | Description |
1081 | Statement command missing required id attribute. |
1082 | Unable to store STATEMENT vector: %1d |
1083 | Encountered following when expecting 'attribute': %1d |
Statement Substatement Summary
Statement is a nonterminal metalanguage substatement that occurs within the Statements statement. This substatement is used to specify which statements are available in the language and what the attributes are of those statements. Within the current implementation of the tool two such languages are defined -- the language of the tool itself in the file toollang.xml and the html language as it occurs within ASP in the file htmllang.xml. The attributes of the Statement substatement are as follows:Attribute | Description |
Id | This attribute defines the keyword which triggers its processing. This attribute is required and must be unique within a given Statements specification. |
The substatements of the Statement statement are as follows:
Substatement | Description |
Attribute | This attribute defines one of the attributes associated with the statement. |
Attribute Substatement Summary
Attribute is a terminal metalanguage substatement that occurs within the Statement statement. This substatement specifies the information needed to store and retrieve attribute values from XML-attribute value strings and binary information vectors. Semantically they are distinguished from Properties in that an attribute can be stored and accessed directly based on its location in a binary information vector, its type and its support info. Its initial input conversion does not require any individual runtime support. A property on the other hand is simply a shorthand notation for possibly two different methods -- get and set. Each of these methods requires individualized runtime support just as a method requires such support. The attributes of the Attribute substatement are as follows:Attribute | Description | ||||||||||||||
Id | This attribute defines the keyword for one of the attributes of the statement. This attribute is required and must be unique within a given statement specification. | ||||||||||||||
Type | This attribute specifies the type of the actual value expression associated with the attribute. The actual processing of Xml statements proceeds in two steps -- first they are parsed and then their attribute values are optionally interpreted and stored in an information vector. The first step always occurs and ignores the type specification. In order for the second step to occur a type specification is required. The actual entries are described below. | ||||||||||||||
Location | Associated with each attribute is the word starting offset in the information structure of the
start of its value. This location is normally computed by gmBasic. There are times
when a given location in the structure is accessed via two different attributes, either for
historical reasons or because there may be different ways in which the same attribute can
be specified. When this happens the first attribute using the location should be defined in
the normal way and then any following attributes should reference that attribute via a
location attribute as in the following for the Select statement
<Attribute id="Name" type="string[64]" EditString="on" /> <Attribute id="ToolName" type="string[64]" location="Name" /> | ||||||||||||||
Editstring | If this attribute is specified as on then upon input it is edited for global variable
entries:
| ||||||||||||||
Stringoff | If this attribute is specified as on then the keyword off can be used during input to indicate that the attribute value is the empty-string. | ||||||||||||||
Stringon | If this attribute is specified as on then the keyword on can be use to indicate that though the actual attribute value is the empty-string the attribute should none-the-less be considered to have a value. | ||||||||||||||
Projectfile | If this attribute is specified as on then the value is assumed to identify a project or library file in the primary root of the symbol table. If it is a class name, then it becomes the class file or library file being named. | ||||||||||||||
Opcode | If this attribute is specified as On, then the value is assumed to identify one of the primary operation codes in the intermediate language. | ||||||||||||||
Operation | If this attribute is specified as On, then the value is assumed to identify an operation code (opcode.subcode) in the intermediate language. | ||||||||||||||
Additive | If this attribute is specified as On, then the value is masked into the location rather than being simply stored. | ||||||||||||||
Packed | If this attribute is specified as on, then the location of the attribute is assumed to be byte-oriented as opposed to word-oriented. |
The actual entries in the Type attribute are as follows:
Entry | Description |
string | The value of the attribute is an arbitrary character string that can have any content or length. It is isolated by the parser but is not processed by the interpreter. |
string[n] | The value of the attribute is an arbitrary character string that can have any content, but that can contain no more than (n-1) characters. The interpreter stores the string in null-terminated form in an information vector but truncates it to (n-1) characters if necessary. |
integer | The value of the attribute must contain an integer value. If interpreted, this value is calculated from the value string and stored in a word in the information vector. If the value string does not contain a valid integer, then an Xml error is triggered. |
boolean | The value of the attribute must contain an on/off value. If interpreted, the entry "on" is assigned a value of one, and the entry "off" is assigned a value of zero. A valid entry is stored in a word in the information vector. An invalid entry triggers an Xml error. |
boolean[n] | The value of an attribute must contain an on/off value. If interpreted, the entry "on" is assigned a value of one, and the entry "off" is assigned a value of zero. The constant n must have a value between 1 and 31. A valid entry is stored in the nth bit of a word in the information vector. An invalid entry triggers an Xml error. |
enum-id | This entry must be the identifier of an previously stored enumeration with integer entries within the language specification. If interpreted, the entry must match one of the entries for the enumeration. A valid entry stores the matching enumeration entry value in a word in the information vector. An invalid entry triggers an Xml error. |
The script errors associated with the Attribute statement are as follows:
Error | Description |
1021 | Attribute command missing required id attribute. |
1022 | Unable to store attribute vector: %1d |
1023 | Attribute command missing required type attribute. |
1024 | Location attribute [%1d] not defined. |
Table of Contents