diff options
author | Tristan Gingold <gingold@adacore.com> | 2015-11-28 11:02:37 +0100 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2015-11-30 08:02:00 +0100 |
commit | 5e46a4e22a2a1438ee19fd4e964f4b3b2169ea1c (patch) | |
tree | cc78b752ddbcb5143e1a76379bdf821ef69f2810 /src/vhdl | |
parent | 797c7c5962ae4332df74bbc19edd1ed6a343faae (diff) | |
download | ghdl-5e46a4e22a2a1438ee19fd4e964f4b3b2169ea1c.tar.gz ghdl-5e46a4e22a2a1438ee19fd4e964f4b3b2169ea1c.tar.bz2 ghdl-5e46a4e22a2a1438ee19fd4e964f4b3b2169ea1c.zip |
parse: add comments.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/parse.adb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb index 3d3bfcf6d..a56c785f5 100644 --- a/src/vhdl/parse.adb +++ b/src/vhdl/parse.adb @@ -3551,6 +3551,9 @@ package body Parse is -- attribute_specification ::= -- ATTRIBUTE attribute_designator OF entity_specification -- IS expression ; + -- + -- entity_specification ::= entity_name_list : entity_class + -- function Parse_Attribute return Iir is Loc : Location_Type; @@ -3560,7 +3563,10 @@ package body Parse is Scan_Expect (Tok_Identifier); Loc := Get_Token_Location; Ident := Current_Identifier; + + -- Skip identifier. Scan; + case Current_Token is when Tok_Colon => declare @@ -3569,11 +3575,15 @@ package body Parse is Res := Create_Iir (Iir_Kind_Attribute_Declaration); Set_Location (Res, Loc); Set_Identifier (Res, Ident); + + -- Skip ':'. Scan; + Set_Type_Mark (Res, Parse_Type_Mark (Check_Paren => True)); Expect (Tok_Semi_Colon); return Res; end; + when Tok_Of => declare Res : Iir_Attribute_Specification; @@ -3585,10 +3595,16 @@ package body Parse is Set_Location (Designator, Loc); Set_Identifier (Designator, Ident); Set_Attribute_Designator (Res, Designator); + + -- Skip 'of'. Scan; + Parse_Entity_Name_List (Res); Expect (Tok_Is); + + -- Skip 'is'. Scan; + Set_Expression (Res, Parse_Expression); Expect (Tok_Semi_Colon); return Res; |