diff options
Diffstat (limited to 'src/vhdl/vhdl-scanner.adb')
-rw-r--r-- | src/vhdl/vhdl-scanner.adb | 102 |
1 files changed, 60 insertions, 42 deletions
diff --git a/src/vhdl/vhdl-scanner.adb b/src/vhdl/vhdl-scanner.adb index 089b19125..82ac6adc4 100644 --- a/src/vhdl/vhdl-scanner.adb +++ b/src/vhdl/vhdl-scanner.adb @@ -1262,18 +1262,20 @@ package body Vhdl.Scanner is end Scan_Psl_Keyword_Em_Un; pragma Inline (Scan_Psl_Keyword_Em_Un); - procedure Identifier_To_Token is + procedure Identifier_To_Token + is + use Std_Names; begin - if Current_Identifier in Std_Names.Name_Id_Keywords then + if Current_Identifier in Name_Id_Keywords then -- LRM93 13.9 -- The identifiers listed below are called reserved words and are -- reserved for signifiances in the language. -- IN: this is also achieved in packages std_names and tokens. Current_Token := Token_Type'Val (Token_Type'Pos (Tok_First_Keyword) - + Current_Identifier - Std_Names.Name_First_Keyword); + + Current_Identifier - Name_First_Keyword); case Current_Identifier is - when Std_Names.Name_Id_AMS_Reserved_Words => + when Name_Id_AMS_Reserved_Words => if not AMS_Vhdl then if Is_Warning_Enabled (Warnid_Reserved_Word) then Warning_Msg_Scan @@ -1283,30 +1285,38 @@ package body Vhdl.Scanner is end if; Current_Token := Tok_Identifier; end if; - when Std_Names.Name_Id_Vhdl08_Reserved_Words => + when Name_Id_Vhdl08_Reserved_Words => if Vhdl_Std < Vhdl_08 then -- Some vhdl08 reserved words are PSL keywords. if Flag_Psl then case Current_Identifier is - when Std_Names.Name_Sequence => + when Name_Prev => + Current_Token := Tok_Prev; + when Name_Stable => + Current_Token := Tok_Stable; + when Name_Rose => + Current_Token := Tok_Rose; + when Name_Fell => + Current_Token := Tok_Fell; + when Name_Sequence => Current_Token := Tok_Sequence; - when Std_Names.Name_Property => + when Name_Property => Current_Token := Tok_Property; - when Std_Names.Name_Assume => + when Name_Assume => Current_Token := Tok_Assume; - when Std_Names.Name_Cover => + when Name_Cover => Current_Token := Tok_Cover; - when Std_Names.Name_Default => + when Name_Default => Current_Token := Tok_Default; - when Std_Names.Name_Restrict => + when Name_Restrict => Current_Token := Tok_Restrict; - when Std_Names.Name_Restrict_Guarantee => + when Name_Restrict_Guarantee => Current_Token := Tok_Restrict_Guarantee; - when Std_Names.Name_Vmode => + when Name_Vmode => Current_Token := Tok_Vmode; - when Std_Names.Name_Vprop => + when Name_Vprop => Current_Token := Tok_Vprop; - when Std_Names.Name_Vunit => + when Name_Vunit => Current_Token := Tok_Vunit; when others => Current_Token := Tok_Identifier; @@ -1323,7 +1333,7 @@ package body Vhdl.Scanner is +Current_Identifier); end if; end if; - when Std_Names.Name_Id_Vhdl00_Reserved_Words => + when Name_Id_Vhdl00_Reserved_Words => if Vhdl_Std < Vhdl_00 then if Is_Warning_Enabled (Warnid_Reserved_Word) then Warning_Msg_Scan @@ -1333,7 +1343,7 @@ package body Vhdl.Scanner is end if; Current_Token := Tok_Identifier; end if; - when Std_Names.Name_Id_Vhdl93_Reserved_Words => + when Name_Id_Vhdl93_Reserved_Words => if Vhdl_Std = Vhdl_87 then if Is_Warning_Enabled (Warnid_Reserved_Word) then Report_Start_Group; @@ -1348,7 +1358,7 @@ package body Vhdl.Scanner is end if; Current_Token := Tok_Identifier; end if; - when Std_Names.Name_Id_Vhdl87_Reserved_Words => + when Name_Id_Vhdl87_Reserved_Words => if Flag_Psl then if Current_Token = Tok_Until then Scan_Psl_Keyword_Em_Un (Tok_Until, Tok_Until_Em, @@ -1362,59 +1372,67 @@ package body Vhdl.Scanner is end case; elsif Flag_Psl then case Current_Identifier is - when Std_Names.Name_Clock => + when Name_Prev => + Current_Token := Tok_Prev; + when Name_Stable => + Current_Token := Tok_Stable; + when Name_Rose => + Current_Token := Tok_Rose; + when Name_Fell => + Current_Token := Tok_Fell; + when Name_Clock => Current_Token := Tok_Psl_Clock; - when Std_Names.Name_Const => + when Name_Const => Current_Token := Tok_Psl_Const; - when Std_Names.Name_Boolean => + when Name_Boolean => Current_Token := Tok_Psl_Boolean; - when Std_Names.Name_Sequence => + when Name_Sequence => Current_Token := Tok_Sequence; - when Std_Names.Name_Property => + when Name_Property => Current_Token := Tok_Property; - when Std_Names.Name_Endpoint => + when Name_Endpoint => Current_Token := Tok_Psl_Endpoint; - when Std_Names.Name_Assume => + when Name_Assume => Current_Token := Tok_Assume; - when Std_Names.Name_Cover => + when Name_Cover => Current_Token := Tok_Cover; - when Std_Names.Name_Default => + when Name_Default => Current_Token := Tok_Default; - when Std_Names.Name_Restrict => + when Name_Restrict => Current_Token := Tok_Restrict; - when Std_Names.Name_Restrict_Guarantee => + when Name_Restrict_Guarantee => Current_Token := Tok_Restrict_Guarantee; - when Std_Names.Name_Inf => + when Name_Inf => Current_Token := Tok_Inf; - when Std_Names.Name_Within => + when Name_Within => Current_Token := Tok_Within; - when Std_Names.Name_Abort => + when Name_Abort => Current_Token := Tok_Abort; - when Std_Names.Name_Before => + when Name_Before => Scan_Psl_Keyword_Em_Un (Tok_Before, Tok_Before_Em, Tok_Before_Un, Tok_Before_Em_Un); - when Std_Names.Name_Always => + when Name_Always => Current_Token := Tok_Always; - when Std_Names.Name_Never => + when Name_Never => Current_Token := Tok_Never; - when Std_Names.Name_Eventually => + when Name_Eventually => if Source (Pos) = '!' then Pos := Pos + 1; else Error_Msg_Scan ("'!' expected after 'eventually'"); end if; Current_Token := Tok_Eventually_Em; - when Std_Names.Name_Next_A => + when Name_Next_A => Scan_Psl_Keyword_Em (Tok_Next_A, Tok_Next_A_Em); - when Std_Names.Name_Next_E => + when Name_Next_E => Scan_Psl_Keyword_Em (Tok_Next_E, Tok_Next_E_Em); - when Std_Names.Name_Next_Event => + when Name_Next_Event => Scan_Psl_Keyword_Em (Tok_Next_Event, Tok_Next_Event_Em); - when Std_Names.Name_Next_Event_A => + when Name_Next_Event_A => Scan_Psl_Keyword_Em (Tok_Next_Event_A, Tok_Next_Event_A_Em); - when Std_Names.Name_Next_Event_E => + when Name_Next_Event_E => Scan_Psl_Keyword_Em (Tok_Next_Event_E, Tok_Next_Event_E_Em); - when Std_Names.Name_Until => + when Name_Until => raise Internal_Error; when others => Current_Token := Tok_Identifier; |