Skip to content

Commit

Permalink
Extend grammar with source location decorations
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Feb 22, 2023
1 parent 7478d1b commit 743d0c7
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions RationaleMCP/0031/grammar.md
Expand Up @@ -66,10 +66,10 @@ The _S-CHAR_ accepts Unicode other than " and \\:
> _flat-modelica_\
>   _VERSION-HEADER_\
>   **package** _IDENT_\
>    ( _class-definition_ **;**\
>    | _global-constant_ **;**\
>    ( _decoration_? _class-definition_ **;**\
>    | _decoration_? _global-constant_ **;**\
>    )*\
>    **model** _long-class-specifier_ **;**\
>    _decoration_? **model** _long-class-specifier_ **;**\
>    ( _annotation-comment_ **;** )?
>   **end** _IDENT_ **;**
Expand Down Expand Up @@ -130,14 +130,14 @@ end _F;
> _enumeration-literal__IDENT_ _comment_
> _composition_\
>   (_generic-element_ **;**)* \
>   (_decoration_? _generic-element_ **;**)* \
>   ( **equation** ( _equation_ **;** )* \
>   | **initial** **equation** ( _initial-equation_ **;** )* \
>   | **initial**? **algorithm** ( _statement_ **;** )* \
>   ~~| **public** (_generic-element_ **;**)*~~ \
>   ~~| **protected** (_generic-element_ **;**)*~~ \
>   )* \
>   ( **external** _language-specification_?\
>   ( _decoration_? **external** _language-specification_?\
>    _external-function-call_? _annotation-comment_? **;**\
>   )?\
>   _base-partition_* \
Expand Down Expand Up @@ -190,7 +190,7 @@ end _F;
>   | **algorithm** ( _statement_ **;** )* \
>   )*
> _clock-clause_**Clock** _IDENT_ **=** _expression_ _comment_
> _clock-clause__decoration_? **Clock** _IDENT_ **=** _expression_ _comment_

## B23 Extends
Expand Down Expand Up @@ -231,7 +231,7 @@ end _F;
> _argument-list__argument_ ( **,** _argument_ )*
> _argument_\
>  _element-modification-or-replaceable_\
>  _decoration_? _element-modification-or-replaceable_\
>   ~~| _element-redeclaration_~~
> _element-modification-or-replaceable_\
Expand Down Expand Up @@ -266,7 +266,8 @@ end _F;
## B26 Equations

> _equation_\
>   ( _simple-expression_ ( **=** _expression_ )?\
>   _decoration_?\
>   ( _simple-expression_ _decoration_? ( **=** _expression_ )?\
>   | _if-equation_\
>   | _for-equation_\
>   ~~| _connect-clause_~~\
Expand All @@ -277,6 +278,7 @@ end _F;
> _initial-equation__equation_ | _prioritize-equation_
> _statement_\
>   _decoration_?\
>   ( _component-reference_ ( **:=** _expression_ | _function-call-args_ )\
>   | `[(]` _output-expression-list_ `[)]` **:=** _component-reference_ _function-call-args_\
>   | **break**\
Expand Down Expand Up @@ -356,12 +358,16 @@ end _F;

## Expressions

> _expression__simple-expression_ | _if-expression_
> _decoration_**@** UNSIGNED-INTEGER
> _expression__expression-no-decoration_ _decoration_?
> _expression-no-decoration__simple-expression_ | _if-expression_
> _if-expression_\
>   **if** _expression_ **then** _expression_\
>   ( **elseif** _expression_ **then** _expression_ )* \
>   **else** _expression_
>   **else** _expression-no-decoration_
> _simple-expression__logical-expression_ ( **:** _logical-expression_ ( **:** _logical-expression_ )? )?
Expand Down Expand Up @@ -392,7 +398,7 @@ end _F;
>   | **true**\
>   | ( **der** | **initial** | **pure** ) _function-call-args_\
>   | _component-reference_ _function-call-args_?\
>   | `[(]` _output-expression-list_ `[)]` _array-subscripts_?\
>   | `[(]` _decoration_? _output-expression-list_ `[)]` _array-subscripts_?\
>   | `[[]` _expression-list_ ( **;** _expression-list_ )* `[]]`\
>   | **{** _array-arguments_ **}**\
>   | **end**
Expand Down

0 comments on commit 743d0c7

Please sign in to comment.