diff options
author | Tristan Gingold | 2015-01-10 06:51:02 +0100 |
---|---|---|
committer | Tristan Gingold | 2015-01-10 06:51:02 +0100 |
commit | 2c498db7b2702d3ad762c5a35c23bb41538331b7 (patch) | |
tree | be271050334c14aed09c29a2d24750829a811430 /src/vhdl/parse.adb | |
parent | 91af32964eb22b8fe42551a1fa48c7637563fa55 (diff) | |
download | ghdl-2c498db7b2702d3ad762c5a35c23bb41538331b7.tar.gz ghdl-2c498db7b2702d3ad762c5a35c23bb41538331b7.tar.bz2 ghdl-2c498db7b2702d3ad762c5a35c23bb41538331b7.zip |
vhdl08: block configuration for if-generate statements.
Diffstat (limited to 'src/vhdl/parse.adb')
-rw-r--r-- | src/vhdl/parse.adb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb index a865da6..e9f7c99 100644 --- a/src/vhdl/parse.adb +++ b/src/vhdl/parse.adb @@ -6166,9 +6166,7 @@ package body Parse is case Current_Token is when Tok_Elsif | Tok_Else => - if Get_Kind (Parent) = Iir_Kind_If_Generate_Statement - or else Get_Kind (Parent) = Iir_Kind_If_Generate_Else_Clause - then + if Get_Kind (Parent) = Iir_Kind_If_Generate_Statement then return Bod; end if; when others => @@ -6309,6 +6307,11 @@ package body Parse is Alt_Label := Null_Identifier; if Current_Token = Tok_Colon then if Get_Kind (Cond) = Iir_Kind_Simple_Name then + if Vhdl_Std < Vhdl_08 then + Error_Msg_Parse + ("alternative label not allowed before vhdl08"); + end if; + -- In fact the parsed condition was an alternate label. Alt_Label := Get_Identifier (Cond); Free_Iir (Cond); @@ -6330,7 +6333,7 @@ package body Parse is Scan; Set_Generate_Statement_Body - (Clause, Parse_Generate_Statement_Body (Clause, Alt_Label)); + (Clause, Parse_Generate_Statement_Body (Res, Alt_Label)); if Last /= Null_Iir then Set_Generate_Else_Clause (Last, Clause); @@ -6341,6 +6344,10 @@ package body Parse is end loop; if Current_Token = Tok_Else then + if Vhdl_Std < Vhdl_08 then + Error_Msg_Parse ("else generate not allowed before vhdl08"); + end if; + Clause := Create_Iir (Iir_Kind_If_Generate_Else_Clause); Set_Location (Clause); @@ -6366,7 +6373,7 @@ package body Parse is Scan; Set_Generate_Statement_Body - (Clause, Parse_Generate_Statement_Body (Clause, Alt_Label)); + (Clause, Parse_Generate_Statement_Body (Res, Alt_Label)); Set_Generate_Else_Clause (Last, Clause); end if; @@ -7005,14 +7012,14 @@ package body Parse is -- precond : FOR -- postcond: ';' -- - -- [ �1.3.1 ] + -- [ 1.3.1 ] -- block_configuration ::= -- FOR block_specification -- { use_clause } -- { configuration_item } -- END FOR ; -- - -- [ �1.3.1 ] + -- [ 1.3.1 ] -- block_specification ::= -- ARCHITECTURE_name -- | BLOCK_STATEMENT_label |