![]() |
User Guide
|
Visitor for traversing FunctionBlock
s and ProcedureBlocks
through their FunctionCall
s
More...
Visitor for traversing FunctionBlock
s and ProcedureBlocks
through their FunctionCall
s
This visitor is used to traverse the FUNCTION
s and PROCEDURE
s in the NMODL files. It visits the FunctionBlock
s and ProcedureBlock
s and if there is a FunctionCall
in those, it visits the FunctionBlock
or ProcedureBlock
of the FunctionCall
. Currently it only checks whether in this path of function calls there is any use of RANGE
, POINTER
or BBCOREPOINTER
variable. In case there is it adds the use_range_ptr_var
property in the Symbol
of the function or procedure in the program SymbolTable
and does the same recursively for all the caller functions. The use_range_ptr_var
property is used later in the CodegenNeuronCppVisitor
.
Definition at line 42 of file function_callpath_visitor.hpp.
#include <function_callpath_visitor.hpp>
Private Attributes | |
std::vector< const ast::Block * > | visited_functions_or_procedures |
Vector of currently visited functions or procedures (used as a searchable stack) More... | |
symtab::SymbolTable * | psymtab = nullptr |
symbol table for the program More... | |
|
overridevirtual |
visit node of type ast::FunctionBlock
Implements nmodl::visitor::ConstVisitor.
Definition at line 77 of file function_callpath_visitor.cpp.
|
overridevirtual |
visit node of type ast::FunctionCall
Visit the called FUNCTION/PROCEDURE AST node to check whether it has use_range_ptr_var
property. If it does the currently called function needs to have it too.
Implements nmodl::visitor::ConstVisitor.
Definition at line 38 of file function_callpath_visitor.cpp.
|
overridevirtual |
visit node of type ast::ProcedureBlock
Avoid recursive calls
Implements nmodl::visitor::ConstVisitor.
Definition at line 65 of file function_callpath_visitor.cpp.
|
overridevirtual |
visit node of type ast::Program
Implements nmodl::visitor::ConstVisitor.
Definition at line 89 of file function_callpath_visitor.cpp.
|
overridevirtual |
visit node of type ast::VarName
If node is either a RANGE var, a POINTER or a BBCOREPOINTER then the FUNCTION or PROCEDURE it's used in should have the use_range_ptr_var
property
Implements nmodl::visitor::ConstVisitor.
Definition at line 17 of file function_callpath_visitor.cpp.
|
private |
symbol table for the program
Definition at line 48 of file function_callpath_visitor.hpp.
|
private |
Vector of currently visited functions or procedures (used as a searchable stack)
Definition at line 45 of file function_callpath_visitor.hpp.