lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [lucy-commits] svn commit: r1179410 - /incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCLexHeader.l
Date Wed, 05 Oct 2011 20:16:26 GMT
Author: marvin
Date: Wed Oct  5 20:16:26 2011
New Revision: 1179410

URL: http://svn.apache.org/viewvc?rev=1179410&view=rev
Log:
Make lexer error out on bad input.

Modified:
    incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCLexHeader.l

Modified: incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCLexHeader.l
URL: http://svn.apache.org/viewvc/incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCLexHeader.l?rev=1179410&r1=1179409&r2=1179410&view=diff
==============================================================================
--- incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCLexHeader.l (original)
+++ incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCLexHeader.l Wed Oct  5 20:16:26
2011
@@ -38,6 +38,8 @@ S_save_yytext() {
 OBJECT_TYPE_SPECIFIER   ([a-z]+[a-z0-9]*_)?[A-Z]+[A-Z0-9]*[a-z]+[A-Za-z0-9]*
 
 %option noyywrap
+%option nodefault
+%option yylineno
 
 %%
 void       { PARSE(CFC_TOKENTYPE_VOID, NULL); }
@@ -68,5 +70,12 @@ va_list    { PARSE(CFC_TOKENTYPE_VA_LIST
                 PARSE(CFC_TOKENTYPE_OBJECT_TYPE_SPECIFIER, NULL); 
            }
 [*]        { PARSE(CFC_TOKENTYPE_ASTERISK, NULL); }
+
+[ \t\r\n]  /* Skip whitespace. */
+.          { 
+                printf("Bad input character '%s' at line %d\n", yytext, yylineno);
+                yyterminate();
+           }
+<<EOF>>    { yyterminate(); }
 %%
 



Mime
View raw message