From 14afb771451f24cf998c9a283860eb9b062382f5 Mon Sep 17 00:00:00 2001 From: Thomas Huetter Date: Wed, 17 May 2023 15:21:48 +0200 Subject: [PATCH 1/2] fixed parser; removed parser validation function; added exceptions for parser --- src/command_line/main.cc | 9 -- src/label/json_label.h | 1 + src/label/string_label.h | 1 + src/node/node.h | 1 + src/parser/bracket_notation_parser.h | 8 -- src/parser/bracket_notation_parser_impl.h | 87 ++++++++++--------- test/common/to_string_converters.h | 15 ++++ test/cted_ub/cted_ub_ted_test.cc | 24 ++--- test/lgm_ub/lgm_ub_lb_fill_gaps_test.cc | 25 +++--- test/lgm_ub/lgm_ub_lb_mapping_test.cc | 25 +++--- test/node/tree_indexer_test.cc | 22 +++-- test/parser/CMakeLists.txt | 5 ++ test/parser/parser_labels_test.cc | 37 +++----- test/parser/parser_size_test.cc | 21 +++-- test/parser/parser_tokens_test.cc | 37 ++++---- test/parser/parser_validation_test.cc | 56 ++++++++++++ test/parser/parser_validation_test_data.txt | 21 +++++ test/sed_lb/sed_lb_ed_test.cc | 24 ++--- test/ted/ted_test.cc | 24 ++--- ...zet_subproblem_count_depth_pruning_test.cc | 24 ++--- test/touzet/touzet_td_test.cc | 25 +++--- test/touzet/touzet_ted_test.cc | 25 +++--- 22 files changed, 304 insertions(+), 213 deletions(-) create mode 100644 test/parser/parser_validation_test.cc create mode 100644 test/parser/parser_validation_test_data.txt diff --git a/src/command_line/main.cc b/src/command_line/main.cc index f496db00..0e1da859 100644 --- a/src/command_line/main.cc +++ b/src/command_line/main.cc @@ -62,16 +62,7 @@ int main(int argc, char** argv) { return -1; } - if (!bnp.validate_input(source_tree_string)) { - std::cerr << "Incorrect format of source tree. Is the number of opening and closing brackets equal?" << std::endl; - return -1; - } const node::Node