[asterisk-commits] murf: trunk r162271 - in /trunk: ./ res/ael/ael.flex res/ael/ael_lex.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 9 14:40:31 CST 2008


Author: murf
Date: Tue Dec  9 14:40:31 2008
New Revision: 162271

URL: http://svn.digium.com/view/asterisk?view=rev&rev=162271
Log:
Merged revisions 162264 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r162264 | murf | 2008-12-09 13:20:54 -0700 (Tue, 09 Dec 2008) | 1 line

In discussion with seanbright on #asterisk-dev,  I have added a default rule, and an option to suppress the default rule from being generated in the flex output, for the sake of those OS's where they didn't tweak flex's ECHO macro, and the compiler doesn't like it. The regressions are OK with this.
........

Modified:
    trunk/   (props changed)
    trunk/res/ael/ael.flex
    trunk/res/ael/ael_lex.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/res/ael/ael.flex
URL: http://svn.digium.com/view/asterisk/trunk/res/ael/ael.flex?view=diff&rev=162271&r1=162270&r2=162271
==============================================================================
--- trunk/res/ael/ael.flex (original)
+++ trunk/res/ael/ael.flex Tue Dec  9 14:40:31 2008
@@ -34,6 +34,14 @@
  */
 %option prefix="ael_yy"
 %option noyywrap 8bit
+
+/* I specify this option to suppress flex generating code with ECHO
+  in it. This generates compiler warnings in some systems; We've
+  seen the fwrite generate Unused variable warnings with 4.1.2 gcc.
+  Some systems have tweaked flex ECHO macro to keep the compiler
+  happy.  To keep the warning message from getting output, I added
+  a default rule at the end of the patterns section */
+%option nodefault
 
 /* yyfree normally just frees its arg. It can be null sometimes,
    which some systems will complain about, so, we'll define our own version */
@@ -643,6 +651,8 @@
 		}
 	}
 
+<*>.|\n		{ /* default rule */ ast_log(LOG_ERROR,"Unhandled char(s): %s\n", yytext); }
+
 %%
 
 static void pbcpush(char x)

Modified: trunk/res/ael/ael_lex.c
URL: http://svn.digium.com/view/asterisk/trunk/res/ael/ael_lex.c?view=diff&rev=162271&r1=162270&r2=162271
==============================================================================
--- trunk/res/ael/ael_lex.c (original)
+++ trunk/res/ael/ael_lex.c Tue Dec  9 14:40:31 2008
@@ -352,8 +352,8 @@
 	*yy_cp = '\0'; \
 	yyg->yy_c_buf_p = yy_cp;
 
-#define YY_NUM_RULES 75
-#define YY_END_OF_BUFFER 76
+#define YY_NUM_RULES 76
+#define YY_END_OF_BUFFER 77
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -364,7 +364,7 @@
 static yyconst flex_int16_t yy_accept[285] =
     {   0,
         0,    0,    0,    0,    0,    0,    0,    0,   43,   43,
-        0,    0,    0,    0,    0,    0,   76,   75,   50,   48,
+        0,    0,    0,    0,    0,    0,   77,   75,   50,   48,
        49,   51,   51,   51,    9,    3,    4,    7,   51,    8,
         5,    6,   12,   75,   51,   51,   51,   51,   51,   51,
        51,   51,   51,   51,   51,   51,   51,   51,   51,   51,
@@ -797,6 +797,12 @@
  * This renames also ael_yywrap, but since we do not use it, we just
  * add option noyywrap to remove it.
  */
+/* I specify this option to suppress flex generating code with ECHO
+  in it. This generates compiler warnings in some systems; We've
+  seen the fwrite generate Unused variable warnings with 4.1.2 gcc.
+  Some systems have tweaked flex ECHO macro to keep the compiler
+  happy.  To keep the warning message from getting output, I added
+  a default rule at the end of the patterns section */
 /* ael_yyfree normally just frees its arg. It can be null sometimes,
    which some systems will complain about, so, we'll define our own version */
 /* batch gives a bit more performance if we are using it in
@@ -811,7 +817,7 @@
  * bison-bridge passes an additional yylval argument to ael_yylex().
  * bison-locations is probably not needed.
  */
-#line 63 "ael.flex"
+#line 71 "ael.flex"
 #include "asterisk.h"
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
@@ -946,7 +952,7 @@
 #define	STORE_POS
 #define	STORE_LOC
 #endif
-#line 949 "ael_lex.c"
+#line 955 "ael_lex.c"
 
 #define INITIAL 0
 #define paren 1
@@ -1194,10 +1200,10 @@
 	register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-#line 209 "ael.flex"
-
-
-#line 1200 "ael_lex.c"
+#line 217 "ael.flex"
+
+
+#line 1206 "ael_lex.c"
 
     yylval = yylval_param;
 
@@ -1288,260 +1294,260 @@
 
 case 1:
 YY_RULE_SETUP
-#line 211 "ael.flex"
+#line 219 "ael.flex"
 { STORE_POS; return LC;}
 	YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 212 "ael.flex"
+#line 220 "ael.flex"
 { STORE_POS; return RC;}
 	YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 213 "ael.flex"
+#line 221 "ael.flex"
 { STORE_POS; return LP;}
 	YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 214 "ael.flex"
+#line 222 "ael.flex"
 { STORE_POS; return RP;}
 	YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 215 "ael.flex"
+#line 223 "ael.flex"
 { STORE_POS; return SEMI;}
 	YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 216 "ael.flex"
+#line 224 "ael.flex"
 { STORE_POS; return EQ;}
 	YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 217 "ael.flex"
+#line 225 "ael.flex"
 { STORE_POS; return COMMA;}
 	YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 218 "ael.flex"
+#line 226 "ael.flex"
 { STORE_POS; return COLON;}
 	YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 219 "ael.flex"
+#line 227 "ael.flex"
 { STORE_POS; return AMPER;}
 	YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 220 "ael.flex"
+#line 228 "ael.flex"
 { STORE_POS; return BAR;}
 	YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 221 "ael.flex"
+#line 229 "ael.flex"
 { STORE_POS; return EXTENMARK;}
 	YY_BREAK
 case 12:
 YY_RULE_SETUP
-#line 222 "ael.flex"
+#line 230 "ael.flex"
 { STORE_POS; return AT;}
 	YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 223 "ael.flex"
+#line 231 "ael.flex"
 {/*comment*/}
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 224 "ael.flex"
+#line 232 "ael.flex"
 { STORE_POS; return KW_CONTEXT;}
 	YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 225 "ael.flex"
+#line 233 "ael.flex"
 { STORE_POS; return KW_ABSTRACT;}
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 226 "ael.flex"
+#line 234 "ael.flex"
 { STORE_POS; return KW_EXTEND;}
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 227 "ael.flex"
+#line 235 "ael.flex"
 { STORE_POS; return KW_MACRO;};
 	YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 228 "ael.flex"
+#line 236 "ael.flex"
 { STORE_POS; return KW_GLOBALS;}
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 229 "ael.flex"
+#line 237 "ael.flex"
 { STORE_POS; return KW_LOCAL;}
 	YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 230 "ael.flex"
+#line 238 "ael.flex"
 { STORE_POS; return KW_IGNOREPAT;}
 	YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 231 "ael.flex"
+#line 239 "ael.flex"
 { STORE_POS; return KW_SWITCH;}
 	YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 232 "ael.flex"
+#line 240 "ael.flex"
 { STORE_POS; return KW_IF;}
 	YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 233 "ael.flex"
+#line 241 "ael.flex"
 { STORE_POS; return KW_IFTIME;}
 	YY_BREAK
 case 24:
 YY_RULE_SETUP
-#line 234 "ael.flex"
+#line 242 "ael.flex"
 { STORE_POS; return KW_RANDOM;}
 	YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 235 "ael.flex"
+#line 243 "ael.flex"
 { STORE_POS; return KW_REGEXTEN;}
 	YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 236 "ael.flex"
+#line 244 "ael.flex"
 { STORE_POS; return KW_HINT;}
 	YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 237 "ael.flex"
+#line 245 "ael.flex"
 { STORE_POS; return KW_ELSE;}
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 238 "ael.flex"
+#line 246 "ael.flex"
 { STORE_POS; return KW_GOTO;}
 	YY_BREAK
 case 29:
 YY_RULE_SETUP
-#line 239 "ael.flex"
+#line 247 "ael.flex"
 { STORE_POS; return KW_JUMP;}
 	YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 240 "ael.flex"
+#line 248 "ael.flex"
 { STORE_POS; return KW_RETURN;}
 	YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 241 "ael.flex"
+#line 249 "ael.flex"
 { STORE_POS; return KW_BREAK;}
 	YY_BREAK
 case 32:
 YY_RULE_SETUP
-#line 242 "ael.flex"
+#line 250 "ael.flex"
 { STORE_POS; return KW_CONTINUE;}
 	YY_BREAK
 case 33:
 YY_RULE_SETUP
-#line 243 "ael.flex"
+#line 251 "ael.flex"
 { STORE_POS; return KW_FOR;}
 	YY_BREAK
 case 34:
 YY_RULE_SETUP
-#line 244 "ael.flex"
+#line 252 "ael.flex"
 { STORE_POS; return KW_WHILE;}
 	YY_BREAK
 case 35:
 YY_RULE_SETUP
-#line 245 "ael.flex"
+#line 253 "ael.flex"
 { STORE_POS; return KW_CASE;}
 	YY_BREAK
 case 36:
 YY_RULE_SETUP
-#line 246 "ael.flex"
+#line 254 "ael.flex"
 { STORE_POS; return KW_DEFAULT;}
 	YY_BREAK
 case 37:
 YY_RULE_SETUP
-#line 247 "ael.flex"
+#line 255 "ael.flex"
 { STORE_POS; return KW_PATTERN;}
 	YY_BREAK
 case 38:
 YY_RULE_SETUP
-#line 248 "ael.flex"
+#line 256 "ael.flex"
 { STORE_POS; return KW_CATCH;}
 	YY_BREAK
 case 39:
 YY_RULE_SETUP
-#line 249 "ael.flex"
+#line 257 "ael.flex"
 { STORE_POS; return KW_SWITCHES;}
 	YY_BREAK
 case 40:
 YY_RULE_SETUP
-#line 250 "ael.flex"
+#line 258 "ael.flex"
 { STORE_POS; return KW_ESWITCHES;}
 	YY_BREAK
 case 41:
 YY_RULE_SETUP
-#line 251 "ael.flex"
+#line 259 "ael.flex"
 { STORE_POS; return KW_INCLUDES;}
 	YY_BREAK
 case 42:
 YY_RULE_SETUP
-#line 252 "ael.flex"
+#line 260 "ael.flex"
 { BEGIN(comment); my_col += 2; }
 	YY_BREAK
 case 43:
 YY_RULE_SETUP
-#line 254 "ael.flex"
+#line 262 "ael.flex"
 { my_col += yyleng; }
 	YY_BREAK
 case 44:
 /* rule 44 can match eol */
 YY_RULE_SETUP
-#line 255 "ael.flex"
+#line 263 "ael.flex"
 { ++my_lineno; my_col=1;}
 	YY_BREAK
 case 45:
 YY_RULE_SETUP
-#line 256 "ael.flex"
+#line 264 "ael.flex"
 { my_col += yyleng; }
 	YY_BREAK
 case 46:
 /* rule 46 can match eol */
 YY_RULE_SETUP
-#line 257 "ael.flex"
+#line 265 "ael.flex"
 { ++my_lineno; my_col=1;}
 	YY_BREAK
 case 47:
 YY_RULE_SETUP
-#line 258 "ael.flex"
+#line 266 "ael.flex"
 { my_col += 2; BEGIN(INITIAL); } /* the nice thing about comments is that you know exactly what ends them */
 	YY_BREAK
 case 48:
 /* rule 48 can match eol */
 YY_RULE_SETUP
-#line 260 "ael.flex"
+#line 268 "ael.flex"
 { my_lineno++; my_col = 1; }
 	YY_BREAK
 case 49:
 YY_RULE_SETUP
-#line 261 "ael.flex"
+#line 269 "ael.flex"
 { my_col += yyleng; }
 	YY_BREAK
 case 50:
 YY_RULE_SETUP
-#line 262 "ael.flex"
+#line 270 "ael.flex"
 { my_col += (yyleng*8)-(my_col%8); }
 	YY_BREAK
 case 51:
 YY_RULE_SETUP
-#line 264 "ael.flex"
+#line 272 "ael.flex"
 { 
       /* boy did I open a can of worms when I changed the lexical token "word". 
   	  	 all the above keywords can be used as a beginning to a "word".-
@@ -1570,22 +1576,22 @@
 	YY_BREAK
 case 52:
 YY_RULE_SETUP
-#line 290 "ael.flex"
+#line 298 "ael.flex"
 { yymore(); /* Keep going */ }
 	YY_BREAK
 case 53:
 YY_RULE_SETUP
-#line 291 "ael.flex"
+#line 299 "ael.flex"
 { yymore(); /* Keep going */ }
 	YY_BREAK
 case 54:
 YY_RULE_SETUP
-#line 292 "ael.flex"
+#line 300 "ael.flex"
 { yymore(); /* Keep Going */ }
 	YY_BREAK
 case 55:
 YY_RULE_SETUP
-#line 293 "ael.flex"
+#line 301 "ael.flex"
 { /* the beginning of a ${} construct. prepare and pop into curlystate */
 	   	parencount2 = 0;
 		pbcpos2 = 0;
@@ -1596,7 +1602,7 @@
 	YY_BREAK
 case 56:
 YY_RULE_SETUP
-#line 300 "ael.flex"
+#line 308 "ael.flex"
 { /* the beginning of a $[] construct. prepare and pop into brackstate */
 	   	parencount3 = 0;
 		pbcpos3 = 0;
@@ -1608,7 +1614,7 @@
 case 57:
 /* rule 57 can match eol */
 YY_RULE_SETUP
-#line 307 "ael.flex"
+#line 315 "ael.flex"
 {
 		/* a non-word constituent char, like a space, tab, curly, paren, etc */
 		char c = yytext[yyleng-1];
@@ -1624,7 +1630,7 @@
 case 58:
 /* rule 58 can match eol */
 YY_RULE_SETUP
-#line 320 "ael.flex"
+#line 328 "ael.flex"
 {
 		if ( pbcpop2('}') ) {	/* error */
 			STORE_LOC;
@@ -1647,7 +1653,7 @@
 case 59:
 /* rule 59 can match eol */
 YY_RULE_SETUP
-#line 339 "ael.flex"
+#line 347 "ael.flex"
 { 
 		char c = yytext[yyleng-1];
 		if (c == '{')
@@ -1659,7 +1665,7 @@
 case 60:
 /* rule 60 can match eol */
 YY_RULE_SETUP
-#line 347 "ael.flex"
+#line 355 "ael.flex"
 { 
 		char c = yytext[yyleng-1];
 		if ( pbcpop2(c))  { /* error */
@@ -1678,7 +1684,7 @@
 case 61:
 /* rule 61 can match eol */
 YY_RULE_SETUP
-#line 363 "ael.flex"
+#line 371 "ael.flex"
 {
 		if ( pbcpop3(']') ) {	/* error */
 			STORE_LOC;
@@ -1701,7 +1707,7 @@
 case 62:
 /* rule 62 can match eol */
 YY_RULE_SETUP
-#line 382 "ael.flex"
+#line 390 "ael.flex"
 { 
 		char c = yytext[yyleng-1];
 		if (c == '[')
@@ -1713,7 +1719,7 @@
 case 63:
 /* rule 63 can match eol */
 YY_RULE_SETUP
-#line 390 "ael.flex"
+#line 398 "ael.flex"
 { 
 		char c = yytext[yyleng-1];
 		if ( pbcpop3(c))  { /* error */
@@ -1739,7 +1745,7 @@
 case 64:
 /* rule 64 can match eol */
 YY_RULE_SETUP
-#line 413 "ael.flex"
+#line 421 "ael.flex"
 {
 		if ( pbcpop(')') ) {	/* error */
 			STORE_LOC;
@@ -1768,7 +1774,7 @@
 case 65:
 /* rule 65 can match eol */
 YY_RULE_SETUP
-#line 438 "ael.flex"
+#line 446 "ael.flex"
 {
 		char c = yytext[yyleng-1];
 		if (c == '(')
@@ -1780,7 +1786,7 @@
 case 66:
 /* rule 66 can match eol */
 YY_RULE_SETUP
-#line 446 "ael.flex"
+#line 454 "ael.flex"
 {
 		char c = yytext[yyleng-1];
 		if ( pbcpop(c))  { /* error */
@@ -1807,7 +1813,7 @@
 case 67:
 /* rule 67 can match eol */
 YY_RULE_SETUP
-#line 470 "ael.flex"
+#line 478 "ael.flex"
 {
 		char c = yytext[yyleng-1];
 		if (c == '(')
@@ -1819,7 +1825,7 @@
 case 68:
 /* rule 68 can match eol */
 YY_RULE_SETUP
-#line 478 "ael.flex"
+#line 486 "ael.flex"
 {
 		if ( pbcpop(')') ) { /* error */
 			STORE_LOC;
@@ -1850,7 +1856,7 @@
 case 69:
 /* rule 69 can match eol */
 YY_RULE_SETUP
-#line 505 "ael.flex"
+#line 513 "ael.flex"
 {
 		if( parencount != 0) { /* ast_log(LOG_NOTICE,"Folding in a comma!\n"); */
 			yymore();
@@ -1869,7 +1875,7 @@
 case 70:
 /* rule 70 can match eol */
 YY_RULE_SETUP
-#line 520 "ael.flex"
+#line 528 "ael.flex"
 {
 		char c = yytext[yyleng-1];
 		if ( pbcpop(c) ) { /* error */
@@ -1892,7 +1898,7 @@
 case 71:
 /* rule 71 can match eol */
 YY_RULE_SETUP
-#line 539 "ael.flex"
+#line 547 "ael.flex"
 {
 		char c = yytext[yyleng-1];
 		yymore();
@@ -1902,7 +1908,7 @@
 case 72:
 /* rule 72 can match eol */
 YY_RULE_SETUP
-#line 545 "ael.flex"
+#line 553 "ael.flex"
 {
 		char c = yytext[yyleng-1];
 		if ( pbcpop(c) ) { /* error */
@@ -1920,7 +1926,7 @@
 case 73:
 /* rule 73 can match eol */
 YY_RULE_SETUP
-#line 559 "ael.flex"
+#line 567 "ael.flex"
 {
 		STORE_LOC;
 		yylval->str = malloc(yyleng);
@@ -1934,7 +1940,7 @@
 case 74:
 /* rule 74 can match eol */
 YY_RULE_SETUP
-#line 569 "ael.flex"
+#line 577 "ael.flex"
 {
 		char fnamebuf[1024],*p1,*p2;
 		int glob_ret;
@@ -1987,7 +1993,7 @@
 case YY_STATE_EOF(curlystate):
 case YY_STATE_EOF(wordstate):
 case YY_STATE_EOF(brackstate):
-#line 614 "ael.flex"
+#line 622 "ael.flex"
 {
 		char fnamebuf[2048];
 		if (include_stack_index > 0 && include_stack[include_stack_index-1].globbuf_pos < include_stack[include_stack_index-1].globbuf.gl_pathc-1) {
@@ -2021,11 +2027,17 @@
 	}
 	YY_BREAK
 case 75:
-YY_RULE_SETUP
-#line 646 "ael.flex"
-ECHO;
-	YY_BREAK
-#line 2028 "ael_lex.c"
+/* rule 75 can match eol */
+YY_RULE_SETUP
+#line 654 "ael.flex"
+{ /* default rule */ ast_log(LOG_ERROR,"Unhandled char(s): %s\n", yytext); }
+	YY_BREAK
+case 76:
+YY_RULE_SETUP
+#line 656 "ael.flex"
+YY_FATAL_ERROR( "flex scanner jammed" );
+	YY_BREAK
+#line 2040 "ael_lex.c"
 
 	case YY_END_OF_BUFFER:
 		{
@@ -3198,7 +3210,7 @@
 
 #define YYTABLES_NAME "yytables"
 
-#line 646 "ael.flex"
+#line 656 "ael.flex"
 
 
 




More information about the asterisk-commits mailing list