![Logo](logo.png) |
User Guide
|
Go to the documentation of this file.
8 #include <catch2/catch_test_macros.hpp>
18 using namespace nmodl;
19 using namespace visitor;
21 using namespace test_utils;
34 std::stringstream stream;
35 NmodlPrintVisitor(stream).visit_program(*ast);
38 CheckParentVisitor().check_ast(*ast);
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);
Class that binds all pieces together for parsing nmodl file.
const std::map< std::string, NmodlTestCase > nmodl_valid_constructs
SCENARIO("Convert AST back to NMODL form", "[visitor][nmodl]")
std::string reindent_text(const std::string &text, int indent_level)
Reindent nmodl text for text-to-text comparison.
encapsulates code generation backend implementations
Auto generated AST classes declaration.
nmodl::parser::UnitDriver driver
bool parse_string(const std::string &input)
parser Units provided as string (used for testing)
Visitor for checking parents of ast nodes
std::string run_nmodl_visitor(const std::string &text)
Common utility functions for file/dir manipulation.
THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.