diff options
author | Michael Biebl <biebl@debian.org> | 2014-05-16 14:51:51 +0200 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2014-05-16 14:51:51 +0200 |
commit | f1040389ccb2430b9ab2ba3209aa28a62565b721 (patch) | |
tree | c6bf609292b6f3a80754c2d01cc8855a36ac7a37 /grammar | |
parent | 9374a46543e9c43c009f80def8c3b2506b0b377e (diff) | |
download | rsyslog-f1040389ccb2430b9ab2ba3209aa28a62565b721.tar.gz |
Imported Upstream version 8.2.1upstream/8.2.1
Diffstat (limited to 'grammar')
-rw-r--r-- | grammar/grammar.c | 167 | ||||
-rw-r--r-- | grammar/grammar.h | 2 | ||||
-rw-r--r-- | grammar/grammar.y | 3 | ||||
-rw-r--r-- | grammar/lexer.c | 216 | ||||
-rw-r--r-- | grammar/lexer.l | 6 |
5 files changed, 201 insertions, 193 deletions
diff --git a/grammar/grammar.c b/grammar/grammar.c index 0905c28..e28ba33 100644 --- a/grammar/grammar.c +++ b/grammar/grammar.c @@ -65,6 +65,7 @@ /* Line 358 of yacc.c */ #line 31 "grammar.y" +#include "config.h" #include <stdio.h> #include <libestr.h> #include "rainerscript.h" @@ -77,7 +78,7 @@ extern int yylex(void); extern int yyerror(char*); /* Line 358 of yacc.c */ -#line 81 "grammar.c" +#line 82 "grammar.c" # ifndef YY_NULL # if defined __cplusplus && 201103L <= __cplusplus @@ -203,7 +204,7 @@ extern int yydebug; typedef union YYSTYPE { /* Line 374 of yacc.c */ -#line 44 "grammar.y" +#line 45 "grammar.y" char *s; long long n; @@ -220,7 +221,7 @@ typedef union YYSTYPE /* Line 374 of yacc.c */ -#line 224 "grammar.c" +#line 225 "grammar.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -248,7 +249,7 @@ int yyparse (); /* Copy the second part of user declarations. */ /* Line 377 of yacc.c */ -#line 252 "grammar.c" +#line 253 "grammar.c" #ifdef short # undef short @@ -569,14 +570,14 @@ static const yytype_int8 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 122, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 134, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 155, 159, 160, 161, - 162, 163, 164, 165, 166, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204 + 0, 123, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 135, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 156, 160, 161, 162, + 163, 164, 165, 166, 167, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205 }; #endif @@ -1630,49 +1631,49 @@ yyreduce: { case 3: /* Line 1813 of yacc.c */ -#line 123 "grammar.y" +#line 124 "grammar.y" { cnfDoObj((yyvsp[(2) - (2)].obj)); } break; case 4: /* Line 1813 of yacc.c */ -#line 124 "grammar.y" +#line 125 "grammar.y" { cnfDoScript((yyvsp[(2) - (2)].stmt)); } break; case 5: /* Line 1813 of yacc.c */ -#line 125 "grammar.y" +#line 126 "grammar.y" { cnfDoCfsysline((yyvsp[(2) - (2)].s)); } break; case 6: /* Line 1813 of yacc.c */ -#line 126 "grammar.y" +#line 127 "grammar.y" { cnfDoBSDTag((yyvsp[(2) - (2)].s)); } break; case 7: /* Line 1813 of yacc.c */ -#line 127 "grammar.y" +#line 128 "grammar.y" { cnfDoBSDHost((yyvsp[(2) - (2)].s)); } break; case 8: /* Line 1813 of yacc.c */ -#line 128 "grammar.y" +#line 129 "grammar.y" { (yyval.obj) = cnfobjNew((yyvsp[(1) - (3)].objType), (yyvsp[(2) - (3)].nvlst)); } break; case 9: /* Line 1813 of yacc.c */ -#line 129 "grammar.y" +#line 130 "grammar.y" { (yyval.obj) = cnfobjNew(CNFOBJ_TPL, (yyvsp[(2) - (3)].nvlst)); } break; case 10: /* Line 1813 of yacc.c */ -#line 131 "grammar.y" +#line 132 "grammar.y" { (yyval.obj) = cnfobjNew(CNFOBJ_TPL, (yyvsp[(2) - (6)].nvlst)); (yyval.obj)->subobjs = (yyvsp[(5) - (6)].objlst); } @@ -1680,7 +1681,7 @@ yyreduce: case 11: /* Line 1813 of yacc.c */ -#line 135 "grammar.y" +#line 136 "grammar.y" { (yyval.obj) = cnfobjNew(CNFOBJ_RULESET, (yyvsp[(2) - (6)].nvlst)); (yyval.obj)->script = (yyvsp[(5) - (6)].stmt); } @@ -1688,85 +1689,85 @@ yyreduce: case 12: /* Line 1813 of yacc.c */ -#line 138 "grammar.y" +#line 139 "grammar.y" { (yyval.objlst) = NULL; } break; case 13: /* Line 1813 of yacc.c */ -#line 139 "grammar.y" +#line 140 "grammar.y" { (yyval.objlst) = objlstAdd((yyvsp[(1) - (2)].objlst), (yyvsp[(2) - (2)].obj)); } break; case 14: /* Line 1813 of yacc.c */ -#line 140 "grammar.y" +#line 141 "grammar.y" { (yyval.objlst) = objlstAdd((yyvsp[(1) - (2)].objlst), (yyvsp[(2) - (2)].obj)); } break; case 15: /* Line 1813 of yacc.c */ -#line 141 "grammar.y" +#line 142 "grammar.y" { (yyval.obj) = cnfobjNew(CNFOBJ_PROPERTY, (yyvsp[(2) - (3)].nvlst)); } break; case 16: /* Line 1813 of yacc.c */ -#line 142 "grammar.y" +#line 143 "grammar.y" { (yyval.obj) = cnfobjNew(CNFOBJ_CONSTANT, (yyvsp[(2) - (3)].nvlst)); } break; case 17: /* Line 1813 of yacc.c */ -#line 143 "grammar.y" +#line 144 "grammar.y" { (yyval.nvlst) = NULL; } break; case 18: /* Line 1813 of yacc.c */ -#line 144 "grammar.y" +#line 145 "grammar.y" { (yyvsp[(2) - (2)].nvlst)->next = (yyvsp[(1) - (2)].nvlst); (yyval.nvlst) = (yyvsp[(2) - (2)].nvlst); } break; case 19: /* Line 1813 of yacc.c */ -#line 145 "grammar.y" +#line 146 "grammar.y" { (yyval.nvlst) = nvlstSetName((yyvsp[(3) - (3)].nvlst), (yyvsp[(1) - (3)].estr)); } break; case 20: /* Line 1813 of yacc.c */ -#line 146 "grammar.y" +#line 147 "grammar.y" { (yyval.nvlst) = nvlstNewStr((yyvsp[(1) - (1)].estr)); } break; case 21: /* Line 1813 of yacc.c */ -#line 147 "grammar.y" +#line 148 "grammar.y" { (yyval.nvlst) = nvlstNewArray((yyvsp[(1) - (1)].arr)); } break; case 22: /* Line 1813 of yacc.c */ -#line 148 "grammar.y" +#line 149 "grammar.y" { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } break; case 23: /* Line 1813 of yacc.c */ -#line 149 "grammar.y" +#line 150 "grammar.y" { (yyval.stmt) = scriptAddStmt((yyvsp[(1) - (2)].stmt), (yyvsp[(2) - (2)].stmt)); } break; case 24: /* Line 1813 of yacc.c */ -#line 150 "grammar.y" +#line 151 "grammar.y" { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } break; case 25: /* Line 1813 of yacc.c */ -#line 151 "grammar.y" +#line 152 "grammar.y" { (yyval.stmt) = cnfstmtNew(S_IF); (yyval.stmt)->d.s_if.expr = (yyvsp[(2) - (4)].expr); (yyval.stmt)->d.s_if.t_then = (yyvsp[(4) - (4)].stmt); @@ -1775,7 +1776,7 @@ yyreduce: case 26: /* Line 1813 of yacc.c */ -#line 155 "grammar.y" +#line 156 "grammar.y" { (yyval.stmt) = cnfstmtNew(S_IF); (yyval.stmt)->d.s_if.expr = (yyvsp[(2) - (6)].expr); (yyval.stmt)->d.s_if.t_then = (yyvsp[(4) - (6)].stmt); @@ -1784,277 +1785,277 @@ yyreduce: case 27: /* Line 1813 of yacc.c */ -#line 159 "grammar.y" +#line 160 "grammar.y" { (yyval.stmt) = cnfstmtNewSet((yyvsp[(2) - (5)].s), (yyvsp[(4) - (5)].expr)); } break; case 28: /* Line 1813 of yacc.c */ -#line 160 "grammar.y" +#line 161 "grammar.y" { (yyval.stmt) = cnfstmtNewUnset((yyvsp[(2) - (3)].s)); } break; case 29: /* Line 1813 of yacc.c */ -#line 161 "grammar.y" +#line 162 "grammar.y" { (yyval.stmt) = cnfstmtNewPRIFILT((yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].stmt)); } break; case 30: /* Line 1813 of yacc.c */ -#line 162 "grammar.y" +#line 163 "grammar.y" { (yyval.stmt) = cnfstmtNewPROPFILT((yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].stmt)); } break; case 31: /* Line 1813 of yacc.c */ -#line 163 "grammar.y" +#line 164 "grammar.y" { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } break; case 32: /* Line 1813 of yacc.c */ -#line 164 "grammar.y" +#line 165 "grammar.y" { (yyval.stmt) = (yyvsp[(2) - (3)].stmt); } break; case 33: /* Line 1813 of yacc.c */ -#line 165 "grammar.y" +#line 166 "grammar.y" { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } break; case 34: /* Line 1813 of yacc.c */ -#line 166 "grammar.y" +#line 167 "grammar.y" { (yyval.stmt) = scriptAddStmt((yyvsp[(1) - (3)].stmt), (yyvsp[(3) - (3)].stmt)); } break; case 35: /* Line 1813 of yacc.c */ -#line 168 "grammar.y" +#line 169 "grammar.y" { (yyval.stmt) = cnfstmtNewAct((yyvsp[(2) - (3)].nvlst)); } break; case 36: /* Line 1813 of yacc.c */ -#line 169 "grammar.y" +#line 170 "grammar.y" { (yyval.stmt) = cnfstmtNewLegaAct((yyvsp[(1) - (1)].s)); } break; case 37: /* Line 1813 of yacc.c */ -#line 170 "grammar.y" +#line 171 "grammar.y" { (yyval.stmt) = cnfstmtNew(S_STOP); } break; case 38: /* Line 1813 of yacc.c */ -#line 171 "grammar.y" +#line 172 "grammar.y" { (yyval.stmt) = cnfstmtNewCall((yyvsp[(2) - (2)].estr)); } break; case 39: /* Line 1813 of yacc.c */ -#line 172 "grammar.y" +#line 173 "grammar.y" { (yyval.stmt) = cnfstmtNewContinue(); } break; case 40: /* Line 1813 of yacc.c */ -#line 173 "grammar.y" +#line 174 "grammar.y" { (yyval.expr) = cnfexprNew(AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 41: /* Line 1813 of yacc.c */ -#line 174 "grammar.y" +#line 175 "grammar.y" { (yyval.expr) = cnfexprNew(OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 42: /* Line 1813 of yacc.c */ -#line 175 "grammar.y" +#line 176 "grammar.y" { (yyval.expr) = cnfexprNew(NOT, NULL, (yyvsp[(2) - (2)].expr)); } break; case 43: /* Line 1813 of yacc.c */ -#line 176 "grammar.y" +#line 177 "grammar.y" { (yyval.expr) = cnfexprNew(CMP_EQ, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 44: /* Line 1813 of yacc.c */ -#line 177 "grammar.y" +#line 178 "grammar.y" { (yyval.expr) = cnfexprNew(CMP_NE, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 45: /* Line 1813 of yacc.c */ -#line 178 "grammar.y" +#line 179 "grammar.y" { (yyval.expr) = cnfexprNew(CMP_LE, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 46: /* Line 1813 of yacc.c */ -#line 179 "grammar.y" +#line 180 "grammar.y" { (yyval.expr) = cnfexprNew(CMP_GE, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 47: /* Line 1813 of yacc.c */ -#line 180 "grammar.y" +#line 181 "grammar.y" { (yyval.expr) = cnfexprNew(CMP_LT, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 48: /* Line 1813 of yacc.c */ -#line 181 "grammar.y" +#line 182 "grammar.y" { (yyval.expr) = cnfexprNew(CMP_GT, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 49: /* Line 1813 of yacc.c */ -#line 182 "grammar.y" +#line 183 "grammar.y" { (yyval.expr) = cnfexprNew(CMP_CONTAINS, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 50: /* Line 1813 of yacc.c */ -#line 183 "grammar.y" +#line 184 "grammar.y" { (yyval.expr) = cnfexprNew(CMP_CONTAINSI, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 51: /* Line 1813 of yacc.c */ -#line 184 "grammar.y" +#line 185 "grammar.y" { (yyval.expr) = cnfexprNew(CMP_STARTSWITH, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 52: /* Line 1813 of yacc.c */ -#line 185 "grammar.y" +#line 186 "grammar.y" { (yyval.expr) = cnfexprNew(CMP_STARTSWITHI, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 53: /* Line 1813 of yacc.c */ -#line 186 "grammar.y" +#line 187 "grammar.y" { (yyval.expr) = cnfexprNew('&', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 54: /* Line 1813 of yacc.c */ -#line 187 "grammar.y" +#line 188 "grammar.y" { (yyval.expr) = cnfexprNew('+', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 55: /* Line 1813 of yacc.c */ -#line 188 "grammar.y" +#line 189 "grammar.y" { (yyval.expr) = cnfexprNew('-', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 56: /* Line 1813 of yacc.c */ -#line 189 "grammar.y" +#line 190 "grammar.y" { (yyval.expr) = cnfexprNew('*', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 57: /* Line 1813 of yacc.c */ -#line 190 "grammar.y" +#line 191 "grammar.y" { (yyval.expr) = cnfexprNew('/', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 58: /* Line 1813 of yacc.c */ -#line 191 "grammar.y" +#line 192 "grammar.y" { (yyval.expr) = cnfexprNew('%', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 59: /* Line 1813 of yacc.c */ -#line 192 "grammar.y" +#line 193 "grammar.y" { (yyval.expr) = (yyvsp[(2) - (3)].expr); } break; case 60: /* Line 1813 of yacc.c */ -#line 193 "grammar.y" +#line 194 "grammar.y" { (yyval.expr) = cnfexprNew('M', NULL, (yyvsp[(2) - (2)].expr)); } break; case 61: /* Line 1813 of yacc.c */ -#line 194 "grammar.y" +#line 195 "grammar.y" { (yyval.expr) = (struct cnfexpr*) cnffuncNew((yyvsp[(1) - (3)].estr), NULL); } break; case 62: /* Line 1813 of yacc.c */ -#line 195 "grammar.y" +#line 196 "grammar.y" { (yyval.expr) = (struct cnfexpr*) cnffuncNew((yyvsp[(1) - (4)].estr), (yyvsp[(3) - (4)].fparams)); } break; case 63: /* Line 1813 of yacc.c */ -#line 196 "grammar.y" +#line 197 "grammar.y" { (yyval.expr) = (struct cnfexpr*) cnfnumvalNew((yyvsp[(1) - (1)].n)); } break; case 64: /* Line 1813 of yacc.c */ -#line 197 "grammar.y" +#line 198 "grammar.y" { (yyval.expr) = (struct cnfexpr*) cnfstringvalNew((yyvsp[(1) - (1)].estr)); } break; case 65: /* Line 1813 of yacc.c */ -#line 198 "grammar.y" +#line 199 "grammar.y" { (yyval.expr) = (struct cnfexpr*) cnfvarNew((yyvsp[(1) - (1)].s)); } break; case 66: /* Line 1813 of yacc.c */ -#line 199 "grammar.y" +#line 200 "grammar.y" { (yyval.expr) = (struct cnfexpr*) (yyvsp[(1) - (1)].arr); } break; case 67: /* Line 1813 of yacc.c */ -#line 200 "grammar.y" +#line 201 "grammar.y" { (yyval.fparams) = cnffparamlstNew((yyvsp[(1) - (1)].expr), NULL); } break; case 68: /* Line 1813 of yacc.c */ -#line 201 "grammar.y" +#line 202 "grammar.y" { (yyval.fparams) = cnffparamlstNew((yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].fparams)); } break; case 69: /* Line 1813 of yacc.c */ -#line 202 "grammar.y" +#line 203 "grammar.y" { (yyval.arr) = (yyvsp[(2) - (3)].arr); } break; case 70: /* Line 1813 of yacc.c */ -#line 203 "grammar.y" +#line 204 "grammar.y" { (yyval.arr) = cnfarrayNew((yyvsp[(1) - (1)].estr)); } break; case 71: /* Line 1813 of yacc.c */ -#line 204 "grammar.y" +#line 205 "grammar.y" { (yyval.arr) = cnfarrayAdd((yyvsp[(1) - (3)].arr), (yyvsp[(3) - (3)].estr)); } break; /* Line 1813 of yacc.c */ -#line 2058 "grammar.c" +#line 2059 "grammar.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2286,7 +2287,7 @@ yyreturn: /* Line 2076 of yacc.c */ -#line 206 "grammar.y" +#line 207 "grammar.y" /* int yyerror(char *s) diff --git a/grammar/grammar.h b/grammar/grammar.h index 681e15e..9ff8183 100644 --- a/grammar/grammar.h +++ b/grammar/grammar.h @@ -136,7 +136,7 @@ extern int yydebug; typedef union YYSTYPE { /* Line 2077 of yacc.c */ -#line 44 "grammar.y" +#line 45 "grammar.y" char *s; long long n; diff --git a/grammar/grammar.y b/grammar/grammar.y index c5bad68..a198db0 100644 --- a/grammar/grammar.y +++ b/grammar/grammar.y @@ -8,7 +8,7 @@ * PRI filter) are very hard to beat in ease of use, at least for simpler * cases. * - * Copyright 2011-2012 Rainer Gerhards and Adiscon GmbH. + * Copyright 2011-2014 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -29,6 +29,7 @@ * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. */ %{ +#include "config.h" #include <stdio.h> #include <libestr.h> #include "rainerscript.h" diff --git a/grammar/lexer.c b/grammar/lexer.c index eb34d2a..2c96807 100644 --- a/grammar/lexer.c +++ b/grammar/lexer.c @@ -1430,7 +1430,7 @@ char *yytext; * cases. So while we hope that cfsysline support can be dropped some time in * the future, we will probably keep these useful constructs. * -* Copyright 2011-2013 Rainer Gerhards and Adiscon GmbH. +* Copyright 2011-2014 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -1450,6 +1450,8 @@ char *yytext; * A copy of the GPL can be found in the file "COPYING" in this distribution. * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. */ +#line 34 "lexer.l" +#include "config.h" /*%option noyywrap nodefault case-insensitive */ /* avoid compiler warning: `yyunput' defined but not used */ #define YY_NO_INPUT 1 @@ -1475,7 +1477,7 @@ char *yytext; * wrote this ugly, but the price needed to pay in order to remain * compatible to the previous format. */ -#line 63 "lexer.l" +#line 67 "lexer.l" #include <ctype.h> #include <stdio.h> #include <stdlib.h> @@ -1508,7 +1510,7 @@ extern int yydebug; int fileno(FILE *stream); #endif -#line 1512 "lexer.c" +#line 1514 "lexer.c" #define INITIAL 0 #define INOBJ 1 @@ -1697,11 +1699,11 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 97 "lexer.l" +#line 101 "lexer.l" /* keywords */ -#line 1705 "lexer.c" +#line 1707 "lexer.c" if ( !(yy_init) ) { @@ -1797,131 +1799,131 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 100 "lexer.l" +#line 104 "lexer.l" { BEGIN EXPR; return IF; } YY_BREAK case 2: YY_RULE_SETUP -#line 101 "lexer.l" +#line 105 "lexer.l" { BEGIN INITIAL; return THEN; } YY_BREAK case 3: YY_RULE_SETUP -#line 102 "lexer.l" +#line 106 "lexer.l" { BEGIN INITIAL; return ';'; } YY_BREAK case 4: YY_RULE_SETUP -#line 103 "lexer.l" +#line 107 "lexer.l" { return OR; } YY_BREAK case 5: YY_RULE_SETUP -#line 104 "lexer.l" +#line 108 "lexer.l" { return AND; } YY_BREAK case 6: YY_RULE_SETUP -#line 105 "lexer.l" +#line 109 "lexer.l" { return NOT; } YY_BREAK case 7: -#line 107 "lexer.l" +#line 111 "lexer.l" case 8: -#line 108 "lexer.l" +#line 112 "lexer.l" case 9: -#line 109 "lexer.l" +#line 113 "lexer.l" case 10: -#line 110 "lexer.l" +#line 114 "lexer.l" case 11: -#line 111 "lexer.l" +#line 115 "lexer.l" case 12: -#line 112 "lexer.l" +#line 116 "lexer.l" case 13: -#line 113 "lexer.l" +#line 117 "lexer.l" case 14: -#line 114 "lexer.l" +#line 118 "lexer.l" case 15: -#line 115 "lexer.l" +#line 119 "lexer.l" case 16: -#line 116 "lexer.l" +#line 120 "lexer.l" case 17: -#line 117 "lexer.l" +#line 121 "lexer.l" case 18: YY_RULE_SETUP -#line 117 "lexer.l" +#line 121 "lexer.l" { return yytext[0]; } YY_BREAK case 19: YY_RULE_SETUP -#line 118 "lexer.l" +#line 122 "lexer.l" { return CMP_EQ; } YY_BREAK case 20: YY_RULE_SETUP -#line 119 "lexer.l" +#line 123 "lexer.l" { return CMP_LE; } YY_BREAK case 21: YY_RULE_SETUP -#line 120 "lexer.l" +#line 124 "lexer.l" { return CMP_GE; } YY_BREAK case 22: -#line 122 "lexer.l" +#line 126 "lexer.l" case 23: YY_RULE_SETUP -#line 122 "lexer.l" +#line 126 "lexer.l" { return CMP_NE; } YY_BREAK case 24: YY_RULE_SETUP -#line 123 "lexer.l" +#line 127 "lexer.l" { return CMP_LT; } YY_BREAK case 25: YY_RULE_SETUP -#line 124 "lexer.l" +#line 128 "lexer.l" { return CMP_GT; } YY_BREAK case 26: YY_RULE_SETUP -#line 125 "lexer.l" +#line 129 "lexer.l" { return CMP_CONTAINS; } YY_BREAK case 27: YY_RULE_SETUP -#line 126 "lexer.l" +#line 130 "lexer.l" { return CMP_CONTAINSI; } YY_BREAK case 28: YY_RULE_SETUP -#line 127 "lexer.l" +#line 131 "lexer.l" { return CMP_STARTSWITH; } YY_BREAK case 29: YY_RULE_SETUP -#line 128 "lexer.l" +#line 132 "lexer.l" { return CMP_STARTSWITHI; } YY_BREAK case 30: -#line 130 "lexer.l" +#line 134 "lexer.l" case 31: -#line 131 "lexer.l" +#line 135 "lexer.l" case 32: YY_RULE_SETUP -#line 131 "lexer.l" +#line 135 "lexer.l" { yylval.n = strtoll(yytext, NULL, 0); return NUMBER; } YY_BREAK case 33: YY_RULE_SETUP -#line 132 "lexer.l" +#line 136 "lexer.l" { yylval.s = strdup(yytext+1); return VAR; } YY_BREAK case 34: /* rule 34 can match eol */ YY_RULE_SETUP -#line 133 "lexer.l" +#line 137 "lexer.l" { yytext[yyleng-1] = '\0'; unescapeStr((uchar*)yytext+1, yyleng-2); @@ -1931,7 +1933,7 @@ YY_RULE_SETUP case 35: /* rule 35 can match eol */ YY_RULE_SETUP -#line 138 "lexer.l" +#line 142 "lexer.l" { yytext[yyleng-1] = '\0'; unescapeStr((uchar*)yytext+1, yyleng-2); @@ -1941,18 +1943,18 @@ YY_RULE_SETUP case 36: /* rule 36 can match eol */ YY_RULE_SETUP -#line 143 "lexer.l" +#line 147 "lexer.l" YY_BREAK case 37: YY_RULE_SETUP -#line 144 "lexer.l" +#line 148 "lexer.l" { yylval.estr = es_newStrFromCStr(yytext, yyleng); return FUNC; } YY_BREAK case 38: YY_RULE_SETUP -#line 146 "lexer.l" +#line 150 "lexer.l" { parser_errmsg("invalid character '%s' in expression " "- is there an invalid escape sequence somewhere?", yytext); } @@ -1960,66 +1962,66 @@ YY_RULE_SETUP case 39: /* rule 39 can match eol */ YY_RULE_SETUP -#line 149 "lexer.l" +#line 153 "lexer.l" YY_BREAK case 40: YY_RULE_SETUP -#line 150 "lexer.l" +#line 154 "lexer.l" { parser_errmsg("invalid character '%s' in 'call' statement" "- is there an invalid escape sequence somewhere?", yytext); } YY_BREAK case 41: YY_RULE_SETUP -#line 153 "lexer.l" +#line 157 "lexer.l" { yylval.estr = es_newStrFromCStr(yytext, yyleng); BEGIN INITIAL; return NAME; } YY_BREAK case 42: YY_RULE_SETUP -#line 156 "lexer.l" +#line 160 "lexer.l" { return '&'; } YY_BREAK case 43: YY_RULE_SETUP -#line 157 "lexer.l" +#line 161 "lexer.l" { return '{'; } YY_BREAK case 44: YY_RULE_SETUP -#line 158 "lexer.l" +#line 162 "lexer.l" { return '}'; } YY_BREAK case 45: YY_RULE_SETUP -#line 159 "lexer.l" +#line 163 "lexer.l" { return STOP; } YY_BREAK case 46: YY_RULE_SETUP -#line 160 "lexer.l" +#line 164 "lexer.l" { return ELSE; } YY_BREAK case 47: YY_RULE_SETUP -#line 161 "lexer.l" +#line 165 "lexer.l" { BEGIN INCALL; return CALL; } YY_BREAK case 48: YY_RULE_SETUP -#line 162 "lexer.l" +#line 166 "lexer.l" { BEGIN EXPR; return SET; } YY_BREAK case 49: YY_RULE_SETUP -#line 163 "lexer.l" +#line 167 "lexer.l" { BEGIN EXPR; return UNSET; } YY_BREAK case 50: YY_RULE_SETUP -#line 164 "lexer.l" +#line 168 "lexer.l" { return CONTINUE; } YY_BREAK /* line number support because the "preprocessor" combines lines and so needs @@ -2027,23 +2029,23 @@ YY_RULE_SETUP */ case 51: YY_RULE_SETUP -#line 168 "lexer.l" +#line 172 "lexer.l" { BEGIN LINENO; } YY_BREAK case 52: YY_RULE_SETUP -#line 169 "lexer.l" +#line 173 "lexer.l" { yylineno = atoi(yytext) - 1; } YY_BREAK case 53: YY_RULE_SETUP -#line 170 "lexer.l" +#line 174 "lexer.l" { BEGIN INITIAL; } YY_BREAK case 54: /* rule 54 can match eol */ YY_RULE_SETUP -#line 171 "lexer.l" +#line 175 "lexer.l" YY_BREAK /* $IncludeConfig must be detected as part of CFSYSLINE, because this is @@ -2052,12 +2054,12 @@ YY_RULE_SETUP case 55: /* rule 55 can match eol */ YY_RULE_SETUP -#line 175 "lexer.l" +#line 179 "lexer.l" YY_BREAK case 56: YY_RULE_SETUP -#line 176 "lexer.l" +#line 180 "lexer.l" { if(cnfDoInclude(yytext) != 0) yyterminate(); BEGIN INITIAL; } @@ -2065,76 +2067,76 @@ YY_RULE_SETUP case 57: /* rule 57 can match eol */ YY_RULE_SETUP -#line 179 "lexer.l" +#line 183 "lexer.l" { yylval.objType = CNFOBJ_MAINQ; BEGIN INOBJ; return BEGINOBJ; } YY_BREAK case 58: /* rule 58 can match eol */ YY_RULE_SETUP -#line 181 "lexer.l" +#line 185 "lexer.l" { yylval.objType = CNFOBJ_GLOBAL; BEGIN INOBJ; return BEGINOBJ; } YY_BREAK case 59: /* rule 59 can match eol */ YY_RULE_SETUP -#line 183 "lexer.l" +#line 187 "lexer.l" { yylval.objType = CNFOBJ_TPL; BEGIN INOBJ; return BEGIN_TPL; } YY_BREAK case 60: /* rule 60 can match eol */ YY_RULE_SETUP -#line 185 "lexer.l" +#line 189 "lexer.l" { yylval.objType = CNFOBJ_RULESET; BEGIN INOBJ; return BEGIN_RULESET; } YY_BREAK case 61: /* rule 61 can match eol */ YY_RULE_SETUP -#line 187 "lexer.l" +#line 191 "lexer.l" { yylval.objType = CNFOBJ_PROPERTY; BEGIN INOBJ; return BEGIN_PROPERTY; } YY_BREAK case 62: /* rule 62 can match eol */ YY_RULE_SETUP -#line 189 "lexer.l" +#line 193 "lexer.l" { yylval.objType = CNFOBJ_CONSTANT; BEGIN INOBJ; return BEGIN_CONSTANT; } YY_BREAK case 63: /* rule 63 can match eol */ YY_RULE_SETUP -#line 191 "lexer.l" +#line 195 "lexer.l" { yylval.objType = CNFOBJ_INPUT; BEGIN INOBJ; return BEGINOBJ; } YY_BREAK case 64: /* rule 64 can match eol */ YY_RULE_SETUP -#line 193 "lexer.l" +#line 197 "lexer.l" { yylval.objType = CNFOBJ_MODULE; BEGIN INOBJ; return BEGINOBJ; } YY_BREAK case 65: /* rule 65 can match eol */ YY_RULE_SETUP -#line 195 "lexer.l" +#line 199 "lexer.l" { yylval.objType = CNFOBJ_LOOKUP_TABLE; BEGIN INOBJ; return BEGINOBJ; } YY_BREAK case 66: /* rule 66 can match eol */ YY_RULE_SETUP -#line 197 "lexer.l" +#line 201 "lexer.l" { BEGIN INOBJ; return BEGIN_ACTION; } YY_BREAK case 67: /* rule 67 can match eol */ YY_RULE_SETUP -#line 198 "lexer.l" +#line 202 "lexer.l" { yylval.s = strdup(rmLeadingSpace(yytext)); dbgprintf("lexer: propfilt is '%s'\n", yylval.s); @@ -2143,57 +2145,57 @@ YY_RULE_SETUP YY_BREAK case 68: YY_RULE_SETUP -#line 203 "lexer.l" +#line 207 "lexer.l" { yylval.s = strdup(rmLeadingSpace(yytext)); return PRIFILT; } YY_BREAK case 69: -#line 205 "lexer.l" +#line 209 "lexer.l" case 70: -#line 206 "lexer.l" +#line 210 "lexer.l" case 71: /* rule 71 can match eol */ -#line 207 "lexer.l" +#line 211 "lexer.l" case 72: /* rule 72 can match eol */ -#line 208 "lexer.l" +#line 212 "lexer.l" case 73: /* rule 73 can match eol */ -#line 209 "lexer.l" +#line 213 "lexer.l" case 74: /* rule 74 can match eol */ -#line 210 "lexer.l" +#line 214 "lexer.l" case 75: /* rule 75 can match eol */ YY_RULE_SETUP -#line 210 "lexer.l" +#line 214 "lexer.l" { yylval.s = yytext; return LEGACY_ACTION; } YY_BREAK case 76: YY_RULE_SETUP -#line 211 "lexer.l" +#line 215 "lexer.l" { BEGIN INITIAL; return ENDOBJ; } YY_BREAK case 77: YY_RULE_SETUP -#line 212 "lexer.l" +#line 216 "lexer.l" { yylval.estr = es_newStrFromCStr(yytext, yyleng); return NAME; } YY_BREAK case 78: -#line 215 "lexer.l" +#line 219 "lexer.l" case 79: -#line 216 "lexer.l" +#line 220 "lexer.l" case 80: -#line 217 "lexer.l" +#line 221 "lexer.l" case 81: YY_RULE_SETUP -#line 217 "lexer.l" +#line 221 "lexer.l" { return(yytext[0]); } YY_BREAK case 82: /* rule 82 can match eol */ YY_RULE_SETUP -#line 218 "lexer.l" +#line 222 "lexer.l" { yytext[yyleng-1] = '\0'; unescapeStr((uchar*)yytext+1, yyleng-2); @@ -2204,28 +2206,28 @@ YY_RULE_SETUP return VALUE; }*/ case 83: YY_RULE_SETUP -#line 225 "lexer.l" +#line 229 "lexer.l" { preCommentState = YY_START; BEGIN COMMENT; } YY_BREAK case 84: YY_RULE_SETUP -#line 226 "lexer.l" +#line 230 "lexer.l" { preCommentState = YY_START; BEGIN COMMENT; } YY_BREAK case 85: YY_RULE_SETUP -#line 227 "lexer.l" +#line 231 "lexer.l" { preCommentState = YY_START; BEGIN COMMENT; } YY_BREAK case 86: YY_RULE_SETUP -#line 228 "lexer.l" +#line 232 "lexer.l" { BEGIN preCommentState; } YY_BREAK case 87: /* rule 87 can match eol */ YY_RULE_SETUP -#line 229 "lexer.l" +#line 233 "lexer.l" YY_BREAK case 88: @@ -2233,18 +2235,18 @@ case 88: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 230 "lexer.l" +#line 234 "lexer.l" /* skip comments in input */ YY_BREAK case 89: /* rule 89 can match eol */ YY_RULE_SETUP -#line 231 "lexer.l" +#line 235 "lexer.l" YY_BREAK case 90: YY_RULE_SETUP -#line 232 "lexer.l" +#line 236 "lexer.l" { parser_errmsg("invalid character '%s' in object definition " "- is there an invalid escape sequence somewhere?", yytext); } @@ -2254,7 +2256,7 @@ case 91: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 235 "lexer.l" +#line 239 "lexer.l" { /* see comment on $IncludeConfig above */ if(!strncasecmp(yytext, "$includeconfig ", 14)) { yyless(14); @@ -2272,7 +2274,7 @@ case 92: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 246 "lexer.l" +#line 250 "lexer.l" { yylval.s = strdup(yytext); return BSD_TAG_SELECTOR; } YY_BREAK case 93: @@ -2281,7 +2283,7 @@ case 93: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 247 "lexer.l" +#line 251 "lexer.l" { yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; } YY_BREAK case 94: @@ -2290,7 +2292,7 @@ case 94: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 248 "lexer.l" +#line 252 "lexer.l" { yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; } YY_BREAK case 95: @@ -2298,24 +2300,24 @@ case 95: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 249 "lexer.l" +#line 253 "lexer.l" { yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; } YY_BREAK case 96: /* rule 96 can match eol */ YY_RULE_SETUP -#line 250 "lexer.l" +#line 254 "lexer.l" /* skip comments in input */ YY_BREAK case 97: /* rule 97 can match eol */ YY_RULE_SETUP -#line 251 "lexer.l" +#line 255 "lexer.l" /* drop whitespace */ YY_BREAK case 98: YY_RULE_SETUP -#line 252 "lexer.l" +#line 256 "lexer.l" { parser_errmsg("invalid character '%s' " "- is there an invalid escape sequence somewhere?", yytext); } @@ -2327,15 +2329,15 @@ case YY_STATE_EOF(INCL): case YY_STATE_EOF(LINENO): case YY_STATE_EOF(INCALL): case YY_STATE_EOF(EXPR): -#line 255 "lexer.l" +#line 259 "lexer.l" { if(popfile() != 0) yyterminate(); } YY_BREAK case 99: YY_RULE_SETUP -#line 257 "lexer.l" +#line 261 "lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2339 "lexer.c" +#line 2341 "lexer.c" case YY_END_OF_BUFFER: { @@ -3300,7 +3302,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 257 "lexer.l" +#line 261 "lexer.l" int diff --git a/grammar/lexer.l b/grammar/lexer.l index 7fdb68a..d264d6e 100644 --- a/grammar/lexer.l +++ b/grammar/lexer.l @@ -9,7 +9,7 @@ * cases. So while we hope that cfsysline support can be dropped some time in * the future, we will probably keep these useful constructs. * - * Copyright 2011-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2011-2014 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -30,6 +30,10 @@ * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. */ +%{ +#include "config.h" +%} + %option noyywrap nodefault case-insensitive yylineno /*%option noyywrap nodefault case-insensitive */ |