Generate AstNode accessors via astgen

Introduce the @astgen directives parsed by astgen, currently used for
the generation child node (operand) accessors. Please see the updated
internal documentation for details.
This commit is contained in:
Geza Lore
2022-09-21 13:56:03 +01:00
parent 0a8cfb8d2c
commit ce03293128
70 changed files with 1386 additions and 1530 deletions
+5 -5
View File
@@ -115,7 +115,7 @@ private:
}
} else {
// Move to module
m_modp->addStmtp(nodep);
m_modp->addStmtsp(nodep);
}
}
@@ -214,7 +214,7 @@ private:
UINFO(8, " rename to " << nodep->name() << endl);
// Move to module
nodep->unlinkFrBack();
m_modp->addStmtp(nodep);
m_modp->addStmtsp(nodep);
}
iterateChildren(nodep);
}
@@ -233,10 +233,10 @@ private:
const string scname = nodep->forFormat() ? m_displayScope : m_namedScope;
if (!scname.empty()) {
// To keep correct visual order, must add before other Text's
AstNode* const afterp = nodep->scopeAttrp();
AstText* const afterp = nodep->scopeAttrp();
if (afterp) afterp->unlinkFrBackWithNext();
nodep->scopeAttrp(new AstText{nodep->fileline(), string("__DOT__") + scname});
if (afterp) nodep->scopeAttrp(afterp);
nodep->addScopeAttrp(new AstText{nodep->fileline(), string("__DOT__") + scname});
if (afterp) nodep->addScopeAttrp(afterp);
}
iterateChildren(nodep);
}