xml_GNode*
xml_pdoc_c_read (xml_GNode* tree)
{
if (! tree) return tree;
if (! tree->children)
tree = xml_pdoc_preparse_c (tree);
___ xml_GNode* node = tree->children;
for (; node ; node = node->next)
{
if (! xml_pcre_contains (
node, CPRE, "?" "\\s*#\\s*ifdef\\s+__cplusplus\\b.*"))
continue;
X(("A"));
___ xml_GNode* with = node->next;
while (xml_pcre_followedby0 (with, 0, "?" "\\s*") &&
xml_pcre_hasnextnode (with, "?" ".comment|br"))
X(("B[%s]", with->name));
___ int opens = 0;
if (! xml_pcre_followedby (with, 0, "?" "\\s*}\\s*"))
{
opens = 1;
X(("M[%s]", with->name));
if (! xml_pcre_followedby (with, 0, "?" "\\s*extern\\s*"))
continue;
X(("MM[%s[%s:%s]]\n", with->name, with->next->name, CSTR));
// if (! xml_pcre_hasnextnode (with, CSTR))
// continue;
if (! with->next) continue;
X(("N[%s]", with->name));
with = with->next;
if (! xml_pcre_contains (with, CSTR, "?" "\"C\"") ||
! xml_pcre_followedby (with, 0, "?" "\\s*{\\s*"))
continue;
X(("X[%s]", with->name));
} |
with = with->next;
X(("C[%s]", with->name));
while (xml_pcre_followedby0 (with, 0, "?" "\\s*") &&
xml_pcre_hasnextnode (with, "?" ".comment|br"))
X(("E[%s]", with->name));
if (! xml_pcre_contains (
with, CPRE, "?" "\\s*#\\s*endif\\b.*"))
continue;
X(("F[%s][%s]", with->name, node->name));
if (opens)
node = xml_node_group_outer_new (node, with, EXTERNC_A);
else
node = xml_node_group_outer_new (node, with, EXTERNC_E);
____;____;
} |
____;
return tree;
} |
|