diff options
author | Clifford Wolf <clifford@clifford.at> | 2013-11-18 19:54:36 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2013-11-18 19:54:36 +0100 |
commit | 79910a55473a697f4c4131151b15f42dc5337148 (patch) | |
tree | d14bf341565bb6e4c6c5529794b94ad7af6548c4 /frontends | |
parent | 2a25e3bca351ad85b328ed808f4efdcf45f6b02c (diff) | |
download | yosys-79910a55473a697f4c4131151b15f42dc5337148.tar.gz yosys-79910a55473a697f4c4131151b15f42dc5337148.tar.bz2 yosys-79910a55473a697f4c4131151b15f42dc5337148.zip |
Added dumping of attributes in AST frontend
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/ast/ast.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc index 115a39333..887ae85c3 100644 --- a/frontends/ast/ast.cc +++ b/frontends/ast/ast.cc @@ -263,6 +263,11 @@ void AstNode::dumpAst(FILE *f, std::string indent) fprintf(f, " int=%u", (int)integer); fprintf(f, "\n"); + for (auto &it : attributes) { + fprintf(f, "%s ATTR %s:\n", indent.c_str(), it.first.c_str()); + it.second->dumpAst(f, indent + " "); + } + for (size_t i = 0; i < children.size(); i++) children[i]->dumpAst(f, indent + " "); } @@ -296,6 +301,12 @@ void AstNode::dumpVlog(FILE *f, std::string indent) return; } + for (auto &it : attributes) { + fprintf(f, "%s" "(* %s = ", indent.c_str(), id2vl(it.first).c_str()); + it.second->dumpVlog(f, ""); + fprintf(f, " *)%s", indent.empty() ? "" : "\n"); + } + switch (type) { case AST_MODULE: |