Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7fe565c

Browse files
committed
Review section 5 to 12
1 parentb2c7dc5 commit7fe565c

File tree

9 files changed

+51
-57
lines changed

9 files changed

+51
-57
lines changed

‎core/alternators.adoc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A _command selector_ (or _alternator_) is a kind of command which gets rewritten
55

66
A command selector consists of a name and a finite sequence of commands which are alternatives for replacement.
77

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.
99

1010
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:
1111

‎core/appendix-miss2.adoc‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ More control codes than the specified are _accepted_ by miss2 (such as `\r` anyw
1111

1212
You may use custom characters (c > 127), but you may clash with the characters DMA used to tokenize string literals.
1313

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
15+
1416
*A string literal is the same as four tokens*
1517

1618
----

‎core/command-def.adoc‎

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ In order to perform useful computation the following supporting commands may be
1212
WAIT INPUT_INT
1313
----
1414

15-
*Side-effects*
15+
*Sideeffects*
1616

1717
Yields control to another script. The current script is not resumed for at least the specified number of milliseconds.
1818

19-
This command is useful due to the cooperative multitasking nature of the execution environment.
20-
2119
[[command-def-goto]]
2220
=== GOTO
2321

@@ -27,7 +25,7 @@ This command is useful due to the cooperative multitasking nature of the executi
2725
GOTO LABEL
2826
----
2927

30-
*Side-effects*
28+
*Sideeffects*
3129

3230
Performs a jump to the specified location.
3331

@@ -40,7 +38,7 @@ Performs a jump to the specified location.
4038
GOSUB LABEL
4139
----
4240

43-
*Side-effects*
41+
*Sideeffects*
4442

4543
Calls the subroutine in the specified location.
4644

@@ -53,7 +51,7 @@ Calls the subroutine in the specified location.
5351
RETURN
5452
----
5553

56-
*Side-effects*
54+
*Sideeffects*
5755

5856
Returns from the last called subroutine.
5957

@@ -68,7 +66,7 @@ The behaviour is undefined if there is no active subroutine.
6866
RETURN_TRUE
6967
----
7068

71-
*Side-effects*
69+
*Sideeffects*
7270

7371
Returns true (as in any command updating the compare flag to true).
7472

@@ -81,7 +79,7 @@ Returns true (as in any command updating the compare flag to true).
8179
RETURN_FALSE
8280
----
8381

84-
*Side-effects*
82+
*Sideeffects*
8583

8684
Returns false (as in any command updating the compare flag to false).
8785

@@ -94,7 +92,7 @@ Returns false (as in any command updating the compare flag to false).
9492
SCRIPT_NAME TEXT_LABEL
9593
----
9694

97-
*Side-effects*
95+
*Sideeffects*
9896

9997
Associates a name to the executing script.
10098

@@ -104,7 +102,7 @@ The translation environment must enforce the following constraints.
104102

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

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.]
108106

109107
[[command-def-terminate-this-script]]
110108
=== TERMINATE_THIS_SCRIPT
@@ -115,7 +113,7 @@ It is unspecified whether a name given by a text label variable is accepted.
115113
TERMINATE_THIS_SCRIPT
116114
----
117115

118-
*Side-effects*
116+
*Sideeffects*
119117

120118
Terminates the executing script.
121119

@@ -128,7 +126,7 @@ Terminates the executing script.
128126
START_NEW_SCRIPT LABEL INPUT_OPT...
129127
----
130128

131-
*Side-effects*
129+
*Sideeffects*
132130

133131
Creates a script and sets its program counter to the specified label location.
134132

@@ -138,10 +136,10 @@ The first few local variables at the scope of the target label are assigned the
138136

139137
The translation environment must enforce the following constraints.
140138

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).]
142140

143141
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.
144142

145143
If there are not enough local variables in the target scope to accomodate the input arguments the program is ill-formed.
146144

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>>).

‎core/concepts.adoc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ A _main extension file_ (or _foreign gosub file_) is a script file required by t
4141

4242
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.
4343

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.
4545

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

‎core/elements.adoc‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
[[elements]]
22
==Elements
33

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.]
55

66
[[element-source-code]]
77
=== Source Code
88

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]
1010

1111
----
1212
ascii_char := ascii_printable | ascii_control ;
1313
ascii_printable := /* printable ASCII characters */ ;
1414
ascii_control := '\n' | '\t' | '\r' ;
1515
----
1616

17-
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.]
1818

1919
Lowercase letters in the stream shall be interpreted as its uppercase equivalent.
2020

21-
Space, horizontal tab, parentheses and comma are defined aswhitespace characters.
21+
Space, horizontal tab, parentheses and comma are defined as_whitespace_ characters.
2222

2323
----
2424
whitespace := ' ' | '\t' | '(' | ')' | ',' ;
@@ -30,7 +30,7 @@ A _line_ is a sequence of characters delimited by a newline. The start of the st
3030
newline := ['\r'] `\n` ;
3131
----
3232

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.]
3434

3535
A _token character_ is any character capable of forming a single token.
3636

@@ -62,12 +62,12 @@ There are two forms:
6262
* _Line comments_ starts with the character sequence `//` and stop at the end of the line.
6363
* _Block comments_ starts with the character sequence `/\*` and stop with its matching `*/`. Block comments can be nested inside each other.
6464

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:
6666

6767
* A line comment should be interpreted as an `eol`.
6868
* 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.
6969

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.]
7171

7272
[[element-command]]
7373
=== Commands
@@ -96,7 +96,7 @@ digit := '0'..'9' ;
9696
integer := ['-'] digit {digit} ;
9797
----
9898

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]
100100

101101
If the literal begins with a minus, the number following it shall be negated.
102102

@@ -111,7 +111,7 @@ floating := ['-'] (floating_form1 | floating_form2) ;
111111

112112
A _floating-point literal_ is a sequence of digits which must contain at least one occurrence of the characters `.` or `F`.
113113

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.]
115115

116116
The literal can be preceded by a minus sign, which shall negate the floating-point number.
117117

@@ -188,7 +188,7 @@ variable_char := token_char - ('[' | ']') ;
188188
variable_name := ('$' | 'A'..'Z') {variable_char} ;
189189
----
190190

191-
A _variable reference_ is a variable name optionally followed by an array subscript.
191+
A _variable reference_ is a variable name optionally followed by an array subscript.footnoteref:[miss2]
192192

193193
----
194194
subscript := '[' (variable_name | integer) ']' ;
@@ -197,10 +197,10 @@ variable := variable_name [ subscript ] ;
197197

198198
The type of a variable reference is the type of the variable name being referenced.
199199

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.]
201201

202202
The program is ill-formed if the array subscript uses a negative or out of bounds value for indexing.
203203

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]
205205

206206
An array variable name which is not followed by a subscript behaves as if its zero-indexed element is referenced.

‎core/expressions.adoc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
An argument in an expression cannot be a string literal.
77

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.
99

1010
[[assignment-expressions]]
1111
=== Assignment Expressions
@@ -75,7 +75,7 @@ The ternary assignment `a = b + c` behaves as if the following is executed:
7575
The ternary assignment `a = b - c` behaves as if the following is executed:
7676

7777
* `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.]
7979
* `SET a b` followed by `SUB_THING_BY_THING a c` otherwise.
8080

8181
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`.

‎core/parameters.adoc‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A command receives several arguments. Every argument must obey the rules of its
55

66
A _parameter definition_ is a set of definitions regarding a single parameter for a specific command.
77

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.
99

1010
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.
1111

@@ -31,9 +31,7 @@ A parameter definition can have an associated entity type.
3131

3232
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.
3333

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.
3735

3836
[[parameter-types]]
3937
=== Parameter Types

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp