diff options
Diffstat (limited to 'src/vhdl')
| -rw-r--r-- | src/vhdl/disp_tree.adb | 28 | ||||
| -rw-r--r-- | src/vhdl/disp_tree.ads | 1 | ||||
| -rw-r--r-- | src/vhdl/iirs.ads | 2 | 
3 files changed, 31 insertions, 0 deletions
diff --git a/src/vhdl/disp_tree.adb b/src/vhdl/disp_tree.adb index e254bb883..9aed6c3f9 100644 --- a/src/vhdl/disp_tree.adb +++ b/src/vhdl/disp_tree.adb @@ -20,6 +20,7 @@  with Ada.Text_IO; use Ada.Text_IO;  with Name_Table; +with Str_Table;  with Files_Map;  with PSL.Dump_Tree;  with Nodes_Meta; @@ -315,6 +316,33 @@ package body Disp_Tree is     function Image_Token_Type (Tok : Tokens.Token_Type) return String       renames Tokens.Image; +   function Image_String8 (N : Iir) return String +   is +      use Str_Table; +      T : constant Iir := Get_Type (N); +      Str : constant String8_Id := Get_String8_Id (N); +      Len : constant Int32 := Get_String_Length (N); +   begin +      if Is_Null (T) then +         --  Not yet analyzed, the string is the ASCII image. +         return Str_Table.String_String8 (Str, Len); +      else +         declare +            El : constant Iir := Get_Base_Type (Get_Element_Subtype (T)); +            Lits : constant Iir_List := Get_Enumeration_Literal_List (El); +            Res : String (1 .. Natural (Len)); +            C : Natural; +         begin +            for I in 1 .. Len loop +               C := Natural (Element_String8 (Str, I)); +               Res (Natural (I)) := Name_Table.Get_Character +                 (Get_Identifier (Get_Nth_Element (Lits, C))); +            end loop; +            return Res; +         end; +      end if; +   end Image_String8; +     procedure Header (Str : String; Indent : Natural) is     begin        Put_Indent (Indent); diff --git a/src/vhdl/disp_tree.ads b/src/vhdl/disp_tree.ads index 0ea056a6a..e6a10fcea 100644 --- a/src/vhdl/disp_tree.ads +++ b/src/vhdl/disp_tree.ads @@ -47,4 +47,5 @@ package Disp_Tree is     function Image_Location_Type (Loc : Location_Type) return String;     function Image_Iir_Direction (Dir : Iir_Direction) return String;     function Image_Token_Type (Tok : Tokens.Token_Type) return String; +   function Image_String8 (N : Iir) return String;  end Disp_Tree; diff --git a/src/vhdl/iirs.ads b/src/vhdl/iirs.ads index 79356b3cd..3c33aeecc 100644 --- a/src/vhdl/iirs.ads +++ b/src/vhdl/iirs.ads @@ -310,6 +310,8 @@ package Iirs is     --  Number of literals in the expanded string.     --   Get/Set_String_Length (Field4)     -- +   --  Before analysis, this is the ASCII code of each character in the string. +   --  After analysis, this is the position of each literal.     --   Get/Set_String8_Id (Field5)     --     --  Base of the bit_string (corresponds to letters 'b', 'o', 'd' or 'x' in  | 
