8 #include <catch2/catch_test_macros.hpp>
18 using namespace nmodl;
19 using namespace visitor;
21 using namespace test_utils;
34 std::stringstream stream;
43 SCENARIO(
"Convert AST back to NMODL form",
"[visitor][nmodl]") {
45 auto test_case = construct.second;
46 const std::string& input_nmodl_text =
reindent_text(test_case.input);
47 const std::string& output_nmodl_text =
reindent_text(test_case.output);
48 GIVEN(test_case.name) {
49 THEN(
"Visitor successfully returns : " + input_nmodl_text) {
51 REQUIRE(
result == output_nmodl_text);
Visitor for checking parents of ast nodes
Class that binds all pieces together for parsing nmodl file.
Visitor for printing AST back to NMODL
void visit_program(const ast::Program &node) override
visit node of type ast::Program
Visitor for checking parents of ast nodes
int check_ast(const ast::Ast &node)
A small wrapper to have a nicer call in parser.cpp.
Common utility functions for file/dir manipulation.
bool parse_string(const std::string &input)
parser Units provided as string (used for testing)
std::map< std::string, NmodlTestCase > const nmodl_valid_constructs
std::string reindent_text(const std::string &text, int indent_level)
Reindent nmodl text for text-to-text comparison.
encapsulates code generation backend implementations
std::string run_nmodl_visitor(const std::string &text)
SCENARIO("Convert AST back to NMODL form", "[visitor][nmodl]")
THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
Auto generated AST classes declaration.
nmodl::parser::UnitDriver driver