From 9fcd8640506a5ad020f36b63858898efbda1f429 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Tue, 2 Jun 2015 12:34:09 +0100 Subject: [PATCH] Fixed build system to support automake's 'subdir-objects' feature. As I updated automake to version 1.15 it began to produce lots of warnings about 'subdir-objects' not used when it should have been. Turns out that 'subdir-objects' will be on by default in 2.0. So I tried to turn on 'subdir-objects' and builds began to fail: automake didn't expand '$(sourcedir)' and '$(builddir)' prefixes. I erroneously prepended these prefixes in commit 38f526d04415adb7b5e6bca228fc26409833f5c3 "Updated build system.", as commit message says: ... Makefile.am: - explicitly prefixed all file names with $(srcdir) or $(builddir) ... But automake prepends these prefixes already where necessary, except for custom rules with side effects: if a custom rule touches some files that are not explicit targets or dependencies of this rule, then automake won't find these files unless they are in build directory. We have such side-effectful custom rules: - parser rule produces multiple files and touches bootstrap files - scanner rule touches bootstrap file - doc rules touch bootstrap files Multiple files is a common problem of make. Bootstrap introduces circular dependency, since bootstrap files need to be updated after they've been used. So it's hard to get rid of side effects in these rules. This commit enabels 'subdir-objects' feature and removes all prefixes in variables and adds them in side-effectful custom rules (for files from source directory, not for files from build directory). It also makes use of '$@' and '$<' special variables in custom rules (which makes side effects more explicit). Still I don't yet fully understand how automake uses things like '$(sourcedir)' and '$(builddir)' and their relation with 'subdir-objects' (it's probably related with non-recursive makefiles). --- re2c/Makefile.am | 274 ++++++++++++++++++++------------------- re2c/bootstrap/parser.cc | 112 ++++++++-------- re2c/bootstrap/y.tab.h | 4 +- re2c/configure.ac | 2 +- 4 files changed, 200 insertions(+), 192 deletions(-) diff --git a/re2c/Makefile.am b/re2c/Makefile.am index 7609fa34..cb415805 100644 --- a/re2c/Makefile.am +++ b/re2c/Makefile.am @@ -1,113 +1,106 @@ +# flags AM_CXXFLAGS = -W -Wall -Wextra -Weffc++ -pedantic -Wredundant-decls -O2 AM_YFLAGS = -y -d --no-lines RE2CFLAGS = -bi +# binary bin_PROGRAMS = re2c -RE2C = $(builddir)/re2c$(EXEEXT) - -# scanner -SRC_SCANNER = $(srcdir)/src/parse/scanner_lex.re -AUTOGEN_SCANNER = $(builddir)/scanner_lex.cc -BOOTSTRAP_SCANNER = $(srcdir)/bootstrap/scanner_lex.cc - -# parser -SRC_PARSER = $(srcdir)/src/parse/parser.ypp -AUTOGEN_PARSER = $(builddir)/parser.cc -AUTOGEN_PARSER_HDR = $(builddir)/y.tab.h -BOOTSTRAP_PARSER = $(srcdir)/bootstrap/parser.cc -BOOTSTRAP_PARSER_HDR = $(srcdir)/bootstrap/y.tab.h - -# docs -DOC_MAN = $(builddir)/doc/re2c.1 -DOC_HTML = $(builddir)/doc/manual.html -SRC_DOC = $(builddir)/doc/re2c.ad -BOOTSTRAP_DOC_MAN = $(srcdir)/bootstrap/re2c.1 -BOOTSTRAP_DOC_HTML = $(srcdir)/bootstrap/manual.html +RE2C = re2c$(EXEEXT) +# sources SRC_HDR = \ - $(srcdir)/src/codegen/bitmap.h \ - $(srcdir)/src/codegen/code_names.h \ - $(srcdir)/src/codegen/emit.h \ - $(srcdir)/src/codegen/go.h \ - $(srcdir)/src/codegen/indent.h \ - $(srcdir)/src/codegen/input_api.h \ - $(srcdir)/src/codegen/label.h \ - $(srcdir)/src/codegen/output.h \ - $(srcdir)/src/codegen/print.h \ - $(srcdir)/src/codegen/scc.h \ - $(srcdir)/src/codegen/skeleton/path.h \ - $(srcdir)/src/codegen/skeleton/skeleton.h \ - $(srcdir)/src/dfa/action.h \ - $(srcdir)/src/dfa/encoding/enc.h \ - $(srcdir)/src/dfa/encoding/range_suffix.h \ - $(srcdir)/src/dfa/encoding/utf16/utf16.h \ - $(srcdir)/src/dfa/encoding/utf16/utf16_range.h \ - $(srcdir)/src/dfa/encoding/utf16/utf16_regexp.h \ - $(srcdir)/src/dfa/encoding/utf8/utf8.h \ - $(srcdir)/src/dfa/encoding/utf8/utf8_range.h \ - $(srcdir)/src/dfa/encoding/utf8/utf8_regexp.h \ - $(srcdir)/src/dfa/dfa.h \ - $(srcdir)/src/dfa/ins.h \ - $(srcdir)/src/dfa/re.h \ - $(srcdir)/src/dfa/state.h \ - $(srcdir)/src/globals.h \ - $(srcdir)/src/mbo_getopt.h \ - $(srcdir)/src/parse/input.h \ - $(srcdir)/src/parse/parser.h \ - $(srcdir)/src/parse/scanner.h \ - $(srcdir)/src/parse/token.h \ - $(srcdir)/src/util/allocate.h \ - $(srcdir)/src/util/c99_stdint.h \ - $(srcdir)/src/util/forbid_copy.h \ - $(srcdir)/src/util/free_list.h \ - $(srcdir)/src/util/local_increment.h \ - $(srcdir)/src/util/range.h \ - $(srcdir)/src/util/smart_ptr.h \ - $(srcdir)/src/util/substr.h \ - $(srcdir)/src/util/wrap_iterator.h - + src/codegen/bitmap.h \ + src/codegen/code_names.h \ + src/codegen/emit.h \ + src/codegen/go.h \ + src/codegen/indent.h \ + src/codegen/input_api.h \ + src/codegen/label.h \ + src/codegen/output.h \ + src/codegen/print.h \ + src/codegen/scc.h \ + src/codegen/skeleton/path.h \ + src/codegen/skeleton/skeleton.h \ + src/dfa/action.h \ + src/dfa/encoding/enc.h \ + src/dfa/encoding/range_suffix.h \ + src/dfa/encoding/utf16/utf16.h \ + src/dfa/encoding/utf16/utf16_range.h \ + src/dfa/encoding/utf16/utf16_regexp.h \ + src/dfa/encoding/utf8/utf8.h \ + src/dfa/encoding/utf8/utf8_range.h \ + src/dfa/encoding/utf8/utf8_regexp.h \ + src/dfa/dfa.h \ + src/dfa/ins.h \ + src/dfa/re.h \ + src/dfa/state.h \ + src/globals.h \ + src/mbo_getopt.h \ + src/parse/input.h \ + src/parse/parser.h \ + src/parse/scanner.h \ + src/parse/token.h \ + src/util/allocate.h \ + src/util/c99_stdint.h \ + src/util/forbid_copy.h \ + src/util/free_list.h \ + src/util/local_increment.h \ + src/util/range.h \ + src/util/smart_ptr.h \ + src/util/substr.h \ + src/util/wrap_iterator.h SRC = \ - $(SRC_SCANNER) \ - $(srcdir)/src/codegen/bitmap.cc \ - $(srcdir)/src/codegen/code_names.cc \ - $(srcdir)/src/codegen/emit_action.cc \ - $(srcdir)/src/codegen/emit_dfa.cc \ - $(srcdir)/src/codegen/label.cc \ - $(srcdir)/src/codegen/prepare_dfa.cc \ - $(srcdir)/src/codegen/go_construct.cc \ - $(srcdir)/src/codegen/go_destruct.cc \ - $(srcdir)/src/codegen/go_emit.cc \ - $(srcdir)/src/codegen/go_used_labels.cc \ - $(srcdir)/src/codegen/input_api.cc \ - $(srcdir)/src/codegen/output.cc \ - $(srcdir)/src/codegen/print.cc \ - $(srcdir)/src/codegen/scc.cc \ - $(srcdir)/src/codegen/skeleton/path.cc \ - $(srcdir)/src/codegen/skeleton/skeleton.cc \ - $(srcdir)/src/dfa/actions.cc \ - $(srcdir)/src/dfa/encoding/enc.cc \ - $(srcdir)/src/dfa/encoding/range_suffix.cc \ - $(srcdir)/src/dfa/encoding/utf16/utf16.cc \ - $(srcdir)/src/dfa/encoding/utf16/utf16_range.cc \ - $(srcdir)/src/dfa/encoding/utf16/utf16_regexp.cc \ - $(srcdir)/src/dfa/encoding/utf8/utf8.cc \ - $(srcdir)/src/dfa/encoding/utf8/utf8_range.cc \ - $(srcdir)/src/dfa/encoding/utf8/utf8_regexp.cc \ - $(srcdir)/src/dfa/dfa.cc \ - $(srcdir)/src/main.cc \ - $(srcdir)/src/mbo_getopt.cc \ - $(srcdir)/src/parse/input.cc \ - $(srcdir)/src/parse/scanner.cc \ - $(srcdir)/src/util/range.cc -# omit SRC_PARSER here; include it in EXTRA_DIST instead -# (automake generates standard build rules for all YACC-ish -# sources, they will conflict with our custom build rule). + src/codegen/bitmap.cc \ + src/codegen/code_names.cc \ + src/codegen/emit_action.cc \ + src/codegen/emit_dfa.cc \ + src/codegen/label.cc \ + src/codegen/prepare_dfa.cc \ + src/codegen/go_construct.cc \ + src/codegen/go_destruct.cc \ + src/codegen/go_emit.cc \ + src/codegen/go_used_labels.cc \ + src/codegen/input_api.cc \ + src/codegen/output.cc \ + src/codegen/print.cc \ + src/codegen/scc.cc \ + src/codegen/skeleton/path.cc \ + src/codegen/skeleton/skeleton.cc \ + src/dfa/actions.cc \ + src/dfa/encoding/enc.cc \ + src/dfa/encoding/range_suffix.cc \ + src/dfa/encoding/utf16/utf16.cc \ + src/dfa/encoding/utf16/utf16_range.cc \ + src/dfa/encoding/utf16/utf16_regexp.cc \ + src/dfa/encoding/utf8/utf8.cc \ + src/dfa/encoding/utf8/utf8_range.cc \ + src/dfa/encoding/utf8/utf8_regexp.cc \ + src/dfa/dfa.cc \ + src/main.cc \ + src/mbo_getopt.cc \ + src/parse/input.cc \ + src/parse/scanner.cc \ + src/util/range.cc +re2c_SOURCES = \ + $(SRC_HDR) \ + $(SRC) +# autogenerated sources +AUTOGEN_SCANNER = scanner_lex.cc +AUTOGEN_PARSER = parser.cc +AUTOGEN_PARSER_HDR = y.tab.h AUTOGEN = \ $(AUTOGEN_PARSER) \ $(AUTOGEN_PARSER_HDR) \ $(AUTOGEN_SCANNER) +nodist_re2c_SOURCES = $(AUTOGEN) +# bootstrap sources +BOOTSTRAP_SCANNER = bootstrap/scanner_lex.cc +BOOTSTRAP_PARSER = bootstrap/parser.cc +BOOTSTRAP_PARSER_HDR = bootstrap/y.tab.h +BOOTSTRAP_DOC_MAN = bootstrap/re2c.1 +BOOTSTRAP_DOC_HTML = bootstrap/manual.html BOOTSTRAP = \ $(BOOTSTRAP_DOC_HTML) \ $(BOOTSTRAP_DOC_MAN) \ @@ -115,59 +108,70 @@ BOOTSTRAP = \ $(BOOTSTRAP_PARSER_HDR) \ $(BOOTSTRAP_SCANNER) -re2c_SOURCES = \ - $(SRC_HDR) \ - $(SRC) -nodist_re2c_SOURCES = $(AUTOGEN) +# custom sources +CUSTOM_SCANNER = src/parse/scanner_lex.re +CUSTOM_PARSER = src/parse/parser.ypp +CUSTOM = \ + $(CUSTOM_SCANNER) \ + $(CUSTOM_PARSER) + +# docs +SRC_DOC = doc/re2c.ad +DOC_MAN = doc/re2c.1 +DOC_HTML = doc/manual.html +DOC = \ + $(DOC_HTML) \ + $(DOC_MAN) +man_MANS = $(DOC_MAN) EXTRA_DIST = \ $(BOOTSTRAP) \ - $(SRC_PARSER) \ - $(srcdir)/CHANGELOG \ - $(srcdir)/NO_WARRANTY \ - $(srcdir)/README \ - $(srcdir)/autogen.sh \ - $(srcdir)/doc/index.html \ - $(srcdir)/doc/loplas.ps \ - $(srcdir)/doc/sample.bib \ - $(srcdir)/examples \ - $(srcdir)/test + $(CUSTOM) \ + CHANGELOG \ + NO_WARRANTY \ + README \ + autogen.sh \ + doc/index.html \ + doc/loplas.ps \ + doc/sample.bib \ + examples \ + test CLEANFILES = \ $(AUTOGEN) \ - $(DOC_HTML) \ - $(DOC_MAN) + $(DOC) -TESTS = $(builddir)/run_tests.sh - -man_MANS = $(DOC_MAN) +TESTS = run_tests.sh -$(AUTOGEN_PARSER): $(SRC_PARSER) +# rule has side effects: +# - autogenerated header in build directory +# - bootstrap files in source directory, must manually prepend $(top_srcdir) +$(AUTOGEN_PARSER): $(CUSTOM_PARSER) @if test $(BISON) = "yes"; \ then \ - bison $(YFLAGS) --output=$(AUTOGEN_PARSER) --defines=$(AUTOGEN_PARSER_HDR) $(SRC_PARSER) && \ - cp $(AUTOGEN_PARSER) $(BOOTSTRAP_PARSER) && \ - cp $(AUTOGEN_PARSER_HDR) $(BOOTSTRAP_PARSER_HDR); \ + bison $(YFLAGS) --output=$@ --defines=$(AUTOGEN_PARSER_HDR) $< && \ + cp $@ $(top_srcdir)/$(BOOTSTRAP_PARSER) && \ + cp $(AUTOGEN_PARSER_HDR) $(top_srcdir)/$(BOOTSTRAP_PARSER_HDR); \ else \ - cp $(BOOTSTRAP_PARSER) $(AUTOGEN_PARSER) && \ - cp $(BOOTSTRAP_PARSER_HDR) $(AUTOGEN_PARSER_HDR); \ + cp $(top_srcdir)/$(BOOTSTRAP_PARSER) $@ && \ + cp $(top_srcdir)/$(BOOTSTRAP_PARSER_HDR) $(AUTOGEN_PARSER_HDR); \ fi -$(AUTOGEN_SCANNER): $(SRC_SCANNER) +# rule has side effects: +# - bootstrap file in source directory, must manually prepend $(top_srcdir) +$(AUTOGEN_SCANNER): $(CUSTOM_SCANNER) @if test -x $(RE2C); \ then \ - $(RE2C) $(RE2CFLAGS) -o $(AUTOGEN_SCANNER) $(SRC_SCANNER) && \ - cp $(AUTOGEN_SCANNER) $(BOOTSTRAP_SCANNER); \ + $(RE2C) $(RE2CFLAGS) -o $@ $< && \ + cp $@ $(top_srcdir)/$(BOOTSTRAP_SCANNER); \ else \ - cp $(BOOTSTRAP_SCANNER) $(AUTOGEN_SCANNER); \ + cp $(top_srcdir)/$(BOOTSTRAP_SCANNER) $@; \ fi # rebuild lexer (just in case it was bootstrapped) and rebuild re2c .PHONY: bootstrap bootstrap: all rm $(AUTOGEN_SCANNER) - $(RE2C) $(RE2CFLAGS) -o $(AUTOGEN_SCANNER) $(SRC_SCANNER) - cp $(AUTOGEN_SCANNER) $(BOOTSTRAP_SCANNER) make all .PHONY: tests @@ -183,19 +187,23 @@ wtests: all $(TESTS) .PHONY: docs if REBUILD_DOCS docs: $(DOC_MAN) $(DOC_HTML) +# rule has side effects: +# - bootstrap file in source directory, must manually prepend $(top_srcdir) $(DOC_MAN): $(SRC_DOC) - a2x -f manpage $(SRC_DOC) - cp $(DOC_MAN) $(BOOTSTRAP_DOC_MAN) + a2x -f manpage $< + cp $@ $(top_srcdir)/$(BOOTSTRAP_DOC_MAN) +# rule has side effects: +# - bootstrap file in source directory, must manually prepend $(top_srcdir) $(DOC_HTML): $(SRC_DOC) - asciidoc -o $(DOC_HTML) $(SRC_DOC) - cp $(DOC_HTML) $(BOOTSTRAP_DOC_HTML) + asciidoc -o $@ $< + cp $@ $(top_srcdir)/$(BOOTSTRAP_DOC_HTML) else docs: $(DOC_MAN) $(DOC_HTML) @echo "Reconfigure to rebuild docs: ./configure --enable-docs" $(DOC_MAN): $(BOOTSTRAP_DOC_MAN) - cp $(BOOTSTRAP_DOC_MAN) $(DOC_MAN) + cp $< $@ $(DOC_HTML): $(BOOTSTRAP_DOC_HTML) - cp $(BOOTSTRAP_DOC_HTML) $(DOC_HTML) + cp $< $@ endif all-local: docs diff --git a/re2c/bootstrap/parser.cc b/re2c/bootstrap/parser.cc index 23802d24..727e570f 100644 --- a/re2c/bootstrap/parser.cc +++ b/re2c/bootstrap/parser.cc @@ -67,7 +67,7 @@ /* Copy the first part of user declarations. */ /* Line 189 of yacc.c */ -#line 1 "../src/parse/parser.ypp" +#line 1 "src/parse/parser.ypp" #include @@ -214,7 +214,7 @@ void default_rule(CondList *clist, Token *code) /* Line 189 of yacc.c */ -#line 218 "./parser.cc" +#line 218 "parser.cc" /* Enabling traces. */ #ifndef YYDEBUG @@ -264,7 +264,7 @@ typedef union YYSTYPE { /* Line 214 of yacc.c */ -#line 148 "../src/parse/parser.ypp" +#line 148 "src/parse/parser.ypp" re2c::RegExp *regexp; re2c::Token *token; @@ -277,7 +277,7 @@ typedef union YYSTYPE /* Line 214 of yacc.c */ -#line 281 "./parser.cc" +#line 281 "parser.cc" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -289,7 +289,7 @@ typedef union YYSTYPE /* Line 264 of yacc.c */ -#line 293 "./parser.cc" +#line 293 "parser.cc" #ifdef short # undef short @@ -1570,7 +1570,7 @@ yyreduce: case 2: /* Line 1464 of yacc.c */ -#line 175 "../src/parse/parser.ypp" +#line 175 "src/parse/parser.ypp" { ;} break; @@ -1578,7 +1578,7 @@ yyreduce: case 3: /* Line 1464 of yacc.c */ -#line 178 "../src/parse/parser.ypp" +#line 178 "src/parse/parser.ypp" { foundRules = true; ;} @@ -1587,7 +1587,7 @@ yyreduce: case 5: /* Line 1464 of yacc.c */ -#line 186 "../src/parse/parser.ypp" +#line 186 "src/parse/parser.ypp" { if (!symbol_table.insert (std::make_pair (* (yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].regexp))).second) { @@ -1601,7 +1601,7 @@ yyreduce: case 6: /* Line 1464 of yacc.c */ -#line 195 "../src/parse/parser.ypp" +#line 195 "src/parse/parser.ypp" { if (!symbol_table.insert (std::make_pair (* (yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].regexp))).second) { @@ -1615,7 +1615,7 @@ yyreduce: case 7: /* Line 1464 of yacc.c */ -#line 204 "../src/parse/parser.ypp" +#line 204 "src/parse/parser.ypp" { in->fatal("trailing contexts are not allowed in named definitions"); ;} @@ -1624,7 +1624,7 @@ yyreduce: case 8: /* Line 1464 of yacc.c */ -#line 208 "../src/parse/parser.ypp" +#line 208 "src/parse/parser.ypp" { in->fatal("trailing contexts are not allowed in named definitions"); ;} @@ -1633,7 +1633,7 @@ yyreduce: case 9: /* Line 1464 of yacc.c */ -#line 212 "../src/parse/parser.ypp" +#line 212 "src/parse/parser.ypp" { in->config (* (yyvsp[(1) - (4)].str), * (yyvsp[(3) - (4)].str)); delete (yyvsp[(1) - (4)].str); @@ -1644,7 +1644,7 @@ yyreduce: case 10: /* Line 1464 of yacc.c */ -#line 218 "../src/parse/parser.ypp" +#line 218 "src/parse/parser.ypp" { in->config (* (yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].number)); delete (yyvsp[(1) - (4)].str); @@ -1654,7 +1654,7 @@ yyreduce: case 11: /* Line 1464 of yacc.c */ -#line 226 "../src/parse/parser.ypp" +#line 226 "src/parse/parser.ypp" { if (cFlag) { @@ -1668,7 +1668,7 @@ yyreduce: case 12: /* Line 1464 of yacc.c */ -#line 235 "../src/parse/parser.ypp" +#line 235 "src/parse/parser.ypp" { if (cFlag) in->fatal("condition or '<*>' required when using -c switch"); @@ -1682,7 +1682,7 @@ yyreduce: case 13: /* Line 1464 of yacc.c */ -#line 244 "../src/parse/parser.ypp" +#line 244 "src/parse/parser.ypp" { context_rule((yyvsp[(2) - (7)].clist), (yyvsp[(4) - (7)].regexp), (yyvsp[(5) - (7)].regexp), (yyvsp[(6) - (7)].str), (yyvsp[(7) - (7)].token)); ;} @@ -1691,7 +1691,7 @@ yyreduce: case 14: /* Line 1464 of yacc.c */ -#line 248 "../src/parse/parser.ypp" +#line 248 "src/parse/parser.ypp" { assert((yyvsp[(7) - (7)].str)); context_rule((yyvsp[(2) - (7)].clist), (yyvsp[(4) - (7)].regexp), (yyvsp[(5) - (7)].regexp), (yyvsp[(7) - (7)].str), NULL); @@ -1701,7 +1701,7 @@ yyreduce: case 15: /* Line 1464 of yacc.c */ -#line 253 "../src/parse/parser.ypp" +#line 253 "src/parse/parser.ypp" { context_none((yyvsp[(2) - (6)].clist)); delete (yyvsp[(5) - (6)].str); @@ -1711,7 +1711,7 @@ yyreduce: case 16: /* Line 1464 of yacc.c */ -#line 258 "../src/parse/parser.ypp" +#line 258 "src/parse/parser.ypp" { assert((yyvsp[(6) - (6)].str)); context_none((yyvsp[(2) - (6)].clist)); @@ -1722,7 +1722,7 @@ yyreduce: case 17: /* Line 1464 of yacc.c */ -#line 264 "../src/parse/parser.ypp" +#line 264 "src/parse/parser.ypp" { default_rule((yyvsp[(2) - (5)].clist), (yyvsp[(5) - (5)].token)); ;} @@ -1731,7 +1731,7 @@ yyreduce: case 18: /* Line 1464 of yacc.c */ -#line 268 "../src/parse/parser.ypp" +#line 268 "src/parse/parser.ypp" { context_check(NULL); Token *token = new Token((yyvsp[(7) - (7)].token), (yyvsp[(7) - (7)].token)->source, (yyvsp[(7) - (7)].token)->line, (yyvsp[(6) - (7)].str)); @@ -1744,7 +1744,7 @@ yyreduce: case 19: /* Line 1464 of yacc.c */ -#line 276 "../src/parse/parser.ypp" +#line 276 "src/parse/parser.ypp" { assert((yyvsp[(7) - (7)].str)); context_check(NULL); @@ -1757,7 +1757,7 @@ yyreduce: case 20: /* Line 1464 of yacc.c */ -#line 284 "../src/parse/parser.ypp" +#line 284 "src/parse/parser.ypp" { context_none(NULL); delete (yyvsp[(5) - (6)].str); @@ -1767,7 +1767,7 @@ yyreduce: case 21: /* Line 1464 of yacc.c */ -#line 289 "../src/parse/parser.ypp" +#line 289 "src/parse/parser.ypp" { assert((yyvsp[(6) - (6)].str)); context_none(NULL); @@ -1778,7 +1778,7 @@ yyreduce: case 22: /* Line 1464 of yacc.c */ -#line 295 "../src/parse/parser.ypp" +#line 295 "src/parse/parser.ypp" { CondList *clist = new CondList(); clist->insert("*"); @@ -1789,7 +1789,7 @@ yyreduce: case 23: /* Line 1464 of yacc.c */ -#line 301 "../src/parse/parser.ypp" +#line 301 "src/parse/parser.ypp" { context_check(NULL); if (specNone) @@ -1806,7 +1806,7 @@ yyreduce: case 24: /* Line 1464 of yacc.c */ -#line 313 "../src/parse/parser.ypp" +#line 313 "src/parse/parser.ypp" { assert((yyvsp[(3) - (3)].str)); context_check(NULL); @@ -1823,7 +1823,7 @@ yyreduce: case 25: /* Line 1464 of yacc.c */ -#line 325 "../src/parse/parser.ypp" +#line 325 "src/parse/parser.ypp" { CondList *clist = new CondList(); clist->insert("*"); @@ -1834,7 +1834,7 @@ yyreduce: case 26: /* Line 1464 of yacc.c */ -#line 331 "../src/parse/parser.ypp" +#line 331 "src/parse/parser.ypp" { setup_rule((yyvsp[(2) - (4)].clist), (yyvsp[(4) - (4)].token)); ;} @@ -1843,7 +1843,7 @@ yyreduce: case 27: /* Line 1464 of yacc.c */ -#line 338 "../src/parse/parser.ypp" +#line 338 "src/parse/parser.ypp" { in->fatal("unnamed condition not supported"); ;} @@ -1852,7 +1852,7 @@ yyreduce: case 28: /* Line 1464 of yacc.c */ -#line 342 "../src/parse/parser.ypp" +#line 342 "src/parse/parser.ypp" { (yyval.clist) = (yyvsp[(1) - (1)].clist); ;} @@ -1861,7 +1861,7 @@ yyreduce: case 29: /* Line 1464 of yacc.c */ -#line 349 "../src/parse/parser.ypp" +#line 349 "src/parse/parser.ypp" { (yyval.clist) = new CondList(); (yyval.clist)->insert(* (yyvsp[(1) - (1)].str)); @@ -1872,7 +1872,7 @@ yyreduce: case 30: /* Line 1464 of yacc.c */ -#line 355 "../src/parse/parser.ypp" +#line 355 "src/parse/parser.ypp" { (yyvsp[(1) - (3)].clist)->insert(* (yyvsp[(3) - (3)].str)); delete (yyvsp[(3) - (3)].str); @@ -1883,7 +1883,7 @@ yyreduce: case 31: /* Line 1464 of yacc.c */ -#line 364 "../src/parse/parser.ypp" +#line 364 "src/parse/parser.ypp" { (yyval.str) = NULL; ;} @@ -1892,7 +1892,7 @@ yyreduce: case 32: /* Line 1464 of yacc.c */ -#line 368 "../src/parse/parser.ypp" +#line 368 "src/parse/parser.ypp" { (yyval.str) = (yyvsp[(3) - (3)].str); ;} @@ -1901,7 +1901,7 @@ yyreduce: case 33: /* Line 1464 of yacc.c */ -#line 375 "../src/parse/parser.ypp" +#line 375 "src/parse/parser.ypp" { (yyval.regexp) = new NullOp; ;} @@ -1910,7 +1910,7 @@ yyreduce: case 34: /* Line 1464 of yacc.c */ -#line 379 "../src/parse/parser.ypp" +#line 379 "src/parse/parser.ypp" { (yyval.regexp) = (yyvsp[(2) - (2)].regexp); ;} @@ -1919,7 +1919,7 @@ yyreduce: case 35: /* Line 1464 of yacc.c */ -#line 386 "../src/parse/parser.ypp" +#line 386 "src/parse/parser.ypp" { (yyval.regexp) = (yyvsp[(1) - (1)].regexp); ;} @@ -1928,7 +1928,7 @@ yyreduce: case 36: /* Line 1464 of yacc.c */ -#line 390 "../src/parse/parser.ypp" +#line 390 "src/parse/parser.ypp" { (yyval.regexp) = mkAlt((yyvsp[(1) - (3)].regexp), (yyvsp[(3) - (3)].regexp)); ;} @@ -1937,7 +1937,7 @@ yyreduce: case 37: /* Line 1464 of yacc.c */ -#line 397 "../src/parse/parser.ypp" +#line 397 "src/parse/parser.ypp" { (yyval.regexp) = (yyvsp[(1) - (1)].regexp); ;} @@ -1946,7 +1946,7 @@ yyreduce: case 38: /* Line 1464 of yacc.c */ -#line 401 "../src/parse/parser.ypp" +#line 401 "src/parse/parser.ypp" { (yyval.regexp) = mkDiff((yyvsp[(1) - (3)].regexp), (yyvsp[(3) - (3)].regexp)); if(!(yyval.regexp)) @@ -1959,7 +1959,7 @@ yyreduce: case 39: /* Line 1464 of yacc.c */ -#line 412 "../src/parse/parser.ypp" +#line 412 "src/parse/parser.ypp" { (yyval.regexp) = (yyvsp[(1) - (1)].regexp); ;} @@ -1968,7 +1968,7 @@ yyreduce: case 40: /* Line 1464 of yacc.c */ -#line 416 "../src/parse/parser.ypp" +#line 416 "src/parse/parser.ypp" { (yyval.regexp) = new CatOp((yyvsp[(1) - (2)].regexp), (yyvsp[(2) - (2)].regexp)); ;} @@ -1977,7 +1977,7 @@ yyreduce: case 41: /* Line 1464 of yacc.c */ -#line 423 "../src/parse/parser.ypp" +#line 423 "src/parse/parser.ypp" { (yyval.regexp) = (yyvsp[(1) - (1)].regexp); ;} @@ -1986,7 +1986,7 @@ yyreduce: case 42: /* Line 1464 of yacc.c */ -#line 427 "../src/parse/parser.ypp" +#line 427 "src/parse/parser.ypp" { switch((yyvsp[(2) - (2)].op)) { @@ -2006,7 +2006,7 @@ yyreduce: case 43: /* Line 1464 of yacc.c */ -#line 442 "../src/parse/parser.ypp" +#line 442 "src/parse/parser.ypp" { (yyval.regexp) = new CloseVOp((yyvsp[(1) - (2)].regexp), (yyvsp[(2) - (2)].extop).minsize, (yyvsp[(2) - (2)].extop).maxsize); ;} @@ -2015,7 +2015,7 @@ yyreduce: case 44: /* Line 1464 of yacc.c */ -#line 449 "../src/parse/parser.ypp" +#line 449 "src/parse/parser.ypp" { (yyval.op) = (yyvsp[(1) - (1)].op); ;} @@ -2024,7 +2024,7 @@ yyreduce: case 45: /* Line 1464 of yacc.c */ -#line 453 "../src/parse/parser.ypp" +#line 453 "src/parse/parser.ypp" { (yyval.op) = (yyvsp[(1) - (1)].op); ;} @@ -2033,7 +2033,7 @@ yyreduce: case 46: /* Line 1464 of yacc.c */ -#line 457 "../src/parse/parser.ypp" +#line 457 "src/parse/parser.ypp" { (yyval.op) = ((yyvsp[(1) - (2)].op) == (yyvsp[(2) - (2)].op)) ? (yyvsp[(1) - (2)].op) : '*'; ;} @@ -2042,7 +2042,7 @@ yyreduce: case 47: /* Line 1464 of yacc.c */ -#line 461 "../src/parse/parser.ypp" +#line 461 "src/parse/parser.ypp" { (yyval.op) = ((yyvsp[(1) - (2)].op) == (yyvsp[(2) - (2)].op)) ? (yyvsp[(1) - (2)].op) : '*'; ;} @@ -2051,7 +2051,7 @@ yyreduce: case 48: /* Line 1464 of yacc.c */ -#line 468 "../src/parse/parser.ypp" +#line 468 "src/parse/parser.ypp" { symbol_table_t::iterator i = symbol_table.find (* (yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str); @@ -2066,7 +2066,7 @@ yyreduce: case 49: /* Line 1464 of yacc.c */ -#line 478 "../src/parse/parser.ypp" +#line 478 "src/parse/parser.ypp" { (yyval.regexp) = (yyvsp[(1) - (1)].regexp); ;} @@ -2075,7 +2075,7 @@ yyreduce: case 50: /* Line 1464 of yacc.c */ -#line 482 "../src/parse/parser.ypp" +#line 482 "src/parse/parser.ypp" { (yyval.regexp) = (yyvsp[(1) - (1)].regexp); ;} @@ -2084,7 +2084,7 @@ yyreduce: case 51: /* Line 1464 of yacc.c */ -#line 486 "../src/parse/parser.ypp" +#line 486 "src/parse/parser.ypp" { (yyval.regexp) = (yyvsp[(2) - (3)].regexp); ;} @@ -2093,7 +2093,7 @@ yyreduce: /* Line 1464 of yacc.c */ -#line 2097 "./parser.cc" +#line 2097 "parser.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2305,7 +2305,7 @@ yyreturn: /* Line 1684 of yacc.c */ -#line 491 "../src/parse/parser.ypp" +#line 491 "src/parse/parser.ypp" extern "C" { diff --git a/re2c/bootstrap/y.tab.h b/re2c/bootstrap/y.tab.h index 4b104395..82aef116 100644 --- a/re2c/bootstrap/y.tab.h +++ b/re2c/bootstrap/y.tab.h @@ -61,7 +61,7 @@ typedef union YYSTYPE { /* Line 1685 of yacc.c */ -#line 148 "../src/parse/parser.ypp" +#line 148 "src/parse/parser.ypp" re2c::RegExp *regexp; re2c::Token *token; @@ -74,7 +74,7 @@ typedef union YYSTYPE /* Line 1685 of yacc.c */ -#line 78 "./y.tab.h" +#line 78 "y.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/re2c/configure.ac b/re2c/configure.ac index 2a5a39bb..caa6a3f4 100644 --- a/re2c/configure.ac +++ b/re2c/configure.ac @@ -1,5 +1,5 @@ AC_INIT([re2c],[0.14.1.dev],[re2c-general@lists.sourceforge.net]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AM_INIT_AUTOMAKE([foreign subdir-objects]) AM_SILENT_RULES([yes]) -- 2.40.0