diff options
Diffstat (limited to 'vhdlparser/vhdlparser.jj')
-rw-r--r-- | vhdlparser/vhdlparser.jj | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/vhdlparser/vhdlparser.jj b/vhdlparser/vhdlparser.jj index af1bd34..6eb95b4 100644 --- a/vhdlparser/vhdlparser.jj +++ b/vhdlparser/vhdlparser.jj @@ -31,7 +31,7 @@ static Entry* current_root; static Entry* tempEntry; static Entry* lastEntity ; static Entry* lastCompound ; -static Entry* current; +static std::unique_ptr<Entry> current; static QCString compSpec; static QCString currName; static int levelCounter; @@ -409,7 +409,7 @@ void architecture_body() : {QCString s,s1;} QCString t=s1+"::"+s; genLabels.resize(0); pushLabel(genLabels,s1); - lastCompound=current; + lastCompound=current.get(); addVhdlType(t,getLine(ARCHITECTURE_T),Entry::CLASS_SEC,VhdlDocGen::ARCHITECTURE,0,0,Private); } try{ @@ -1012,7 +1012,7 @@ void entity_declaration() : {QCString s;} // try{ <ENTITY_T> s=identifier() <IS_T> { - lastEntity=current; + lastEntity=current.get(); lastCompound=0; addVhdlType(s.data(),getLine(ENTITY_T),Entry::CLASS_SEC,VhdlDocGen::ENTITY,0,0,Public); } @@ -1209,7 +1209,7 @@ QCString full_type_declaration() : {Entry *tmpEntry;QCString s,s1,s2;} { <TYPE_T> s=identifier() <IS_T> { - tmpEntry=current; + tmpEntry=current.get(); addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::RECORD,0,0,Public); } try{ @@ -1693,7 +1693,7 @@ void package_body() : {QCString s;} { <PACKAGE_T> <BODY_T> s=name() <IS_T> { - lastCompound=current; + lastCompound=current.get(); s.prepend("_"); addVhdlType(s,getLine(),Entry::CLASS_SEC,VhdlDocGen::PACKAGE_BODY,0,0,Protected); } @@ -1729,15 +1729,15 @@ void package_declaration(): {QCString s;} <PACKAGE_T> s=identifier() <IS_T> { - lastCompound=current; - Entry *clone=new Entry(*current); + lastCompound=current.get(); + std::unique_ptr<Entry> clone=std::make_unique_ptr<Entry>(*current); clone->section=Entry::NAMESPACE_SEC; clone->spec=VhdlDocGen::PACKAGE; clone->name=s; clone->startLine=getLine(PACKAGE_T); clone->bodyLine=getLine(PACKAGE_T); clone->protection=Package; - current_root->addSubEntry(clone); + current_root->moveToSubEntryAndKeep(clone); addVhdlType(s,getLine(PACKAGE_T),Entry::CLASS_SEC,VhdlDocGen::PACKAGE,0,0,Package); } package_declarative_part() @@ -2292,7 +2292,7 @@ void subprogram_specification() : {QCString s;Token *tok=0;Token *t;} { currP=VhdlDocGen::PROCEDURE; createFunction(s.data(),currP,0); - tempEntry=current; + tempEntry=current.get(); current->startLine=getLine(PROCEDURE_T); current->bodyLine=getLine(PROCEDURE_T); @@ -2309,14 +2309,14 @@ void subprogram_specification() : {QCString s;Token *tok=0;Token *t;} createFunction(tok->image.c_str(),currP,s.data()); else createFunction(0,currP,s.data()); - tempEntry=current; + tempEntry=current.get(); current->startLine=getLine(FUNCTION_T); current->bodyLine=getLine(FUNCTION_T); } [{ param_sec=PARAM_SEC; } <LPAREN_T> formal_parameter_list() <RPAREN_T> { param_sec=0; }] <RETURN_T> s=type_mark() { - tempEntry=current; + tempEntry=current.get(); current->type=s; newEntry(); } |