Project

General

Profile

Actions

Feature #8818

closed

Extending grammar to allow else if

Added by Alexander Kamkin almost 5 years ago. Updated almost 5 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 #1

Updated by Alexander Kamkin almost 5 years ago

  • Status changed from New to Resolved

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

Actions #2

Updated by Alexander Kamkin almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF