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.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Steve Murphy
2008-12-09 20:20:54 +00:00
parent 114c659195
commit 8582a3e924
2 changed files with 107 additions and 84 deletions

View File

@@ -35,6 +35,14 @@
%option prefix="ael_yy"
%option noyywrap
/* 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 */
%option noyyfree
@@ -282,6 +290,7 @@ includes { STORE_POS; return KW_INCLUDES;}
yymore();
}
}
<wordstate>[-a-zA-Z0-9'"_/.\<\>\*\+!$#\[\]] { yymore(); /* Keep going */ }
<wordstate>(\\.) { yymore(); /* Keep Going */ }
<wordstate>(\$\{) { /* the beginning of a ${} construct. prepare and pop into curlystate */
@@ -632,6 +641,8 @@ includes { STORE_POS; return KW_INCLUDES;}
}
}
<*>.|\n { /* default rule */ ast_log(LOG_ERROR,"Unhandled char(s): %s\n", yytext); }
%%
static void pbcpush(char x)