summaryrefslogtreecommitdiffstats
path: root/src/args-bison.y
diff options
context:
space:
mode:
authorjolsa@redhat.com <jolsa@redhat.com>2011-03-12 13:59:21 +0100
committerJiri Olsa <Jiri Olsa jolsa@redhat.com>2011-04-05 17:35:56 +0200
commit252af820ecf406c7dac397bcb54f763883e1eb8f (patch)
tree8302abfb4dffe2aa46d200e5d09590fd2a091dda /src/args-bison.y
parent79381b3ed5b490054cb211d0374f4338ef9d5931 (diff)
downloadlatrace-252af820ecf406c7dac397bcb54f763883e1eb8f.tar.gz
latrace-252af820ecf406c7dac397bcb54f763883e1eb8f.tar.xz
latrace-252af820ecf406c7dac397bcb54f763883e1eb8f.zip
adding support for configuration file
- separating bison/flex functions for args and config - the "include file support" unified among new conf and C header parsing - support for following options: HEADERS INDENT_SYM PIPE TIMESTAMP FRAMESIZE FRAMESIZE_CHECK HIDE_TID FOLLOW_FORK FOLLOW_EXEC DEMANGLE BRACES ENABLE_ARGS DETAIL_ARGS
Diffstat (limited to 'src/args-bison.y')
-rw-r--r--src/args-bison.y16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/args-bison.y b/src/args-bison.y
index 1776a1e..fc6787c 100644
--- a/src/args-bison.y
+++ b/src/args-bison.y
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>.
*/
+%name-prefix "lt_args_"
%{
@@ -27,18 +28,20 @@
#include <string.h>
#include "config.h"
+#include "lib-include.h"
-int yylex (void);
-void yyerror(const char *m);
+int lt_args_lex(void);
+void lt_args_error(const char *m);
static struct lt_config_shared *scfg;
static int struct_alive = 0;
+struct lt_include *lt_args_sinc;
#define ERROR(fmt, args...) \
do { \
char ebuf[1024]; \
sprintf(ebuf, fmt, ## args); \
- yyerror(ebuf); \
+ lt_args_error(ebuf); \
YYERROR; \
} while(0)
@@ -100,7 +103,7 @@ entry include_def
|
entry END
{
- if (lt_args_buf_close(scfg))
+ if (lt_inc_close(scfg, lt_args_sinc))
return 0;
}
|
@@ -289,14 +292,15 @@ ENUM_REF:
/* include definitions */
include_def: INCLUDE '"' FILENAME '"'
{
- if (lt_args_buf_open(scfg, $3))
+ if (lt_inc_open(scfg, lt_args_sinc, $3))
ERROR("failed to process include");
}
%%
-int lt_args_parse_init(struct lt_config_shared *cfg)
+int lt_args_parse_init(struct lt_config_shared *cfg, struct lt_include *inc)
{
scfg = cfg;
+ lt_args_sinc = inc;
return 0;
}