[Openswan dev] fixes to parser.l and parser.y to eliminate build-time diagnostics

D. Hugh Redelmeier hugh at mimosa.com
Fri Jul 4 22:56:19 EDT 2008


The enclosed patch eliminates a couple of warning messages.
It also adds a comment and corrects a comment.

UNTESTED but should have no observable effect.

===================================================================
RCS file: RCS/parser.l,v
retrieving revision 1.2
diff -u -r1.2 parser.l
--- parser.l	2008/07/04 21:37:12	1.2
+++ parser.l	2008/07/05 02:47:08
@@ -1,5 +1,6 @@
 /* -*- flex-mode -*- */
 %option nounput
+%option noinput
 %{ 
 /* FreeS/WAN config file parser (parser.l)
  * Copyright (C) 2001 Mathieu Lafon - Arkoon Network Security
@@ -280,6 +281,14 @@
 
 %}
 
+    /* lexical states:
+     *
+     * INITIAL
+     * USERDEF: after "="
+     * BOOLEAN: after keyword with BOOLWORD attribute, until \n
+     * COMMENTEQUAL: after keyword "x-comment"
+     * COMMENTSTRING: after = in COMMENTEQUAL state, until \n
+     */
 %x USERDEF BOOLEAN COMMENTEQUAL COMMENTSTRING
 
 %%
@@ -439,7 +448,7 @@
 			   return tok;
 			}
 
-#.*		        /* eat comment lines */ {
+#.*		        /* eat comment to end of line */ {
                         }
 
 .			yyerror(yytext);
===================================================================
RCS file: RCS/parser.y,v
retrieving revision 1.1
diff -u -r1.1 parser.y
--- parser.y	2008/07/05 02:20:40	1.1
+++ parser.y	2008/07/05 02:34:51
@@ -62,7 +62,6 @@
 	struct keyword k;
 }
 %token EQUAL FIRST_SPACES EOL CONFIG SETUP CONN INCLUDE VERSION 
-%token DEFAULT  TIMEWORD
 %token <dblnum> NUMBER
 %token <s>      STRING
 %token <num>    INTEGER
================ end of patch ================


More information about the Dev mailing list