Project

General

Profile

Feature #8818

Extending grammar to allow else if

Added by Alexander Kamkin over 2 years ago. Updated over 2 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

History

#1

Updated by Alexander Kamkin over 2 years ago

  • Status changed from New to Resolved

Grammar is Ok. The problem is in AST construction. Fixed.

#2

Updated by Alexander Kamkin over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF