From c6a7b402bce1af143f91dcd53ececc7fd3adb631 Mon Sep 17 00:00:00 2001 From: Dominik Drexler Date: Sun, 15 Oct 2023 19:04:14 +0200 Subject: [PATCH] added glue code driver to stage 2 parsero --- src/core/parsers/elements/driver.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/core/parsers/elements/driver.cpp b/src/core/parsers/elements/driver.cpp index 8f4adcea..363ef93d 100644 --- a/src/core/parsers/elements/driver.cpp +++ b/src/core/parsers/elements/driver.cpp @@ -5,7 +5,8 @@ #include "common/error_handler.hpp" #include "stage_1_ast/parser.hpp" -//#include "stage_2_sketch/parser.hpp" +#include "stage_2_feature/context.hpp" +#include "stage_2_feature/parser.hpp" namespace dlplan::core::parsers::elements { @@ -36,10 +37,10 @@ std::shared_ptr Driver::parse_boolean( auto root_node = stage_1::parser::parse_ast(iter, end, error_handler); // Stage 2 parse - //stage_2::Context context(domain_description, element_factory, policy_builder); - //auto sketch = stage_2::parser::parse_sketch(context, error_handler, root_node); + stage_2::Context context(element_factory); + auto feature = stage_2::parser::parse_boolean(context, error_handler, root_node); - return nullptr; // TODO + return feature; } std::shared_ptr Driver::parse_numerical( @@ -66,10 +67,10 @@ std::shared_ptr Driver::parse_numerical( auto root_node = stage_1::parser::parse_ast(iter, end, error_handler); // Stage 2 parse - //stage_2::Context context(domain_description, element_factory, policy_builder); - //auto sketch = stage_2::parser::parse_sketch(context, error_handler, root_node); + stage_2::Context context(element_factory); + auto feature = stage_2::parser::parse_numerical(context, error_handler, root_node); - return nullptr; // TODO + return feature; } std::shared_ptr Driver::parse_concept( @@ -94,10 +95,10 @@ std::shared_ptr Driver::parse_concept( auto root_node = stage_1::parser::parse_ast(iter, end, error_handler); // Stage 2 parse - //stage_2::Context context(domain_description, element_factory, policy_builder); - //auto sketch = stage_2::parser::parse_sketch(context, error_handler, root_node); + stage_2::Context context(element_factory); + auto feature = stage_2::parser::parse_concept(context, error_handler, root_node); - return nullptr; // TODO + return feature; } std::shared_ptr Driver::parse_role( @@ -122,10 +123,10 @@ std::shared_ptr Driver::parse_role( auto root_node = stage_1::parser::parse_ast(iter, end, error_handler); // Stage 2 parse - //stage_2::Context context(domain_description, element_factory, policy_builder); - //auto sketch = stage_2::parser::parse_sketch(context, error_handler, root_node); + stage_2::Context context(element_factory); + auto feature = stage_2::parser::parse_role(context, error_handler, root_node); - return nullptr; // TODO + return feature; } }