Example for correctly formatted code contains mistakes
In 9.2.4 Example: Code 3. Example for correctly formatted code in ASAM OpenSCENARIO, there is a range of problems:
- Line 25: file_path is not a valid osc2 type. Also, it goes against the formatting recommendations (No space between value and unit)
- E.g., line 66: See in the standard here. Many parameters are accessed using an exclamation mark operator. However, the only grammar rule allowing the exclamation mark is
enum-value-reference ::= [enum-name '!'] enum-member-name
That does not allow the '!' to occur at the start of a name, it has to be used after an enum-name.
- Line 1: The scenario declaration does not end with a colon.
- E.g., line 30: The '^' character is not valid in OpenSCENARIO2 in any location outside of comments.
- E.g., Line 34: OpenSCENARIO2 does not allow assignment as shown here, should it be replaced with
keep(simple_3_lane_road_01.lanes == [lane1, lane2, lane3])
- E.g., line 35: The '.' operator does not exist in OpenSCENARIO2, should the '' be removed?
- Line 41: Used curly braces instead of angle brackets.
- Line 41: 'if' is listed as a keyword, 'THEN' is not. However, the standard never defines an 'if then' statement, only a ternary 9. operator, and an 'if' operator used in event specifications.
- E.g., line 37: No updated syntax for left_of, should probably be replaced with a different construct altogether.
- E.g., line 62: Argument specification requires 'identifier : type' syntax.
- E.g., line 62: External method specification requires parentheses and an optional argument list after the identifier, not a string literal.
- E.g., line 72: No argument types should appear in a function call, only the symbols. Furthermore, an event-specification is missing in the sample statement, and the bracket syntax appears inappropriate.
- Line 75: one_of is only used as a composition operator inside do-directives, perhaps use an every-expression instead. E.g., line 80: event-declaration cannot declare a list element, only a new event can be declared, and a list could be created of those after.
- Line 95: Until does not use parentheses.