From 3764216a88023064444c46eb46572871f7cdca17 Mon Sep 17 00:00:00 2001 From: Pawel Szostek Date: Wed, 20 Jul 2011 14:44:25 +0200 Subject: [PATCH] Use stl stack for for carrying scopes This is rather a cosmetic change. The patch changes the container used for stack of scopes from std::list to std::stack. It suits this particular application a bit better. --- vhdlpp/parse.y | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vhdlpp/parse.y b/vhdlpp/parse.y index 4629b2eaf..a6d1bb8cd 100644 --- a/vhdlpp/parse.y +++ b/vhdlpp/parse.y @@ -34,6 +34,7 @@ # include # include # include +# include # include # include # include "parse_types.h" @@ -69,7 +70,7 @@ int parse_sorrys = 0; * manage lexical scopes. */ static ActiveScope*active_scope = new ActiveScope; -static list scope_stack; +static stack scope_stack; /* * When a scope boundary starts, call the push_scope function to push @@ -81,7 +82,7 @@ static list scope_stack; static void push_scope(void) { assert(active_scope); - scope_stack.push_front(active_scope); + scope_stack.push(active_scope); active_scope = new ActiveScope (active_scope); } @@ -89,8 +90,8 @@ static void pop_scope(void) { delete active_scope; assert(scope_stack.size() > 0); - active_scope = scope_stack.front(); - scope_stack.pop_front(); + active_scope = scope_stack.top(); + scope_stack.pop(); }