parse only public inherited classes
This commit is contained in:
@@ -580,6 +580,7 @@ PICodeParser::Entity * PICodeParser::parseClassDeclaration(const PIString & fc)
|
|||||||
static const PIString s_ss = PIStringAscii(" ");
|
static const PIString s_ss = PIStringAscii(" ");
|
||||||
static const PIString s_M = PIStringAscii("$M");
|
static const PIString s_M = PIStringAscii("$M");
|
||||||
static const PIString s_class = PIStringAscii("class");
|
static const PIString s_class = PIStringAscii("class");
|
||||||
|
static const PIString s_public = PIStringAscii("public");
|
||||||
PIString cd = fc.trimmed().removeAll('\n').replaceAll('\t', ' ').replaceAll(s_ss, ' '), pn;
|
PIString cd = fc.trimmed().removeAll('\n').replaceAll('\t', ' ').replaceAll(s_ss, ' '), pn;
|
||||||
MetaMap meta;
|
MetaMap meta;
|
||||||
int ind = cd.find(s_M);
|
int ind = cd.find(s_M);
|
||||||
@@ -587,18 +588,25 @@ PICodeParser::Entity * PICodeParser::parseClassDeclaration(const PIString & fc)
|
|||||||
meta = tmp_meta.value(cd.takeMid(ind, 5));
|
meta = tmp_meta.value(cd.takeMid(ind, 5));
|
||||||
cd.replaceAll(s_ss, ' ');
|
cd.replaceAll(s_ss, ' ');
|
||||||
}
|
}
|
||||||
// piCout << "found class <****\n" << cd << "\n****>";
|
PIString typename_ = cd.left(6).trim();
|
||||||
|
bool is_class = typename_ == s_class;
|
||||||
ind = cd.find(':');
|
ind = cd.find(':');
|
||||||
|
// piCout << "found class <****\n" << cd << "\n****>";
|
||||||
PIVector<Entity *> parents;
|
PIVector<Entity *> parents;
|
||||||
if (ind > 0) {
|
if (ind > 0) {
|
||||||
PIStringList pl = cd.takeMid(ind + 1).trim().split(',');
|
PIStringList pl = cd.takeMid(ind + 1).trim().split(',');
|
||||||
cd.cutRight(1);
|
cd.cutRight(1);
|
||||||
Entity * pe = 0;
|
Entity * pe = 0;
|
||||||
for (const auto & p: pl) {
|
for (const auto & p: pl) {
|
||||||
if (p.contains(' '))
|
PIString access;
|
||||||
|
if (p.contains(' ')) {
|
||||||
|
access = p.left(p.find(' ')).trim();
|
||||||
pn = p.mid(p.find(' ') + 1);
|
pn = p.mid(p.find(' ') + 1);
|
||||||
else
|
} else {
|
||||||
pn = p;
|
pn = p;
|
||||||
|
}
|
||||||
|
bool is_public = access.isEmpty() ? !is_class : access == s_public;
|
||||||
|
if (!is_public) continue;
|
||||||
pe = findEntityByName(pn);
|
pe = findEntityByName(pn);
|
||||||
if (pe == 0)
|
if (pe == 0)
|
||||||
; //{piCout << "Error: can`t find" << pn;}
|
; //{piCout << "Error: can`t find" << pn;}
|
||||||
@@ -606,8 +614,6 @@ PICodeParser::Entity * PICodeParser::parseClassDeclaration(const PIString & fc)
|
|||||||
parents << pe;
|
parents << pe;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PIString typename_ = cd.left(6).trim();
|
|
||||||
bool is_class = typename_ == s_class;
|
|
||||||
Visibility vis = cur_def_vis;
|
Visibility vis = cur_def_vis;
|
||||||
cur_def_vis = (is_class ? Private : Public);
|
cur_def_vis = (is_class ? Private : Public);
|
||||||
PIString cn = cd.mid(6).trim();
|
PIString cn = cd.mid(6).trim();
|
||||||
|
|||||||
Reference in New Issue
Block a user