diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-10-05 03:58:52 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-10-05 03:58:52 +0200 |
commit | c17992d28aa5b4b67828a0e717cf4840ba980628 (patch) | |
tree | e92cb4028ddd1ac9c9f43009a33579485b9f2cb4 | |
parent | 937c3e565b1f249bf86805c8cb6d8ff93fa8d4b8 (diff) | |
download | ghdl-c17992d28aa5b4b67828a0e717cf4840ba980628.tar.gz ghdl-c17992d28aa5b4b67828a0e717cf4840ba980628.tar.bz2 ghdl-c17992d28aa5b4b67828a0e717cf4840ba980628.zip |
disp_vhdl: print 'parameter' if textually present.
-rw-r--r-- | src/vhdl/disp_vhdl.adb | 5 | ||||
-rw-r--r-- | src/vhdl/iirs.adb | 16 | ||||
-rw-r--r-- | src/vhdl/iirs.ads | 9 | ||||
-rw-r--r-- | src/vhdl/nodes_meta.adb | 350 | ||||
-rw-r--r-- | src/vhdl/nodes_meta.ads | 2 | ||||
-rw-r--r-- | src/vhdl/parse.adb | 2 |
6 files changed, 222 insertions, 162 deletions
diff --git a/src/vhdl/disp_vhdl.adb b/src/vhdl/disp_vhdl.adb index ec26bb84f..01ad49552 100644 --- a/src/vhdl/disp_vhdl.adb +++ b/src/vhdl/disp_vhdl.adb @@ -1454,6 +1454,11 @@ package body Disp_Vhdl is Put (' '); Disp_Function_Name (Subprg); + if Get_Has_Parameter (Subprg) then + Put (' '); + Put ("parameter"); + end if; + Inter := Get_Interface_Declaration_Chain (Subprg); if Implicit then Disp_Interface_Chain (Inter, "", Start); diff --git a/src/vhdl/iirs.adb b/src/vhdl/iirs.adb index d7546d2d7..06ee9a305 100644 --- a/src/vhdl/iirs.adb +++ b/src/vhdl/iirs.adb @@ -5356,6 +5356,22 @@ package body Iirs is Set_Flag9 (Decl, Flag); end Set_Has_Body; + function Get_Has_Parameter (Decl : Iir) return Boolean is + begin + pragma Assert (Decl /= Null_Iir); + pragma Assert (Has_Has_Parameter (Get_Kind (Decl)), + "no field Has_Parameter"); + return Get_Flag10 (Decl); + end Get_Has_Parameter; + + procedure Set_Has_Parameter (Decl : Iir; Flag : Boolean) is + begin + pragma Assert (Decl /= Null_Iir); + pragma Assert (Has_Has_Parameter (Get_Kind (Decl)), + "no field Has_Parameter"); + Set_Flag10 (Decl, Flag); + end Set_Has_Parameter; + function Get_Has_Identifier_List (Decl : Iir) return Boolean is begin pragma Assert (Decl /= Null_Iir); diff --git a/src/vhdl/iirs.ads b/src/vhdl/iirs.ads index a521fda52..59d6c904f 100644 --- a/src/vhdl/iirs.ads +++ b/src/vhdl/iirs.ads @@ -1372,6 +1372,8 @@ package Iirs is -- True is the specification is immediately followed by a body. -- Get/Set_Has_Body (Flag9) -- + -- Get/Set_Has_Parameter (Flag10) + -- -- Only for Iir_Kind_Procedure_Declaration: -- Get/Set_Suspend_Flag (Flag11) -- @@ -1484,6 +1486,8 @@ package Iirs is -- Only for Iir_Kind_Interface_Function_Declaration: -- Get/Set_Has_Pure (Flag8) -- + -- Get/Set_Has_Parameter (Flag10) + -- -- Get/Set_All_Sensitized_State (State3) -- Iir_Kind_Signal_Declaration (Short) @@ -7020,6 +7024,11 @@ package Iirs is function Get_Has_Body (Decl : Iir) return Boolean; procedure Set_Has_Body (Decl : Iir; Flag : Boolean); + -- Layout flag: true if 'parameter' reserved identifier is present. + -- Field: Flag10 + function Get_Has_Parameter (Decl : Iir) return Boolean; + procedure Set_Has_Parameter (Decl : Iir; Flag : Boolean); + -- Layout flag for object declaration. If True, the identifier of this -- declaration is followed by an identifier (and separated by a comma). -- This flag is set on all but the last declarations. diff --git a/src/vhdl/nodes_meta.adb b/src/vhdl/nodes_meta.adb index 63bae62b4..21142d2d3 100644 --- a/src/vhdl/nodes_meta.adb +++ b/src/vhdl/nodes_meta.adb @@ -319,6 +319,7 @@ package body Nodes_Meta is Field_Has_Is => Type_Boolean, Field_Has_Pure => Type_Boolean, Field_Has_Body => Type_Boolean, + Field_Has_Parameter => Type_Boolean, Field_Has_Identifier_List => Type_Boolean, Field_Has_Mode => Type_Boolean, Field_Has_Class => Type_Boolean, @@ -944,6 +945,8 @@ package body Nodes_Meta is return "has_pure"; when Field_Has_Body => return "has_body"; + when Field_Has_Parameter => + return "has_parameter"; when Field_Has_Identifier_List => return "has_identifier_list"; when Field_Has_Mode => @@ -2110,6 +2113,8 @@ package body Nodes_Meta is return Attr_None; when Field_Has_Body => return Attr_None; + when Field_Has_Parameter => + return Attr_None; when Field_Has_Identifier_List => return Attr_None; when Field_Has_Mode => @@ -2921,6 +2926,7 @@ package body Nodes_Meta is Field_Subprogram_Hash, Field_Implicit_Definition, Field_Seen_Flag, + Field_Has_Parameter, Field_Hide_Implicit_Flag, Field_Pure_Flag, Field_Foreign_Flag, @@ -2946,6 +2952,7 @@ package body Nodes_Meta is Field_Subprogram_Hash, Field_Implicit_Definition, Field_Seen_Flag, + Field_Has_Parameter, Field_Suspend_Flag, Field_Hide_Implicit_Flag, Field_Passive_Flag, @@ -3186,6 +3193,7 @@ package body Nodes_Meta is Field_Identifier, Field_Subprogram_Hash, Field_Seen_Flag, + Field_Has_Parameter, Field_Pure_Flag, Field_Foreign_Flag, Field_Visible_Flag, @@ -3203,6 +3211,7 @@ package body Nodes_Meta is Field_Identifier, Field_Subprogram_Hash, Field_Seen_Flag, + Field_Has_Parameter, Field_Foreign_Flag, Field_Visible_Flag, Field_Use_Flag, @@ -4323,168 +4332,168 @@ package body Nodes_Meta is Iir_Kind_Across_Quantity_Declaration => 645, Iir_Kind_Through_Quantity_Declaration => 657, Iir_Kind_Enumeration_Literal => 668, - Iir_Kind_Function_Declaration => 692, - Iir_Kind_Procedure_Declaration => 715, - Iir_Kind_Function_Body => 725, - Iir_Kind_Procedure_Body => 736, - Iir_Kind_Object_Alias_Declaration => 747, - Iir_Kind_File_Declaration => 761, - Iir_Kind_Guard_Signal_Declaration => 774, - Iir_Kind_Signal_Declaration => 791, - Iir_Kind_Variable_Declaration => 804, - Iir_Kind_Constant_Declaration => 818, - Iir_Kind_Iterator_Declaration => 829, - Iir_Kind_Interface_Constant_Declaration => 845, - Iir_Kind_Interface_Variable_Declaration => 861, - Iir_Kind_Interface_Signal_Declaration => 882, - Iir_Kind_Interface_File_Declaration => 898, - Iir_Kind_Interface_Type_Declaration => 908, - Iir_Kind_Interface_Package_Declaration => 918, - Iir_Kind_Interface_Function_Declaration => 934, - Iir_Kind_Interface_Procedure_Declaration => 946, - Iir_Kind_Identity_Operator => 950, - Iir_Kind_Negation_Operator => 954, - Iir_Kind_Absolute_Operator => 958, - Iir_Kind_Not_Operator => 962, - Iir_Kind_Condition_Operator => 966, - Iir_Kind_Reduction_And_Operator => 970, - Iir_Kind_Reduction_Or_Operator => 974, - Iir_Kind_Reduction_Nand_Operator => 978, - Iir_Kind_Reduction_Nor_Operator => 982, - Iir_Kind_Reduction_Xor_Operator => 986, - Iir_Kind_Reduction_Xnor_Operator => 990, - Iir_Kind_And_Operator => 995, - Iir_Kind_Or_Operator => 1000, - Iir_Kind_Nand_Operator => 1005, - Iir_Kind_Nor_Operator => 1010, - Iir_Kind_Xor_Operator => 1015, - Iir_Kind_Xnor_Operator => 1020, - Iir_Kind_Equality_Operator => 1025, - Iir_Kind_Inequality_Operator => 1030, - Iir_Kind_Less_Than_Operator => 1035, - Iir_Kind_Less_Than_Or_Equal_Operator => 1040, - Iir_Kind_Greater_Than_Operator => 1045, - Iir_Kind_Greater_Than_Or_Equal_Operator => 1050, - Iir_Kind_Match_Equality_Operator => 1055, - Iir_Kind_Match_Inequality_Operator => 1060, - Iir_Kind_Match_Less_Than_Operator => 1065, - Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1070, - Iir_Kind_Match_Greater_Than_Operator => 1075, - Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1080, - Iir_Kind_Sll_Operator => 1085, - Iir_Kind_Sla_Operator => 1090, - Iir_Kind_Srl_Operator => 1095, - Iir_Kind_Sra_Operator => 1100, - Iir_Kind_Rol_Operator => 1105, - Iir_Kind_Ror_Operator => 1110, - Iir_Kind_Addition_Operator => 1115, - Iir_Kind_Substraction_Operator => 1120, - Iir_Kind_Concatenation_Operator => 1125, - Iir_Kind_Multiplication_Operator => 1130, - Iir_Kind_Division_Operator => 1135, - Iir_Kind_Modulus_Operator => 1140, - Iir_Kind_Remainder_Operator => 1145, - Iir_Kind_Exponentiation_Operator => 1150, - Iir_Kind_Function_Call => 1158, - Iir_Kind_Aggregate => 1164, - Iir_Kind_Parenthesis_Expression => 1167, - Iir_Kind_Qualified_Expression => 1171, - Iir_Kind_Type_Conversion => 1176, - Iir_Kind_Allocator_By_Expression => 1180, - Iir_Kind_Allocator_By_Subtype => 1185, - Iir_Kind_Selected_Element => 1191, - Iir_Kind_Dereference => 1196, - Iir_Kind_Implicit_Dereference => 1201, - Iir_Kind_Slice_Name => 1208, - Iir_Kind_Indexed_Name => 1214, - Iir_Kind_Psl_Expression => 1216, - Iir_Kind_Sensitized_Process_Statement => 1236, - Iir_Kind_Process_Statement => 1256, - Iir_Kind_Concurrent_Simple_Signal_Assignment => 1267, - Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1278, - Iir_Kind_Concurrent_Selected_Signal_Assignment => 1290, - Iir_Kind_Concurrent_Assertion_Statement => 1298, - Iir_Kind_Concurrent_Procedure_Call_Statement => 1305, - Iir_Kind_Psl_Assert_Statement => 1318, - Iir_Kind_Psl_Cover_Statement => 1331, - Iir_Kind_Block_Statement => 1344, - Iir_Kind_If_Generate_Statement => 1354, - Iir_Kind_Case_Generate_Statement => 1363, - Iir_Kind_For_Generate_Statement => 1372, - Iir_Kind_Component_Instantiation_Statement => 1382, - Iir_Kind_Psl_Default_Clock => 1386, - Iir_Kind_Simple_Simultaneous_Statement => 1393, - Iir_Kind_Generate_Statement_Body => 1404, - Iir_Kind_If_Generate_Else_Clause => 1409, - Iir_Kind_Simple_Signal_Assignment_Statement => 1418, - Iir_Kind_Conditional_Signal_Assignment_Statement => 1427, - Iir_Kind_Null_Statement => 1431, - Iir_Kind_Assertion_Statement => 1438, - Iir_Kind_Report_Statement => 1444, - Iir_Kind_Wait_Statement => 1451, - Iir_Kind_Variable_Assignment_Statement => 1457, - Iir_Kind_Conditional_Variable_Assignment_Statement => 1463, - Iir_Kind_Return_Statement => 1469, - Iir_Kind_For_Loop_Statement => 1478, - Iir_Kind_While_Loop_Statement => 1486, - Iir_Kind_Next_Statement => 1492, - Iir_Kind_Exit_Statement => 1498, - Iir_Kind_Case_Statement => 1506, - Iir_Kind_Procedure_Call_Statement => 1512, - Iir_Kind_If_Statement => 1521, - Iir_Kind_Elsif => 1526, - Iir_Kind_Character_Literal => 1533, - Iir_Kind_Simple_Name => 1540, - Iir_Kind_Selected_Name => 1548, - Iir_Kind_Operator_Symbol => 1553, - Iir_Kind_Selected_By_All_Name => 1558, - Iir_Kind_Parenthesis_Name => 1562, - Iir_Kind_External_Constant_Name => 1570, - Iir_Kind_External_Signal_Name => 1578, - Iir_Kind_External_Variable_Name => 1586, - Iir_Kind_Package_Pathname => 1589, - Iir_Kind_Absolute_Pathname => 1590, - Iir_Kind_Relative_Pathname => 1591, - Iir_Kind_Pathname_Element => 1595, - Iir_Kind_Base_Attribute => 1597, - Iir_Kind_Left_Type_Attribute => 1602, - Iir_Kind_Right_Type_Attribute => 1607, - Iir_Kind_High_Type_Attribute => 1612, - Iir_Kind_Low_Type_Attribute => 1617, - Iir_Kind_Ascending_Type_Attribute => 1622, - Iir_Kind_Image_Attribute => 1628, - Iir_Kind_Value_Attribute => 1634, - Iir_Kind_Pos_Attribute => 1640, - Iir_Kind_Val_Attribute => 1646, - Iir_Kind_Succ_Attribute => 1652, - Iir_Kind_Pred_Attribute => 1658, - Iir_Kind_Leftof_Attribute => 1664, - Iir_Kind_Rightof_Attribute => 1670, - Iir_Kind_Delayed_Attribute => 1678, - Iir_Kind_Stable_Attribute => 1686, - Iir_Kind_Quiet_Attribute => 1694, - Iir_Kind_Transaction_Attribute => 1702, - Iir_Kind_Event_Attribute => 1706, - Iir_Kind_Active_Attribute => 1710, - Iir_Kind_Last_Event_Attribute => 1714, - Iir_Kind_Last_Active_Attribute => 1718, - Iir_Kind_Last_Value_Attribute => 1722, - Iir_Kind_Driving_Attribute => 1726, - Iir_Kind_Driving_Value_Attribute => 1730, - Iir_Kind_Behavior_Attribute => 1730, - Iir_Kind_Structure_Attribute => 1730, - Iir_Kind_Simple_Name_Attribute => 1737, - Iir_Kind_Instance_Name_Attribute => 1742, - Iir_Kind_Path_Name_Attribute => 1747, - Iir_Kind_Left_Array_Attribute => 1754, - Iir_Kind_Right_Array_Attribute => 1761, - Iir_Kind_High_Array_Attribute => 1768, - Iir_Kind_Low_Array_Attribute => 1775, - Iir_Kind_Length_Array_Attribute => 1782, - Iir_Kind_Ascending_Array_Attribute => 1789, - Iir_Kind_Range_Array_Attribute => 1796, - Iir_Kind_Reverse_Range_Array_Attribute => 1803, - Iir_Kind_Attribute_Name => 1811 + Iir_Kind_Function_Declaration => 693, + Iir_Kind_Procedure_Declaration => 717, + Iir_Kind_Function_Body => 727, + Iir_Kind_Procedure_Body => 738, + Iir_Kind_Object_Alias_Declaration => 749, + Iir_Kind_File_Declaration => 763, + Iir_Kind_Guard_Signal_Declaration => 776, + Iir_Kind_Signal_Declaration => 793, + Iir_Kind_Variable_Declaration => 806, + Iir_Kind_Constant_Declaration => 820, + Iir_Kind_Iterator_Declaration => 831, + Iir_Kind_Interface_Constant_Declaration => 847, + Iir_Kind_Interface_Variable_Declaration => 863, + Iir_Kind_Interface_Signal_Declaration => 884, + Iir_Kind_Interface_File_Declaration => 900, + Iir_Kind_Interface_Type_Declaration => 910, + Iir_Kind_Interface_Package_Declaration => 920, + Iir_Kind_Interface_Function_Declaration => 937, + Iir_Kind_Interface_Procedure_Declaration => 950, + Iir_Kind_Identity_Operator => 954, + Iir_Kind_Negation_Operator => 958, + Iir_Kind_Absolute_Operator => 962, + Iir_Kind_Not_Operator => 966, + Iir_Kind_Condition_Operator => 970, + Iir_Kind_Reduction_And_Operator => 974, + Iir_Kind_Reduction_Or_Operator => 978, + Iir_Kind_Reduction_Nand_Operator => 982, + Iir_Kind_Reduction_Nor_Operator => 986, + Iir_Kind_Reduction_Xor_Operator => 990, + Iir_Kind_Reduction_Xnor_Operator => 994, + Iir_Kind_And_Operator => 999, + Iir_Kind_Or_Operator => 1004, + Iir_Kind_Nand_Operator => 1009, + Iir_Kind_Nor_Operator => 1014, + Iir_Kind_Xor_Operator => 1019, + Iir_Kind_Xnor_Operator => 1024, + Iir_Kind_Equality_Operator => 1029, + Iir_Kind_Inequality_Operator => 1034, + Iir_Kind_Less_Than_Operator => 1039, + Iir_Kind_Less_Than_Or_Equal_Operator => 1044, + Iir_Kind_Greater_Than_Operator => 1049, + Iir_Kind_Greater_Than_Or_Equal_Operator => 1054, + Iir_Kind_Match_Equality_Operator => 1059, + Iir_Kind_Match_Inequality_Operator => 1064, + Iir_Kind_Match_Less_Than_Operator => 1069, + Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1074, + Iir_Kind_Match_Greater_Than_Operator => 1079, + Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1084, + Iir_Kind_Sll_Operator => 1089, + Iir_Kind_Sla_Operator => 1094, + Iir_Kind_Srl_Operator => 1099, + Iir_Kind_Sra_Operator => 1104, + Iir_Kind_Rol_Operator => 1109, + Iir_Kind_Ror_Operator => 1114, + Iir_Kind_Addition_Operator => 1119, + Iir_Kind_Substraction_Operator => 1124, + Iir_Kind_Concatenation_Operator => 1129, + Iir_Kind_Multiplication_Operator => 1134, + Iir_Kind_Division_Operator => 1139, + Iir_Kind_Modulus_Operator => 1144, + Iir_Kind_Remainder_Operator => 1149, + Iir_Kind_Exponentiation_Operator => 1154, + Iir_Kind_Function_Call => 1162, + Iir_Kind_Aggregate => 1168, + Iir_Kind_Parenthesis_Expression => 1171, + Iir_Kind_Qualified_Expression => 1175, + Iir_Kind_Type_Conversion => 1180, + Iir_Kind_Allocator_By_Expression => 1184, + Iir_Kind_Allocator_By_Subtype => 1189, + Iir_Kind_Selected_Element => 1195, + Iir_Kind_Dereference => 1200, + Iir_Kind_Implicit_Dereference => 1205, + Iir_Kind_Slice_Name => 1212, + Iir_Kind_Indexed_Name => 1218, + Iir_Kind_Psl_Expression => 1220, + Iir_Kind_Sensitized_Process_Statement => 1240, + Iir_Kind_Process_Statement => 1260, + Iir_Kind_Concurrent_Simple_Signal_Assignment => 1271, + Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1282, + Iir_Kind_Concurrent_Selected_Signal_Assignment => 1294, + Iir_Kind_Concurrent_Assertion_Statement => 1302, + Iir_Kind_Concurrent_Procedure_Call_Statement => 1309, + Iir_Kind_Psl_Assert_Statement => 1322, + Iir_Kind_Psl_Cover_Statement => 1335, + Iir_Kind_Block_Statement => 1348, + Iir_Kind_If_Generate_Statement => 1358, + Iir_Kind_Case_Generate_Statement => 1367, + Iir_Kind_For_Generate_Statement => 1376, + Iir_Kind_Component_Instantiation_Statement => 1386, + Iir_Kind_Psl_Default_Clock => 1390, + Iir_Kind_Simple_Simultaneous_Statement => 1397, + Iir_Kind_Generate_Statement_Body => 1408, + Iir_Kind_If_Generate_Else_Clause => 1413, + Iir_Kind_Simple_Signal_Assignment_Statement => 1422, + Iir_Kind_Conditional_Signal_Assignment_Statement => 1431, + Iir_Kind_Null_Statement => 1435, + Iir_Kind_Assertion_Statement => 1442, + Iir_Kind_Report_Statement => 1448, + Iir_Kind_Wait_Statement => 1455, + Iir_Kind_Variable_Assignment_Statement => 1461, + Iir_Kind_Conditional_Variable_Assignment_Statement => 1467, + Iir_Kind_Return_Statement => 1473, + Iir_Kind_For_Loop_Statement => 1482, + Iir_Kind_While_Loop_Statement => 1490, + Iir_Kind_Next_Statement => 1496, + Iir_Kind_Exit_Statement => 1502, + Iir_Kind_Case_Statement => 1510, + Iir_Kind_Procedure_Call_Statement => 1516, + Iir_Kind_If_Statement => 1525, + Iir_Kind_Elsif => 1530, + Iir_Kind_Character_Literal => 1537, + Iir_Kind_Simple_Name => 1544, + Iir_Kind_Selected_Name => 1552, + Iir_Kind_Operator_Symbol => 1557, + Iir_Kind_Selected_By_All_Name => 1562, + Iir_Kind_Parenthesis_Name => 1566, + Iir_Kind_External_Constant_Name => 1574, + Iir_Kind_External_Signal_Name => 1582, + Iir_Kind_External_Variable_Name => 1590, + Iir_Kind_Package_Pathname => 1593, + Iir_Kind_Absolute_Pathname => 1594, + Iir_Kind_Relative_Pathname => 1595, + Iir_Kind_Pathname_Element => 1599, + Iir_Kind_Base_Attribute => 1601, + Iir_Kind_Left_Type_Attribute => 1606, + Iir_Kind_Right_Type_Attribute => 1611, + Iir_Kind_High_Type_Attribute => 1616, + Iir_Kind_Low_Type_Attribute => 1621, + Iir_Kind_Ascending_Type_Attribute => 1626, + Iir_Kind_Image_Attribute => 1632, + Iir_Kind_Value_Attribute => 1638, + Iir_Kind_Pos_Attribute => 1644, + Iir_Kind_Val_Attribute => 1650, + Iir_Kind_Succ_Attribute => 1656, + Iir_Kind_Pred_Attribute => 1662, + Iir_Kind_Leftof_Attribute => 1668, + Iir_Kind_Rightof_Attribute => 1674, + Iir_Kind_Delayed_Attribute => 1682, + Iir_Kind_Stable_Attribute => 1690, + Iir_Kind_Quiet_Attribute => 1698, + Iir_Kind_Transaction_Attribute => 1706, + Iir_Kind_Event_Attribute => 1710, + Iir_Kind_Active_Attribute => 1714, + Iir_Kind_Last_Event_Attribute => 1718, + Iir_Kind_Last_Active_Attribute => 1722, + Iir_Kind_Last_Value_Attribute => 1726, + Iir_Kind_Driving_Attribute => 1730, + Iir_Kind_Driving_Value_Attribute => 1734, + Iir_Kind_Behavior_Attribute => 1734, + Iir_Kind_Structure_Attribute => 1734, + Iir_Kind_Simple_Name_Attribute => 1741, + Iir_Kind_Instance_Name_Attribute => 1746, + Iir_Kind_Path_Name_Attribute => 1751, + Iir_Kind_Left_Array_Attribute => 1758, + Iir_Kind_Right_Array_Attribute => 1765, + Iir_Kind_High_Array_Attribute => 1772, + Iir_Kind_Low_Array_Attribute => 1779, + Iir_Kind_Length_Array_Attribute => 1786, + Iir_Kind_Ascending_Array_Attribute => 1793, + Iir_Kind_Range_Array_Attribute => 1800, + Iir_Kind_Reverse_Range_Array_Attribute => 1807, + Iir_Kind_Attribute_Name => 1815 ); function Get_Fields (K : Iir_Kind) return Fields_Array @@ -4628,6 +4637,8 @@ package body Nodes_Meta is return Get_Has_Pure (N); when Field_Has_Body => return Get_Has_Body (N); + when Field_Has_Parameter => + return Get_Has_Parameter (N); when Field_Has_Identifier_List => return Get_Has_Identifier_List (N); when Field_Has_Mode => @@ -4748,6 +4759,8 @@ package body Nodes_Meta is Set_Has_Pure (N, V); when Field_Has_Body => Set_Has_Body (N, V); + when Field_Has_Parameter => + Set_Has_Parameter (N, V); when Field_Has_Identifier_List => Set_Has_Identifier_List (N, V); when Field_Has_Mode => @@ -10096,6 +10109,19 @@ package body Nodes_Meta is end case; end Has_Has_Body; + function Has_Has_Parameter (K : Iir_Kind) return Boolean is + begin + case K is + when Iir_Kind_Function_Declaration + | Iir_Kind_Procedure_Declaration + | Iir_Kind_Interface_Function_Declaration + | Iir_Kind_Interface_Procedure_Declaration => + return True; + when others => + return False; + end case; + end Has_Has_Parameter; + function Has_Has_Identifier_List (K : Iir_Kind) return Boolean is begin case K is diff --git a/src/vhdl/nodes_meta.ads b/src/vhdl/nodes_meta.ads index 4d1cb3710..44e56dbf1 100644 --- a/src/vhdl/nodes_meta.ads +++ b/src/vhdl/nodes_meta.ads @@ -359,6 +359,7 @@ package Nodes_Meta is Field_Has_Is, Field_Has_Pure, Field_Has_Body, + Field_Has_Parameter, Field_Has_Identifier_List, Field_Has_Mode, Field_Has_Class, @@ -864,6 +865,7 @@ package Nodes_Meta is function Has_Has_Is (K : Iir_Kind) return Boolean; function Has_Has_Pure (K : Iir_Kind) return Boolean; function Has_Has_Body (K : Iir_Kind) return Boolean; + function Has_Has_Parameter (K : Iir_Kind) return Boolean; function Has_Has_Identifier_List (K : Iir_Kind) return Boolean; function Has_Has_Mode (K : Iir_Kind) return Boolean; function Has_Has_Class (K : Iir_Kind) return Boolean; diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb index 7dfb2c7bf..ee377792b 100644 --- a/src/vhdl/parse.adb +++ b/src/vhdl/parse.adb @@ -1473,6 +1473,8 @@ package body Parse is Inters : Iir; begin if Current_Token = Tok_Parameter then + Set_Has_Parameter (Subprg, True); + -- Eat 'parameter' Scan; |