diff --git a/core.html b/core.html index 44cd2b3..9ac8e83 100644 --- a/core.html +++ b/core.html @@ -52,7 +52,7 @@
@@ -73,151 +73,158 @@

GTA3script Specification

-

1. Introduction

+

Introduction

This is an attempt to produce a formal language specification for the GTA3script language.

@@ -229,12 +236,12 @@

1. Introduction

The DMA Design compiler is very basic and contains a huge amount of bugs. These bugs introduce a lot of inconsistencies and quirks to the language. This document attempts to resolve these issues and set a coherent language.

-

The language specified by this document is thus a subset of the language accepted by the in-house compiler. Any source code translated by an implementation of this should be able to be translated by the original compiler. The reverse is not true. A non-exhaustive list of differences is presented on the appendix.

+

The language specified by this document is thus a subset of the language accepted by the in-house compiler. Any source code translated by an implementation of this should be able to be translated by the original compiler. The reverse is not true. A known list of differences is presented in Appendix D.

-

2. Scope

+

1. Scope

This document is targeted at implementation writers and perhaps curious community members.

@@ -248,9 +255,15 @@

2. Scope

-

3. Terms and Definitions

+

2. Terms and Definitions

+

For the purposes of this document, the terms and definitions given in [ISO/IEC 2382:2015] and the following apply.

+
+
+

Terms that are used only in a small portion of this document are defined where they are used and italicized where they are defined.

+
+

behaviour

@@ -272,7 +285,7 @@

3. Terms and Definitions

behaviour, unspecified

-

behavior for which this specification provides no requirements.

+

behavior for which this specification provides two or more possibilities and imposes no further requirements on which is chosen in any instance.

constraint

@@ -332,7 +345,7 @@

3. Terms and Definitions

ill-formed program

-

program that is not well-formed. translators should produce diagnostic messages for such programs.

+

program that is not well-formed.

well-formed program

@@ -358,21 +371,100 @@

3. Terms and Definitions

the value to be received in a specific argument position of a command.

+
+

in-house compiler

+
+
+

the translation environment used by DMA Design. this document refers more specifically to Official GTA3 Script Compiler V413.

+
-

4. Notation

+

3. General Principles

+
+

3.1. Implementation Conformance

-

TODO

+

A conforming implementation must be able to translate and correctly execute, within its resource limits, any program which does not violate the rules in this document.

+
+
+

A conforming implementation must produce diagnostics for violations of the syntactic and semantic rules of this document except for those resulting in undefined behaviour.

+
+
+

A conforming implementation must document the choices made to implementation-defined portions of this specification as well as to unsupported optional features.

+
+
+

A conforming implementation may have extensions, provided they do not alter the behaviour of any well-formed program.

+
+
+

This specification does not impose any lower or upper bound restrictions on the resource limits of an implementation. An implementation should have reasonable limits given its problem domain, and should document them where known.

+
+
+
+

3.2. Structure of this Document

+
+

Section 4 through 10 describes the GTA3script programming language. That description includes detailed syntactic specifications in a form detailed in 3.3. For convenience, Appendix A repeats all such syntactic specifications.

+
+
+

Sections 11 and 12 describes a minimal set of commands to perform computations using the language.

+
+
+

Appendix B describes a regular grammar suitable for scanning the language.

+
+
+

Appendix C describes ambiguities present in the language grammar and resolutions for them.

+
+
+

Appendix D describes problematic elements in the in-house compiler that this specification choose not to follow.

+
+
+

Along this document there are several footnotes explaining or clarifying some decisions. Often these footnotes exposes the reason for changes in the language compared to the in-house compiler. These footnotes are purely informative and are not an integral part of this document.

+
+
+

Some changes demand more details than a footnote permits. These are marked with the footnote [1] and further details are presented in Appendix D.

+
+
+
+

3.3. Syntax Notation

+
+

The syntax in this document is specified using a variation of [ISO/IEC 14977:1996] (also known as EBNF). This variant can be self-described as follow:

+
+
+
+
# EBNF Grammar Used In This Specification (informative)
+
+letter      := 'A'..'Z' | 'a'..'z' ;
+digit       := '0'..'9' ;
+character   := /* printable ASCII characters */ ;
+identifier  := letter { letter | digit | '_' } ;
+terminal    := "'" character { character } "'"
+             | '"' character { character } '"' ;
+
+syntax      := { production } ;
+production  := identifier ':=' [ expression ] ';' ;
+expression  := alternative { '|' alternative } ;
+alternative := term { term } ;
+term        := factor { '-' factor } ;
+factor      := identifier | terminal [ '..' terminal ] | group | option | repetition ;
+group       := '(' expression ')' ;
+option      := '[' expression ']' ;
+repetition  := '{' expression '}' ;
+
+
+
+

The double-dot operator is an extension to EBNF. It represents the set of characters from the left to the right inclusive as alternatives.

+
+
+

A syntax specification might refer to symbols in [ISO 646:1991 IRV] (also known as ASCII) through comments, avoiding the alternation of a set of well known characters.

+
-

5. Concepts

+

4. Concepts

-

5.1. Scripts

+

4.1. Scripts

A script is a unit of execution which contains its own program counter, local variables and compare flag.

@@ -408,7 +500,7 @@

5.1. Scripts

-

5.2. Script Files

+

4.2. Script Files

A script file is a source file containing a sequence of commands.

@@ -437,7 +529,7 @@

5.2. Script Files

An implementation may contain special features regarding the way subscripts and mission scripts are executed.

-

The main script file is found in a unspecified manner. The other script files are found by recursively searching a directory with the same filename (excluding extension) as the main script file. This directory is in the same path as the main script file. The search for the script files shall be case-insensitive. All script files must have a .sc extension. If multiple script files with the same name are found, behaviour is unspecified.

+

The main script file is found in a unspecified manner. The other script files are found by recursively searching a directory with the same filename (excluding extension) as the main script file. This directory is in the same path as the main script file. The search for the script files shall be case-insensitive. All script files must have a .sc extension. If multiple script files with the same name are found, which script file is chosen is unspecified.

A script type is said to come before another script type under the following total order:

@@ -479,7 +571,7 @@

5.2. Script Files

-

5.3. Types

+

4.3. Types

An integer is a binary signed two’s-complement integral number. It represents 32 bits of data and the range of values -2147483648 through 2147483647.

@@ -502,13 +594,13 @@

5.3. Types

-

6. Elements

+

5. Elements

The lexical grammar of the language is context-sensitive. As such, the lexical elements and the syntactic elements are presented together.

-

6.1. Source Code

+

5.1. Source Code

Source code is a stream of printable ASCII characters plus the control codes line feed (\n), horizontal tab (\t) and carriage return (\r).

@@ -564,7 +656,7 @@

6.1. Source Code

-

6.2. Comments

+

5.2. Comments

Comments serve as program documentation.

@@ -606,7 +698,7 @@

6.2. Comments

-

6.3. Commands

+

5.3. Commands

A command describes an operation for a script to perform.

@@ -628,7 +720,7 @@

6.3. Commands

-

6.3.1. Integer Literals

+

5.3.1. Integer Literals

digit := '0'..'9' ;
@@ -643,7 +735,7 @@ 

6.3.1. Integer Literals

-

6.3.2. Floating-Point Literals

+

5.3.2. Floating-Point Literals

floating_form1 := '.' digit { digit | '.' | 'F' } ;
@@ -723,7 +815,7 @@ 

6.3.2. Floating-Point Literals

-

6.3.3. Identifiers

+

5.3.3. Identifiers

identifier := ('$' | 'A'..'Z') {token_char} ;
@@ -740,7 +832,7 @@

6.3.3. Identifiers

-

6.3.4. String Literals

+

5.3.4. String Literals

A string literal holds a string delimited by quotation marks.

@@ -751,7 +843,7 @@

6.3.4. String Literals

-

6.3.5. Variable References

+

5.3.5. Variable References

A variable name is a sequence of token characters, except the characters [ and ] cannot happen.

@@ -790,7 +882,7 @@

6.3.5. Variable References

-

7. Parameters

+

6. Parameters

A command receives several arguments. Every argument must obey the rules of its corresponding parameter definition.

@@ -805,7 +897,7 @@

7. Parameters

If a variable is used in the same command both as an input and as an output, the input shall be evaluated before any output is assigned to the variable.

-

7.1. String Constants

+

6.1. String Constants

A string constant is a name associated with an integer value. Such association is known in the translation environment.

@@ -823,7 +915,7 @@

7.1. String Constants

-

7.2. Entities

+

6.2. Entities

An entity is an object of the execution environment. Each entity has an entity type, which defines its purposes.

@@ -841,57 +933,57 @@

7.2. Entities

-

7.3. Parameter Types

+

6.3. Parameter Types

-

7.3.1. INT

+

6.3.1. INT

An INT parameter accepts an argument only if it is an integer literal or an identifier matching a global string constant.

-

7.3.2. FLOAT

+

6.3.2. FLOAT

A FLOAT parameter accepts an argument only if it is a floating-point literal.

-

7.3.3. VAR_INT

+

6.3.3. VAR_INT

A VAR_INT parameter accepts an argument only if it is an identifier referencing a global variable of integer type.

-

7.3.4. VAR_FLOAT

+

6.3.4. VAR_FLOAT

A VAR_FLOAT parameter accepts an argument only if it is an identifier referencing a global variable of floating-point type.

-

7.3.5. LVAR_INT

+

6.3.5. LVAR_INT

A LVAR_INT parameter accepts an argument only if it is an identifier referencing a local variable of integer type.

-

7.3.6. LVAR_FLOAT

+

6.3.6. LVAR_FLOAT

A LVAR_FLOAT parameter accepts an argument only if it is an identifier referencing a local variable of floating-point type.

-

7.3.7. INPUT_INT

+

6.3.7. INPUT_INT

An INPUT_INT parameter accepts an argument only if it is an integer literal or an identifier either matching a string constant, global string constant or referencing a variable of integer type (in this order).

-

7.3.8. INPUT_FLOAT

+

6.3.8. INPUT_FLOAT

An INPUT_FLOAT parameter accepts an argument only if it is a floating-point literal or an identifier referencing a variable of floating-point type.

-

7.3.9. OUTPUT_INT

+

6.3.9. OUTPUT_INT

An OUTPUT_INT parameter accepts an argument only if it is an identifier referencing a variable of integer type.

@@ -900,65 +992,65 @@

7.3.9. OUTPUT_INT

-

7.3.10. OUTPUT_FLOAT

+

6.3.10. OUTPUT_FLOAT

An OUTPUT_FLOAT parameter accepts an argument only if it is a identifier referencing a variable of floating-point type.

-

7.3.11. LABEL

+

6.3.11. LABEL

A LABEL parameter accepts an argument only if it is an identifier whose name is a label in the multi-file.

-

7.3.12. TEXT_LABEL

+

6.3.12. TEXT_LABEL

A TEXT_LABEL parameter accepts an argument only if it is an identifier. If the identifier begins with a dollar character ($), its suffix must reference a variable of text label type and such a variable is the actual argument. Otherwise, the identifier is a text label.

-

7.3.13. VAR_TEXT_LABEL

+

6.3.13. VAR_TEXT_LABEL

A VAR_TEXT_LABEL parameter accepts an argument only if it is an identifier referencing a global variable of text label type.

-

7.3.14. LVAR_TEXT_LABEL

+

6.3.14. LVAR_TEXT_LABEL

A LVAR_TEXT_LABEL parameter accepts an argument only if it is an identifier referencing a local variable of text label type.

-

7.3.15. STRING

+

6.3.15. STRING

A STRING parameter accepts an argument only if it is a string literal.

-

7.3.16. Optional Parameters

+

6.3.16. Optional Parameters

Additionally, the following parameters are defined as behaving equivalently to their correspondent parameters above, except that in case an argument is absent, parameter checking stops as if there are no more parameters to be checked.

  • -

    VAR_INT_OPT

    +

    VAR_INT_OPT

  • -

    VAR_FLOAT_OPT

    +

    VAR_FLOAT_OPT

  • -

    LVAR_INT_OPT

    +

    LVAR_INT_OPT

  • -

    LVAR_FLOAT_OPT

    +

    LVAR_FLOAT_OPT

  • -

    VAR_TEXT_LABEL_OPT

    +

    VAR_TEXT_LABEL_OPT

  • -

    LVAR_TEXT_LABEL_OPT

    +

    LVAR_TEXT_LABEL_OPT_

  • INPUT_OPT

    @@ -969,14 +1061,14 @@

    7.3.16. Optional Parameters

    Such parameters are always trailing parameters.

-

The INPUT_OPT parameter accepts an argument only if it is an integer literal, floating-point literal, or identifier referencing a variable of integer, floating-point or text label type.

+

The INPUT_OPT parameter accepts an argument only if it is an integer literal, floating-point literal, or identifier referencing a variable of integer, floating-point or text label type.

-

8. Command Selectors

+

7. Command Selectors

A command selector (or alternator) is a kind of command which gets rewritten by the translator to another command based on the supplied argument types.

@@ -1028,7 +1120,7 @@

8. Command Selectors

-

9. Expressions

+

8. Expressions

Constraints

@@ -1040,7 +1132,7 @@

9. Expressions

The name of commands used to require script files (e.g. GOSUB_FILE) and its directive commands (i.e. MISSION_START and MISSION_END) cannot be on the left hand side of a expression.

-

9.1. Assignment Expressions

+

8.1. Assignment Expressions

binop := '+' | '-' | '*' | '/' | '+@' | '-@' ;
@@ -1170,7 +1262,7 @@ 

9.1. Assignment Expressions

-

9.2. Conditional Expressions

+

8.2. Conditional Expressions

relop := '=' | '<' | '>' | '>=' | '<=' ;
@@ -1218,7 +1310,7 @@ 

9.2. Conditional Expressions

-

10. Statements

+

9. Statements

A statement specifies an action to be executed.

@@ -1230,7 +1322,7 @@

10. Statements

-

10.1. Labeled Statements

+

9.1. Labeled Statements

Statements can be prefixed with a label.

@@ -1260,7 +1352,7 @@

10.1. Labeled Statements

-

10.2. Empty Statements

+

9.2. Empty Statements

empty_statement := eol ;
@@ -1274,7 +1366,7 @@

10.2. Empty Statements

-

10.3. Embedded Statements

+

9.3. Embedded Statements

Embedded statements are statements not prefixed by a label.

@@ -1297,7 +1389,7 @@

10.3. Embedded Statements

-

10.4. Command Statements

+

9.4. Command Statements

command_statement := command eol ;
@@ -1311,7 +1403,7 @@

10.4. Command Statements

-

10.5. Expression Statements

+

9.5. Expression Statements

expression_statement := assignment_expression eol
@@ -1329,7 +1421,7 @@ 

10.5. Expression Statements

-

10.6. Scope Statements

+

9.6. Scope Statements

scope_statement := '{' eol
@@ -1359,20 +1451,20 @@ 

10.6. Scope Statements

The execution of a jump to outside the scope block leaves the lexical scope.

-

Performing a subroutine call does not leave the active scope. The name of local variables become hidden if the subroutine is not within the scope block. The behaviour of the program is unspecified if such a subroutine activates another lexical scope.

+

Performing a subroutine call does not leave the active scope. The name of local variables become hidden if the subroutine is not within the scope block. The behaviour of the program is undefined if such a subroutine activates another lexical scope.

Leaving a lexical scope causes the storage for the declared local variables to be reclaimed.

-

10.7. Variable Declaration Statements

+

9.7. Variable Declaration Statements

command_var_name := 'VAR_INT'
                     | 'LVAR_INT'
                     | 'VAR_FLOAT'
-                    | 'LVAR_FLOAT' ;
+                    | 'LVAR_FLOAT'
                     | 'VAR_TEXT_LABEL'
                     | 'LVAR_TEXT_LABEL' ;
 command_var_param := sep variable ;
@@ -1424,7 +1516,7 @@ 

10.7. Variable Declaration Statements

-

10.8. Conditional Statements

+

9.8. Conditional Statements

Conditional statements produce changes in the script compare flag.

@@ -1464,16 +1556,16 @@

10.8. Conditional Statements

A conditional list shall not be short-circuit evaluated. All conditional elements are executed in order.

-

The behaviour is unspecified if the command used in a conditional element does not cause side-effects in the compare flag.

+

The behaviour is undefined if the command used in a conditional element does not cause side-effects in the compare flag.

-

10.9. Selection Statements

+

9.9. Selection Statements

Selection statements selects which statement to execute depending on certain conditions.

-

10.9.1. IF Statement

+

9.9.1. IF Statement

if_statement := 'IF' sep conditional_list
@@ -1494,7 +1586,7 @@ 

10.9.1. IF Statement

-

10.9.2. IFNOT Statement

+

9.9.2. IFNOT Statement

ifnot_statement := 'IFNOT' sep conditional_list
@@ -1512,7 +1604,7 @@ 

10.9.2. IFNOT Statement

-

10.9.3. IF GOTO Statement

+

9.9.3. IF GOTO Statement

if_goto_statement := 'IF' sep conditional_element sep 'GOTO' sep identifier eol ;
@@ -1526,7 +1618,7 @@

10.9.3. IF GOTO Statement

-

10.9.4. IFNOT GOTO Statement

+

9.9.4. IFNOT GOTO Statement

ifnot_goto_statement := 'IFNOT' sep conditional_element sep 'GOTO' sep identifier eol ;
@@ -1541,9 +1633,9 @@

10.9.4. IFNOT GOTO Statement

-

10.10. Iteration Statements

+

9.10. Iteration Statements

-

10.10.1. WHILE Statement

+

9.10.1. WHILE Statement

while_statement := 'WHILE' sep conditional_list
@@ -1562,7 +1654,7 @@ 

10.10.1. WHILE Statement

-

10.10.2. WHILENOT Statement

+

9.10.2. WHILENOT Statement

whilenot_statement := 'WHILENOT' sep conditional_list
@@ -1578,7 +1670,7 @@ 

10.10.2. WHILENOT Statement

-

10.10.3. REPEAT Statement

+

9.10.3. REPEAT Statement

repeat_statement := 'REPEAT' sep integer sep identifier eol
@@ -1610,7 +1702,7 @@ 

10.10.3. REPEAT Statement

-

10.11. Require Statements

+

9.11. Require Statements

filename := {graph_char} '.SC' ;
@@ -1624,7 +1716,7 @@ 

10.11. Require Statements

Require statements request script files to become part of the multi-file being translated.

-

A file can be required more than once. If it is required using the same statement as the first request, the latter request is ignored. Otherwise, behaviour is unspecified.

+

A file can be required more than once. If it is required using the same statement as the first request, the latter request is ignored. Otherwise, behaviour is undefined.

Constraints

@@ -1633,7 +1725,7 @@

10.11. Require Statements

Require statements shall only appear in the main script file or main extension files.

-

10.11.1. GOSUB_FILE Statement

+

9.11.1. GOSUB_FILE Statement

command_gosub_file := 'GOSUB_FILE' sep identifier sep filename eol ;
@@ -1649,11 +1741,11 @@

10.11.1. GOSUB_FILE Statement

It also calls the subroutine specified by label.

-

The behaviour is unspecified if the label is not part of the required file.

+

The behaviour is undefined if the label is not part of the required file.

-

10.11.2. LAUNCH_MISSION Statement

+

9.11.2. LAUNCH_MISSION Statement

command_launch_mission := 'LAUNCH_MISSION' sep filename eol ;
@@ -1670,7 +1762,7 @@

10.11.2. LAUNCH_MISSION Statement

-

10.11.3. LOAD_AND_LAUNCH_MISSION Statement

+

9.11.3. LOAD_AND_LAUNCH_MISSION Statement

command_load_and_launch_mission := 'LOAD_AND_LAUNCH_MISSION' sep filename eol ;
@@ -1696,10 +1788,10 @@

10.11.3. LOAD_AND_LAUNCH_MISSION Stat

-

11. Script File Structure

+

10. Script File Structure

-

11.1. Main Script Files

+

10.1. Main Script Files

main_script_file := {statement} ;
@@ -1712,7 +1804,7 @@

11.1. Main Script Files

Semantics

-

The main script starts execution at the first statement of the main script file. If there is no statement to be executed, behaviour is unspecified.

+

The main script starts execution at the first statement of the main script file. If there is no statement to be executed, behaviour is undefined.

Constraints

@@ -1722,7 +1814,7 @@

11.1. Main Script Files

-

11.2. Main Extension Files

+

10.2. Main Extension Files

main_extension_file := {statement} ;
@@ -1739,7 +1831,7 @@

11.2. Main Extension Files

-

11.3. Subscript Files

+

10.3. Subscript Files

subscript_file := 'MISSION_START' eol
@@ -1768,7 +1860,7 @@ 

11.3. Subscript Files

-

11.4. Mission Script Files

+

10.4. Mission Script Files

mission_script_file := subscript_file ;
@@ -1787,13 +1879,13 @@

11.4. Mission Script Files

-

12. Supporting Commands

+

11. Supporting Commands

In order to perform useful computation the following supporting commands may be available.

-

12.1. WAIT

+

11.1. WAIT

Parameters

@@ -1813,7 +1905,7 @@

12.1. WAIT

-

12.2. GOTO

+

11.2. GOTO

Parameters

@@ -1830,7 +1922,7 @@

12.2. GOTO

-

12.3. GOSUB

+

11.3. GOSUB

Parameters

@@ -1847,7 +1939,7 @@

12.3. GOSUB

-

12.4. RETURN

+

11.4. RETURN

Parameters

@@ -1867,7 +1959,7 @@

12.4. RETURN

-

12.5. RETURN_TRUE

+

11.5. RETURN_TRUE

Parameters

@@ -1884,7 +1976,7 @@

12.5. RETURN_TRUE

-

12.6. RETURN_FALSE

+

11.6. RETURN_FALSE

Parameters

@@ -1901,7 +1993,7 @@

12.6. RETURN_FALSE

-

12.7. SCRIPT_NAME

+

11.7. SCRIPT_NAME

Parameters

@@ -1926,11 +2018,11 @@

12.7. SCRIPT_NAME

The name of a script must be unique across the multi-file.

-

The behaviour of the translation is unspecified if the name is given by a text label variable.

+

It is unspecified whether a name given by a text label variable is accepted.

-

12.8. TERMINATE_THIS_SCRIPT

+

11.8. TERMINATE_THIS_SCRIPT

Parameters

@@ -1947,7 +2039,7 @@

12.8. TERMINATE_THIS_SCRIPT

-

12.9. START_NEW_SCRIPT

+

11.9. START_NEW_SCRIPT

Parameters

@@ -1987,7 +2079,7 @@

12.9. START_NEW_SCRIPT

-

13. Supporting Command Selectors

+

12. Supporting Command Selectors

To further enchance the set of minimal commands for useful computation, the following command selectors and its supportive alternatives are defined.

@@ -1996,7 +2088,7 @@

13. Supporting Command Selectors

An implementation is required to support these selectors, but it may not support all of its alternatives.

-

13.1. SET

+

12.1. SET

Alternatives

@@ -2037,7 +2129,7 @@

13.1. SET

-

13.2. CSET

+

12.2. CSET

Alternatives

@@ -2061,7 +2153,7 @@

13.2. CSET

-

13.3. ADD_THING_TO_THING

+

12.3. ADD_THING_TO_THING

Alternatives

@@ -2089,7 +2181,7 @@

13.3. ADD_THING_TO_THING

-

13.4. SUB_THING_FROM_THING

+

12.4. SUB_THING_FROM_THING

Alternatives

@@ -2117,7 +2209,7 @@

13.4. SUB_THING_FROM_THING

-

13.5. MULT_THING_BY_THING

+

12.5. MULT_THING_BY_THING

Alternatives

@@ -2145,7 +2237,7 @@

13.5. MULT_THING_BY_THING

-

13.6. DIV_THING_BY_THING

+

12.6. DIV_THING_BY_THING

Alternatives

@@ -2173,7 +2265,7 @@

13.6. DIV_THING_BY_THING

-

13.7. ABS

+

12.7. ABS

Alternatives

@@ -2193,7 +2285,7 @@

13.7. ABS

-

13.8. ADD_THING_TO_THING_TIMED

+

12.8. ADD_THING_TO_THING_TIMED

Alternatives

@@ -2215,7 +2307,7 @@

13.8. ADD_THING_TO_THING_TIMED

-

13.9. SUB_THING_FROM_THING_TIMED

+

12.9. SUB_THING_FROM_THING_TIMED

Alternatives

@@ -2237,7 +2329,7 @@

13.9. SUB_THING_FROM_THING_TIMED

-

13.10. IS_THING_EQUAL_TO_THING

+

12.10. IS_THING_EQUAL_TO_THING

Alternatives

@@ -2269,7 +2361,7 @@

13.10. IS_THING_EQUAL_TO_THING

-

13.11. IS_THING_GREATER_THAN_THING

+

12.11. IS_THING_GREATER_THAN_THING

Alternatives

@@ -2305,7 +2397,7 @@

13.11. IS_THING_GREATER_THAN_THING

-

13.12. IS_THING_GREATER_OR_EQUAL_TO_THING

+

12.12. IS_THING_GREATER_OR_EQUAL_TO_THING

Alternatives

@@ -2343,11 +2435,19 @@

13.12. IS_THING_GREATER_OR_EQUAL_TO_

-

Appendix A: Regular Lexical Grammar

+

Appendix A: Grammar Summary

+
+
+

TODO

+
+
+
+
+

Appendix B: Regular Lexical Grammar

-
# A Regular Lexical Grammar for GTA3script
+
# A Regular Lexical Grammar for GTA3script (informative)
 sep := sep ;
 eol := eol ;
 token := token_char {token_char}
@@ -2426,13 +2526,13 @@ 

Appendix A: Regular Lexical Grammar

-

Appendix B: Ambiguity

+

Appendix C: Ambiguity

Not only the language, but the grammar presented in this document is ambiguous. Here are all the instances of ambiguity, which is the correct derivation, and suggestions to avoid users getting trapped in them.

-

B.1. IF GOTO

+

C.1. IF GOTO

IF COMMAND goto other
@@ -2450,7 +2550,7 @@ 

B.1. IF GOTO

-

B.2. Ternary Minus One

+

C.2. Ternary Minus One

x = 1-1
@@ -2476,13 +2576,13 @@ 

B.2. Ternary Minus One

The fifth line is not ambiguous.

-

The token stream produced by the regular lexical grammar in the appendix should solve this issue naturally.

+

The token stream produced by the regular lexical grammar in Appendix B should solve this issue naturally.

-

Appendix C: How to MISS2

+

Appendix D: How to MISS2

The leaked script compiler is full of bugs. It was written for in-house use, so it’s meant to work and recognize at least the intended language. The problem is, the language is too inconsistent in this buggy superset. After constantly trying to make those bugs part of this specification, I strongly believe we shouldn’t. For the conservative, the following is a list of known things miss2 accepts that this specification does not.

@@ -2712,17 +2812,28 @@

Appendix C: How to MISS2

-
WAIT arr[0]anything // recognized
+
WAIT array[1]anything // recognized
+WAIT non_array[1]     // recognized
+WAIT non_array[2]     // not recognized
 // this specification does not accept this
-

Arachniography

+

References

-

TODO should we fix the floating point literals (e.g. '1.9.2')? I think there are DMA scripts that need this. @@ -2779,5 +2890,11 @@

Arachniography

+
+
+
+1. For consistency we have simplified this feature. Please refer to Appendix D for details on how the in-house compiler behaves. +
+
\ No newline at end of file