Date: Fri, 23 Apr 2004 17:43:14 -0500 (CDT)
From: Gilles Detillieux <grdetil@scrc.umanitoba.ca>
To: Joe R. Jah <jjah@cloud.ccsf.cc.ca.us>
Cc: "ht://Dig developers list" <htdig-dev@lists.sourceforge.net>
Subject: Re: [htdig-dev] PATCH: 3.2.0b5 config parser fixes

According to Joe R. Jah:
> I believe we should make the patches against virgin 3.2.0b5; alternatively
> we should indicate to what snapshot they apply.  Many people do not
> download weekly snapshots, and use the patches to upgrade 3.2.0b5.
> I plead guilty, until a few minutes ago;)

I agree.  Certainly for the archives, it's important they they apply
to the release they're supposedly for, and dependencies on other patches
should be stated.  I was just trying to get the patch out quickly, after
spending hours playing with the code, and I didn't consider these issues.

Below is an updated patch, which should apply properly to 3.2.0b5.

> I see that except one, the patches in the patch site have not been
> committed to 3.2.0b5-20040418; when will they be committed?

We'll obviously need to look into this, to determine the suitability
and reliability of each patch.  Certainly the bug fixes need to get in
in some form or other.

> > That's odd.  Did your system use yacc or bison to build conf_parser.cxx
> > from the .yxx source?  Which version of this tool do you have?  The config
> > parser relies on the "#define YYPARSE_PARAM aConf" statement to get bison
> > to use aConf as the argument to yyparse(), so the declaration is supposed
> > to be auto-generated.  I guess for completeness, the patch would need to
> > include the autogenerated *.h and *.cxx files as well.
> 
> My system used yacc; it's time stamp is relatively recent:
> 
>   -r-xr-xr-x  1 bin  bin  54144 Jul 17  2003 /usr/bin/yacc

I guess yacc doesn't support passing parameters to yyparse(), or does
it differently.  Anyone have ideas about this?

> I also reconfigured with GNU Bison version 1.28; this is what I got:(

I was able to build earlier 3.2 betas with bison 1.28, so I'm not sure
why there's a problem.

> sed '/^#/ s|y\.tab\.c|conf_parser.cxx|' y.tab.c >conf_parser.cxxt && mv conf_parser.cxxt conf_parser.cxx
> sed: y.tab.c: No such file or directory
> gmake[1]: *** [conf_parser.cxx] Error 1
> gmake[1]: Leaving directory `/usr/tmp/htdig/htdig-3.2.0b5/htcommon'
> gmake: *** [all-recursive] Error 1
> 
> Does it require a more recent version of Bison?

That's odd, as y.tab.c is the standard yacc/bison output file name.
Are there any error messages above that would help?  How did you
reconfigure it to use bison instead of yacc?

Here's the updated patch...  Apply to 3.2.0b5 using "patch -p0 < this-file".

-- 
Gilles R. Detillieux              E-mail: <grdetil@scrc.umanitoba.ca>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/
Dept. Physiology, U. of Manitoba  Winnipeg, MB  R3E 3J7  (Canada)

--- htcommon/conf_lexer.lxx.orig	2003-06-24 15:05:44.000000000 -0500
+++ htcommon/conf_lexer.lxx	2004-04-22 15:47:48.000000000 -0500
@@ -41,6 +41,7 @@
 #define MAX_INCLUDE_DEPTH 10
 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
 String *name_stack[MAX_INCLUDE_DEPTH];
+int lineno_stack[MAX_INCLUDE_DEPTH];
 int include_stack_ptr = 0;
 %}
 
@@ -50,7 +51,7 @@ STRING			[\x21-\xff]+
 BR_STRING		[^ \n\t<>]+
 %%
 
-^#.*\n			/*   Ignore comments     */
+^[[:space:]]*#.*\n	/*   Ignore comments     */
 ^[[:space:]]*\n		/*   Ignore emty lines   */
 <*>[ \t]+		/*   Ignore spaces       */
 include[ \t]*:		BEGIN(incl);
@@ -157,6 +158,8 @@ include[ \t]*:		BEGIN(incl);
 			}
 			name_stack[include_stack_ptr-1] =
 					new String(ParsedFilename.get());
+			lineno_stack[include_stack_ptr-1] = yylineno;
+			yylineno = 1;
 		        yy_switch_to_buffer( yy_create_buffer( yyin, YY_BUF_SIZE ) );
 
 		        BEGIN(INITIAL);
@@ -164,10 +167,18 @@ include[ \t]*:		BEGIN(incl);
 
 <<EOF>> 		{
 		        if ( include_stack_ptr <= 0 )
+			    {
+			    static int termnext = 0;
+			    // fix to allow unterminated final line
+			    if (++termnext <= 1)
+				return(T_NEWLINE);
+			    termnext = 0;	// in case we're called again
 		            yyterminate();
+			    }
 		        else
 		            {
 			    delete name_stack[include_stack_ptr-1];
+			    yylineno = lineno_stack[include_stack_ptr-1];
 		            yy_delete_buffer( YY_CURRENT_BUFFER );
 		            yy_switch_to_buffer(
 		                 include_stack[--include_stack_ptr] );
@@ -183,7 +194,13 @@ include[ \t]*:		BEGIN(incl);
 
 \n			
 <*>.|\n		{ 
-	fprintf(stderr,"Unknown char in line %d: %s",yylineno,yytext);
-	// exit(1); // Seems to harsh!
+	HtConfiguration* config= HtConfiguration::config();
+	String str;
+	if (include_stack_ptr > 0)
+	    str = *name_stack[include_stack_ptr-1];
+	else	// still at top level config
+	    str = config->getFileName();
+	fprintf(stderr,"Unknown char in file %s line %d: %s\n",str.get(),yylineno,yytext);
+	// exit(1); // Seems too harsh!
 	}
 %%
--- htcommon/conf_lexer.cxx.orig	2003-11-10 19:27:33.000000000 -0600
+++ htcommon/conf_lexer.cxx	2004-04-22 15:47:52.000000000 -0500
@@ -9,7 +9,8 @@
 #define YY_FLEX_MINOR_VERSION 5
 
 #include <stdio.h>
-#include <errno.h>
+#include <unistd.h>
+
 
 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
 #ifdef c_plusplus
@@ -22,9 +23,6 @@
 #ifdef __cplusplus
 
 #include <stdlib.h>
-#ifndef _WIN32
-#include <unistd.h>
-#endif
 
 /* Use prototypes in function declarations. */
 #define YY_USE_PROTOS
@@ -64,7 +62,6 @@
 #define YY_PROTO(proto) ()
 #endif
 
-
 /* Returned upon end-of-file. */
 #define YY_NULL 0
 
@@ -309,15 +306,15 @@ static yyconst short int yy_acclist[100]
 
     } ;
 
-static yyconst short int yy_accept[63] =
+static yyconst short int yy_accept[64] =
     {   0,
         1,    1,    1,    2,    3,    3,    3,    3,    3,    3,
         3,    4,    6,    9,   12,   15,   18,   21,   24,   28,
        33,   36,   38,   42,   45,   48,   51,   55,   58,   61,
        64,   67,   70,   71,   72,   73,   75,   77,   78,   78,
-       79,   81,   82,   83,   83,   84,   85,   87,   88,   89,
-       90,   91,   92,   93,   95,   96,   97,   98,   99,   99,
-      100,  100
+       78,   79,   81,   82,   83,   83,   84,   85,   87,   88,
+       89,   90,   91,   92,   93,   95,   96,   97,   98,   99,
+       99,  100,  100
     } ;
 
 static yyconst int yy_ec[256] =
@@ -359,80 +356,82 @@ static yyconst int yy_meta[22] =
         5
     } ;
 
-static yyconst short int yy_base[72] =
+static yyconst short int yy_base[73] =
     {   0,
         0,   20,   27,   41,   55,   59,   61,    0,   78,   89,
-      112,  177,  109,  177,  177,  177,    0,   90,   35,   49,
-       63,  106,  106,  177,   93,  101,   26,   68,    0,  177,
-      177,    0,  104,    0,   84,   72,   81,   84,   95,  177,
-       95,   82,   90,   89,  115,   91,   40,  177,    0,    0,
-       58,  177,   62,    0,   27,   30,   15,   24,   68,  177,
-      177,  129,  135,  141,   20,  147,  150,  156,  159,  165,
-      170
+       87,  183,   84,  183,  183,  183,    0,   65,  100,   82,
+        0,   80,   80,  183,   64,  107,   23,   32,    0,  183,
+      183,    0,   75,    0,   61,    0,    0,    0,   72,   68,
+      183,   68,   54,   35,   61,  121,   62,   25,  183,    0,
+        0,   35,  183,   47,    0,   31,   35,    9,   38,   64,
+      183,  183,  135,  141,  147,   20,  153,  156,  162,  165,
+      171,  176
     } ;
 
-static yyconst short int yy_def[72] =
+static yyconst short int yy_def[73] =
     {   0,
-       61,    1,   62,   62,   63,   63,    1,    7,   64,   64,
-       61,   61,   61,   61,   61,   61,   65,   65,   61,   61,
-       61,   66,   61,   61,   67,   68,   67,   67,   69,   61,
-       61,   70,   61,   65,   65,   61,   61,   61,   66,   61,
-       61,   67,   67,   71,   68,   45,   67,   61,   69,   70,
-       65,   61,   71,   45,   65,   65,   65,   65,   61,   61,
-        0,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-       61
+       62,    1,   63,   63,   64,   64,    1,    7,   65,   65,
+       62,   62,   62,   62,   62,   62,   66,   66,   62,   19,
+       20,   67,   62,   62,   68,   69,   68,   68,   70,   62,
+       62,   71,   62,   66,   66,   19,   20,   20,   67,   67,
+       62,   62,   68,   68,   72,   69,   46,   68,   62,   70,
+       71,   66,   62,   72,   46,   66,   66,   66,   66,   62,
+       62,    0,   62,   62,   62,   62,   62,   62,   62,   62,
+       62,   62
     } ;
 
-static yyconst short int yy_nxt[199] =
+static yyconst short int yy_nxt[205] =
     {   0,
        12,   13,   14,   12,   12,   12,   12,   12,   12,   15,
        16,   12,   17,   12,   17,   17,   17,   18,   17,   17,
        17,   19,   20,   21,   34,   59,   22,   12,   23,   24,
-       12,   58,   26,   60,   47,   27,   36,   37,   38,   43,
-       28,   12,   23,   24,   12,   57,   26,   56,   47,   27,
-       38,   37,   38,   43,   28,   12,   13,   12,   12,   12,
-       13,   12,   12,   24,   38,   37,   38,   53,   30,   59,
-       48,   12,   31,   36,   37,   38,   55,   60,   17,   13,
-       12,   43,   38,   37,   38,   38,   37,   38,   12,   12,
-       13,   12,   52,   52,   53,   43,   41,   40,   51,   12,
-
-       12,   44,   44,   43,   44,   33,   43,   41,   40,   35,
-       33,   61,   61,   61,   46,   44,   44,   61,   44,   61,
-       54,   61,   61,   61,   61,   61,   61,   61,   46,   25,
-       25,   25,   25,   25,   25,   29,   29,   29,   29,   29,
-       29,   32,   32,   32,   32,   32,   32,   39,   39,   39,
-       39,   39,   39,   42,   42,   42,   45,   45,   61,   45,
-       45,   45,   49,   49,   49,   50,   61,   61,   50,   50,
-       44,   44,   61,   44,   44,   44,   11,   61,   61,   61,
-       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-       61,   61,   61,   61,   61,   61,   61,   61
+       12,   48,   26,   48,   49,   27,   44,   53,   44,   60,
+       28,   12,   23,   24,   12,   44,   26,   61,   44,   27,
+       58,   57,   54,   56,   28,   12,   13,   12,   12,   12,
+       13,   12,   12,   24,   53,   60,   54,   44,   30,   42,
+       41,   12,   31,   61,   41,   52,   33,   44,   17,   13,
+       12,   42,   41,   38,   35,   33,   62,   62,   12,   12,
+       13,   12,   62,   62,   62,   62,   62,   62,   62,   12,
+
+       12,   36,   37,   38,   62,   62,   39,   45,   45,   62,
+       45,   62,   62,   62,   62,   62,   62,   62,   62,   62,
+       47,   45,   45,   62,   45,   62,   55,   62,   62,   62,
+       62,   62,   62,   62,   47,   25,   25,   25,   25,   25,
+       25,   29,   29,   29,   29,   29,   29,   32,   32,   32,
+       32,   32,   32,   40,   40,   40,   40,   40,   40,   43,
+       43,   43,   46,   46,   62,   46,   46,   46,   50,   50,
+       50,   51,   62,   62,   51,   51,   45,   45,   62,   45,
+       45,   45,   11,   62,   62,   62,   62,   62,   62,   62,
+       62,   62,   62,   62,   62,   62,   62,   62,   62,   62,
 
+       62,   62,   62,   62
     } ;
 
-static yyconst short int yy_chk[199] =
+static yyconst short int yy_chk[205] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2,    2,    2,   65,   58,    2,    3,    3,    3,
-        3,   57,    3,   58,   27,    3,   19,   19,   19,   27,
-        3,    4,    4,    4,    4,   56,    4,   55,   47,    4,
-       20,   20,   20,   47,    4,    5,    5,    5,    5,    6,
-        6,    6,    6,    7,   21,   21,   21,   53,    7,   59,
-       28,    7,    7,   36,   36,   36,   51,   59,    7,    9,
-        9,   28,   37,   37,   37,   38,   38,   38,    9,    9,
-       10,   10,   43,   46,   44,   42,   41,   39,   35,   10,
-
-       10,   26,   26,   43,   26,   33,   25,   23,   22,   18,
-       13,   11,    0,    0,   26,   45,   45,    0,   45,    0,
-       45,    0,    0,    0,    0,    0,    0,    0,   45,   62,
-       62,   62,   62,   62,   62,   63,   63,   63,   63,   63,
-       63,   64,   64,   64,   64,   64,   64,   66,   66,   66,
-       66,   66,   66,   67,   67,   67,   68,   68,    0,   68,
-       68,   68,   69,   69,   69,   70,    0,    0,   70,   70,
-       71,   71,    0,   71,   71,   71,   61,   61,   61,   61,
-       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-       61,   61,   61,   61,   61,   61,   61,   61
+        1,    2,    2,    2,   66,   58,    2,    3,    3,    3,
+        3,   27,    3,   48,   28,    3,   27,   44,   48,   59,
+        3,    4,    4,    4,    4,   28,    4,   59,   44,    4,
+       57,   56,   54,   52,    4,    5,    5,    5,    5,    6,
+        6,    6,    6,    7,   47,   60,   45,   43,    7,   42,
+       40,    7,    7,   60,   39,   35,   33,   25,    7,    9,
+        9,   23,   22,   20,   18,   13,   11,    0,    9,    9,
+       10,   10,    0,    0,    0,    0,    0,    0,    0,   10,
+
+       10,   19,   19,   19,    0,    0,   19,   26,   26,    0,
+       26,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       26,   46,   46,    0,   46,    0,   46,    0,    0,    0,
+        0,    0,    0,    0,   46,   63,   63,   63,   63,   63,
+       63,   64,   64,   64,   64,   64,   64,   65,   65,   65,
+       65,   65,   65,   67,   67,   67,   67,   67,   67,   68,
+       68,   68,   69,   69,    0,   69,   69,   69,   70,   70,
+       70,   71,    0,    0,   71,   71,   72,   72,    0,   72,
+       72,   72,   62,   62,   62,   62,   62,   62,   62,   62,
+       62,   62,   62,   62,   62,   62,   62,   62,   62,   62,
 
+       62,   62,   62,   62
     } ;
 
 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
@@ -492,6 +491,7 @@ char *yytext;
 #define MAX_INCLUDE_DEPTH 10
 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
 String *name_stack[MAX_INCLUDE_DEPTH];
+int lineno_stack[MAX_INCLUDE_DEPTH];
 int include_stack_ptr = 0;
 
 /* Macros after this point can all be overridden by user definitions in
@@ -592,20 +592,9 @@ YY_MALLOC_DECL
 			YY_FATAL_ERROR( "input in flex scanner failed" ); \
 		result = n; \
 		} \
-	else \
-		{ \
-		errno=0; \
-		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
-			{ \
-			if( errno != EINTR) \
-				{ \
-				YY_FATAL_ERROR( "input in flex scanner failed" ); \
-				break; \
-				} \
-			errno=0; \
-			clearerr(yyin); \
-			} \
-		}
+	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+		  && ferror( yyin ) ) \
+		YY_FATAL_ERROR( "input in flex scanner failed" );
 #endif
 
 /* No semi-colon after return; correct usage is to write "yyterminate();" -
@@ -654,7 +643,7 @@ YY_MALLOC_DECL
 YY_DECL
 	{
 	register yy_state_type yy_current_state;
-	register char *yy_cp, *yy_bp;
+	register char *yy_cp = NULL, *yy_bp = NULL;
 	register int yy_act;
 
 
@@ -707,14 +696,14 @@ yy_match:
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 62 )
+				if ( yy_current_state >= 63 )
 					yy_c = yy_meta[(unsigned int) yy_c];
 				}
 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 			*yy_state_ptr++ = yy_current_state;
 			++yy_cp;
 			}
-		while ( yy_base[yy_current_state] != 177 );
+		while ( yy_base[yy_current_state] != 183 );
 
 yy_find_action:
 		yy_current_state = *--yy_state_ptr;
@@ -902,6 +891,8 @@ YY_RULE_SETUP
 			}
 			name_stack[include_stack_ptr-1] =
 					new String(ParsedFilename.get());
+			lineno_stack[include_stack_ptr-1] = yylineno;
+			yylineno = 1;
 		        yy_switch_to_buffer( yy_create_buffer( yyin, YY_BUF_SIZE ) );
 
 		        BEGIN(INITIAL);
@@ -914,10 +905,18 @@ case YY_STATE_EOF(bracket):
 case YY_STATE_EOF(br_string):
 {
 		        if ( include_stack_ptr <= 0 )
+			    {
+			    static int termnext = 0;
+			    // fix to allow unterminated final line
+			    if (++termnext <= 1)
+				return(T_NEWLINE);
+			    termnext = 0;	// in case we're called again
 		            yyterminate();
+			    }
 		        else
 		            {
 			    delete name_stack[include_stack_ptr-1];
+			    yylineno = lineno_stack[include_stack_ptr-1];
 		            yy_delete_buffer( YY_CURRENT_BUFFER );
 		            yy_switch_to_buffer(
 		                 include_stack[--include_stack_ptr] );
@@ -942,8 +941,14 @@ YY_RULE_SETUP
 case 21:
 YY_RULE_SETUP
 { 
-	fprintf(stderr,"Unknown char in line %d: %s",yylineno,yytext);
-	// exit(1); // Seems to harsh!
+	HtConfiguration* config= HtConfiguration::config();
+	String str;
+	if (include_stack_ptr > 0)
+	    str = *name_stack[include_stack_ptr-1];
+	else	// still at top level config
+	    str = config->getFileName();
+	fprintf(stderr,"Unknown char in file %s line %d: %s\n",str.get(),yylineno,yytext);
+	// exit(1); // Seems too harsh!
 	}
 	YY_BREAK
 case 22:
@@ -1237,7 +1242,7 @@ static yy_state_type yy_get_previous_sta
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 			{
 			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 62 )
+			if ( yy_current_state >= 63 )
 				yy_c = yy_meta[(unsigned int) yy_c];
 			}
 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1267,11 +1272,11 @@ yy_state_type yy_current_state;
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 		{
 		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 62 )
+		if ( yy_current_state >= 63 )
 			yy_c = yy_meta[(unsigned int) yy_c];
 		}
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 61);
+	yy_is_jam = (yy_current_state == 62);
 	if ( ! yy_is_jam )
 		*yy_state_ptr++ = yy_current_state;
 
@@ -1326,6 +1331,7 @@ register char *yy_bp;
 #endif	/* ifndef YY_NO_UNPUT */
 
 
+#ifndef YY_NO_INPUT
 #ifdef __cplusplus
 static int yyinput()
 #else
@@ -1400,7 +1406,7 @@ static int input()
 
 	return c;
 	}
-
+#endif /* YY_NO_INPUT */
 
 #ifdef YY_USE_PROTOS
 void yyrestart( FILE *input_file )
@@ -1511,15 +1517,6 @@ YY_BUFFER_STATE b;
 	}
 
 
-#ifndef _WIN32
-#include <unistd.h>
-#else
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
-#endif
 
 #ifdef YY_USE_PROTOS
 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
--- htcommon/conf_parser.yxx.orig	2003-07-21 03:16:10.000000000 -0500
+++ htcommon/conf_parser.yxx	2004-04-22 15:48:54.000000000 -0500
@@ -84,6 +84,7 @@ block:        simple_expression		{   
           //    ... : ...
           // </server>
 	}
+        | T_NEWLINE	{ /* Ignore empty lines */  }
 ;
 
 simple_expression:      T_KEYWORD T_DELIMITER T_STRING T_NEWLINE	{ 
@@ -116,7 +117,6 @@ simple_expression:      T_KEYWORD T_DELI
 				    $$->value=new char[1];
 				    *$$->value='\0';
 					}
-        | T_NEWLINE	{ /* Ignore empty lines */  }
 ;
 
 complex_expression:	T_LEFT_BR T_KEYWORD T_DELIMITER T_STRING T_RIGHT_BR T_NEWLINE simple_expression_list T_LEFT_BR T_SLASH T_KEYWORD T_RIGHT_BR T_NEWLINE {
@@ -170,6 +170,7 @@ simple_expression_list:   simple_express
 				delete $2;
 				//$$=$1; //I think $$==$1
 			}
+			| T_NEWLINE	{ /* Ignore empty lines */  }
                       ;
 
 list:	  T_STRING T_STRING			{ 
@@ -253,8 +254,17 @@ list:	  T_STRING T_STRING			{ 
 int
 yyerror (char *s)  /* Called by yyparse on error */
 {
-extern int yylineno;	// I don't know what about included files
-   printf ("%s\nIn line %d\n",s,yylineno);
+extern int yylineno;
+extern int include_stack_ptr;
+extern String *name_stack[];
+   HtConfiguration* config= HtConfiguration::config();
+   String str;
+   if (include_stack_ptr > 0)
+	str = *name_stack[include_stack_ptr-1];
+   else	// still at top level config
+	str = config->getFileName();
+   //printf ("%s\nIn line %d\n",s,yylineno);
+   fprintf(stderr,"Error in file %s line %d: %s\n",str.get(),yylineno,s);
    // exit(1);
    return -1;
 }
--- htcommon/conf_parser.cxx.orig	2003-11-10 19:27:33.000000000 -0600
+++ htcommon/conf_parser.cxx	2004-04-22 15:48:56.000000000 -0500
@@ -1,83 +1,17 @@
-/* A Bison parser, made by GNU Bison 1.875a.  */
+/* A Bison parser, made from conf_parser.yxx
+   by GNU bison 1.35.  */
 
-/* Skeleton parser for Yacc-like parsing with Bison,
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+#define YYBISON 1  /* Identify Bison output.  */
 
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
-
-/* Written by Richard Stallman by simplifying the original so called
-   ``semantic'' parser.  */
-
-/* All symbols defined below should begin with yy or YY, to avoid
-   infringing on user name space.  This should be done even for local
-   variables, as they might otherwise be expanded by user macros.
-   There are some unavoidable exceptions within include files to
-   define necessary library symbols; they are noted "INFRINGES ON
-   USER NAME SPACE" below.  */
-
-/* Identify Bison output.  */
-#define YYBISON 1
-
-/* Skeleton name.  */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers.  */
-#define YYPURE 0
-
-/* Using locations.  */
-#define YYLSP_NEEDED 0
-
-
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     NUM = 258,
-     T_DELIMITER = 259,
-     T_NEWLINE = 260,
-     T_RIGHT_BR = 261,
-     T_LEFT_BR = 262,
-     T_SLASH = 263,
-     T_STRING = 264,
-     T_KEYWORD = 265,
-     T_NUMBER = 266
-   };
-#endif
-#define NUM 258
-#define T_DELIMITER 259
-#define T_NEWLINE 260
-#define T_RIGHT_BR 261
-#define T_LEFT_BR 262
-#define T_SLASH 263
-#define T_STRING 264
-#define T_KEYWORD 265
-#define T_NUMBER 266
-
-
-
-
-/* Copy the first part of user declarations.  */
+# define	NUM	257
+# define	T_DELIMITER	258
+# define	T_NEWLINE	259
+# define	T_RIGHT_BR	260
+# define	T_LEFT_BR	261
+# define	T_SLASH	262
+# define	T_STRING	263
+# define	T_KEYWORD	264
+# define	T_NUMBER	265
 
 
 //
@@ -127,43 +61,203 @@ int yylex(void);  
 int sn_debug=3;
 #endif
 
-
-/* Enabling traces.  */
+#ifndef YYSTYPE
+typedef union {
+	char *str;
+	ConfigDefaults	*ConfLine;
+	HtConfiguration	*ConfLines;
+} yystype;
+# define YYSTYPE yystype
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
 #ifndef YYDEBUG
 # define YYDEBUG 0
 #endif
 
-/* Enabling verbose error messages.  */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
+
+
+#define	YYFINAL		37
+#define	YYFLAG		-32768
+#define	YYNTBASE	12
+
+/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
+#define YYTRANSLATE(x) ((unsigned)(x) <= 265 ? yytranslate[x] : 18)
+
+/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
+static const char yytranslate[] =
+{
+       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     1,     3,     4,     5,
+       6,     7,     8,     9,    10,    11
+};
+
+#if YYDEBUG
+static const short yyprhs[] =
+{
+       0,     0,     1,     4,     6,     8,    10,    15,    20,    25,
+      29,    42,    44,    47,    49,    52,    55,    58,    61,    64
+};
+static const short yyrhs[] =
+{
+      -1,    12,    13,     0,    14,     0,    15,     0,     5,     0,
+      10,     4,     9,     5,     0,    10,     4,    11,     5,     0,
+      10,     4,    17,     5,     0,    10,     4,     5,     0,     7,
+      10,     4,     9,     6,     5,    16,     7,     8,    10,     6,
+       5,     0,    14,     0,    16,    14,     0,     5,     0,     9,
+       9,     0,    11,     9,     0,     9,    11,     0,    11,    11,
+       0,    17,     9,     0,    17,    11,     0
+};
+
+#endif
+
+#if YYDEBUG
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+static const short yyrline[] =
+{
+       0,    65,    66,    69,    81,    87,    90,   100,   106,   112,
+     122,   143,   161,   173,   176,   189,   202,   215,   228,   240
+};
 #endif
 
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
 
-typedef union YYSTYPE {
-	char *str;
-	ConfigDefaults	*ConfLine;
-	HtConfiguration	*ConfLines;
-} YYSTYPE;
-/* Line 191 of yacc.c.  */
+#if (YYDEBUG) || defined YYERROR_VERBOSE
 
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
+/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
+static const char *const yytname[] =
+{
+  "$", "error", "$undefined.", "NUM", "T_DELIMITER", "T_NEWLINE", 
+  "T_RIGHT_BR", "T_LEFT_BR", "T_SLASH", "T_STRING", "T_KEYWORD", 
+  "T_NUMBER", "input", "block", "simple_expression", "complex_expression", 
+  "simple_expression_list", "list", 0
+};
 #endif
 
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const short yyr1[] =
+{
+       0,    12,    12,    13,    13,    13,    14,    14,    14,    14,
+      15,    16,    16,    16,    17,    17,    17,    17,    17,    17
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+static const short yyr2[] =
+{
+       0,     0,     2,     1,     1,     1,     4,     4,     4,     3,
+      12,     1,     2,     1,     2,     2,     2,     2,     2,     2
+};
+
+/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
+   doesn't specify something else to do.  Zero means the default is an
+   error. */
+static const short yydefact[] =
+{
+       1,     0,     5,     0,     0,     2,     3,     4,     0,     0,
+       0,     9,     0,     0,     0,     0,     6,    14,    16,     7,
+      15,    17,     8,    18,    19,     0,     0,    13,    11,     0,
+       0,    12,     0,     0,     0,    10,     0,     0
+};
+
+static const short yydefgoto[] =
+{
+       1,     5,     6,     7,    29,    14
+};
+
+static const short yypact[] =
+{
+  -32768,     0,-32768,    -7,    16,-32768,-32768,-32768,    20,    -3,
+       2,-32768,     4,     7,    12,    21,-32768,-32768,-32768,-32768,
+  -32768,-32768,-32768,-32768,-32768,    23,     9,-32768,-32768,    -6,
+      18,-32768,    19,    24,    26,-32768,    32,-32768
+};
+
+static const short yypgoto[] =
+{
+  -32768,-32768,    -4,-32768,-32768,-32768
+};
+
+
+#define	YYLAST		32
+
+
+static const short yytable[] =
+{
+      36,    30,    11,     8,     4,     2,    12,     3,    13,    16,
+       4,    15,    19,    17,    27,    18,    20,    22,    21,     4,
+       9,    23,    28,    24,    10,    31,    32,    25,    26,    33,
+      34,    35,    37
+};
+
+static const short yycheck[] =
+{
+       0,     7,     5,    10,    10,     5,     9,     7,    11,     5,
+      10,     9,     5,     9,     5,    11,     9,     5,    11,    10,
+       4,     9,    26,    11,     4,    29,     8,     6,     5,    10,
+       6,     5,     0
+};
+/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
 
+/* Skeleton output parser for bison,
 
-/* Copy the second part of user declarations.  */
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
+   Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
-/* Line 214 of yacc.c.  */
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
 
+/* This is the parser code that is written into each bison parser when
+   the %semantic_parser declaration is not specified in the grammar.
+   It was written by Richard Stallman by simplifying the hairy parser
+   used when %semantic_parser is specified.  */
 
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
 
@@ -192,28 +286,37 @@ typedef union YYSTYPE {
 #  define YYSTACK_ALLOC malloc
 #  define YYSTACK_FREE free
 # endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
 
 
 #if (! defined (yyoverflow) \
      && (! defined (__cplusplus) \
-	 || (YYSTYPE_IS_TRIVIAL)))
+	 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
 {
   short yyss;
   YYSTYPE yyvs;
-  };
+# if YYLSP_NEEDED
+  YYLTYPE yyls;
+# endif
+};
 
 /* The size of the maximum gap between one aligned stack and the next.  */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
 
 /* The size of an array large to enough to hold all stacks, each with
    N elements.  */
-# define YYSTACK_BYTES(N) \
+# if YYLSP_NEEDED
+#  define YYSTACK_BYTES(N) \
+     ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE))	\
+      + 2 * YYSTACK_GAP_MAX)
+# else
+#  define YYSTACK_BYTES(N) \
      ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
-      + YYSTACK_GAP_MAXIMUM)
+      + YYSTACK_GAP_MAX)
+# endif
 
 /* Copy COUNT objects from FROM to TO.  The source and destination do
    not overlap.  */
@@ -244,201 +347,13 @@ union yyalloc
 	YYSIZE_T yynewbytes;						\
 	YYCOPY (&yyptr->Stack, Stack, yysize);				\
 	Stack = &yyptr->Stack;						\
-	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;	\
 	yyptr += yynewbytes / sizeof (*yyptr);				\
       }									\
     while (0)
 
 #endif
 
-#if defined (__STDC__) || defined (__cplusplus)
-   typedef signed char yysigned_char;
-#else
-   typedef short yysigned_char;
-#endif
-
-/* YYFINAL -- State number of the termination state. */
-#define YYFINAL  2
-/* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   33
-
-/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS  12
-/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS  7
-/* YYNRULES -- Number of rules. */
-#define YYNRULES  19
-/* YYNRULES -- Number of states. */
-#define YYNSTATES  36
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
-#define YYUNDEFTOK  2
-#define YYMAXUTOK   266
-
-#define YYTRANSLATE(YYX) 						\
-  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
-static const unsigned char yytranslate[] =
-{
-       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
-       5,     6,     7,     8,     9,    10,    11
-};
-
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
-   YYRHS.  */
-static const unsigned char yyprhs[] =
-{
-       0,     0,     3,     4,     7,     9,    11,    16,    21,    26,
-      30,    32,    45,    47,    50,    53,    56,    59,    62,    65
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
-{
-      13,     0,    -1,    -1,    13,    14,    -1,    15,    -1,    16,
-      -1,    10,     4,     9,     5,    -1,    10,     4,    11,     5,
-      -1,    10,     4,    18,     5,    -1,    10,     4,     5,    -1,
-       5,    -1,     7,    10,     4,     9,     6,     5,    17,     7,
-       8,    10,     6,     5,    -1,    15,    -1,    17,    15,    -1,
-       9,     9,    -1,    11,     9,    -1,     9,    11,    -1,    11,
-      11,    -1,    18,     9,    -1,    18,    11,    -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
-static const unsigned char yyrline[] =
-{
-       0,    65,    65,    66,    69,    81,    89,    99,   105,   111,
-     119,   122,   143,   161,   175,   188,   201,   214,   227,   239
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE
-/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
-static const char *const yytname[] =
-{
-  "$end", "error", "$undefined", "NUM", "T_DELIMITER", "T_NEWLINE", 
-  "T_RIGHT_BR", "T_LEFT_BR", "T_SLASH", "T_STRING", "T_KEYWORD", 
-  "T_NUMBER", "$accept", "input", "block", "simple_expression", 
-  "complex_expression", "simple_expression_list", "list", 0
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
-   token YYLEX-NUM.  */
-static const unsigned short yytoknum[] =
-{
-       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
-     265,   266
-};
-# endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const unsigned char yyr1[] =
-{
-       0,    12,    13,    13,    14,    14,    15,    15,    15,    15,
-      15,    16,    17,    17,    18,    18,    18,    18,    18,    18
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const unsigned char yyr2[] =
-{
-       0,     2,     0,     2,     1,     1,     4,     4,     4,     3,
-       1,    12,     1,     2,     2,     2,     2,     2,     2,     2
-};
-
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
-   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
-   means the default is an error.  */
-static const unsigned char yydefact[] =
-{
-       2,     0,     1,    10,     0,     0,     3,     4,     5,     0,
-       0,     0,     9,     0,     0,     0,     0,     6,    14,    16,
-       7,    15,    17,     8,    18,    19,     0,     0,    12,     0,
-       0,    13,     0,     0,     0,    11
-};
-
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
-{
-      -1,     1,     6,     7,     8,    29,    15
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-   STATE-NUM.  */
-#define YYPACT_NINF -27
-static const yysigned_char yypact[] =
-{
-     -27,     0,   -27,   -27,    -6,    20,   -27,   -27,   -27,    22,
-      -3,     2,   -27,     4,     7,    12,    21,   -27,   -27,   -27,
-     -27,   -27,   -27,   -27,   -27,   -27,    23,     9,   -27,    15,
-      24,   -27,    19,    25,    28,   -27
-};
-
-/* YYPGOTO[NTERM-NUM].  */
-static const yysigned_char yypgoto[] =
-{
-     -27,   -27,   -27,   -26,   -27,   -27,   -27
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
-   positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If zero, do what YYDEFACT says.
-   If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -1
-static const unsigned char yytable[] =
-{
-       2,    28,    12,    31,     9,     3,    13,     4,    14,    17,
-       5,    16,    20,    18,     3,    19,    21,    23,    22,     5,
-       3,    24,    30,    25,    10,     5,    11,    26,    27,    33,
-       0,    34,    32,    35
-};
-
-static const yysigned_char yycheck[] =
-{
-       0,    27,     5,    29,    10,     5,     9,     7,    11,     5,
-      10,     9,     5,     9,     5,    11,     9,     5,    11,    10,
-       5,     9,     7,    11,     4,    10,     4,     6,     5,    10,
-      -1,     6,     8,     5
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-   symbol of state STATE-NUM.  */
-static const unsigned char yystos[] =
-{
-       0,    13,     0,     5,     7,    10,    14,    15,    16,    10,
-       4,     4,     5,     9,    11,    18,     9,     5,     9,    11,
-       5,     9,    11,     5,     9,    11,     6,     5,    15,    17,
-       7,    15,     8,    10,     6,     5
-};
 
 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
 # define YYSIZE_T __SIZE_TYPE__
@@ -458,35 +373,29 @@ static const unsigned char yystos[] =
 
 #define yyerrok		(yyerrstatus = 0)
 #define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		(-2)
+#define YYEMPTY		-2
 #define YYEOF		0
-
 #define YYACCEPT	goto yyacceptlab
-#define YYABORT		goto yyabortlab
+#define YYABORT 	goto yyabortlab
 #define YYERROR		goto yyerrlab1
-
-
 /* Like YYERROR except do call yyerror.  This remains here temporarily
    to ease the transition to the new meaning of YYERROR, for GCC.
    Once GCC version 2 has supplanted version 1, this can go.  */
-
 #define YYFAIL		goto yyerrlab
-
 #define YYRECOVERING()  (!!yyerrstatus)
-
 #define YYBACKUP(Token, Value)					\
 do								\
   if (yychar == YYEMPTY && yylen == 1)				\
     {								\
       yychar = (Token);						\
       yylval = (Value);						\
-      yytoken = YYTRANSLATE (yychar);				\
+      yychar1 = YYTRANSLATE (yychar);				\
       YYPOPSTACK;						\
       goto yybackup;						\
     }								\
   else								\
     { 								\
-      yyerror ("syntax error: cannot back up");\
+      yyerror ("syntax error: cannot back up");			\
       YYERROR;							\
     }								\
 while (0)
@@ -494,24 +403,41 @@ while (0)
 #define YYTERROR	1
 #define YYERRCODE	256
 
+
 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
-   are run).  */
+   are run).
+
+   When YYLLOC_DEFAULT is run, CURRENT is set the location of the
+   first token.  By default, to implement support for ranges, extend
+   its range to the last symbol.  */
 
 #ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N)         \
-  Current.first_line   = Rhs[1].first_line;      \
-  Current.first_column = Rhs[1].first_column;    \
-  Current.last_line    = Rhs[N].last_line;       \
-  Current.last_column  = Rhs[N].last_column;
+# define YYLLOC_DEFAULT(Current, Rhs, N)       	\
+   Current.last_line   = Rhs[N].last_line;	\
+   Current.last_column = Rhs[N].last_column;
 #endif
 
+
 /* YYLEX -- calling `yylex' with the right arguments.  */
 
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (YYLEX_PARAM)
-#else
-# define YYLEX yylex ()
-#endif
+#if YYPURE
+# if YYLSP_NEEDED
+#  ifdef YYLEX_PARAM
+#   define YYLEX		yylex (&yylval, &yylloc, YYLEX_PARAM)
+#  else
+#   define YYLEX		yylex (&yylval, &yylloc)
+#  endif
+# else /* !YYLSP_NEEDED */
+#  ifdef YYLEX_PARAM
+#   define YYLEX		yylex (&yylval, YYLEX_PARAM)
+#  else
+#   define YYLEX		yylex (&yylval)
+#  endif
+# endif /* !YYLSP_NEEDED */
+#else /* !YYPURE */
+# define YYLEX			yylex ()
+#endif /* !YYPURE */
+
 
 /* Enable debugging if requested.  */
 #if YYDEBUG
@@ -526,93 +452,13 @@ do {						\
   if (yydebug)					\
     YYFPRINTF Args;				\
 } while (0)
-
-# define YYDSYMPRINT(Args)			\
-do {						\
-  if (yydebug)					\
-    yysymprint Args;				\
-} while (0)
-
-# define YYDSYMPRINTF(Title, Token, Value, Location)		\
-do {								\
-  if (yydebug)							\
-    {								\
-      YYFPRINTF (stderr, "%s ", Title);				\
-      yysymprint (stderr, 					\
-                  Token, Value);	\
-      YYFPRINTF (stderr, "\n");					\
-    }								\
-} while (0)
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (cinluded).                                                   |
-`------------------------------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yy_stack_print (short *bottom, short *top)
-#else
-static void
-yy_stack_print (bottom, top)
-    short *bottom;
-    short *top;
-#endif
-{
-  YYFPRINTF (stderr, "Stack now");
-  for (/* Nothing. */; bottom <= top; ++bottom)
-    YYFPRINTF (stderr, " %d", *bottom);
-  YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top)				\
-do {								\
-  if (yydebug)							\
-    yy_stack_print ((Bottom), (Top));				\
-} while (0)
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced.  |
-`------------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yy_reduce_print (int yyrule)
-#else
-static void
-yy_reduce_print (yyrule)
-    int yyrule;
-#endif
-{
-  int yyi;
-  unsigned int yylineno = yyrline[yyrule];
-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
-             yyrule - 1, yylineno);
-  /* Print the symbols being reduced, and their result.  */
-  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
-    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
-  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
-}
-
-# define YY_REDUCE_PRINT(Rule)		\
-do {					\
-  if (yydebug)				\
-    yy_reduce_print (Rule);		\
-} while (0)
-
 /* Nonzero means print parse trace.  It is left uninitialized so that
    multiple parsers can coexist.  */
 int yydebug;
 #else /* !YYDEBUG */
 # define YYDPRINTF(Args)
-# define YYDSYMPRINT(Args)
-# define YYDSYMPRINTF(Title, Token, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
 #endif /* !YYDEBUG */
 
-
 /* YYINITDEPTH -- initial size of the parser's stacks.  */
 #ifndef	YYINITDEPTH
 # define YYINITDEPTH 200
@@ -632,10 +478,8 @@ int yydebug;
 #ifndef YYMAXDEPTH
 # define YYMAXDEPTH 10000
 #endif
-
 
-
-#if YYERROR_VERBOSE
+#ifdef YYERROR_VERBOSE
 
 # ifndef yystrlen
 #  if defined (__GLIBC__) && defined (_STRING_H)
@@ -685,134 +529,85 @@ yystpcpy (yydest, yysrc)
 }
 #  endif
 # endif
-
-#endif /* !YYERROR_VERBOSE */
-
-
-
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE *yyvaluep;
 #endif
-{
-  /* Pacify ``unused variable'' warnings.  */
-  (void) yyvaluep;
-
-  if (yytype < YYNTOKENS)
-    {
-      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-# ifdef YYPRINT
-      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
-    }
-  else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
-  switch (yytype)
-    {
-      default:
-        break;
-    }
-  YYFPRINTF (yyoutput, ")");
-}
-
-#endif /* ! YYDEBUG */
-/*-----------------------------------------------.
-| Release the memory associated to this symbol.  |
-`-----------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yydestruct (int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yydestruct (yytype, yyvaluep)
-    int yytype;
-    YYSTYPE *yyvaluep;
-#endif
-{
-  /* Pacify ``unused variable'' warnings.  */
-  (void) yyvaluep;
-
-  switch (yytype)
-    {
-
-      default:
-        break;
-    }
-}
 
 
-/* Prevent warnings from -Wmissing-prototypes.  */
+
+/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+   into yyparse.  The argument should have type void *.
+   It should actually point to an object.
+   Grammar actions can access the variable by casting it
+   to the proper pointer type.  */
 
 #ifdef YYPARSE_PARAM
 # if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM);
+#  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+#  define YYPARSE_PARAM_DECL
 # else
-int yyparse ();
+#  define YYPARSE_PARAM_ARG YYPARSE_PARAM
+#  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
 # endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#else /* !YYPARSE_PARAM */
+# define YYPARSE_PARAM_ARG
+# define YYPARSE_PARAM_DECL
+#endif /* !YYPARSE_PARAM */
+
+/* Prevent warning if -Wstrict-prototypes.  */
+#ifdef __GNUC__
+# ifdef YYPARSE_PARAM
+int yyparse (void *);
+# else
 int yyparse (void);
-#else
-int yyparse ();
+# endif
 #endif
-#endif /* ! YYPARSE_PARAM */
-
 
+/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
+   variables are global, or local to YYPARSE.  */
 
-/* The lookahead symbol.  */
-int yychar;
-
-/* The semantic value of the lookahead symbol.  */
-YYSTYPE yylval;
-
-/* Number of syntax errors so far.  */
+#define YY_DECL_NON_LSP_VARIABLES			\
+/* The lookahead symbol.  */				\
+int yychar;						\
+							\
+/* The semantic value of the lookahead symbol. */	\
+YYSTYPE yylval;						\
+							\
+/* Number of parse errors so far.  */			\
 int yynerrs;
 
+#if YYLSP_NEEDED
+# define YY_DECL_VARIABLES			\
+YY_DECL_NON_LSP_VARIABLES			\
+						\
+/* Location data for the lookahead symbol.  */	\
+YYLTYPE yylloc;
+#else
+# define YY_DECL_VARIABLES			\
+YY_DECL_NON_LSP_VARIABLES
+#endif
 
 
-/*----------.
-| yyparse.  |
-`----------*/
+/* If nonreentrant, generate the variables here. */
 
-#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
-  void *YYPARSE_PARAM;
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
-int
-yyparse (void)
-#else
-int
-yyparse ()
+#if !YYPURE
+YY_DECL_VARIABLES
+#endif  /* !YYPURE */
 
-#endif
-#endif
+int
+yyparse (YYPARSE_PARAM_ARG)
+     YYPARSE_PARAM_DECL
 {
-  
+  /* If reentrant, generate the variables here. */
+#if YYPURE
+  YY_DECL_VARIABLES
+#endif  /* !YYPURE */
+
   register int yystate;
   register int yyn;
   int yyresult;
   /* Number of tokens to shift before error messages enabled.  */
   int yyerrstatus;
   /* Lookahead token as an internal (translated) token number.  */
-  int yytoken = 0;
+  int yychar1 = 0;
 
   /* Three stacks and their tools:
      `yyss': related to states,
@@ -822,7 +617,7 @@ yyparse ()
      Refer to the stacks thru separate pointers, to allow yyoverflow
      to reallocate them elsewhere.  */
 
-  /* The state stack.  */
+  /* The state stack. */
   short	yyssa[YYINITDEPTH];
   short *yyss = yyssa;
   register short *yyssp;
@@ -832,19 +627,31 @@ yyparse ()
   YYSTYPE *yyvs = yyvsa;
   register YYSTYPE *yyvsp;
 
+#if YYLSP_NEEDED
+  /* The location stack.  */
+  YYLTYPE yylsa[YYINITDEPTH];
+  YYLTYPE *yyls = yylsa;
+  YYLTYPE *yylsp;
+#endif
 
-
-#define YYPOPSTACK   (yyvsp--, yyssp--)
+#if YYLSP_NEEDED
+# define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
+#else
+# define YYPOPSTACK   (yyvsp--, yyssp--)
+#endif
 
   YYSIZE_T yystacksize = YYINITDEPTH;
 
+
   /* The variables used to return semantic value and location from the
      action routines.  */
   YYSTYPE yyval;
-
+#if YYLSP_NEEDED
+  YYLTYPE yyloc;
+#endif
 
   /* When reducing, the number of symbols on the RHS of the reduced
-     rule.  */
+     rule. */
   int yylen;
 
   YYDPRINTF ((stderr, "Starting parse\n"));
@@ -861,7 +668,9 @@ yyparse ()
 
   yyssp = yyss;
   yyvsp = yyvs;
-
+#if YYLSP_NEEDED
+  yylsp = yyls;
+#endif
   goto yysetstate;
 
 /*------------------------------------------------------------.
@@ -876,7 +685,7 @@ yyparse ()
  yysetstate:
   *yyssp = yystate;
 
-  if (yyss + yystacksize - 1 <= yyssp)
+  if (yyssp >= yyss + yystacksize - 1)
     {
       /* Get the current used size of the three stacks, in elements.  */
       YYSIZE_T yysize = yyssp - yyss + 1;
@@ -889,17 +698,24 @@ yyparse ()
 	YYSTYPE *yyvs1 = yyvs;
 	short *yyss1 = yyss;
 
-
 	/* Each stack pointer address is followed by the size of the
-	   data in use in that stack, in bytes.  This used to be a
-	   conditional around just the two extra args, but that might
-	   be undefined if yyoverflow is a macro.  */
+	   data in use in that stack, in bytes.  */
+# if YYLSP_NEEDED
+	YYLTYPE *yyls1 = yyls;
+	/* This used to be a conditional around just the two extra args,
+	   but that might be undefined if yyoverflow is a macro.  */
 	yyoverflow ("parser stack overflow",
 		    &yyss1, yysize * sizeof (*yyssp),
 		    &yyvs1, yysize * sizeof (*yyvsp),
-
+		    &yyls1, yysize * sizeof (*yylsp),
 		    &yystacksize);
-
+	yyls = yyls1;
+# else
+	yyoverflow ("parser stack overflow",
+		    &yyss1, yysize * sizeof (*yyssp),
+		    &yyvs1, yysize * sizeof (*yyvsp),
+		    &yystacksize);
+# endif
 	yyss = yyss1;
 	yyvs = yyvs1;
       }
@@ -908,10 +724,10 @@ yyparse ()
       goto yyoverflowlab;
 # else
       /* Extend the stack our own way.  */
-      if (YYMAXDEPTH <= yystacksize)
+      if (yystacksize >= YYMAXDEPTH)
 	goto yyoverflowlab;
       yystacksize *= 2;
-      if (YYMAXDEPTH < yystacksize)
+      if (yystacksize > YYMAXDEPTH)
 	yystacksize = YYMAXDEPTH;
 
       {
@@ -922,8 +738,10 @@ yyparse ()
 	  goto yyoverflowlab;
 	YYSTACK_RELOCATE (yyss);
 	YYSTACK_RELOCATE (yyvs);
-
-#  undef YYSTACK_RELOCATE
+# if YYLSP_NEEDED
+	YYSTACK_RELOCATE (yyls);
+# endif
+# undef YYSTACK_RELOCATE
 	if (yyss1 != yyssa)
 	  YYSTACK_FREE (yyss1);
       }
@@ -932,12 +750,14 @@ yyparse ()
 
       yyssp = yyss + yysize - 1;
       yyvsp = yyvs + yysize - 1;
-
+#if YYLSP_NEEDED
+      yylsp = yyls + yysize - 1;
+#endif
 
       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
 		  (unsigned long int) yystacksize));
 
-      if (yyss + yystacksize - 1 <= yyssp)
+      if (yyssp >= yyss + yystacksize - 1)
 	YYABORT;
     }
 
@@ -945,6 +765,7 @@ yyparse ()
 
   goto yybackup;
 
+
 /*-----------.
 | yybackup.  |
 `-----------*/
@@ -957,55 +778,88 @@ yybackup:
   /* First try to decide what to do without reference to lookahead token.  */
 
   yyn = yypact[yystate];
-  if (yyn == YYPACT_NINF)
+  if (yyn == YYFLAG)
     goto yydefault;
 
   /* Not known => get a lookahead token if don't already have one.  */
 
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
+  /* yychar is either YYEMPTY or YYEOF
+     or a valid token in external form.  */
+
   if (yychar == YYEMPTY)
     {
       YYDPRINTF ((stderr, "Reading a token: "));
       yychar = YYLEX;
     }
 
-  if (yychar <= YYEOF)
+  /* Convert token to internal form (in yychar1) for indexing tables with */
+
+  if (yychar <= 0)		/* This means end of input. */
     {
-      yychar = yytoken = YYEOF;
+      yychar1 = 0;
+      yychar = YYEOF;		/* Don't call YYLEX any more */
+
       YYDPRINTF ((stderr, "Now at end of input.\n"));
     }
   else
     {
-      yytoken = YYTRANSLATE (yychar);
-      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+      yychar1 = YYTRANSLATE (yychar);
+
+#if YYDEBUG
+     /* We have to keep this `#if YYDEBUG', since we use variables
+	which are defined only if `YYDEBUG' is set.  */
+      if (yydebug)
+	{
+	  YYFPRINTF (stderr, "Next token is %d (%s",
+		     yychar, yytname[yychar1]);
+	  /* Give the individual parser a way to print the precise
+	     meaning of a token, for further debugging info.  */
+# ifdef YYPRINT
+	  YYPRINT (stderr, yychar, yylval);
+# endif
+	  YYFPRINTF (stderr, ")\n");
+	}
+#endif
     }
 
-  /* If the proper action on seeing token YYTOKEN is to reduce or to
-     detect an error, take that action.  */
-  yyn += yytoken;
-  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+  yyn += yychar1;
+  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
     goto yydefault;
+
   yyn = yytable[yyn];
-  if (yyn <= 0)
+
+  /* yyn is what to do for this token type in this state.
+     Negative => reduce, -yyn is rule number.
+     Positive => shift, yyn is new state.
+       New state is final state => don't bother to shift,
+       just return success.
+     0, or most negative number => error.  */
+
+  if (yyn < 0)
     {
-      if (yyn == 0 || yyn == YYTABLE_NINF)
+      if (yyn == YYFLAG)
 	goto yyerrlab;
       yyn = -yyn;
       goto yyreduce;
     }
+  else if (yyn == 0)
+    goto yyerrlab;
 
   if (yyn == YYFINAL)
     YYACCEPT;
 
   /* Shift the lookahead token.  */
-  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+  YYDPRINTF ((stderr, "Shifting token %d (%s), ",
+	      yychar, yytname[yychar1]));
 
   /* Discard the token being shifted unless it is eof.  */
   if (yychar != YYEOF)
     yychar = YYEMPTY;
 
   *++yyvsp = yylval;
-
+#if YYLSP_NEEDED
+  *++yylsp = yylloc;
+#endif
 
   /* Count tokens shifted since error; after three, turn off error
      status.  */
@@ -1036,25 +890,44 @@ yyreduce:
   /* If YYLEN is nonzero, implement the default value of the action:
      `$$ = $1'.
 
-     Otherwise, the following line sets YYVAL to garbage.
-     This behavior is undocumented and Bison
+     Otherwise, the following line sets YYVAL to the semantic value of
+     the lookahead token.  This behavior is undocumented and Bison
      users should not rely upon it.  Assigning to YYVAL
      unconditionally makes the parser a bit smaller, and it avoids a
      GCC warning that YYVAL may be used uninitialized.  */
   yyval = yyvsp[1-yylen];
 
+#if YYLSP_NEEDED
+  /* Similarly for the default location.  Let the user run additional
+     commands if for instance locations are ranges.  */
+  yyloc = yylsp[1-yylen];
+  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
+#endif
 
-  YY_REDUCE_PRINT (yyn);
-  switch (yyn)
+#if YYDEBUG
+  /* We have to keep this `#if YYDEBUG', since we use variables which
+     are defined only if `YYDEBUG' is set.  */
+  if (yydebug)
     {
-        case 3:
+      int yyi;
 
-    { /* Whole config file */ }
-    break;
+      YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
+		 yyn, yyrline[yyn]);
 
-  case 4:
+      /* Print the symbols being reduced, and their result.  */
+      for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
+	YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
+      YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+    }
+#endif
+
+  switch (yyn) {
 
-    {   
+case 2:
+{ /* Whole config file */ }
+    break;
+case 3:
+{   
   // name: value
                ((HtConfiguration *)aConf)->AddParsed(yyvsp[0].ConfLine->name,yyvsp[0].ConfLine->value);
 	       #ifdef DEBUG
@@ -1067,20 +940,19 @@ yyreduce:
 	       delete yyvsp[0].ConfLine;
                }
     break;
-
-  case 5:
-
-    {
+case 4:
+{
           // <server www.gc.lviv.ua>
           //    server_max_docs: 456
           //    ... : ...
           // </server>
 	}
     break;
-
-  case 6:
-
-    { 
+case 5:
+{ /* Ignore empty lines */  }
+    break;
+case 6:
+{ 
   // locale: uk_UA.KOI8-U
                                         //
 					// We can't do inserting into config
@@ -1090,30 +962,24 @@ yyreduce:
 					yyval.ConfLine->name = yyvsp[-3].str; yyval.ConfLine->value=yyvsp[-1].str;
 					}
     break;
-
-  case 7:
-
-    { 
+case 7:
+{ 
 	  // max_head_length: 300000
 	  //
 	                                yyval.ConfLine=new ConfigDefaults;
 					yyval.ConfLine->name = yyvsp[-3].str; yyval.ConfLine->value=yyvsp[-1].str;
 					}
     break;
-
-  case 8:
-
-    {
+case 8:
+{
 	  // bad_extensions: .XLS .xls .pdf .PDF .doc .DOC 
 	  //
 	  yyval.ConfLine=new ConfigDefaults;
 	  yyval.ConfLine->name = yyvsp[-3].str; yyval.ConfLine->value=yyvsp[-1].str;
 	}
     break;
-
-  case 9:
-
-    {
+case 9:
+{
 	  // excude_urls:
 	  //
 	                            yyval.ConfLine=new ConfigDefaults;
@@ -1122,15 +988,8 @@ yyreduce:
 				    *yyval.ConfLine->value='\0';
 					}
     break;
-
-  case 10:
-
-    { /* Ignore empty lines */  }
-    break;
-
-  case 11:
-
-    {
+case 10:
+{
 		      // check if "<param> ... </param>" are equal
 		      if (strcmp(yyvsp[-10].str,yyvsp[-2].str)!=0) {
 			// todo: setup error string, return with error.
@@ -1150,10 +1009,8 @@ yyreduce:
 		      delete [] yyvsp[-2].str;
 		    }
     break;
-
-  case 12:
-
-    {
+case 11:
+{
   //aaa: nnn
   //bbb: ccc
   // ...
@@ -1172,10 +1029,8 @@ yyreduce:
   delete yyvsp[0].ConfLine;
 }
     break;
-
-  case 13:
-
-    {
+case 12:
+{
 				yyvsp[-1].ConfLines->AddParsed(yyvsp[0].ConfLine->name,yyvsp[0].ConfLine->value);
 				#ifdef DEBUG
 				if (sn_debug>=2) {
@@ -1188,10 +1043,11 @@ yyreduce:
 				//$$=$1; //I think $$==$1
 			}
     break;
-
-  case 14:
-
-    { 
+case 13:
+{ /* Ignore empty lines */  }
+    break;
+case 14:
+{ 
 	// Paste 2 components. Reallocate memory for 2 components.
 	if ((yyval.str=new char[strlen(yyvsp[-1].str)+strlen(yyvsp[0].str)+1+1])==NULL) {
 		fprintf(stderr,"Can't allocate memory\n");
@@ -1204,10 +1060,8 @@ yyreduce:
 	delete [] yyvsp[0].str;
 	}
     break;
-
-  case 15:
-
-    { 
+case 15:
+{ 
 	// Paste 2 components. Reallocate memory for 2 components.
 	if ((yyval.str=new char[strlen(yyvsp[-1].str)+strlen(yyvsp[0].str)+1+1])==NULL) {
 		fprintf(stderr,"Can't allocate memory\n");
@@ -1220,10 +1074,8 @@ yyreduce:
 	delete [] yyvsp[0].str;
 	}
     break;
-
-  case 16:
-
-    { 
+case 16:
+{ 
 	// Paste 2 components. Reallocate memory for 2 components.
 	if ((yyval.str=new char[strlen(yyvsp[-1].str)+strlen(yyvsp[0].str)+1+1])==NULL) {
 		fprintf(stderr,"Can't allocate memory\n");
@@ -1236,10 +1088,8 @@ yyreduce:
 	delete [] yyvsp[0].str;
 	}
     break;
-
-  case 17:
-
-    { 
+case 17:
+{ 
 	// Paste 2 components. Reallocate memory for 2 components.
 	if ((yyval.str=new char[strlen(yyvsp[-1].str)+strlen(yyvsp[0].str)+1+1])==NULL) {
 		fprintf(stderr,"Can't allocate memory\n");
@@ -1252,10 +1102,8 @@ yyreduce:
 	delete [] yyvsp[0].str;
 	}
     break;
-
-  case 18:
-
-    { 
+case 18:
+{ 
 		char *old=yyval.str;
 		if ((yyval.str=new char [strlen(yyval.str)+strlen(yyvsp[0].str)+1+1])==NULL) {
 		  fprintf(stderr,"Can't reallocate memory\n");
@@ -1268,10 +1116,8 @@ yyreduce:
 		delete [] yyvsp[0].str;
 	}
     break;
-
-  case 19:
-
-    {
+case 19:
+{
 		char *old=yyval.str;
 		if ((yyval.str=new char [strlen(yyval.str)+strlen(yyvsp[0].str)+1+1])==NULL) {
 		  fprintf(stderr,"Can't reallocate memory\n");
@@ -1284,21 +1130,31 @@ yyreduce:
 		delete [] yyvsp[0].str;
 	}
     break;
+}
 
 
-    }
-
-/* Line 999 of yacc.c.  */
-
 
   yyvsp -= yylen;
   yyssp -= yylen;
+#if YYLSP_NEEDED
+  yylsp -= yylen;
+#endif
 
-
-  YY_STACK_PRINT (yyss, yyssp);
+#if YYDEBUG
+  if (yydebug)
+    {
+      short *yyssp1 = yyss - 1;
+      YYFPRINTF (stderr, "state stack now");
+      while (yyssp1 != yyssp)
+	YYFPRINTF (stderr, " %d", *++yyssp1);
+      YYFPRINTF (stderr, "\n");
+    }
+#endif
 
   *++yyvsp = yyval;
-
+#if YYLSP_NEEDED
+  *++yylsp = yyloc;
+#endif
 
   /* Now `shift' the result of the reduction.  Determine what state
      that goes to, based on the state we popped back to and the rule
@@ -1306,11 +1162,11 @@ yyreduce:
 
   yyn = yyr1[yyn];
 
-  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
-  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
     yystate = yytable[yystate];
   else
-    yystate = yydefgoto[yyn - YYNTOKENS];
+    yystate = yydefgoto[yyn - YYNTBASE];
 
   goto yynewstate;
 
@@ -1323,13 +1179,13 @@ yyerrlab:
   if (!yyerrstatus)
     {
       ++yynerrs;
-#if YYERROR_VERBOSE
+
+#ifdef YYERROR_VERBOSE
       yyn = yypact[yystate];
 
-      if (YYPACT_NINF < yyn && yyn < YYLAST)
+      if (yyn > YYFLAG && yyn < YYLAST)
 	{
 	  YYSIZE_T yysize = 0;
-	  int yytype = YYTRANSLATE (yychar);
 	  char *yymsg;
 	  int yyx, yycount;
 
@@ -1338,15 +1194,15 @@ yyerrlab:
 	     YYCHECK.  */
 	  for (yyx = yyn < 0 ? -yyn : 0;
 	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
-	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	    if (yycheck[yyx + yyn] == yyx)
 	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
-	  yysize += yystrlen ("syntax error, unexpected ") + 1;
-	  yysize += yystrlen (yytname[yytype]);
+	  yysize += yystrlen ("parse error, unexpected ") + 1;
+	  yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
 	  yymsg = (char *) YYSTACK_ALLOC (yysize);
 	  if (yymsg != 0)
 	    {
-	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
-	      yyp = yystpcpy (yyp, yytname[yytype]);
+	      char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
+	      yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
 
 	      if (yycount < 5)
 		{
@@ -1354,7 +1210,7 @@ yyerrlab:
 		  for (yyx = yyn < 0 ? -yyn : 0;
 		       yyx < (int) (sizeof (yytname) / sizeof (char *));
 		       yyx++)
-		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+		    if (yycheck[yyx + yyn] == yyx)
 		      {
 			const char *yyq = ! yycount ? ", expecting " : " or ";
 			yyp = yystpcpy (yyp, yyq);
@@ -1366,77 +1222,102 @@ yyerrlab:
 	      YYSTACK_FREE (yymsg);
 	    }
 	  else
-	    yyerror ("syntax error; also virtual memory exhausted");
+	    yyerror ("parse error; also virtual memory exhausted");
 	}
       else
-#endif /* YYERROR_VERBOSE */
-	yyerror ("syntax error");
+#endif /* defined (YYERROR_VERBOSE) */
+	yyerror ("parse error");
     }
+  goto yyerrlab1;
 
 
-
+/*--------------------------------------------------.
+| yyerrlab1 -- error raised explicitly by an action |
+`--------------------------------------------------*/
+yyerrlab1:
   if (yyerrstatus == 3)
     {
       /* If just tried and failed to reuse lookahead token after an
 	 error, discard it.  */
 
-      /* Return failure if at end of input.  */
+      /* return failure if at end of input */
       if (yychar == YYEOF)
-        {
-	  /* Pop the error token.  */
-          YYPOPSTACK;
-	  /* Pop the rest of the stack.  */
-	  while (yyss < yyssp)
-	    {
-	      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
-	      yydestruct (yystos[*yyssp], yyvsp);
-	      YYPOPSTACK;
-	    }
-	  YYABORT;
-        }
-
-      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
-      yydestruct (yytoken, &yylval);
+	YYABORT;
+      YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
+		  yychar, yytname[yychar1]));
       yychar = YYEMPTY;
-
     }
 
   /* Else will try to reuse lookahead token after shifting the error
      token.  */
-  goto yyerrlab1;
 
+  yyerrstatus = 3;		/* Each real token shifted decrements this */
 
-/*----------------------------------------------------.
-| yyerrlab1 -- error raised explicitly by an action.  |
-`----------------------------------------------------*/
-yyerrlab1:
-  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+  goto yyerrhandle;
+
+
+/*-------------------------------------------------------------------.
+| yyerrdefault -- current state does not do anything special for the |
+| error token.                                                       |
+`-------------------------------------------------------------------*/
+yyerrdefault:
+#if 0
+  /* This is wrong; only states that explicitly want error tokens
+     should shift them.  */
 
-  for (;;)
+  /* If its default is to accept any token, ok.  Otherwise pop it.  */
+  yyn = yydefact[yystate];
+  if (yyn)
+    goto yydefault;
+#endif
+
+
+/*---------------------------------------------------------------.
+| yyerrpop -- pop the current state because it cannot handle the |
+| error token                                                    |
+`---------------------------------------------------------------*/
+yyerrpop:
+  if (yyssp == yyss)
+    YYABORT;
+  yyvsp--;
+  yystate = *--yyssp;
+#if YYLSP_NEEDED
+  yylsp--;
+#endif
+
+#if YYDEBUG
+  if (yydebug)
     {
-      yyn = yypact[yystate];
-      if (yyn != YYPACT_NINF)
-	{
-	  yyn += YYTERROR;
-	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-	    {
-	      yyn = yytable[yyn];
-	      if (0 < yyn)
-		break;
-	    }
-	}
+      short *yyssp1 = yyss - 1;
+      YYFPRINTF (stderr, "Error: state stack now");
+      while (yyssp1 != yyssp)
+	YYFPRINTF (stderr, " %d", *++yyssp1);
+      YYFPRINTF (stderr, "\n");
+    }
+#endif
 
-      /* Pop the current state because it cannot handle the error token.  */
-      if (yyssp == yyss)
-	YYABORT;
+/*--------------.
+| yyerrhandle.  |
+`--------------*/
+yyerrhandle:
+  yyn = yypact[yystate];
+  if (yyn == YYFLAG)
+    goto yyerrdefault;
 
-      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
-      yydestruct (yystos[yystate], yyvsp);
-      yyvsp--;
-      yystate = *--yyssp;
+  yyn += YYTERROR;
+  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+    goto yyerrdefault;
 
-      YY_STACK_PRINT (yyss, yyssp);
+  yyn = yytable[yyn];
+  if (yyn < 0)
+    {
+      if (yyn == YYFLAG)
+	goto yyerrpop;
+      yyn = -yyn;
+      goto yyreduce;
     }
+  else if (yyn == 0)
+    goto yyerrpop;
 
   if (yyn == YYFINAL)
     YYACCEPT;
@@ -1444,7 +1325,9 @@ yyerrlab1:
   YYDPRINTF ((stderr, "Shifting error token, "));
 
   *++yyvsp = yylval;
-
+#if YYLSP_NEEDED
+  *++yylsp = yylloc;
+#endif
 
   yystate = yyn;
   goto yynewstate;
@@ -1464,15 +1347,13 @@ yyabortlab:
   yyresult = 1;
   goto yyreturn;
 
-#ifndef yyoverflow
-/*----------------------------------------------.
-| yyoverflowlab -- parser overflow comes here.  |
-`----------------------------------------------*/
+/*---------------------------------------------.
+| yyoverflowab -- parser overflow comes here.  |
+`---------------------------------------------*/
 yyoverflowlab:
   yyerror ("parser stack overflow");
   yyresult = 2;
   /* Fall through.  */
-#endif
 
 yyreturn:
 #ifndef yyoverflow
@@ -1482,15 +1363,20 @@ yyreturn:
   return yyresult;
 }
 
-
-
-
 int
 yyerror (char *s)  /* Called by yyparse on error */
 {
-extern int yylineno;	// I don't know what about included files
-   printf ("%s\nIn line %d\n",s,yylineno);
+extern int yylineno;
+extern int include_stack_ptr;
+extern String *name_stack[];
+   HtConfiguration* config= HtConfiguration::config();
+   String str;
+   if (include_stack_ptr > 0)
+	str = *name_stack[include_stack_ptr-1];
+   else	// still at top level config
+	str = config->getFileName();
+   //printf ("%s\nIn line %d\n",s,yylineno);
+   fprintf(stderr,"Error in file %s line %d: %s\n",str.get(),yylineno,s);
    // exit(1);
    return -1;
 }
-
--- htcommon/conf_parser.h.orig	2003-07-21 03:16:10.000000000 -0500
+++ htcommon/conf_parser.h	2004-04-22 12:48:44.000000000 -0500
@@ -1,73 +1,26 @@
-/* A Bison parser, made by GNU Bison 1.875a.  */
+#ifndef BISON_CONF_PARSER_H
+# define BISON_CONF_PARSER_H
 
-/* Skeleton parser for Yacc-like parsing with Bison,
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     NUM = 258,
-     T_DELIMITER = 259,
-     T_NEWLINE = 260,
-     T_RIGHT_BR = 261,
-     T_LEFT_BR = 262,
-     T_SLASH = 263,
-     T_STRING = 264,
-     T_KEYWORD = 265,
-     T_NUMBER = 266
-   };
-#endif
-#define NUM 258
-#define T_DELIMITER 259
-#define T_NEWLINE 260
-#define T_RIGHT_BR 261
-#define T_LEFT_BR 262
-#define T_SLASH 263
-#define T_STRING 264
-#define T_KEYWORD 265
-#define T_NUMBER 266
-
-
-
-
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-
-typedef union YYSTYPE {
+#ifndef YYSTYPE
+typedef union {
 	char *str;
 	ConfigDefaults	*ConfLine;
 	HtConfiguration	*ConfLines;
-} YYSTYPE;
-/* Line 1240 of yacc.c.  */
-
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
+} yystype;
+# define YYSTYPE yystype
 # define YYSTYPE_IS_TRIVIAL 1
 #endif
-
-extern YYSTYPE yylval;
+# define	NUM	257
+# define	T_DELIMITER	258
+# define	T_NEWLINE	259
+# define	T_RIGHT_BR	260
+# define	T_LEFT_BR	261
+# define	T_SLASH	262
+# define	T_STRING	263
+# define	T_KEYWORD	264
+# define	T_NUMBER	265
 
 
+extern YYSTYPE yylval;
 
+#endif /* not BISON_CONF_PARSER_H */

