From 200ea05b53cbc5a3afbdf77955729d6d68ea4172 Mon Sep 17 00:00:00 2001 From: Serguei Makarov Date: Mon, 22 Jul 2013 11:56:50 -0400 Subject: [PATCH] stapregex REWRITE - rig test suite to work with new code --- re2c-migrate/Makefile.am | 11 +++++++---- re2c-migrate/regtest.cxx | 13 +++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/re2c-migrate/Makefile.am b/re2c-migrate/Makefile.am index 705e6f9ba..23b4ebe49 100644 --- a/re2c-migrate/Makefile.am +++ b/re2c-migrate/Makefile.am @@ -2,6 +2,8 @@ AUTOMAKE_OPTIONS=dejagnu +AM_CPPFLAGS = -I$(srcdir)/../includes -I$(builddir)/../includes/sys + clean-local: -rm -f tmp_regtest* @@ -9,11 +11,12 @@ check_PROGRAMS = check_PROGRAMS += regtest -# check_SCRIPTS = regcomp.base/regtest.in.0 regcomp.base/regtest.in.1 +check_SCRIPTS = regcomp.base/regtest.in.0 regcomp.base/regtest.in.1 -regtest_SOURCES = stapregex.cxx regtest.cxx -regtest_SOURCES += re2c-regex.cxx re2c-emit.cxx re2c-dfa.cxx re2c-globals.cxx -regtest_CXXFLAGS = $(AM_CXXFLAGS) -DREGCOMP_STANDALONE +regtest_SOURCES = regtest.cxx ../stapregex.cxx ../stapregex-tree.cxx \ + ../stapregex-parse.cxx ../stapregex-dfa.cxx +regtest_SOURCES += ../translator-output.cxx ../util.cxx +regtest_CXXFLAGS = $(AM_CXXFLAGS) -DSTAPREGEX_STANDALONE BUILT_SOURCES = diff --git a/re2c-migrate/regtest.cxx b/re2c-migrate/regtest.cxx index db2de8eed..b40699757 100644 --- a/re2c-migrate/regtest.cxx +++ b/re2c-migrate/regtest.cxx @@ -9,9 +9,10 @@ // --- // // This file incorporates code from the re2c project; please see -// re2c-migrate/README for details. +// the file README.stapregex for details. -#include "stapregex.h" +#include "../stapregex.h" +#include "../stapregex-tree.h" #include "../translate.h" #include #include @@ -46,7 +47,6 @@ int main(int argc, char *argv []) } int test_type = atoi (argv[1]); - try { switch (test_type) { case 0: @@ -56,7 +56,8 @@ int main(int argc, char *argv []) { if (argc != 4) { print_usage (argv[0]); exit (1); } string s(argv[2]); - stapdfa d("do_match", s, false); // no backslash escaping + // generate a dfa with no unescaping and no tags + stapdfa d("do_match", s, NULL, false, false); translator_output o(cout); string t(argv[3]); @@ -96,8 +97,4 @@ int main(int argc, char *argv []) print_usage (argv[0]); exit (1); } - } catch (const dfa_parse_error &e) { - cerr << "ERROR: " << e.what() << endl; - exit (1); - } } -- 2.43.5