![]() |
User Guide
|
Visitor for printing compatibility issues of the mod file More...
Visitor for printing compatibility issues of the mod file
INDEPENDENT_BLOCK is ignored (no error raised) as stated in: https://www.neuron.yale.edu/neuron/static/py_doc/modelspec/programmatic/mechanisms/nmodl.html
Definition at line 42 of file codegen_compatibility_visitor.hpp.
#include <codegen_compatibility_visitor.hpp>
Private Types | |
typedef std::string(CodegenCompatibilityVisitor::* | FunctionPointer) (ast::Ast &node, const std::shared_ptr< ast::Ast > &) const |
Typedef for defining FunctionPointer that points to the function needed to be called for every kind of error. More... | |
Private Member Functions | |
std::string | return_error_if_solve_method_is_unhandled (ast::Ast &node, const std::shared_ptr< ast::Ast > &ast_node) const |
Takes as parameter an std::shared_ptr<ast::Ast>, searches if the method used for solving is supported and if it is not it returns a relative error message. More... | |
template<typename T > | |
std::string | return_error_with_name (ast::Ast &, const std::shared_ptr< ast::Ast > &ast_node) const |
Takes as parameter an std::shared_ptr<ast::Ast> node and returns a relative error with the name, the type and the location of the unhandled statement. More... | |
template<typename T > | |
std::string | return_error_without_name (ast::Ast &, const std::shared_ptr< ast::Ast > &ast_node) const |
Takes as parameter an std::shared_ptr<ast::Ast> node and returns a relative error with the type and the location of the unhandled statement. More... | |
std::string | return_error_extern (ast::Ast &node, const std::shared_ptr< ast::Ast > &ast_node) const |
Callback when detecting EXTERNAL. More... | |
std::string | return_error_global_var (ast::Ast &node, const std::shared_ptr< ast::Ast > &ast_node) const |
Takes as parameter the ast::Ast to read the symbol table and an std::shared_ptr<ast::Ast> node and returns relative error if a variable that is writen in the mod file is defined as GLOBAL instead of RANGE. More... | |
std::string | return_error_param_var (ast::Ast &node, const std::shared_ptr< ast::Ast > &ast_node) const |
std::string | return_error_if_no_bbcore_read_write (ast::Ast &node, const std::shared_ptr< ast::Ast > &ast_node) const |
Takes as parameter the ast::Ast and checks if the functions "bbcore_read" and "bbcore_write" are defined in any of the ast::Ast VERBATIM blocks. More... | |
Private Attributes | |
const std::string | simulator = "coreneuron" |
Static Private Attributes | |
static const std::map< ast::AstNodeType, FunctionPointer > | unhandled_ast_types_func |
associated container to find the function needed to be called in for every ast::AstNodeType that is unsupported More... | |
static const std::set< std::string > | handled_solvers |
Set of handled solvers by the NMODL C++ code generator. More... | |
|
private |
Typedef for defining FunctionPointer that points to the function needed to be called for every kind of error.
Definition at line 45 of file codegen_compatibility_visitor.hpp.
|
inline |
Default CodegenCompatibilityVisitor constructor.
The argument simulator
must be "neuron"
for NEURON, everything else refers to CoreNEURON. The compatibility will be checked as if generating code for the specified simulator.
Definition at line 71 of file codegen_compatibility_visitor.hpp.
bool nmodl::codegen::CodegenCompatibilityVisitor::find_unhandled_ast_nodes | ( | Ast & | node | ) | const |
Search the ast::Ast for nodes that are incompatible with NMODL C++
code generator.
node | Ast |
Checks all the ast::AstNodeType that are not handled in NMODL code generation backend for CoreNEURON and prints related messages. If there is some kind of incompatibility return false.
Definition at line 156 of file codegen_compatibility_visitor.cpp.
|
private |
Callback when detecting EXTERNAL.
Definition at line 54 of file codegen_compatibility_visitor.cpp.
|
private |
Takes as parameter the ast::Ast to read the symbol table and an std::shared_ptr<ast::Ast> node and returns relative error if a variable that is writen in the mod file is defined as GLOBAL instead of RANGE.
node | Ast |
ast_node | Ast node which is checked |
Definition at line 70 of file codegen_compatibility_visitor.cpp.
|
private |
Takes as parameter the ast::Ast and checks if the functions "bbcore_read" and "bbcore_write" are defined in any of the ast::Ast VERBATIM blocks.
The function is called if there is a BBCORE_POINTER defined in the mod file
node | Ast |
ast_node | Not used by the function |
Definition at line 110 of file codegen_compatibility_visitor.cpp.
|
private |
Takes as parameter an std::shared_ptr<ast::Ast>, searches if the method used for solving is supported and if it is not it returns a relative error message.
node | Not used by the function |
ast_node | Ast node which is checked |
Definition at line 32 of file codegen_compatibility_visitor.cpp.
|
private |
Definition at line 94 of file codegen_compatibility_visitor.cpp.
|
inlineprivate |
Takes as parameter an std::shared_ptr<ast::Ast> node and returns a relative error with the name, the type and the location of the unhandled statement.
T | Type of node parameter in the ast::Ast |
node | Not used by the function |
ast_node | Ast node which is checked |
Definition at line 104 of file codegen_compatibility_visitor.hpp.
|
inlineprivate |
Takes as parameter an std::shared_ptr<ast::Ast> node and returns a relative error with the type and the location of the unhandled statement.
T | Type of node parameter in the ast::Ast |
node | Not used by the function |
ast_node | Ast node which is checked |
Definition at line 129 of file codegen_compatibility_visitor.hpp.
|
inlinestaticprivate |
Set of handled solvers by the NMODL C++
code generator.
Definition at line 54 of file codegen_compatibility_visitor.hpp.
|
private |
Definition at line 60 of file codegen_compatibility_visitor.hpp.
|
staticprivate |
associated container to find the function needed to be called in for every ast::AstNodeType that is unsupported
Definition at line 51 of file codegen_compatibility_visitor.hpp.