From a5458828cd36ccaf23eb6bd6adda41c1e3543ce1 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Thu, 5 Apr 2012 20:20:34 -0700 Subject: [PATCH] Some vhdl parser error handling. --- vhdlpp/parse.y | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/vhdlpp/parse.y b/vhdlpp/parse.y index b7d69ede0..349f49b7c 100644 --- a/vhdlpp/parse.y +++ b/vhdlpp/parse.y @@ -864,6 +864,16 @@ constant_declaration } delete $2; } + | K_constant identifier_list ':' error ';' + { errormsg(@4, "Syntax error in constant declaration type.\n"); + yyerrok; + delete $2; + } + | K_constant error ';' + { errormsg(@2, "Syntax error in constant declaration.\n"); + yyerrok; + } + ; context_clause : context_items | ; @@ -1595,6 +1605,7 @@ package_body_declarative_part_opt package_declarative_item : component_declaration | constant_declaration + | type_declaration | subtype_declaration | type_declaration | use_clause @@ -2139,6 +2150,10 @@ type_declaration yyerrok; delete[]$2; } + | K_type error ';' + { errormsg(@1, "Error in type definition\n"); + yyerrok; + } ; type_definition