User Guide

Code generation backends for CoreNEURON. More...

Detailed Description

Code generation backends for CoreNEURON.

Code generation backends for NEURON.

Classes

class  nmodl::codegen::CodegenAccVisitor
 Visitor for printing C++ code with OpenACC backend More...
 
class  nmodl::codegen::CodegenCompatibilityVisitor
 Visitor for printing compatibility issues of the mod file More...
 
class  nmodl::codegen::CodegenCoreneuronCppVisitor
 Visitor for printing C++ code compatible with legacy api of CoreNEURON More...
 
class  nmodl::codegen::CodegenCppVisitor
 Visitor for printing C++ code compatible with legacy api of CoreNEURON More...
 
struct  nmodl::codegen::ThreadVariableInfo
 
class  nmodl::codegen::CodegenNeuronCppVisitor
 Visitor for printing C++ code compatible with legacy api of NEURON More...
 

Functions

std::string nmodl::codegen::get_name (const ThreadVariableInfo &var)
 
template<typename T >
void nmodl::codegen::CodegenCppVisitor::print_vector_elements (const std::vector< T > &elements, const std::string &separator, const std::string &prefix="")
 Print the items in a vector as a list. More...
 
template<typename T >
void nmodl::codegen::CodegenCppVisitor::print_function_declaration (const T &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &={CppObjectSpecifier::Static, CppObjectSpecifier::Inline})
 Print prototype declarations of functions or procedures. More...
 

Function Documentation

◆ get_name()

std::string nmodl::codegen::get_name ( const ThreadVariableInfo var)
inline

Definition at line 76 of file codegen_neuron_cpp_visitor.hpp.

◆ print_function_declaration()

template<typename T >
void nmodl::codegen::CodegenCppVisitor::print_function_declaration ( const T &  node,
const std::string &  name,
const std::unordered_set< CppObjectSpecifier > &  specifiers = {CppObjectSpecifier::StaticCppObjectSpecifier::Inline} 
)
protected

Print prototype declarations of functions or procedures.

Template Parameters
TThe AST node type of the node (must be of nmodl::ast::Ast or subclass)
Parameters
nodeThe AST node representing the function or procedure block
nameA user defined name for the function

If there is an argument with name (say alpha) same as range variable (say alpha), we want to avoid it being printed as instance->alpha. And hence we disable variable name lookup during prototype declaration. Note that the name of procedure can be different in case of table statement.

Definition at line 1567 of file codegen_cpp_visitor.hpp.

◆ print_vector_elements()

template<typename T >
void nmodl::codegen::CodegenCppVisitor::print_vector_elements ( const std::vector< T > &  elements,
const std::string &  separator,
const std::string &  prefix = "" 
)
protected

Print the items in a vector as a list.

This function prints a given vector of elements as a list with given separator onto the current printer. Elements are expected to be of type nmodl::ast::Ast and are printed by being visited. Care is taken to omit the separator after the the last element.

Template Parameters
TThe element type in the vector, which must be of type nmodl::ast::Ast
Parameters
elementsThe vector of elements to be printed
separatorThe separator string to print between all elements
prefixA prefix string to print before each element

Definition at line 1547 of file codegen_cpp_visitor.hpp.