aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-nodes.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-05-29 08:45:55 +0200
committerTristan Gingold <tgingold@free.fr>2019-05-29 08:45:55 +0200
commit5035b126d932529683640867cdf8fe686d7f7cac (patch)
tree7a48dd954794cf10938509a459a5a9cabf7fd86c /src/vhdl/vhdl-nodes.adb
parent7619ac406427a30e2963e11ad67b43b6aae26ee5 (diff)
downloadghdl-5035b126d932529683640867cdf8fe686d7f7cac.tar.gz
ghdl-5035b126d932529683640867cdf8fe686d7f7cac.tar.bz2
ghdl-5035b126d932529683640867cdf8fe686d7f7cac.zip
vhdl-disp_vhdl: print literals and identifiers from the source.
Add Literal_Length and set it in the parser.
Diffstat (limited to 'src/vhdl/vhdl-nodes.adb')
-rw-r--r--src/vhdl/vhdl-nodes.adb16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-nodes.adb b/src/vhdl/vhdl-nodes.adb
index 40048a84f..85755105e 100644
--- a/src/vhdl/vhdl-nodes.adb
+++ b/src/vhdl/vhdl-nodes.adb
@@ -1875,6 +1875,22 @@ package body Vhdl.Nodes is
Set_Flag3 (Lit, Flag);
end Set_Has_Length;
+ function Get_Literal_Length (Lit : Iir) return Int32 is
+ begin
+ pragma Assert (Lit /= Null_Iir);
+ pragma Assert (Has_Literal_Length (Get_Kind (Lit)),
+ "no field Literal_Length");
+ return Iir_To_Int32 (Get_Field0 (Lit));
+ end Get_Literal_Length;
+
+ procedure Set_Literal_Length (Lit : Iir; Len : Int32) is
+ begin
+ pragma Assert (Lit /= Null_Iir);
+ pragma Assert (Has_Literal_Length (Get_Kind (Lit)),
+ "no field Literal_Length");
+ Set_Field0 (Lit, Int32_To_Iir (Len));
+ end Set_Literal_Length;
+
function Get_Literal_Origin (Lit : Iir) return Iir is
begin
pragma Assert (Lit /= Null_Iir);