| |
LCS-2016-007a |
| |
1 {24-Jan-2017} 2 {02-Feb-2017} 3 {07-Feb-2017} |
| |
07-Feb-2017 |
| |
Voting |
| |
Patrick Lehmann Jim Lewis |
| |
Main.PatrickLehmann Main.JimLewis |
| |
Sequential Declaration Regions |
| |
Adds a short form for "Sequential Declaration Regions". |
begin reserved word in all sequential statements which support
a list of nested statements.
Version 2:
if_statement ::=
[ if_label : ]
if condition then
sequence_of_statements
sequential_statement_body
{ elsif condition then
sequence_of_statements
sequential_statement_body }
[ else
sequence_of_statements
sequential_statement_body ]
end if [ if_label ] ;
sequential_statement_body ::=
[ sequential_statement_declarative_part
begin ]
sequence_of_statements
sequential_statement_declarative_part ::=
{ process_declarative_item }
If a label appears at the end of an if statement, it shall repeat the if label. For the execution of an if statement, the condition specified after
case_statement ::=
[ case_label : ]
case [ ? ] expression is
case_statement_alternative
{ case_statement_alternative }
end case [ ? ] [ case_label ] ;
case_statement_alternative ::=
when choices =>
sequence_of_statements
sequential_statement_body
A case statement shall include the question mark delimiter either in both places, in which case the case statement is called a matching case
loop_statement ::=
[ loop_label : ]
[ iteration_scheme ] loop
sequence_of_statements
sequential_statement_body
end loop [ loop_label ] ;
iteration_scheme ::=
while condition
| for loop_parameter_specification
parameter_specification ::=
identifier in discrete_range
If a label appears at the end of a loop statement, it shall repeat the label at the beginning of the loop statement.
Execution of a loop statement is complete when the loop is left as a consequence of the completion of the iteration scheme (see the
if_statement ::=
[ if_label : ]
if condition then
sequence_of_statements
sequential_statement_body
{ elsif condition then
sequence_of_statements
sequential_statement_body }
[ else
sequence_of_statements
sequential_statement_body ]
end if [ if_label ] ;
case_statement_alternative ::=
when choices =>
sequence_of_statements
sequential_statement_body
loop_statement ::=
[ loop_label : ]
[ iteration_scheme ] loop
sequence_of_statements
sequential_statement_body
end loop [ loop_label ] ;
[New EBNF rule]
sequential_statement_body ::=
[ sequential_statement_declarative_part
begin ]
sequence_of_statements
sequential_statement_declarative_part ::=
{ process_declarative_item }
[ end [ alternative_label ] ; ] part.
There is already an end in the outer structure (e.g loop, ...).
It is also unclear to me what alternative_label label should point o.
-- case
statement as this would create the first awkward situation of a begin without an end.
-- end foo, but I'm against an additional end in case statement alternatives. See the case generate statement for a negative example.
-- begin without end in case statements would be awkward. Same applies to an if / elsif block followed by an
elsif or else block.elsif, the 1st sentence must be extended as follows (the blue part):
The equivalent if statement contains as many elsif branches as the original statement contains with the same conditions and in the
same order.
-- end keyword like in generate statements, when nobody ever uses it? Every elsif, else or when has
the same meaning as end. This is not Pascal, where begin .. end is equal to { ... } like in C. A begin keyword is a delimiter between the
declarative part and statement part -- at least in my eyes.
-- begin without end is just a matter of style. The other issues of my last comment still persist.
-- sequential_statement_body does not quite sound right as it suggests to be a part of a single statement. Maybe, naming it sequential_section or sequential_bock_body is getting closer.
TBP#2: The semantic description is based on a transformation to a sequential block statement. This creates unnecessary dependency chains through the LRM. I would prefer a flatter hierarchy and define the semantics bottom up based on a common sequential_section or something similar that is used by both the sequential block statement and the control-flow structures. I believe that this will also create a significantly shorter update combining 007 and 007a as the description of the transformation can be dropped.
-- sequential_statement_body does not quite sound right as it suggests to be a part of a single statement.
PL: Please see Annex C. EBNF rules with suffix _body mostly contain *_declarative_part -> begin -> statements -> end productions.
TBP: The semantic description is based on a transformation to a sequential block statement. This creates unnecessary dependency chains through the LRM.
PL: A major parts of the LRM are written as transformations. E.g. generated statements are block statements, entities are block statements as well,
every concurrent assignment or concurrent procedure call is translated into a process, ...
-- sequential_statement_list_body because it is a list and not a statement.
PL: A major parts of the LRM are written as transformations.
TBP: Sometimes transformations make life easier. Concurrent assignments are most easily described this way and a bottom-up composition is not really an option. I do not see any such advantage or even need here.
-- _list is used for unordered lists; otherwise it's a sequence. Regarding the use of _body : see architecture_body, generate_statement_body, subprogram_body, package_body and finally protected_type_body. They all fit into the scheme *_declarative_part -> begin -> statements -> end.
TBP: I do not see any such advantage or even need here.
PL: You can still submit alternative LCS' until mid of February. I've written a lot of LCS'. I have to write some new LCS' and I also have to finalize three LCS' in the next two weeks. So I won't change anything, other then for technical objections.
-- sequential_statement_body is misleading.
generate statements. They are concurrent - well with the exception of their declarative part. Is this what you are after?
--