You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/alternators.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ A _command selector_ (or _alternator_) is a kind of command which gets rewritten
5
5
6
6
A command selector consists of a name and a finite sequence of commands which are alternatives for replacement.
7
7
8
-
A command name which is the name of a selector shall behave as if its command name is rewritten as a_matching alternative_ before any parameter checking takes place.
8
+
A command name which is the name of a selector shall behave as if its command name is rewritten as amatching alternative before any parameter checking takes place.
9
9
10
10
A _matching alternative_ is the first command in the alternative sequence to have the same amount of parameters as arguments in the actual command, and to obey the following rules for every argument and its corresponding parameter:
Copy file name to clipboardExpand all lines: core/appendix-miss2.adoc
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ More control codes than the specified are _accepted_ by miss2 (such as `\r` anyw
11
11
12
12
You may use custom characters (c > 127), but you may clash with the characters DMA used to tokenize string literals.
13
13
14
+
BLA BLA The in-house compiler recognizes all of the octets in the range 01 through FF almost indiscriminately. Some of these codes produce unexpected results, while others are used internally during translation (for e.g. escaping string literals). In practice, only the printable characters were used by designers. For simplicity we restrict source code to these characters. BLA BLA
Copy file name to clipboardExpand all lines: core/command-def.adoc
+12-14Lines changed: 12 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,10 @@ In order to perform useful computation the following supporting commands may be
12
12
WAIT INPUT_INT
13
13
----
14
14
15
-
*Side-effects*
15
+
*Sideeffects*
16
16
17
17
Yields control to another script. The current script is not resumed for at least the specified number of milliseconds.
18
18
19
-
This command is useful due to the cooperative multitasking nature of the execution environment.
20
-
21
19
[[command-def-goto]]
22
20
=== GOTO
23
21
@@ -27,7 +25,7 @@ This command is useful due to the cooperative multitasking nature of the executi
27
25
GOTO LABEL
28
26
----
29
27
30
-
*Side-effects*
28
+
*Sideeffects*
31
29
32
30
Performs a jump to the specified location.
33
31
@@ -40,7 +38,7 @@ Performs a jump to the specified location.
40
38
GOSUB LABEL
41
39
----
42
40
43
-
*Side-effects*
41
+
*Sideeffects*
44
42
45
43
Calls the subroutine in the specified location.
46
44
@@ -53,7 +51,7 @@ Calls the subroutine in the specified location.
53
51
RETURN
54
52
----
55
53
56
-
*Side-effects*
54
+
*Sideeffects*
57
55
58
56
Returns from the last called subroutine.
59
57
@@ -68,7 +66,7 @@ The behaviour is undefined if there is no active subroutine.
68
66
RETURN_TRUE
69
67
----
70
68
71
-
*Side-effects*
69
+
*Sideeffects*
72
70
73
71
Returns true (as in any command updating the compare flag to true).
74
72
@@ -81,7 +79,7 @@ Returns true (as in any command updating the compare flag to true).
81
79
RETURN_FALSE
82
80
----
83
81
84
-
*Side-effects*
82
+
*Sideeffects*
85
83
86
84
Returns false (as in any command updating the compare flag to false).
87
85
@@ -94,7 +92,7 @@ Returns false (as in any command updating the compare flag to false).
94
92
SCRIPT_NAME TEXT_LABEL
95
93
----
96
94
97
-
*Side-effects*
95
+
*Sideeffects*
98
96
99
97
Associates a name to the executing script.
100
98
@@ -104,7 +102,7 @@ The translation environment must enforce the following constraints.
104
102
105
103
The name of a script must be unique across the multi-file.
106
104
107
-
It is unspecified whether a name given by a text label variable is accepted.
105
+
It is unspecified whether a name given by a text label variable is accepted.footnote:[The in-house compiler does not handle the case of text label variables in `SCRIPT_NAME`, but this does not tell much because it barely supports any text label variable feature. No compiled multi-file contains script names assigned by a variable. Thus, we refrain from defining any semantics for this case.]
108
106
109
107
[[command-def-terminate-this-script]]
110
108
=== TERMINATE_THIS_SCRIPT
@@ -115,7 +113,7 @@ It is unspecified whether a name given by a text label variable is accepted.
115
113
TERMINATE_THIS_SCRIPT
116
114
----
117
115
118
-
*Side-effects*
116
+
*Sideeffects*
119
117
120
118
Terminates the executing script.
121
119
@@ -128,7 +126,7 @@ Terminates the executing script.
128
126
START_NEW_SCRIPT LABEL INPUT_OPT...
129
127
----
130
128
131
-
*Side-effects*
129
+
*Sideeffects*
132
130
133
131
Creates a script and sets its program counter to the specified label location.
134
132
@@ -138,10 +136,10 @@ The first few local variables at the scope of the target label are assigned the
138
136
139
137
The translation environment must enforce the following constraints.
140
138
141
-
The specified label location must be within a scope. Such scope may begin at the next non-empty embedded statement relative to the label location.
139
+
The specified label location must be within a scope. Such scope may begin at the next non-empty embedded statement relative to the label location.footnote:[For GTA III 10th Anniversary multi-files, all target scopes are a line after its target label, which would emit an error in the in-house compiler (for GTA Vice City).]
142
140
143
141
The type of a local variable and its respective input argument must match. For instance, if an input argument is an integer literal or variable of integer type, its corresponding local variable in the target scope must be of integer type.
144
142
145
143
If there are not enough local variables in the target scope to accomodate the input arguments the program is ill-formed.
146
144
147
-
If an input argument is a variable, the value assignment to the variable in the target scope shall obey the same constraints as specifiedin theSETalternator.
145
+
If an input argument is a variable, the value assignment to the variable in the target scope shall obey the same constraints as specifiedfor `SET` (<<alternator-def-set>>).
Copy file name to clipboardExpand all lines: core/concepts.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ A _main extension file_ (or _foreign gosub file_) is a script file required by t
41
41
42
42
A _subscript file_ is a script file required by the means of a LAUNCH_MISSION statement. A _subscript_ is a script started by the same statement.
43
43
44
-
A _mission script file_ is a script file required by the means of a LOAD_AND_LAUNCH_MISSION statement. A _mission script_ is a script started by the same statement. Only a single mission script can be running at once.
44
+
A _mission script file_ is a script file required by the means of a LOAD_AND_LAUNCH_MISSION statement. A _mission script_ is a script started by the same statement.
45
45
46
46
An implementation may contain special features regarding the way subscripts and mission scripts are executed.
Copy file name to clipboardExpand all lines: core/elements.adoc
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,24 @@
1
1
[[elements]]
2
2
==Elements
3
3
4
-
The lexical grammar of the language is context-sensitive. As such, the lexical elements and the syntactic elements are presented together.
4
+
The lexical grammar of the language is context-sensitive. As such, the lexical elements and the syntactic elements are presented together.footnote:[The in-house compiler is an ad-hoc parser, introducing a lot of contextual problems to the language.]
5
5
6
6
[[element-source-code]]
7
7
=== Source Code
8
8
9
-
_Source code_ is a stream of printable ASCII characters plus the control codes line feed (`\n`), horizontal tab (`\t`) and carriage return (`\r`).
9
+
_Source code_ is a stream of printable ASCII characters plus the control codes line feed (`\n`), horizontal tab (`\t`) and carriage return (`\r`).footnoteref:[miss2]
Carriage returns should appear only before a line feed.
17
+
Carriage returns should appear only before a line feed.footnote:[The in-house compiler does not have such a restriction. We introduce it for simplicity.]
18
18
19
19
Lowercase letters in the stream shall be interpreted as its uppercase equivalent.
20
20
21
-
Space, horizontal tab, parentheses and comma are defined aswhitespace characters.
21
+
Space, horizontal tab, parentheses and comma are defined as_whitespace_ characters.
22
22
23
23
----
24
24
whitespace := ' ' | '\t' | '(' | ')' | ',' ;
@@ -30,7 +30,7 @@ A _line_ is a sequence of characters delimited by a newline. The start of the st
30
30
newline := ['\r'] `\n` ;
31
31
----
32
32
33
-
Each line should be interpreted as if there is no whitespaces in either ends of the line.
33
+
Each line should be interpreted as if there is no whitespaces in either ends of the line.footnoteref:[simplify-whitespace,This simplifies the syntactic specification.]
34
34
35
35
A _token character_ is any character capable of forming a single token.
36
36
@@ -62,12 +62,12 @@ There are two forms:
62
62
* _Line comments_ starts with the character sequence `//` and stop at the end of the line.
63
63
* _Block comments_ starts with the character sequence `/\*` and stop with its matching `*/`. Block comments can be nested inside each other.
64
64
65
-
The contents of a comment shall be interpreted as if it is whitespaces in the source code. More specifically:
65
+
The contents of a comment shall be interpreted as if it is whitespaces in the source code.footnoteref:[simplify-whitespace] More specifically:
66
66
67
67
* A line comment should be interpreted as an `eol`.
68
68
* A single, nested, block comment should be interpreted as an `eol` on each line boundary it crosses. On its last line (i.e. the one it does not cross), it should be interpreted as one or more whitespace characters.
69
69
70
-
Comments cannot start inside string literals.
70
+
Comments cannot start inside string literals.footnote:[i.e. `"This // is a string"` is a string literal, not an incomplete string.]
71
71
72
72
[[element-command]]
73
73
=== Commands
@@ -96,7 +96,7 @@ digit := '0'..'9' ;
96
96
integer := ['-'] digit {digit} ;
97
97
----
98
98
99
-
An _integer literal_ is a sequence of digits optionally preceded by a minus sign.
99
+
An _integer literal_ is a sequence of digits optionally preceded by a minus sign.footnoteref:[miss2]
100
100
101
101
If the literal begins with a minus, the number following it shall be negated.
A _floating-point literal_ is a sequence of digits which must contain at least one occurrence of the characters `.` or `F`.
113
113
114
-
Once the `F` characters is found, all characters including and following it shall be ignored. The same shall happen when the character `.` is found a second time.
114
+
Once the `F` characters is found, all characters including and following it shall be ignored. The same shall happen when the character `.` is found a second time.footnote:[We have not simplified this misfeature because it is used in one of the GTA III 10th Anniversary scripts.]
115
115
116
116
The literal can be preceded by a minus sign, which shall negate the floating-point number.
The type of a variable reference is the type of the variable name being referenced.
199
199
200
-
The subscript uses an integer literal or another variable name of integer type for zero-based indexing.
200
+
The subscript uses an integer literal or another variable name of integer type for zero-based indexing.footnote:[The in-house compiler uses one-based indexing. Its array feature is incomplete and produces problematic bytecode when subscripting variables. Additionally, the GTA Vice City runtime (the target of the in-house compiler) does not support arrays. Thus it's believed this feature is still incomplete in V413 and was never used. Not until GTA San Andreas, which introduces arrays in the execution environment. Its runtime performs zero-based indexing on variable subscripts, but for literal subscripts we can only guess. The compiled multifile contains debug strings that suggests zero-based indexing for literals.]
201
201
202
202
The program is ill-formed if the array subscript uses a negative or out of bounds value for indexing.
203
203
204
-
The program is ill-formed if a variable name is followed by a subscript but the variable is not an array.
204
+
The program is ill-formed if a variable name is followed by a subscript but the variable is not an array.footnoteref:[miss2]
205
205
206
206
An array variable name which is not followed by a subscript behaves as if its zero-indexed element is referenced.
Copy file name to clipboardExpand all lines: core/expressions.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
6
6
An argument in an expression cannot be a string literal.
7
7
8
-
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 ofa expression.
8
+
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 ofan expression.
9
9
10
10
[[assignment-expressions]]
11
11
=== Assignment Expressions
@@ -75,7 +75,7 @@ The ternary assignment `a = b + c` behaves as if the following is executed:
75
75
The ternary assignment `a = b - c` behaves as if the following is executed:
76
76
77
77
* `SUB_THING_FROM_THING a c` if the name `a` is the same as the name `b`.
78
-
* Implementation-defined if `a` is the same name as `c`.
78
+
* Implementation-defined if `a` is the same name as `c`.footnote:[The in-house compiler uses unsupported command selectors (`NEGATE` for substraction and `ONEOVER` for division) to perform this operation.]
79
79
* `SET a b` followed by `SUB_THING_BY_THING a c` otherwise.
80
80
81
81
The ternary assignment `a = b * c` behaves as if `a = b + c`, except by using `MULT_THING_BY_THING` instead of `ADD_THING_TO_THING`.
Copy file name to clipboardExpand all lines: core/parameters.adoc
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ A command receives several arguments. Every argument must obey the rules of its
5
5
6
6
A _parameter definition_ is a set of definitions regarding a single parameter for a specific command.
7
7
8
-
A command must have the same amount of arguments as its amount of parameter definitions, unless the missing arguments correspond to_optional parameters_ (defined below).
8
+
A command must have the same amount of arguments as its amount of parameter definitions, unless the missing arguments correspond tooptional parameters.
9
9
10
10
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.
11
11
@@ -31,9 +31,7 @@ A parameter definition can have an associated entity type.
31
31
32
32
An entity can be assigned to a variable. In such case, the variable is said to be of that specific entity type from that line of code on. Previous lines of code are not affected.
33
33
34
-
If an entity type is associated with an parameter and a variable is used as argument, the variable must have the same entity type as the parameter.
35
-
36
-
Further semantics for entities are defined along this document.
34
+
If an entity type is associated with an parameter and a variable is used as argument, the variable must have the same entity type as the formal parameter.