diff --git a/lexor.lex b/lexor.lex index 76413039d..0bf05178a 100644 --- a/lexor.lex +++ b/lexor.lex @@ -192,6 +192,7 @@ TU [munpf] "++" { return K_INCR; } "--" {return K_DECR; } "'{" { return K_LP; } +"::" { return K_SCOPE_RES; } /* Watch out for the tricky case of (*). Cannot parse this as "(*" and ")", but since I know that this is really ( * ), replace it diff --git a/parse.y b/parse.y index 3cfc0ca2d..b21d3d12c 100644 --- a/parse.y +++ b/parse.y @@ -409,6 +409,7 @@ static void current_function_set_statement(const YYLTYPE&loc, vector %token K_PO_POS K_PO_NEG K_POW %token K_PSTAR K_STARP K_DOTSTAR %token K_LOR K_LAND K_NAND K_NOR K_NXOR K_TRIGGER +%token K_SCOPE_RES %token K_edge_descriptor /* The base tokens from 1364-1995. */ @@ -1335,6 +1336,22 @@ package_declaration /* IEEE1800-2005 A.1.2 */ } ; +package_import_declaration /* IEEE1800-2005 A.2.1.3 */ + : K_import package_import_item_list ';' + { yyerror(@1, "sorry: Package import declarations not supported."); + } + ; + +package_import_item + : IDENTIFIER K_SCOPE_RES IDENTIFIER + | IDENTIFIER K_SCOPE_RES '*' + ; + +package_import_item_list + : package_import_item_list',' package_import_item + | package_import_item + ; + package_item /* IEEE1800-2005 A.1.10 */ : timeunits_declaration | K_localparam param_type localparam_assign_list ';' @@ -4267,6 +4284,8 @@ module_item pform_endgenerate(); } + | package_import_declaration + /* 1364-2001 and later allow specparam declarations outside specify blocks. */ | attribute_list_opt K_specparam specparam_decl ';'