From: Matthew Fernandez Date: Wed, 9 Sep 2020 03:21:26 +0000 (-0700) Subject: remove now-unnecessary ad hoc replacement of HTML parser prefix X-Git-Tag: 2.46.0~20^2^2~80^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e78a26f6820b8bf85038f269583ee879022fa3e;p=graphviz remove now-unnecessary ad hoc replacement of HTML parser prefix Related to #1806. --- diff --git a/lib/common/CMakeLists.txt b/lib/common/CMakeLists.txt index 7e04133e6..b96b3e99d 100644 --- a/lib/common/CMakeLists.txt +++ b/lib/common/CMakeLists.txt @@ -1,18 +1,5 @@ BISON_TARGET(HTMLparse htmlparse.y ${CMAKE_CURRENT_BINARY_DIR}/htmlparse.c) -# Modify files generated by Bison, to match the Autotools build. -# - Replace "yy" with "aag" -configure_file( - "${TOP_SOURCE_DIR}/cmake/modify_common_htmlparse.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/modify_common_htmlparse.cmake" - @ONLY -) -add_custom_command( - OUTPUT ${BISON_HTMLparse_OUTPUTS} - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/modify_common_htmlparse.cmake - APPEND -) - add_definitions(-DGVC_EXPORTS -D_BLD_gvc=1) # Generate colortbl.h from sources diff --git a/lib/common/Makefile.am b/lib/common/Makefile.am index 217b34023..7b0cf6f21 100644 --- a/lib/common/Makefile.am +++ b/lib/common/Makefile.am @@ -60,10 +60,10 @@ htmllex.o htmllex.lo: htmllex.c htmllex.h htmlparse.h htmlparse.o htmlparse.lo: htmlparse.c htmlparse.h htmlparse.c: y.tab.c - @SED@ "s/yy/html/g" < y.tab.c > htmlparse.c + cp -f y.tab.c htmlparse.c htmlparse.h: y.tab.h - @SED@ "s/yy/html/g" < y.tab.h > htmlparse.h + cp -f y.tab.h htmlparse.h y.tab.c y.tab.h: y.output diff --git a/lib/common/htmlparse.y b/lib/common/htmlparse.y index 715aa91f6..e8b3fee49 100644 --- a/lib/common/htmlparse.y +++ b/lib/common/htmlparse.y @@ -25,7 +25,7 @@ #include #include -extern int yyparse(void); +extern int htmlparse(void); typedef struct sfont_t { textfont_t *cfont; @@ -534,7 +534,7 @@ string : T_string table : opt_space T_table { if (nonSpace(agxbuse(HTMLstate.str))) { - yyerror ("Syntax error: non-space string used before "); + htmlerror ("Syntax error: non-space string used before
"); cleanup(); YYABORT; } $2->u.p.prev = HTMLstate.tblstack; @@ -545,7 +545,7 @@ table : opt_space T_table { } rows T_end_table opt_space { if (nonSpace(agxbuse(HTMLstate.str))) { - yyerror ("Syntax error: non-space string used after
"); + htmlerror ("Syntax error: non-space string used after "); cleanup(); YYABORT; } $$ = HTMLstate.tblstack; @@ -628,7 +628,7 @@ parseHTML (char* txt, int* warn, htmlenv_t *env) l = NULL; } else { - yyparse(); + htmlparse(); *warn = clearHTMLlexer (); l = HTMLstate.lbl; } diff --git a/lib/gvc.vcxproj b/lib/gvc.vcxproj index d604f4a79..ce99c8f07 100644 --- a/lib/gvc.vcxproj +++ b/lib/gvc.vcxproj @@ -73,8 +73,8 @@ win_bison -dy -Wno-yacc common\htmlparse.y -o common\htmlparse-intermediate.c -sed "s/yy/html/g" < common\htmlparse-intermediate.c > common\htmlparse.c -sed "s/yy/html/g" < common\htmlparse-intermediate.h > common\htmlparse.h +copy common\htmlparse-intermediate.c common\htmlparse.c +copy common\htmlparse-intermediate.h common\htmlparse.h del common\htmlparse-intermediate.c del common\htmlparse-intermediate.h awk -f $(SolutionDir)awk\svgcolor.awk common\svgcolor_names > common\svgcolor_lib @@ -108,8 +108,8 @@ awk -f $(SolutionDir)awk\colortbl.awk color_lib > common\colortbl.h win_bison -dy -Wno-yacc common\htmlparse.y -o common\htmlparse-intermediate.c -sed "s/yy/html/g" < common\htmlparse-intermediate.c > common\htmlparse.c -sed "s/yy/html/g" < common\htmlparse-intermediate.h > common\htmlparse.h +copy common\htmlparse-intermediate.c common\htmlparse.c +copy common\htmlparse-intermediate.h common\htmlparse.h del common\htmlparse-intermediate.c del common\htmlparse-intermediate.h awk -f $(SolutionDir)awk\svgcolor.awk common\svgcolor_names > common\svgcolor_lib