diff options
author | Tristan Gingold <tgingold@free.fr> | 2015-05-12 20:06:22 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2015-05-12 20:06:22 +0200 |
commit | e8e5c3d2ab5783d65fcd7a33a7b35c103179ece8 (patch) | |
tree | 7705d74b45e55239f58242f1ce5d591ebfe7aa09 /src/libraries.adb | |
parent | 1effd3eb564f49a9b8e3543dfdbb121c6e1e9b73 (diff) | |
download | ghdl-e8e5c3d2ab5783d65fcd7a33a7b35c103179ece8.tar.gz ghdl-e8e5c3d2ab5783d65fcd7a33a7b35c103179ece8.tar.bz2 ghdl-e8e5c3d2ab5783d65fcd7a33a7b35c103179ece8.zip |
Add context declaration and reference (vhdl 2008).
Diffstat (limited to 'src/libraries.adb')
-rw-r--r-- | src/libraries.adb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/libraries.adb b/src/libraries.adb index e01a9bc24..39e50395f 100644 --- a/src/libraries.adb +++ b/src/libraries.adb @@ -144,7 +144,8 @@ package body Libraries is | Iir_Kind_Configuration_Declaration | Iir_Kind_Package_Declaration | Iir_Kind_Package_Body - | Iir_Kind_Package_Instantiation_Declaration => + | Iir_Kind_Package_Instantiation_Declaration + | Iir_Kind_Context_Declaration => Id := Get_Identifier (Lib_Unit); when Iir_Kind_Architecture_Body => -- Architectures are put with the entity identifier. @@ -242,6 +243,7 @@ package body Libraries is -- | package_format -- | package_body_format -- | configuration_format + -- | context_format -- position_format ::= LINE(POS) + OFF on DATE -- entity_format ::= -- ENTITY identifier AT position_format ; @@ -253,6 +255,8 @@ package body Libraries is -- PACKAGE BODY identifier AT position_format ; -- configuration_format ::= -- CONFIGURATION identifier AT position_format ; + -- context_format ::= + -- CONTEXT identifier AT position_format ; -- -- The position_format meaning is: -- LINE is the line number (first line is number 1), @@ -481,6 +485,10 @@ package body Libraries is Scan; Set_Dependence_List (Design_Unit, Scan_Unit_List); goto Next_Line; + when Tok_Context => + Library_Unit := + Create_Iir (Iir_Kind_Context_Declaration); + Scan; when others => Put_Line ("load_library: line must start with " & @@ -1224,6 +1232,9 @@ package body Libraries is when Iir_Kind_Configuration_Declaration => WR ("configuration "); WR (Image_Identifier (Library_Unit)); + when Iir_Kind_Context_Declaration => + WR ("context "); + WR (Image_Identifier (Library_Unit)); when others => Error_Kind ("save_library", Library_Unit); end case; @@ -1585,7 +1596,8 @@ package body Libraries is when Iir_Kind_Package_Declaration | Iir_Kind_Package_Instantiation_Declaration | Iir_Kind_Entity_Declaration - | Iir_Kind_Configuration_Declaration => + | Iir_Kind_Configuration_Declaration + | Iir_Kind_Context_Declaration => -- Only return a primary unit. return Unit; when Iir_Kind_Package_Body |