From cef37e0a4bc3b460d7f42346769952e2c5195d84 Mon Sep 17 00:00:00 2001 From: Pawel Szostek Date: Fri, 1 Apr 2011 09:50:04 +0200 Subject: [PATCH] Add component specification parsing A class for component specification has been added --- vhdlpp/parse.y | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/vhdlpp/parse.y b/vhdlpp/parse.y index 72e632fe8..4a2ca20bf 100644 --- a/vhdlpp/parse.y +++ b/vhdlpp/parse.y @@ -94,6 +94,7 @@ static map block_components; std::list*named_expr_list; entity_aspect_t* entity_aspect; instant_list_t* instantiation_list; + std::pair* component_specification; const VType* vtype; @@ -146,6 +147,7 @@ static map block_components; %type entity_aspect entity_aspect_opt binding_indication binding_indication_semicolon_opt %type instantiation_list +%type component_specification %type concurrent_statement component_instantiation_statement concurrent_signal_assignment_statement %type architecture_statement_part @@ -337,6 +339,10 @@ component_configuration binding_indication_semicolon_opt block_configuration_opt K_end K_for ';' + | K_for component_specification error K_end K_for + { + errormsg(@1, "Error in component configuration statement.\n"); + } ; component_instantiation_statement @@ -358,9 +364,11 @@ component_instantiation_statement ; component_specification - : instantiation_list ':' IDENTIFIER - { sorrymsg(@1, "Component specifications are not supported.\n"); - delete[] $3 + : instantiation_list ':' name + { + ExpName* name = dynamic_cast($3); + std::pair* tmp = new std::pair($1, name); + $$ = tmp; } ;