We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is a script to have usage of keywords in your mod files.
import os from nmodl.dsl import visitor import nmodl class NodeVisitor(visitor.AstVisitor): def __init__(self): visitor.AstVisitor.__init__(self) self.dict = {} def visit_node(self, node): type_name = node.get_node_type_name() self.dict[type_name] = self.dict.get(type_name, 0) + 1 visit = NodeVisitor() files = (os.path.join(dirpath,f) for (dirpath, dirnames, filenames) in os.walk("/home/alkino/EPFL/nrn-modeldb-ci/cache/out/") for f in filenames if f.endswith(".mod")) for f in files: driver = nmodl.NmodlDriver() try: ast = driver.parse_file(f) except RuntimeError: print(f) ast.visit_children(visit) print(visit.dict)
It requires a small addition to https://github.com/BlueBrain/nmodl/blob/master/src/language/templates/ast/ast.cpp#L134 Before v.visit_{{}} add:
v.visit_{{}}
{% if not node.is_program_node %} v.visit_node(*this); {% endif %}
Add the same for the constVisitor function right below.
constVisitor
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Here is a script to have usage of keywords in your mod files.
It requires a small addition to https://github.com/BlueBrain/nmodl/blob/master/src/language/templates/ast/ast.cpp#L134
Before
v.visit_{{}}
add:Add the same for the
constVisitor
function right below.The text was updated successfully, but these errors were encountered: