Project

General

Profile

Actions

Feature #8818

closed

Extending grammar to allow else if

Added by Alexander Kamkin over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
04/11/2018
Due date:
% Done:

0%

Estimated time:
Published in build:

Description

The current grammar conforms the IEEE 1364-2005 Std.

if_generate
    : KW_IF LPAREN cond=expression RPAREN
        then_body=generate_block_or_null
        ((KW_ELSE)=> KW_ELSE else_body=generate_block_or_null)?
;

generate_block
    : module_or_generate_item
    | KW_BEGIN
        (module_or_generate_item)*
      KW_END
;

generate_block_or_null
    : generate_block
    | SEMI!
;

However, there industrial designs (e.g., Altera's ones) that use syntax.

if (...) begin
 ...
else if (...) begin
...
end
Actions

Also available in: Atom PDF