summaryrefslogtreecommitdiff
path: root/grammar/lexer.c
diff options
context:
space:
mode:
Diffstat (limited to 'grammar/lexer.c')
-rw-r--r--grammar/lexer.c216
1 files changed, 109 insertions, 107 deletions
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