aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libraries.adb13
-rw-r--r--src/vhdl/vhdl-parse.adb20
-rw-r--r--src/vhdl/vhdl-utils.adb27
-rw-r--r--src/vhdl/vhdl-utils.ads4
4 files changed, 33 insertions, 31 deletions
diff --git a/src/libraries.adb b/src/libraries.adb
index 3ce5581f5..15b0fd3bc 100644
--- a/src/libraries.adb
+++ b/src/libraries.adb
@@ -536,9 +536,16 @@ package body Libraries is
Set_Identifier (Design_Unit, Current_Identifier);
if Get_Kind (Library_Unit) = Iir_Kind_Architecture_Body then
- Scan_Expect (Tok_Of);
- Scan_Expect (Tok_Identifier);
- Set_Entity_Name (Library_Unit, Current_Text);
+ declare
+ Ent : Iir;
+ begin
+ Scan_Expect (Tok_Of);
+ Scan_Expect (Tok_Identifier);
+ Ent := Create_Iir (Iir_Kind_Simple_Name);
+ Set_Identifier (Ent, Current_Identifier);
+ Set_Location (Ent, Get_Token_Location);
+ Set_Entity_Name (Library_Unit, Ent);
+ end;
end if;
-- Scan position.
diff --git a/src/vhdl/vhdl-parse.adb b/src/vhdl/vhdl-parse.adb
index 140317d3f..e10be4998 100644
--- a/src/vhdl/vhdl-parse.adb
+++ b/src/vhdl/vhdl-parse.adb
@@ -157,6 +157,26 @@ package body Vhdl.Parse is
end if;
end Expect_Scan;
+ -- Transform the current token into an iir literal.
+ -- The current token must be either a character or an identifier.
+ function Current_Text return Iir is
+ Res: Iir;
+ begin
+ case Current_Token is
+ when Tok_Identifier =>
+ Res := Create_Iir (Iir_Kind_Simple_Name);
+ when Tok_Character =>
+ Res := Create_Iir (Iir_Kind_Character_Literal);
+ when others =>
+ raise Internal_Error;
+ end case;
+ Set_Identifier (Res, Current_Identifier);
+ Invalidate_Current_Identifier;
+ Invalidate_Current_Token;
+ Set_Location (Res, Get_Token_Location);
+ return Res;
+ end Current_Text;
+
-- Expect the identifier for node RES.
procedure Scan_Identifier (Res : Iir) is
begin
diff --git a/src/vhdl/vhdl-utils.adb b/src/vhdl/vhdl-utils.adb
index e1477a7bc..ea269f2cc 100644
--- a/src/vhdl/vhdl-utils.adb
+++ b/src/vhdl/vhdl-utils.adb
@@ -15,37 +15,16 @@
-- along with GHDL; see the file COPYING. If not, write to the Free
-- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-- 02111-1307, USA.
-with Vhdl.Scanner; use Vhdl.Scanner;
-with Vhdl.Tokens; use Vhdl.Tokens;
-with Vhdl.Errors; use Vhdl.Errors;
+
+with Flags; use Flags;
with Name_Table;
with Str_Table;
with Std_Names; use Std_Names;
with Vhdl.Std_Package;
-with Flags; use Flags;
+with Vhdl.Errors; use Vhdl.Errors;
with PSL.Nodes;
package body Vhdl.Utils is
- -- Transform the current token into an iir literal.
- -- The current token must be either a character or an identifier.
- function Current_Text return Iir is
- Res: Iir;
- begin
- case Current_Token is
- when Tok_Identifier =>
- Res := Create_Iir (Iir_Kind_Simple_Name);
- when Tok_Character =>
- Res := Create_Iir (Iir_Kind_Character_Literal);
- when others =>
- raise Internal_Error;
- end case;
- Set_Identifier (Res, Current_Identifier);
- Invalidate_Current_Identifier;
- Invalidate_Current_Token;
- Set_Location (Res, Get_Token_Location);
- return Res;
- end Current_Text;
-
function Is_Error (N : Iir) return Boolean is
begin
return Get_Kind (N) = Iir_Kind_Error;
diff --git a/src/vhdl/vhdl-utils.ads b/src/vhdl/vhdl-utils.ads
index f94d5996e..fabe48f81 100644
--- a/src/vhdl/vhdl-utils.ads
+++ b/src/vhdl/vhdl-utils.ads
@@ -20,10 +20,6 @@ with Vhdl.Nodes; use Vhdl.Nodes;
with PSL.Types; use PSL.Types;
package Vhdl.Utils is
- -- Transform the current token into an iir literal.
- -- The current token must be either a character, a string or an identifier.
- function Current_Text return Iir;
-
-- Get identifier of NODE as a string.
function Image_Identifier (Node : Iir) return String;
function Image_String_Lit (Str : Iir) return String;