summaryrefslogtreecommitdiff
path: root/grammar
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2012-11-21 17:23:23 +0100
committerMichael Biebl <biebl@debian.org>2012-11-21 17:23:23 +0100
commit1796f8e02b6d0bc29ab65427d2ebf97f82f41999 (patch)
treeb095bd5faf13d6a48cc5ddc18891338931c5a273 /grammar
parent792f31fe29bef0c9960d3951f266fc7b2c70a2fc (diff)
downloadrsyslog-1796f8e02b6d0bc29ab65427d2ebf97f82f41999.tar.gz
Imported Upstream version 7.2.3upstream/7.2.3
Diffstat (limited to 'grammar')
-rw-r--r--grammar/Makefile.in97
-rw-r--r--grammar/grammar.c593
-rw-r--r--grammar/grammar.h14
-rw-r--r--grammar/lexer.c207
-rw-r--r--grammar/lexer.l1
-rw-r--r--grammar/rainerscript.c18
6 files changed, 444 insertions, 486 deletions
diff --git a/grammar/Makefile.in b/grammar/Makefile.in
index 0021ba9..05d0fb8 100644
--- a/grammar/Makefile.in
+++ b/grammar/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -54,8 +54,8 @@ libgrammar_la_LIBADD =
am_libgrammar_la_OBJECTS = libgrammar_la-grammar.lo \
libgrammar_la-lexer.lo libgrammar_la-rainerscript.lo
libgrammar_la_OBJECTS = $(am_libgrammar_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
am__v_lt_0 = --silent
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -67,34 +67,34 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
am__v_at_0 = @
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
am__v_CCLD_0 = @echo " CCLD " $@;
-LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS)
+LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS)
-AM_V_LEX = $(am__v_LEX_@AM_V@)
-am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@)
+ $(LIBTOOLFLAGS) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
+AM_V_LEX = $(am__v_LEX_$(V))
+am__v_LEX_ = $(am__v_LEX_$(AM_DEFAULT_VERBOSITY))
am__v_LEX_0 = @echo " LEX " $@;
YLWRAP = $(top_srcdir)/ylwrap
-YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS)
+YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS)
-AM_V_YACC = $(am__v_YACC_@AM_V@)
-am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@)
+ $(LIBTOOLFLAGS) --mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS)
+AM_V_YACC = $(am__v_YACC_$(V))
+am__v_YACC_ = $(am__v_YACC_$(AM_DEFAULT_VERBOSITY))
am__v_YACC_0 = @echo " YACC " $@;
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo " GEN " $@;
SOURCES = $(libgrammar_la_SOURCES)
DIST_SOURCES = $(libgrammar_la_SOURCES)
@@ -121,7 +121,6 @@ CZMQ_CFLAGS = @CZMQ_CFLAGS@
CZMQ_LIBS = @CZMQ_LIBS@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
DL_LIBS = @DL_LIBS@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
@@ -174,7 +173,6 @@ LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MYSQL_CFLAGS = @MYSQL_CFLAGS@
MYSQL_LIBS = @MYSQL_LIBS@
@@ -226,7 +224,6 @@ abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
@@ -260,6 +257,7 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
moddirs = @moddirs@
@@ -336,9 +334,11 @@ clean-noinstLTLIBRARIES:
rm -f "$${dir}/so_locations"; \
done
grammar.h: grammar.c
- @if test ! -f $@; then rm -f grammar.c; else :; fi
- @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) grammar.c; else :; fi
-libgrammar.la: $(libgrammar_la_OBJECTS) $(libgrammar_la_DEPENDENCIES) $(EXTRA_libgrammar_la_DEPENDENCIES)
+ @if test ! -f $@; then \
+ rm -f grammar.c; \
+ $(MAKE) $(AM_MAKEFLAGS) grammar.c; \
+ else :; fi
+libgrammar.la: $(libgrammar_la_OBJECTS) $(libgrammar_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) $(libgrammar_la_OBJECTS) $(libgrammar_la_LIBADD) $(LIBS)
mostlyclean-compile:
@@ -354,44 +354,50 @@ distclean-compile:
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
libgrammar_la-grammar.lo: grammar.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgrammar_la-grammar.lo -MD -MP -MF $(DEPDIR)/libgrammar_la-grammar.Tpo -c -o libgrammar_la-grammar.lo `test -f 'grammar.c' || echo '$(srcdir)/'`grammar.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgrammar_la-grammar.Tpo $(DEPDIR)/libgrammar_la-grammar.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='grammar.c' object='libgrammar_la-grammar.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='grammar.c' object='libgrammar_la-grammar.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgrammar_la-grammar.lo `test -f 'grammar.c' || echo '$(srcdir)/'`grammar.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgrammar_la-grammar.lo `test -f 'grammar.c' || echo '$(srcdir)/'`grammar.c
libgrammar_la-lexer.lo: lexer.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgrammar_la-lexer.lo -MD -MP -MF $(DEPDIR)/libgrammar_la-lexer.Tpo -c -o libgrammar_la-lexer.lo `test -f 'lexer.c' || echo '$(srcdir)/'`lexer.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgrammar_la-lexer.Tpo $(DEPDIR)/libgrammar_la-lexer.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lexer.c' object='libgrammar_la-lexer.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lexer.c' object='libgrammar_la-lexer.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgrammar_la-lexer.lo `test -f 'lexer.c' || echo '$(srcdir)/'`lexer.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgrammar_la-lexer.lo `test -f 'lexer.c' || echo '$(srcdir)/'`lexer.c
libgrammar_la-rainerscript.lo: rainerscript.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgrammar_la-rainerscript.lo -MD -MP -MF $(DEPDIR)/libgrammar_la-rainerscript.Tpo -c -o libgrammar_la-rainerscript.lo `test -f 'rainerscript.c' || echo '$(srcdir)/'`rainerscript.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgrammar_la-rainerscript.Tpo $(DEPDIR)/libgrammar_la-rainerscript.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rainerscript.c' object='libgrammar_la-rainerscript.lo' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rainerscript.c' object='libgrammar_la-rainerscript.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgrammar_la-rainerscript.lo `test -f 'rainerscript.c' || echo '$(srcdir)/'`rainerscript.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgrammar_la-rainerscript.lo `test -f 'rainerscript.c' || echo '$(srcdir)/'`rainerscript.c
.l.c:
$(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)
@@ -503,15 +509,10 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
diff --git a/grammar/grammar.c b/grammar/grammar.c
index ccac140..c9a7cc6 100644
--- a/grammar/grammar.c
+++ b/grammar/grammar.c
@@ -1,8 +1,10 @@
-/* A Bison parser, made by GNU Bison 2.5. */
-/* Bison implementation for Yacc-like parsers in C
+/* A Bison parser, made by GNU Bison 2.4.1. */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,7 +46,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.5"
+#define YYBISON_VERSION "2.4.1"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -65,7 +67,7 @@
/* Copy the first part of user declarations. */
-/* Line 268 of yacc.c */
+/* Line 189 of yacc.c */
#line 31 "grammar.y"
#include <stdio.h>
@@ -80,8 +82,8 @@ extern int yylex(void);
extern int yyerror(char*);
-/* Line 268 of yacc.c */
-#line 85 "grammar.c"
+/* Line 189 of yacc.c */
+#line 87 "grammar.c"
/* Enabling traces. */
#ifndef YYDEBUG
@@ -199,7 +201,7 @@ extern int yyerror(char*);
typedef union YYSTYPE
{
-/* Line 293 of yacc.c */
+/* Line 214 of yacc.c */
#line 44 "grammar.y"
char *s;
@@ -217,8 +219,8 @@ typedef union YYSTYPE
-/* Line 293 of yacc.c */
-#line 222 "grammar.c"
+/* Line 214 of yacc.c */
+#line 224 "grammar.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -229,8 +231,8 @@ typedef union YYSTYPE
/* Copy the second part of user declarations. */
-/* Line 343 of yacc.c */
-#line 234 "grammar.c"
+/* Line 264 of yacc.c */
+#line 236 "grammar.c"
#ifdef short
# undef short
@@ -280,7 +282,7 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if defined YYENABLE_NLS && YYENABLE_NLS
+# if YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -333,11 +335,11 @@ YYID (yyi)
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
# endif
# endif
# endif
@@ -360,24 +362,24 @@ YYID (yyi)
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
-# if (defined __cplusplus && ! defined EXIT_SUCCESS \
+# if (defined __cplusplus && ! defined _STDLIB_H \
&& ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
@@ -406,7 +408,23 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
-# define YYCOPY_NEEDED 1
+/* Copy COUNT objects from FROM to TO. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined __GNUC__ && 1 < __GNUC__
+# define YYCOPY(To, From, Count) \
+ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+# else
+# define YYCOPY(To, From, Count) \
+ do \
+ { \
+ YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (To)[yyi] = (From)[yyi]; \
+ } \
+ while (YYID (0))
+# endif
+# endif
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
@@ -426,26 +444,6 @@ union yyalloc
#endif
-#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined __GNUC__ && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (YYID (0))
-# endif
-# endif
-#endif /* !YYCOPY_NEEDED */
-
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */
@@ -621,8 +619,8 @@ static const yytype_uint8 yyr2[] =
1, 3
};
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
- Performed when YYTABLE doesn't specify something else to do. Zero
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
@@ -679,7 +677,8 @@ static const yytype_int8 yypgoto[] =
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
- number is the opposite. If YYTABLE_NINF, syntax error. */
+ number is the opposite. If zero, do what YYDEFACT says.
+ If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -1
static const yytype_uint8 yytable[] =
{
@@ -716,12 +715,6 @@ static const yytype_uint8 yytable[] =
74, 75, 76, 77, 78, 79
};
-#define yypact_value_is_default(yystate) \
- ((yystate) == (-34))
-
-#define yytable_value_is_error(yytable_value) \
- YYID (0)
-
static const yytype_int8 yycheck[] =
{
4, 5, 6, 15, 4, 1, 7, 30, 3, 8,
@@ -789,18 +782,9 @@ static const yytype_uint8 yystos[] =
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. However,
- YYFAIL appears to be in use. Nevertheless, it is formally deprecated
- in Bison 2.4.2's NEWS entry, where a plan to phase it out is
- discussed. */
+ Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
-#if defined YYFAIL
- /* This is here to suppress warnings from the GCC cpp's
- -Wunused-macros. Normally we don't worry about that warning, but
- some users do, and we want to make it easy for users to remove
- YYFAIL uses, which will produce warnings from Bison 2.5. */
-#endif
#define YYRECOVERING() (!!yyerrstatus)
@@ -810,6 +794,7 @@ do \
{ \
yychar = (Token); \
yylval = (Value); \
+ yytoken = YYTRANSLATE (yychar); \
YYPOPSTACK (1); \
goto yybackup; \
} \
@@ -851,10 +836,19 @@ while (YYID (0))
#endif
-/* This macro is provided for backward compatibility. */
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+ This macro was not mandated originally: define only if we know
+ we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# if YYLTYPE_IS_TRIVIAL
+# define YY_LOCATION_PRINT(File, Loc) \
+ fprintf (File, "%d.%d-%d.%d", \
+ (Loc).first_line, (Loc).first_column, \
+ (Loc).last_line, (Loc).last_column)
+# else
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
#endif
@@ -1046,6 +1040,7 @@ int yydebug;
# define YYMAXDEPTH 10000
#endif
+
#if YYERROR_VERBOSE
@@ -1148,142 +1143,115 @@ yytnamerr (char *yyres, const char *yystr)
}
# endif
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
- about the unexpected token YYTOKEN for the state stack whose top is
- YYSSP.
-
- Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
- not large enough to hold the message. In that case, also set
- *YYMSG_ALLOC to the required number of bytes. Return 2 if the
- required number of bytes is too large to store. */
-static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
- yytype_int16 *yyssp, int yytoken)
+/* Copy into YYRESULT an error message about the unexpected token
+ YYCHAR while in state YYSTATE. Return the number of bytes copied,
+ including the terminating null byte. If YYRESULT is null, do not
+ copy anything; just return the number of bytes that would be
+ copied. As a special case, return 0 if an ordinary "syntax error"
+ message will do. Return YYSIZE_MAXIMUM if overflow occurs during
+ size calculation. */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
{
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- /* Internationalized format string. */
- const char *yyformat = 0;
- /* Arguments of yyformat. */
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- /* Number of reported tokens (one for the "unexpected", one per
- "expected"). */
- int yycount = 0;
-
- /* There are many possibilities here to consider:
- - Assume YYFAIL is not used. It's too flawed to consider. See
- <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
- for details. YYERROR is fine as it does not invoke this
- function.
- - If this state is a consistent state with a default action, then
- the only way this function was invoked is if the default action
- is an error action. In that case, don't check for expected
- tokens because there are none.
- - The only way there can be no lookahead present (in yychar) is if
- this state is a consistent state with a default action. Thus,
- detecting the absence of a lookahead is sufficient to determine
- that there is no unexpected or expected token to report. In that
- case, just report a simple "syntax error".
- - Don't assume there isn't a lookahead just because this state is a
- consistent state with a default action. There might have been a
- previous inconsistent state, consistent state with a non-default
- action, or user semantic action that manipulated yychar.
- - Of course, the expected token list depends on states to have
- correct lookahead information, and it depends on the parser not
- to perform extra reductions after fetching a lookahead from the
- scanner and before detecting a syntax error. Thus, state merging
- (from LALR or IELR) and default reductions corrupt the expected
- token list. However, the list is correct for canonical LR with
- one exception: it will still contain any token that will not be
- accepted due to an error action in a later state.
- */
- if (yytoken != YYEMPTY)
- {
- int yyn = yypact[*yyssp];
- yyarg[yycount++] = yytname[yytoken];
- if (!yypact_value_is_default (yyn))
- {
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. In other words, skip the first -YYN actions for
- this state because they are default actions. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yyx;
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
- && !yytable_value_is_error (yytable[yyx + yyn]))
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
- }
- }
- }
+ int yyn = yypact[yystate];
- switch (yycount)
+ if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+ return 0;
+ else
{
-# define YYCASE_(N, S) \
- case N: \
- yyformat = S; \
- break
- YYCASE_(0, YY_("syntax error"));
- YYCASE_(1, YY_("syntax error, unexpected %s"));
- YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
- YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
- YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
- YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-# undef YYCASE_
- }
+ int yytype = YYTRANSLATE (yychar);
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+ YYSIZE_T yysize = yysize0;
+ YYSIZE_T yysize1;
+ int yysize_overflow = 0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ int yyx;
+
+# if 0
+ /* This is so xgettext sees the translatable formats that are
+ constructed on the fly. */
+ YY_("syntax error, unexpected %s");
+ YY_("syntax error, unexpected %s, expecting %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+ char *yyfmt;
+ char const *yyf;
+ static char const yyunexpected[] = "syntax error, unexpected %s";
+ static char const yyexpecting[] = ", expecting %s";
+ static char const yyor[] = " or %s";
+ char yyformat[sizeof yyunexpected
+ + sizeof yyexpecting - 1
+ + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+ * (sizeof yyor - 1))];
+ char const *yyprefix = yyexpecting;
+
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yycount = 1;
+
+ yyarg[0] = yytname[yytype];
+ yyfmt = yystpcpy (yyformat, yyunexpected);
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ yyformat[sizeof yyunexpected - 1] = '\0';
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
+ yyfmt = yystpcpy (yyfmt, yyprefix);
+ yyprefix = yyor;
+ }
- yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
+ yyf = YY_(yyformat);
+ yysize1 = yysize + yystrlen (yyf);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
- if (*yymsg_alloc < yysize)
- {
- *yymsg_alloc = 2 * yysize;
- if (! (yysize <= *yymsg_alloc
- && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
- *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
- return 1;
- }
+ if (yysize_overflow)
+ return YYSIZE_MAXIMUM;
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- {
- char *yyp = *yymsg;
- int yyi = 0;
- while ((*yyp = *yyformat) != '\0')
- if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyformat += 2;
- }
- else
- {
- yyp++;
- yyformat++;
- }
- }
- return 0;
+ if (yyresult)
+ {
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ char *yyp = yyresult;
+ int yyi = 0;
+ while ((*yyp = *yyf) != '\0')
+ {
+ if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyf += 2;
+ }
+ else
+ {
+ yyp++;
+ yyf++;
+ }
+ }
+ }
+ return yysize;
+ }
}
#endif /* YYERROR_VERBOSE */
+
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
@@ -1316,7 +1284,6 @@ yydestruct (yymsg, yytype, yyvaluep)
}
}
-
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
@@ -1343,9 +1310,10 @@ YYSTYPE yylval;
int yynerrs;
-/*----------.
-| yyparse. |
-`----------*/
+
+/*-------------------------.
+| yyparse or yypush_parse. |
+`-------------------------*/
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1369,6 +1337,8 @@ yyparse ()
#endif
#endif
{
+
+
int yystate;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
@@ -1523,7 +1493,7 @@ yybackup:
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
- if (yypact_value_is_default (yyn))
+ if (yyn == YYPACT_NINF)
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
@@ -1554,8 +1524,8 @@ yybackup:
yyn = yytable[yyn];
if (yyn <= 0)
{
- if (yytable_value_is_error (yyn))
- goto yyerrlab;
+ if (yyn == 0 || yyn == YYTABLE_NINF)
+ goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
@@ -1610,56 +1580,56 @@ yyreduce:
{
case 3:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 123 "grammar.y"
{ cnfDoObj((yyvsp[(2) - (2)].obj)); }
break;
case 4:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 124 "grammar.y"
{ cnfDoScript((yyvsp[(2) - (2)].stmt)); }
break;
case 5:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 125 "grammar.y"
{ cnfDoCfsysline((yyvsp[(2) - (2)].s)); }
break;
case 6:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 126 "grammar.y"
{ cnfDoBSDTag((yyvsp[(2) - (2)].s)); }
break;
case 7:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 127 "grammar.y"
{ cnfDoBSDHost((yyvsp[(2) - (2)].s)); }
break;
case 8:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 128 "grammar.y"
{ (yyval.obj) = cnfobjNew((yyvsp[(1) - (3)].objType), (yyvsp[(2) - (3)].nvlst)); }
break;
case 9:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 129 "grammar.y"
{ (yyval.obj) = cnfobjNew(CNFOBJ_TPL, (yyvsp[(2) - (3)].nvlst)); }
break;
case 10:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 131 "grammar.y"
{ (yyval.obj) = cnfobjNew(CNFOBJ_TPL, (yyvsp[(2) - (6)].nvlst));
(yyval.obj)->subobjs = (yyvsp[(5) - (6)].objlst);
@@ -1668,7 +1638,7 @@ yyreduce:
case 11:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 135 "grammar.y"
{ (yyval.obj) = cnfobjNew(CNFOBJ_RULESET, (yyvsp[(2) - (6)].nvlst));
(yyval.obj)->script = (yyvsp[(5) - (6)].stmt);
@@ -1677,105 +1647,105 @@ yyreduce:
case 12:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 138 "grammar.y"
{ (yyval.objlst) = NULL; }
break;
case 13:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 139 "grammar.y"
{ (yyval.objlst) = objlstAdd((yyvsp[(1) - (2)].objlst), (yyvsp[(2) - (2)].obj)); }
break;
case 14:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 140 "grammar.y"
{ (yyval.objlst) = objlstAdd((yyvsp[(1) - (2)].objlst), (yyvsp[(2) - (2)].obj)); }
break;
case 15:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 141 "grammar.y"
{ (yyval.obj) = cnfobjNew(CNFOBJ_PROPERTY, (yyvsp[(2) - (3)].nvlst)); }
break;
case 16:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 142 "grammar.y"
{ (yyval.obj) = cnfobjNew(CNFOBJ_CONSTANT, (yyvsp[(2) - (3)].nvlst)); }
break;
case 17:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 143 "grammar.y"
{ (yyval.nvlst) = NULL; }
break;
case 18:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 144 "grammar.y"
{ (yyvsp[(2) - (2)].nvlst)->next = (yyvsp[(1) - (2)].nvlst); (yyval.nvlst) = (yyvsp[(2) - (2)].nvlst); }
break;
case 19:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 145 "grammar.y"
{ (yyval.nvlst) = nvlstSetName((yyvsp[(3) - (3)].nvlst), (yyvsp[(1) - (3)].estr)); }
break;
case 20:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 146 "grammar.y"
{ (yyval.nvlst) = nvlstNewStr((yyvsp[(1) - (1)].estr)); }
break;
case 21:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 147 "grammar.y"
{ (yyval.nvlst) = nvlstNewArray((yyvsp[(1) - (1)].arr)); }
break;
case 22:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 148 "grammar.y"
{ (yyval.stmt) = (yyvsp[(1) - (1)].stmt); }
break;
case 23:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 149 "grammar.y"
{ (yyval.stmt) = scriptAddStmt((yyvsp[(1) - (2)].stmt), (yyvsp[(2) - (2)].stmt)); }
break;
case 24:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 150 "grammar.y"
{ (yyval.stmt) = (yyvsp[(1) - (1)].stmt); }
break;
case 25:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 151 "grammar.y"
{ (yyval.stmt) = cnfstmtNew(S_STOP); }
break;
case 26:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 152 "grammar.y"
{ (yyval.stmt) = cnfstmtNew(S_IF);
(yyval.stmt)->d.s_if.expr = (yyvsp[(2) - (4)].expr);
@@ -1785,7 +1755,7 @@ yyreduce:
case 27:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 156 "grammar.y"
{ (yyval.stmt) = cnfstmtNew(S_IF);
(yyval.stmt)->d.s_if.expr = (yyvsp[(2) - (6)].expr);
@@ -1795,329 +1765,318 @@ yyreduce:
case 28:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 160 "grammar.y"
{ (yyval.stmt) = cnfstmtNewSet((yyvsp[(2) - (5)].s), (yyvsp[(4) - (5)].expr)); }
break;
case 29:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 161 "grammar.y"
{ (yyval.stmt) = cnfstmtNewUnset((yyvsp[(2) - (3)].s)); }
break;
case 30:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 162 "grammar.y"
{ (yyval.stmt) = cnfstmtNewPRIFILT((yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].stmt)); }
break;
case 31:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 163 "grammar.y"
{ (yyval.stmt) = cnfstmtNewPROPFILT((yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].stmt)); }
break;
case 32:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 164 "grammar.y"
{ (yyval.stmt) = cnfstmtNewCall((yyvsp[(2) - (2)].estr)); }
break;
case 33:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 165 "grammar.y"
{ (yyval.stmt) = cnfstmtNewContinue(); }
break;
case 34:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 166 "grammar.y"
{ (yyval.stmt) = (yyvsp[(1) - (1)].stmt); }
break;
case 35:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 167 "grammar.y"
{ (yyval.stmt) = (yyvsp[(2) - (3)].stmt); }
break;
case 36:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 168 "grammar.y"
{ (yyval.stmt) = (yyvsp[(1) - (1)].stmt); }
break;
case 37:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 169 "grammar.y"
{ (yyval.stmt) = scriptAddStmt((yyvsp[(1) - (3)].stmt), (yyvsp[(3) - (3)].stmt)); }
break;
case 38:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 170 "grammar.y"
{ (yyval.stmt) = cnfstmtNewAct((yyvsp[(2) - (3)].nvlst)); }
break;
case 39:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 171 "grammar.y"
{ (yyval.stmt) = cnfstmtNewLegaAct((yyvsp[(1) - (1)].s)); }
break;
case 40:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 172 "grammar.y"
{ (yyval.expr) = cnfexprNew(AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 41:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 173 "grammar.y"
{ (yyval.expr) = cnfexprNew(OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 42:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 174 "grammar.y"
{ (yyval.expr) = cnfexprNew(NOT, NULL, (yyvsp[(2) - (2)].expr)); }
break;
case 43:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 175 "grammar.y"
{ (yyval.expr) = cnfexprNew(CMP_EQ, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 44:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 176 "grammar.y"
{ (yyval.expr) = cnfexprNew(CMP_NE, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 45:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 177 "grammar.y"
{ (yyval.expr) = cnfexprNew(CMP_LE, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 46:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 178 "grammar.y"
{ (yyval.expr) = cnfexprNew(CMP_GE, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 47:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 179 "grammar.y"
{ (yyval.expr) = cnfexprNew(CMP_LT, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 48:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 180 "grammar.y"
{ (yyval.expr) = cnfexprNew(CMP_GT, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 49:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 181 "grammar.y"
{ (yyval.expr) = cnfexprNew(CMP_CONTAINS, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 50:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 182 "grammar.y"
{ (yyval.expr) = cnfexprNew(CMP_CONTAINSI, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 51:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 183 "grammar.y"
{ (yyval.expr) = cnfexprNew(CMP_STARTSWITH, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 52:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 184 "grammar.y"
{ (yyval.expr) = cnfexprNew(CMP_STARTSWITHI, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 53:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 185 "grammar.y"
{ (yyval.expr) = cnfexprNew('&', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 54:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 186 "grammar.y"
{ (yyval.expr) = cnfexprNew('+', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 55:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 187 "grammar.y"
{ (yyval.expr) = cnfexprNew('-', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 56:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 188 "grammar.y"
{ (yyval.expr) = cnfexprNew('*', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 57:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 189 "grammar.y"
{ (yyval.expr) = cnfexprNew('/', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 58:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 190 "grammar.y"
{ (yyval.expr) = cnfexprNew('%', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
break;
case 59:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 191 "grammar.y"
{ (yyval.expr) = (yyvsp[(2) - (3)].expr); }
break;
case 60:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 192 "grammar.y"
{ (yyval.expr) = cnfexprNew('M', NULL, (yyvsp[(2) - (2)].expr)); }
break;
case 61:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 193 "grammar.y"
{ (yyval.expr) = (struct cnfexpr*) cnffuncNew((yyvsp[(1) - (3)].estr), NULL); }
break;
case 62:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 194 "grammar.y"
{ (yyval.expr) = (struct cnfexpr*) cnffuncNew((yyvsp[(1) - (4)].estr), (yyvsp[(3) - (4)].fparams)); }
break;
case 63:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 195 "grammar.y"
{ (yyval.expr) = (struct cnfexpr*) cnfnumvalNew((yyvsp[(1) - (1)].n)); }
break;
case 64:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 196 "grammar.y"
{ (yyval.expr) = (struct cnfexpr*) cnfstringvalNew((yyvsp[(1) - (1)].estr)); }
break;
case 65:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 197 "grammar.y"
{ (yyval.expr) = (struct cnfexpr*) cnfvarNew((yyvsp[(1) - (1)].s)); }
break;
case 66:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 198 "grammar.y"
{ (yyval.expr) = (struct cnfexpr*) (yyvsp[(1) - (1)].arr); }
break;
case 67:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 199 "grammar.y"
{ (yyval.fparams) = cnffparamlstNew((yyvsp[(1) - (1)].expr), NULL); }
break;
case 68:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 200 "grammar.y"
{ (yyval.fparams) = cnffparamlstNew((yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].fparams)); }
break;
case 69:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 201 "grammar.y"
{ (yyval.arr) = (yyvsp[(2) - (3)].arr); }
break;
case 70:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 202 "grammar.y"
{ (yyval.arr) = cnfarrayNew((yyvsp[(1) - (1)].estr)); }
break;
case 71:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 203 "grammar.y"
{ (yyval.arr) = cnfarrayAdd((yyvsp[(1) - (3)].arr), (yyvsp[(3) - (3)].estr)); }
break;
-/* Line 1806 of yacc.c */
-#line 2108 "grammar.c"
+/* Line 1455 of yacc.c */
+#line 2078 "grammar.c"
default: break;
}
- /* User semantic actions sometimes alter yychar, and that requires
- that yytoken be updated with the new translation. We take the
- approach of translating immediately before every use of yytoken.
- One alternative is translating here after every semantic action,
- but that translation would be missed if the semantic action invokes
- YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
- if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
- incorrect destructor might then be invoked immediately. In the
- case of YYERROR or YYBACKUP, subsequent parser actions might lead
- to an incorrect destructor call or verbose syntax error message
- before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
@@ -2145,10 +2104,6 @@ yyreduce:
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
- /* Make sure we have latest lookahead translation. See comments at
- user semantic actions for why this is necessary. */
- yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
-
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
@@ -2156,36 +2111,37 @@ yyerrlab:
#if ! YYERROR_VERBOSE
yyerror (YY_("syntax error"));
#else
-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
- yyssp, yytoken)
{
- char const *yymsgp = YY_("syntax error");
- int yysyntax_error_status;
- yysyntax_error_status = YYSYNTAX_ERROR;
- if (yysyntax_error_status == 0)
- yymsgp = yymsg;
- else if (yysyntax_error_status == 1)
- {
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
- if (!yymsg)
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- yysyntax_error_status = 2;
- }
- else
- {
- yysyntax_error_status = YYSYNTAX_ERROR;
- yymsgp = yymsg;
- }
- }
- yyerror (yymsgp);
- if (yysyntax_error_status == 2)
- goto yyexhaustedlab;
+ YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+ if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+ {
+ YYSIZE_T yyalloc = 2 * yysize;
+ if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+ yyalloc = YYSTACK_ALLOC_MAXIMUM;
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+ if (yymsg)
+ yymsg_alloc = yyalloc;
+ else
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ }
+ }
+
+ if (0 < yysize && yysize <= yymsg_alloc)
+ {
+ (void) yysyntax_error (yymsg, yystate, yychar);
+ yyerror (yymsg);
+ }
+ else
+ {
+ yyerror (YY_("syntax error"));
+ if (yysize != 0)
+ goto yyexhaustedlab;
+ }
}
-# undef YYSYNTAX_ERROR
#endif
}
@@ -2244,7 +2200,7 @@ yyerrlab1:
for (;;)
{
yyn = yypact[yystate];
- if (!yypact_value_is_default (yyn))
+ if (yyn != YYPACT_NINF)
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -2303,13 +2259,8 @@ yyexhaustedlab:
yyreturn:
if (yychar != YYEMPTY)
- {
- /* Make sure we have latest lookahead translation. See comments at
- user semantic actions for why this is necessary. */
- yytoken = YYTRANSLATE (yychar);
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval);
- }
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval);
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
@@ -2334,7 +2285,7 @@ yyreturn:
-/* Line 2067 of yacc.c */
+/* Line 1675 of yacc.c */
#line 205 "grammar.y"
/*
diff --git a/grammar/grammar.h b/grammar/grammar.h
index cad1d92..2efc0fb 100644
--- a/grammar/grammar.h
+++ b/grammar/grammar.h
@@ -1,8 +1,10 @@
-/* A Bison parser, made by GNU Bison 2.5. */
-/* Bison interface for Yacc-like parsers in C
+/* A Bison parser, made by GNU Bison 2.4.1. */
+
+/* Skeleton interface for Bison's Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -128,7 +130,7 @@
typedef union YYSTYPE
{
-/* Line 2068 of yacc.c */
+/* Line 1676 of yacc.c */
#line 44 "grammar.y"
char *s;
@@ -146,8 +148,8 @@ typedef union YYSTYPE
-/* Line 2068 of yacc.c */
-#line 151 "grammar.h"
+/* Line 1676 of yacc.c */
+#line 153 "grammar.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
diff --git a/grammar/lexer.c b/grammar/lexer.c
index f9ed471..f2323ca 100644
--- a/grammar/lexer.c
+++ b/grammar/lexer.c
@@ -1448,10 +1448,9 @@ extern int yydebug;
/* somehow, I need these prototype even though the headers are
* included. I guess that's some autotools magic I don't understand...
*/
-//char *strdup(char*);
int fileno(FILE *stream);
-#line 1455 "lexer.c"
+#line 1454 "lexer.c"
#define INITIAL 0
#define INOBJ 1
@@ -1645,11 +1644,11 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 96 "lexer.l"
+#line 95 "lexer.l"
/* keywords */
-#line 1653 "lexer.c"
+#line 1652 "lexer.c"
if ( !(yy_init) )
{
@@ -1745,131 +1744,131 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 99 "lexer.l"
+#line 98 "lexer.l"
{ BEGIN EXPR; return IF; }
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 100 "lexer.l"
+#line 99 "lexer.l"
{ BEGIN INITIAL; return THEN; }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 101 "lexer.l"
+#line 100 "lexer.l"
{ BEGIN INITIAL; return ';'; }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 102 "lexer.l"
+#line 101 "lexer.l"
{ return OR; }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 103 "lexer.l"
+#line 102 "lexer.l"
{ return AND; }
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 104 "lexer.l"
+#line 103 "lexer.l"
{ return NOT; }
YY_BREAK
case 7:
-#line 106 "lexer.l"
+#line 105 "lexer.l"
case 8:
-#line 107 "lexer.l"
+#line 106 "lexer.l"
case 9:
-#line 108 "lexer.l"
+#line 107 "lexer.l"
case 10:
-#line 109 "lexer.l"
+#line 108 "lexer.l"
case 11:
-#line 110 "lexer.l"
+#line 109 "lexer.l"
case 12:
-#line 111 "lexer.l"
+#line 110 "lexer.l"
case 13:
-#line 112 "lexer.l"
+#line 111 "lexer.l"
case 14:
-#line 113 "lexer.l"
+#line 112 "lexer.l"
case 15:
-#line 114 "lexer.l"
+#line 113 "lexer.l"
case 16:
-#line 115 "lexer.l"
+#line 114 "lexer.l"
case 17:
-#line 116 "lexer.l"
+#line 115 "lexer.l"
case 18:
YY_RULE_SETUP
-#line 116 "lexer.l"
+#line 115 "lexer.l"
{ return yytext[0]; }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 117 "lexer.l"
+#line 116 "lexer.l"
{ return CMP_EQ; }
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 118 "lexer.l"
+#line 117 "lexer.l"
{ return CMP_LE; }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 119 "lexer.l"
+#line 118 "lexer.l"
{ return CMP_GE; }
YY_BREAK
case 22:
-#line 121 "lexer.l"
+#line 120 "lexer.l"
case 23:
YY_RULE_SETUP
-#line 121 "lexer.l"
+#line 120 "lexer.l"
{ return CMP_NE; }
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 122 "lexer.l"
+#line 121 "lexer.l"
{ return CMP_LT; }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 123 "lexer.l"
+#line 122 "lexer.l"
{ return CMP_GT; }
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 124 "lexer.l"
+#line 123 "lexer.l"
{ return CMP_CONTAINS; }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 125 "lexer.l"
+#line 124 "lexer.l"
{ return CMP_CONTAINSI; }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 126 "lexer.l"
+#line 125 "lexer.l"
{ return CMP_STARTSWITH; }
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 127 "lexer.l"
+#line 126 "lexer.l"
{ return CMP_STARTSWITHI; }
YY_BREAK
case 30:
-#line 129 "lexer.l"
+#line 128 "lexer.l"
case 31:
-#line 130 "lexer.l"
+#line 129 "lexer.l"
case 32:
YY_RULE_SETUP
-#line 130 "lexer.l"
+#line 129 "lexer.l"
{ yylval.n = strtoll(yytext, NULL, 0); return NUMBER; }
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 131 "lexer.l"
+#line 130 "lexer.l"
{ yylval.s = strdup(yytext); return VAR; }
YY_BREAK
case 34:
/* rule 34 can match eol */
YY_RULE_SETUP
-#line 132 "lexer.l"
+#line 131 "lexer.l"
{
yytext[yyleng-1] = '\0';
unescapeStr((uchar*)yytext+1, yyleng-2);
@@ -1879,7 +1878,7 @@ YY_RULE_SETUP
case 35:
/* rule 35 can match eol */
YY_RULE_SETUP
-#line 137 "lexer.l"
+#line 136 "lexer.l"
{
yytext[yyleng-1] = '\0';
unescapeStr((uchar*)yytext+1, yyleng-2);
@@ -1889,81 +1888,81 @@ YY_RULE_SETUP
case 36:
/* rule 36 can match eol */
YY_RULE_SETUP
-#line 142 "lexer.l"
+#line 141 "lexer.l"
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 143 "lexer.l"
+#line 142 "lexer.l"
{ yylval.estr = es_newStrFromCStr(yytext, yyleng);
return FUNC; }
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 145 "lexer.l"
+#line 144 "lexer.l"
{ dbgprintf("invalid char in expr: %s\n", yytext); }
YY_BREAK
case 39:
/* rule 39 can match eol */
YY_RULE_SETUP
-#line 146 "lexer.l"
+#line 145 "lexer.l"
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 147 "lexer.l"
+#line 146 "lexer.l"
{ dbgprintf("invalid char in CALL stmt: %s\n", yytext); }
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 148 "lexer.l"
+#line 147 "lexer.l"
{ yylval.estr = es_newStrFromCStr(yytext, yyleng);
BEGIN INITIAL;
return NAME; }
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 151 "lexer.l"
+#line 150 "lexer.l"
{ return '&'; }
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 152 "lexer.l"
+#line 151 "lexer.l"
{ return '{'; }
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 153 "lexer.l"
+#line 152 "lexer.l"
{ return '}'; }
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 154 "lexer.l"
+#line 153 "lexer.l"
{ return STOP; }
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 155 "lexer.l"
+#line 154 "lexer.l"
{ return ELSE; }
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 156 "lexer.l"
+#line 155 "lexer.l"
{ BEGIN INCALL; return CALL; }
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 157 "lexer.l"
+#line 156 "lexer.l"
{ BEGIN EXPR; return SET; }
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 158 "lexer.l"
+#line 157 "lexer.l"
{ BEGIN EXPR; return UNSET; }
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 159 "lexer.l"
+#line 158 "lexer.l"
{ return CONTINUE; }
YY_BREAK
/* line number support because the "preprocessor" combines lines and so needs
@@ -1971,23 +1970,23 @@ YY_RULE_SETUP
*/
case 51:
YY_RULE_SETUP
-#line 163 "lexer.l"
+#line 162 "lexer.l"
{ BEGIN LINENO; }
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 164 "lexer.l"
+#line 163 "lexer.l"
{ yylineno = atoi(yytext) - 1; }
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 165 "lexer.l"
+#line 164 "lexer.l"
{ BEGIN INITIAL; }
YY_BREAK
case 54:
/* rule 54 can match eol */
YY_RULE_SETUP
-#line 166 "lexer.l"
+#line 165 "lexer.l"
YY_BREAK
/* $IncludeConfig must be detected as part of CFSYSLINE, because this is
@@ -1996,12 +1995,12 @@ YY_RULE_SETUP
case 55:
/* rule 55 can match eol */
YY_RULE_SETUP
-#line 170 "lexer.l"
+#line 169 "lexer.l"
YY_BREAK
case 56:
YY_RULE_SETUP
-#line 171 "lexer.l"
+#line 170 "lexer.l"
{ if(cnfDoInclude(yytext) != 0)
yyterminate();
BEGIN INITIAL; }
@@ -2009,117 +2008,117 @@ YY_RULE_SETUP
case 57:
/* rule 57 can match eol */
YY_RULE_SETUP
-#line 174 "lexer.l"
+#line 173 "lexer.l"
{ yylval.objType = CNFOBJ_GLOBAL;
BEGIN INOBJ; return BEGINOBJ; }
YY_BREAK
case 58:
/* rule 58 can match eol */
YY_RULE_SETUP
-#line 176 "lexer.l"
+#line 175 "lexer.l"
{ yylval.objType = CNFOBJ_TPL;
BEGIN INOBJ; return BEGIN_TPL; }
YY_BREAK
case 59:
/* rule 59 can match eol */
YY_RULE_SETUP
-#line 178 "lexer.l"
+#line 177 "lexer.l"
{ yylval.objType = CNFOBJ_RULESET;
BEGIN INOBJ; return BEGIN_RULESET; }
YY_BREAK
case 60:
/* rule 60 can match eol */
YY_RULE_SETUP
-#line 180 "lexer.l"
+#line 179 "lexer.l"
{ yylval.objType = CNFOBJ_PROPERTY;
BEGIN INOBJ; return BEGIN_PROPERTY; }
YY_BREAK
case 61:
/* rule 61 can match eol */
YY_RULE_SETUP
-#line 182 "lexer.l"
+#line 181 "lexer.l"
{ yylval.objType = CNFOBJ_CONSTANT;
BEGIN INOBJ; return BEGIN_CONSTANT; }
YY_BREAK
case 62:
/* rule 62 can match eol */
YY_RULE_SETUP
-#line 184 "lexer.l"
+#line 183 "lexer.l"
{ yylval.objType = CNFOBJ_INPUT;
BEGIN INOBJ; return BEGINOBJ; }
YY_BREAK
case 63:
/* rule 63 can match eol */
YY_RULE_SETUP
-#line 186 "lexer.l"
+#line 185 "lexer.l"
{ yylval.objType = CNFOBJ_MODULE;
BEGIN INOBJ; return BEGINOBJ; }
YY_BREAK
case 64:
/* rule 64 can match eol */
YY_RULE_SETUP
-#line 188 "lexer.l"
+#line 187 "lexer.l"
{ BEGIN INOBJ; return BEGIN_ACTION; }
YY_BREAK
case 65:
YY_RULE_SETUP
-#line 189 "lexer.l"
+#line 188 "lexer.l"
{
yylval.s = strdup(rmLeadingSpace(yytext)); return PROPFILT; }
YY_BREAK
case 66:
YY_RULE_SETUP
-#line 191 "lexer.l"
+#line 190 "lexer.l"
{ yylval.s = strdup(rmLeadingSpace(yytext)); return PRIFILT; }
YY_BREAK
case 67:
-#line 193 "lexer.l"
+#line 192 "lexer.l"
case 68:
-#line 194 "lexer.l"
+#line 193 "lexer.l"
case 69:
/* rule 69 can match eol */
-#line 195 "lexer.l"
+#line 194 "lexer.l"
case 70:
/* rule 70 can match eol */
-#line 196 "lexer.l"
+#line 195 "lexer.l"
case 71:
/* rule 71 can match eol */
-#line 197 "lexer.l"
+#line 196 "lexer.l"
case 72:
/* rule 72 can match eol */
-#line 198 "lexer.l"
+#line 197 "lexer.l"
case 73:
/* rule 73 can match eol */
YY_RULE_SETUP
-#line 198 "lexer.l"
+#line 197 "lexer.l"
{ yylval.s = yytext; return LEGACY_ACTION; }
YY_BREAK
case 74:
YY_RULE_SETUP
-#line 199 "lexer.l"
+#line 198 "lexer.l"
{ BEGIN INITIAL; return ENDOBJ; }
YY_BREAK
case 75:
YY_RULE_SETUP
-#line 200 "lexer.l"
+#line 199 "lexer.l"
{ yylval.estr = es_newStrFromCStr(yytext, yyleng);
return NAME; }
YY_BREAK
case 76:
-#line 203 "lexer.l"
+#line 202 "lexer.l"
case 77:
-#line 204 "lexer.l"
+#line 203 "lexer.l"
case 78:
-#line 205 "lexer.l"
+#line 204 "lexer.l"
case 79:
YY_RULE_SETUP
-#line 205 "lexer.l"
+#line 204 "lexer.l"
{ return(yytext[0]); }
YY_BREAK
case 80:
/* rule 80 can match eol */
YY_RULE_SETUP
-#line 206 "lexer.l"
+#line 205 "lexer.l"
{
yytext[yyleng-1] = '\0';
unescapeStr((uchar*)yytext+1, yyleng-2);
@@ -2130,28 +2129,28 @@ YY_RULE_SETUP
return VALUE; }*/
case 81:
YY_RULE_SETUP
-#line 213 "lexer.l"
+#line 212 "lexer.l"
{ preCommentState = YY_START; BEGIN COMMENT; }
YY_BREAK
case 82:
YY_RULE_SETUP
-#line 214 "lexer.l"
+#line 213 "lexer.l"
{ preCommentState = YY_START; BEGIN COMMENT; }
YY_BREAK
case 83:
YY_RULE_SETUP
-#line 215 "lexer.l"
+#line 214 "lexer.l"
{ preCommentState = YY_START; BEGIN COMMENT; }
YY_BREAK
case 84:
YY_RULE_SETUP
-#line 216 "lexer.l"
+#line 215 "lexer.l"
{ BEGIN preCommentState; }
YY_BREAK
case 85:
/* rule 85 can match eol */
YY_RULE_SETUP
-#line 217 "lexer.l"
+#line 216 "lexer.l"
YY_BREAK
case 86:
@@ -2159,18 +2158,18 @@ case 86:
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 218 "lexer.l"
+#line 217 "lexer.l"
/* skip comments in input */
YY_BREAK
case 87:
/* rule 87 can match eol */
YY_RULE_SETUP
-#line 219 "lexer.l"
+#line 218 "lexer.l"
YY_BREAK
case 88:
YY_RULE_SETUP
-#line 220 "lexer.l"
+#line 219 "lexer.l"
{ dbgprintf("INOBJ: invalid char '%s'\n", yytext); }
YY_BREAK
case 89:
@@ -2178,7 +2177,7 @@ case 89:
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 221 "lexer.l"
+#line 220 "lexer.l"
{ /* see comment on $IncludeConfig above */
if(!strncasecmp(yytext, "$includeconfig ", 14)) {
yyless(14);
@@ -2196,7 +2195,7 @@ case 90:
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 232 "lexer.l"
+#line 231 "lexer.l"
{ yylval.s = strdup(yytext); return BSD_TAG_SELECTOR; }
YY_BREAK
case 91:
@@ -2205,7 +2204,7 @@ case 91:
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 233 "lexer.l"
+#line 232 "lexer.l"
{ yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; }
YY_BREAK
case 92:
@@ -2214,7 +2213,7 @@ case 92:
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 234 "lexer.l"
+#line 233 "lexer.l"
{ yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; }
YY_BREAK
case 93:
@@ -2222,24 +2221,24 @@ case 93:
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 235 "lexer.l"
+#line 234 "lexer.l"
{ yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; }
YY_BREAK
case 94:
/* rule 94 can match eol */
YY_RULE_SETUP
-#line 236 "lexer.l"
+#line 235 "lexer.l"
/* skip comments in input */
YY_BREAK
case 95:
/* rule 95 can match eol */
YY_RULE_SETUP
-#line 237 "lexer.l"
+#line 236 "lexer.l"
/* drop whitespace */
YY_BREAK
case 96:
YY_RULE_SETUP
-#line 238 "lexer.l"
+#line 237 "lexer.l"
{ dbgprintf("invalid char: %s\n", yytext);
}
YY_BREAK
@@ -2250,15 +2249,15 @@ case YY_STATE_EOF(INCL):
case YY_STATE_EOF(LINENO):
case YY_STATE_EOF(INCALL):
case YY_STATE_EOF(EXPR):
-#line 240 "lexer.l"
+#line 239 "lexer.l"
{ if(popfile() != 0) yyterminate(); }
YY_BREAK
case 97:
YY_RULE_SETUP
-#line 242 "lexer.l"
+#line 241 "lexer.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 2262 "lexer.c"
+#line 2261 "lexer.c"
case YY_END_OF_BUFFER:
{
@@ -3227,7 +3226,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 242 "lexer.l"
+#line 241 "lexer.l"
int
diff --git a/grammar/lexer.l b/grammar/lexer.l
index ce7c34c..63eaa8c 100644
--- a/grammar/lexer.l
+++ b/grammar/lexer.l
@@ -88,7 +88,6 @@ extern int yydebug;
/* somehow, I need these prototype even though the headers are
* included. I guess that's some autotools magic I don't understand...
*/
-//char *strdup(char*);
int fileno(FILE *stream);
%}
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index 27ff537..0dc505a 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -2757,6 +2757,9 @@ cnffuncNew(es_str_t *fname, struct cnffparamlst* paramlst)
return func;
}
+/* returns 0 if everything is OK and config parsing shall continue,
+ * and 1 if things are so wrong that config parsing shall be aborted.
+ */
int
cnfDoInclude(char *name)
{
@@ -2767,6 +2770,7 @@ cnfDoInclude(char *name)
glob_t cfgFiles;
struct stat fileInfo;
char nameBuf[MAXFNAME+1];
+ char cwdBuf[MAXFNAME+1];
finalName = name;
if(stat(name, &fileInfo) == 0) {
@@ -2784,14 +2788,15 @@ cnfDoInclude(char *name)
/* Silently ignore wildcards that match nothing */
if(result == GLOB_NOMATCH) {
- return 1;
+ return 0;
}
if(result == GLOB_NOSPACE || result == GLOB_ABORTED) {
char errStr[1024];
rs_strerror_r(errno, errStr, sizeof(errStr));
- parser_errmsg("error accessing config file or directory '%s': %s",
- finalName, errStr);
+ getcwd(cwdBuf, sizeof(cwdBuf));
+ parser_errmsg("error accessing config file or directory '%s' [cwd:%s]: %s",
+ finalName, cwdBuf, errStr);
return 1;
}
@@ -2800,9 +2805,10 @@ cnfDoInclude(char *name)
if(stat(cfgFile, &fileInfo) != 0) {
char errStr[1024];
rs_strerror_r(errno, errStr, sizeof(errStr));
- parser_errmsg("error accessing config file or directory '%s': %s",
- cfgFile, errStr);
- continue;
+ getcwd(cwdBuf, sizeof(cwdBuf));
+ parser_errmsg("error accessing config file or directory '%s' "
+ "[cwd: %s]: %s", cfgFile, cwdBuf, errStr);
+ return 1;
}
if(S_ISREG(fileInfo.st_mode)) { /* config file */