diff options
author | Adrian Negreanu <groleo@gmail.com> | 2019-07-19 07:39:46 (GMT) |
---|---|---|
committer | Adrian Negreanu <groleo@gmail.com> | 2019-07-26 07:28:15 (GMT) |
commit | 632fc6347b3e065a7d568d4e40ece2f080d295d7 (patch) | |
tree | 24a236256900365f5292a5f9d6a4efa3168c82ea /src/code.l | |
parent | 7f7e3fec87af915ea5367e926c22c364e49f874d (diff) | |
download | Doxygen-632fc6347b3e065a7d568d4e40ece2f080d295d7.zip Doxygen-632fc6347b3e065a7d568d4e40ece2f080d295d7.tar.gz Doxygen-632fc6347b3e065a7d568d4e40ece2f080d295d7.tar.bz2 |
code.l: make CallContext independent of global variables
Diffstat (limited to 'src/code.l')
-rw-r--r-- | src/code.l | 40 |
1 files changed, 20 insertions, 20 deletions
@@ -338,15 +338,15 @@ class CallContext public: struct Ctx { - Ctx() : name(g_name), type(g_type), d(0) {} + Ctx(QCString _name, QCString _type) : name(_name), type(_type), d(0) {} QCString name; QCString type; const Definition *d; }; - CallContext() + CallContext() { - m_defList.append(new Ctx); + m_defList.append(new Ctx("","")); m_defList.setAutoDelete(TRUE); } virtual ~CallContext() {} @@ -359,12 +359,12 @@ class CallContext ctx->d=d; } } - void pushScope() + void pushScope(QCString _name, QCString _type) { - m_defList.append(new Ctx); + m_defList.append(new Ctx(_name,_type)); DBG_CTX((stderr,"** Push call context %d\n",m_defList.count())); } - void popScope() + void popScope(QCString &_name, QCString &_type) { if (m_defList.count()>1) { @@ -372,8 +372,8 @@ class CallContext Ctx *ctx = m_defList.getLast(); if (ctx) { - g_name = ctx->name; - g_type = ctx->type; + _name = ctx->name; + _type = ctx->type; } m_defList.removeLast(); } @@ -386,7 +386,7 @@ class CallContext { DBG_CTX((stderr,"** Clear call context\n")); m_defList.clear(); - m_defList.append(new Ctx); + m_defList.append(new Ctx("","")); } const Definition *getScope() const { @@ -2510,7 +2510,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" } <Body>"*"{B}*")" { // end of cast? g_code->codify(yytext); - g_theCallContext.popScope(); + g_theCallContext.popScope(g_name, g_type); g_bracketCount--; g_parmType = g_name; BEGIN(FuncCall); @@ -2520,7 +2520,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" g_name.resize(0);g_type.resize(0); if (*yytext==')') { - g_theCallContext.popScope(); + g_theCallContext.popScope(g_name, g_type); g_bracketCount--; BEGIN(FuncCall); } @@ -2852,7 +2852,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" } else if (*yytext=='[') { - g_theCallContext.pushScope(); + g_theCallContext.pushScope(g_name, g_type); } g_args.resize(0); g_parmType.resize(0); @@ -2878,7 +2878,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" } <ObjCMemberCall>"[" { g_code->codify(yytext); - g_theCallContext.pushScope(); + g_theCallContext.pushScope(g_name, g_type); } <ObjCMemberCall2>{ID}":"? { g_name+=yytext; @@ -2900,7 +2900,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" BEGIN(ObjCMemberCall3); } <ObjCMemberCall2,ObjCMemberCall3>"]" { - g_theCallContext.popScope(); + g_theCallContext.popScope(g_name, g_type); g_code->codify(yytext); BEGIN(Body); } @@ -2990,7 +2990,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" <ObjCCall,ObjCMName,ObjCSkipStr>\n { g_currentCtx->format+=*yytext; } <Body>"]" { - g_theCallContext.popScope(); + g_theCallContext.popScope(g_name, g_type); g_code->codify(yytext); // TODO: nested arrays like: a[b[0]->func()]->func() g_name = g_saveName.copy(); @@ -3093,7 +3093,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" g_parmType.resize(0);g_parmName.resize(0); g_code->codify(yytext); g_bracketCount++; - g_theCallContext.pushScope(); + g_theCallContext.pushScope(g_name, g_type); if (YY_START==FuncCall && !g_insideBody) { g_theVarContext.pushScope(); @@ -3127,7 +3127,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" g_parmName.resize(0); g_theVarContext.addVariable(g_parmType,g_parmName); } - g_theCallContext.popScope(); + g_theCallContext.popScope(g_name, g_type); g_inForEachExpression = FALSE; //g_theCallContext.setClass(0); // commented out, otherwise a()->b() does not work for b(). g_code->codify(yytext); @@ -3184,7 +3184,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" g_theVarContext.pushScope(); } g_theVarContext.addVariable(g_parmType,g_parmName); - //g_theCallContext.popScope(); + //g_theCallContext.popScope(g_name, g_type); g_parmType.resize(0);g_parmName.resize(0); int index = g_name.findRev("::"); DBG_CTX((stderr,"g_name=%s\n",g_name.data())); @@ -3644,11 +3644,11 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" } <*>"("|"[" { g_code->codify(yytext); - g_theCallContext.pushScope(); + g_theCallContext.pushScope(g_name, g_type); } <*>")"|"]" { g_code->codify(yytext); - g_theCallContext.popScope(); + g_theCallContext.popScope(g_name, g_type); } <*>\n { g_yyColNr++; |