Facilitating namespaces in testing

This commit is contained in:
caheckman 2020-06-29 15:23:09 -04:00
parent e339d91ffd
commit d4217fb814
14 changed files with 181 additions and 80 deletions

View file

@ -46,6 +46,20 @@ PrintJava::PrintJava(Architecture *glb,const string &nm) : PrintC(glb,nm)
castStrategy = new CastStrategyJava();
}
void PrintJava::docFunction(const Funcdata *fd)
{
bool singletonFunction = false;
if (curscope == (const Scope *)0) {
singletonFunction = true;
// Always assume we are in the scope of the parent class
pushScope(fd->getScopeLocal()->getParent());
}
PrintC::docFunction(fd);
if (singletonFunction)
popScope();
}
/// Print a data-type up to the identifier, store off array sizes
/// for printing after the identifier. Find the root type (the one with an identifier)
/// and the count number of wrapping arrays.