User Guide
indexedname_visitor.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2023 Blue Brain Project, EPFL.
3  * See the top-level LICENSE file for details.
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
11 
12 namespace nmodl {
13 namespace visitor {
14 
17 }
18 
20  node.visit_children(*this);
21  const auto& bin_exp = std::static_pointer_cast<ast::BinaryExpression>(node.get_expression());
22  auto lhs = bin_exp->get_lhs();
23  auto rhs = bin_exp->get_rhs();
25 }
26 
28  node.visit_children(*this);
29 }
30 std::pair<std::string, std::unordered_set<std::string>> IndexedNameVisitor::get_dependencies() {
31  return dependencies;
32 }
34  return indexed_name;
35 }
36 
37 } // namespace visitor
38 } // namespace nmodl
nmodl::visitor::IndexedNameVisitor::get_indexed_name
std::string get_indexed_name()
get the attribute indexed_name
Definition: indexedname_visitor.cpp:33
nmodl::get_indexed_name
std::string get_indexed_name(const ast::IndexedName &node)
Given a Indexed node, return the name with index.
Definition: visitor_utils.cpp:270
nmodl::visitor::IndexedNameVisitor::visit_indexed_name
void visit_indexed_name(ast::IndexedName &node) override
Get node name with index for the IndexedName node.
Definition: indexedname_visitor.cpp:15
nmodl::ast::DiffEqExpression
Represents differential equation in DERIVATIVE block.
Definition: diff_eq_expression.hpp:38
nmodl
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
nmodl::visitor::IndexedNameVisitor::visit_program
void visit_program(ast::Program &node) override
visit node of type ast::Program
Definition: indexedname_visitor.cpp:27
nmodl::visitor::IndexedNameVisitor::indexed_name
std::string indexed_name
Definition: indexedname_visitor.hpp:38
nmodl::statement_dependencies
std::pair< std::string, std::unordered_set< std::string > > statement_dependencies(const std::shared_ptr< ast::Expression > &lhs, const std::shared_ptr< ast::Expression > &rhs)
If lhs and rhs combined represent an assignment (we assume to have an "=" in between them) we extract...
Definition: visitor_utils.cpp:246
binary_expression.hpp
Auto generated AST classes declaration.
visitor_utils.hpp
Utility functions for visitors implementation.
nmodl::ast::IndexedName
Represents specific element of an array variable.
Definition: indexed_name.hpp:48
nmodl::visitor::IndexedNameVisitor::get_dependencies
std::pair< std::string, std::unordered_set< std::string > > get_dependencies()
get the attribute dependencies
Definition: indexedname_visitor.cpp:30
nmodl::ast::DiffEqExpression::visit_children
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:6638
nmodl::ast::Program::visit_children
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:12902
nmodl::ast::DiffEqExpression::get_expression
std::shared_ptr< BinaryExpression > get_expression() const noexcept
Getter for member variable DiffEqExpression::expression.
Definition: diff_eq_expression.hpp:143
nmodl::visitor::IndexedNameVisitor::dependencies
std::pair< std::string, std::unordered_set< std::string > > dependencies
Definition: indexedname_visitor.hpp:39
nmodl::ast::Program
Represents top level AST node for whole NMODL input.
Definition: program.hpp:39
nmodl::visitor::IndexedNameVisitor::visit_diff_eq_expression
void visit_diff_eq_expression(ast::DiffEqExpression &node) override
Get dependencies for the DiffEqExpression node.
Definition: indexedname_visitor.cpp:19
indexedname_visitor.hpp
Get node name with indexed for the IndexedName node and the dependencies of DiffEqExpression node.