comparison build-aux/common.mk @ 19980:a941a65c7cb8

handle bison syntax changes in TeX parser * oct-tex-parser.in.yy: Rename from oct-tex-parser.yy. Substitute %API_PREFIX_DECL%. * build-aux/common.mk (subst-bison-api-decls): New macro. * libinterp/parse-tree/module.mk (oct-parse.yy): Use it. * libinterp/corefcn/module.mk (oct-tex-parser.yy): New rule. * libinterp/Makefile.am: Ensure that oct-tex-parser.yy is built early. Search for tests in generated .yy file, not .in.yy file. * oct-tex-lexer.in.ll: Define YYSTPE if needed.
author John W. Eaton <jwe@octave.org>
date Thu, 19 Feb 2015 18:05:07 -0500
parents 9f6ee9cb749c
children 4f6ae6b94abe
comparison
equal deleted inserted replaced
19979:904912f18357 19980:a941a65c7cb8
727 -e "s|%DEFAULT_TERMINAL_FONT%|${DEFAULT_TERMINAL_FONT}|" \ 727 -e "s|%DEFAULT_TERMINAL_FONT%|${DEFAULT_TERMINAL_FONT}|" \
728 -e "s|%DEFAULT_TERMINAL_FONT_SIZE%|${DEFAULT_TERMINAL_FONT_SIZE}|" > $@-t 728 -e "s|%DEFAULT_TERMINAL_FONT_SIZE%|${DEFAULT_TERMINAL_FONT_SIZE}|" > $@-t
729 $(simple_move_if_change_rule) 729 $(simple_move_if_change_rule)
730 endef 730 endef
731 731
732 define subst-bison-api-decls
733 case "$(BISON_API_PREFIX_DECL_STYLE)" in \
734 *api*) \
735 case "$(BISON_API_PREFIX_DECL_STYLE)" in \
736 *brace*) \
737 api_prefix_decl='%define api.prefix {$(1)}'; ;; \
738 *) \
739 api_prefix_decl='%define api.prefix "$(1)"'; ;; \
740 esac; \
741 ;; \
742 *name*) \
743 case "$(BISON_API_PREFIX_DECL_STYLE)" in \
744 *brace*) \
745 api_prefix_decl='%name-prefix {$(1)}'; ;; \
746 *) \
747 api_prefix_decl='%name-prefix="$(1)"'; ;; \
748 esac; \
749 ;; \
750 esac; \
751 case "$(BISON_PUSH_PULL_DECL_STYLE)" in \
752 *quote*) quote='"' ;; \
753 *) quote="" ;; \
754 esac; \
755 case "$(BISON_PUSH_PULL_DECL_STYLE)" in \
756 *dash*) push_pull_decl="%define api.push-pull $${quote}both$${quote}"; ;; \
757 *underscore*) push_pull_decl="%define api.push_pull $${quote}both$${quote}"; ;; \
758 esac; \
759 $(SED) -e "s/%PUSH_PULL_DECL%/$$push_pull_decl/" \
760 -e "s/%API_PREFIX_DECL%/$$api_prefix_decl/" $< > $@-t
761 mv $@-t $@
762 endef
763
732 define test-file-commands 764 define test-file-commands
733 ( echo "## DO NOT EDIT! Generated automatically from $(<F) by Make."; $(GREP) '^%!' $< ) > $@-t 765 ( echo "## DO NOT EDIT! Generated automatically from $(<F) by Make."; $(GREP) '^%!' $< ) > $@-t
734 mv $@-t $@ 766 mv $@-t $@
735 endef 767 endef
736 768