User Guide

Helper routines/types for code generation. More...

Detailed Description

Helper routines/types for code generation.

Classes

class  nmodl::codegen::IndexVariableInfo
 Helper to represent information about index/int variables. More...
 
class  nmodl::codegen::ShadowUseStatement
 Represents ion write statement during code generation. More...
 
class  nmodl::codegen::CodegenHelperVisitor
 Helper visitor to gather AST information to help code generation. More...
 
class  nmodl::codegen::Conductance
 Represent conductance statements used in mod file. More...
 
class  nmodl::codegen::Ion
 Represent ions used in mod file. More...
 
class  nmodl::codegen::IndexSemantics
 Represent semantic information for index variable. More...
 
class  nmodl::codegen::LongitudinalDiffusionInfo
 Information required to print LONGITUDINAL_DIFFUSION callbacks. More...
 
class  nmodl::codegen::CodegenInfo
 Represent information collected from AST for code generation. More...
 
class  nmodl::CodegenTransformVisitor
 Visitor to make last transformation to AST before codegen. More...
 

Enumerations

enum  nmodl::codegen::BlockType {
  nmodl::codegen::BlockType::Initial, nmodl::codegen::BlockType::Constructor, nmodl::codegen::BlockType::Destructor, nmodl::codegen::BlockType::Equation,
  nmodl::codegen::BlockType::State, nmodl::codegen::BlockType::Watch, nmodl::codegen::BlockType::NetReceive, nmodl::codegen::BlockType::BeforeAfter,
  nmodl::codegen::BlockType::BlockTypeEnd
}
 Helper to represent various block types. More...
 
enum  nmodl::codegen::MemberType { nmodl::codegen::MemberType::index, nmodl::codegen::MemberType::range, nmodl::codegen::MemberType::global, nmodl::codegen::MemberType::thread }
 Helper to represent various variables types. More...
 
enum  nmodl::codegen::CppObjectSpecifier {
  nmodl::codegen::CppObjectSpecifier::Inline, nmodl::codegen::CppObjectSpecifier::Static, nmodl::codegen::CppObjectSpecifier::Virtual, nmodl::codegen::CppObjectSpecifier::Explicit,
  nmodl::codegen::CppObjectSpecifier::Friend, nmodl::codegen::CppObjectSpecifier::Constexpr, nmodl::codegen::CppObjectSpecifier::Extern, nmodl::codegen::CppObjectSpecifier::ExternC,
  nmodl::codegen::CppObjectSpecifier::ThreadLocal, nmodl::codegen::CppObjectSpecifier::Const, nmodl::codegen::CppObjectSpecifier::Volatile
}
 various specifiers (mostly for function codegen) More...
 

Functions

std::string nmodl::codegen::get_name (ast::Ast const *sym)
 
std::string nmodl::codegen::get_name (const std::shared_ptr< symtab::Symbol > &sym)
 
std::string nmodl::codegen::get_name (const IndexVariableInfo &var)
 
template<class T >
int nmodl::codegen::get_index_from_name (const std::vector< T > &variables, const std::string &name)
 
int nmodl::codegen::get_length (const std::shared_ptr< symtab::Symbol > &sym)
 
int nmodl::codegen::get_length (const IndexVariableInfo &var)
 
template<class T >
int nmodl::codegen::get_prefixsum_from_name (const std::vector< T > &variables, const std::string &name)
 

Enumeration Type Documentation

◆ BlockType

Helper to represent various block types.

Note: do not assign integers to these enums

Enumerator
Initial 

initial block

Constructor 

constructor block

Destructor 

destructor block

Equation 

breakpoint block

State 

derivative block

Watch 

watch block

NetReceive 

net_receive block

BeforeAfter 

before / after block

BlockTypeEnd 

fake ending block type for loops on the enums. Keep it at the end

Definition at line 56 of file codegen_cpp_visitor.hpp.

◆ CppObjectSpecifier

various specifiers (mostly for function codegen)

Enumerator
Inline 
Static 
Virtual 
Explicit 
Friend 
Constexpr 
Extern 
ExternC 
ThreadLocal 
Const 
Volatile 

Definition at line 107 of file codegen_cpp_visitor.hpp.

◆ MemberType

Helper to represent various variables types.

Enumerator
index 

index / int variables

range 

range / double variables

global 

global variables

thread 

thread variables

Definition at line 91 of file codegen_cpp_visitor.hpp.

Function Documentation

◆ get_index_from_name()

template<class T >
int nmodl::codegen::get_index_from_name ( const std::vector< T > &  variables,
const std::string &  name 
)

Definition at line 185 of file codegen_cpp_visitor.hpp.

◆ get_length() [1/2]

int nmodl::codegen::get_length ( const IndexVariableInfo var)
inline

Definition at line 201 of file codegen_cpp_visitor.hpp.

◆ get_length() [2/2]

int nmodl::codegen::get_length ( const std::shared_ptr< symtab::Symbol > &  sym)
inline

Definition at line 197 of file codegen_cpp_visitor.hpp.

◆ get_name() [1/3]

std::string nmodl::codegen::get_name ( ast::Ast const *  sym)
inline

Definition at line 172 of file codegen_cpp_visitor.hpp.

◆ get_name() [2/3]

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

Definition at line 180 of file codegen_cpp_visitor.hpp.

◆ get_name() [3/3]

std::string nmodl::codegen::get_name ( const std::shared_ptr< symtab::Symbol > &  sym)
inline

Definition at line 176 of file codegen_cpp_visitor.hpp.

◆ get_prefixsum_from_name()

template<class T >
int nmodl::codegen::get_prefixsum_from_name ( const std::vector< T > &  variables,
const std::string &  name 
)

Definition at line 206 of file codegen_cpp_visitor.hpp.