aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-02-03 17:59:49 +0100
committerThomas White <taw@physics.org>2019-05-16 15:15:49 +0200
commit57deff472f027c29d9a59bb059248c76f84c8a34 (patch)
tree0e9198d38f6f4f73a41905290d4ce5bf4bd856d7
parentfdf62472755ff9e2aa0f234e3317d8ff2e709938 (diff)
quote_fmt stuff
-rw-r--r--meson.build28
-rw-r--r--src/quote_fmt_lex.h47
-rw-r--r--src/quote_fmt_lex.l5
-rw-r--r--src/quote_fmt_parse.y1
4 files changed, 22 insertions, 59 deletions
diff --git a/meson.build b/meson.build
index 9103ada4..ce821a67 100644
--- a/meson.build
+++ b/meson.build
@@ -134,13 +134,24 @@ libsylph_dep = declare_dependency(include_directories : libsylph_includes,
# Instructions for building sylpheed executable
flex = find_program('flex')
-
-lgen = generator(flex, output : ['@BASENAME@.c', '@BASENAME@.h'],
- arguments : ['-o', '@OUTPUT0@',
- '--header-file=@OUTPUT1@',
- '@INPUT@'])
-
-quote_fmt_lex_c = lgen.process('src/quote_fmt_lex.l')
+bison = find_program('bison')
+
+quote_fmt_parse_c = custom_target('quote_fmt_parse.tab.c',
+ output : ['quote_fmt_parse.tab.c', 'quote_fmt_parse.tab.h'],
+ input : 'src/quote_fmt_parse.y',
+ command : [bison, '--defines=@OUTPUT1@',
+ '-p', 'quote_fmt',
+ '--output=@OUTPUT0@',
+ '@INPUT@'])
+
+quote_fmt_c = custom_target('quote_fmt.c',
+ output : ['quote_fmt.c', 'quote_fmt.h'],
+ input : 'src/quote_fmt_lex.l',
+ depends : quote_fmt_parse_c,
+ command : [flex, '--outfile=@OUTPUT0@',
+ '--header-file=@OUTPUT1@',
+ '-P', 'quote_fmt',
+ '@INPUT@'])
executable('sylpheed',
['src/about.c',
@@ -210,7 +221,8 @@ executable('sylpheed',
'src/prefs_ui.c',
'src/printing.c',
'src/progressdialog.c',
- quote_fmt_lex_c,
+ quote_fmt_parse_c,
+ quote_fmt_c,
'src/query_search.c',
'src/quick_search.c',
'src/rfc2015.c',
diff --git a/src/quote_fmt_lex.h b/src/quote_fmt_lex.h
deleted file mode 100644
index 585751a1..00000000
--- a/src/quote_fmt_lex.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* The following defines shamelessly stolen from GDB sources... */
-
-/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
- as well as gratuitiously global symbol names, so we can have multiple
- yacc generated parsers in gdb. Note that these are only the variables
- produced by yacc. If other parser generators (bison, byacc, etc) produce
- additional global names that conflict at link time, then those parser
- generators need to be fixed instead of adding those names to this list. */
-
-#define yymaxdepth quote_fmtmaxdepth
-#define yyparse quote_fmtparse
-#define yylex quote_fmtlex
-#define yyerror quote_fmterror
-#define yylval quote_fmtlval
-#define yychar quote_fmtchar
-#define yydebug quote_fmtdebug
-#define yypact quote_fmtpact
-#define yyr1 quote_fmtr1
-#define yyr2 quote_fmtr2
-#define yydef quote_fmtdef
-#define yychk quote_fmtchk
-#define yypgo quote_fmtpgo
-#define yyact quote_fmtact
-#define yyexca quote_fmtexca
-#define yyerrflag quote_fmterrflag
-#define yynerrs quote_fmtnerrs
-#define yyps quote_fmtps
-#define yypv quote_fmtpv
-#define yys quote_fmts
-#define yy_yys quote_fmtyys
-#define yystate quote_fmtstate
-#define yytmp quote_fmttmp
-#define yyv quote_fmtv
-#define yy_yyv quote_fmtyyv
-#define yyval quote_fmtval
-#define yylloc quote_fmtlloc
-#define yyreds quote_fmtreds /* With YYDEBUG defined */
-#define yytoks quote_fmttoks /* With YYDEBUG defined */
-#define yylhs quote_fmtyylhs
-#define yylen quote_fmtyylen
-#define yydefred quote_fmtyydefred
-#define yydgoto quote_fmtyydgoto
-#define yysindex quote_fmtyysindex
-#define yyrindex quote_fmtyyrindex
-#define yygindex quote_fmtyygindex
-#define yytable quote_fmtyytable
-#define yycheck quote_fmtyycheck
diff --git a/src/quote_fmt_lex.l b/src/quote_fmt_lex.l
index 578ea149..c330345e 100644
--- a/src/quote_fmt_lex.l
+++ b/src/quote_fmt_lex.l
@@ -1,6 +1,5 @@
%{
-#include "quote_fmt_lex.h"
-#include "quote_fmt_parse.h"
+#include "quote_fmt_parse.tab.h"
%}
%option prefix="quote_fmt"
@@ -40,6 +39,6 @@
"?r" /* query references */ return QUERY_REFERENCES;
"{" return OPARENT;
"}" return CPARENT;
-. { yylval.chr = yytext[0]; return CHARACTER; }
+. { quote_fmtlval.chr = yytext[0]; return CHARACTER; }
%%
diff --git a/src/quote_fmt_parse.y b/src/quote_fmt_parse.y
index 336b481a..98337179 100644
--- a/src/quote_fmt_parse.y
+++ b/src/quote_fmt_parse.y
@@ -10,7 +10,6 @@
#include "utils.h"
#include "quote_fmt.h"
-#include "quote_fmt_lex.h"
/* decl */
/*