]> git.saurik.com Git - bison.git/blobdiff - src/scan-skel.l
Don't escape $ in test case titles since Autoconf 2.61 now does that
[bison.git] / src / scan-skel.l
index e3a5eabd437d2c95158247b6d1dd5b18bb9b6eb5..6c516097e64cf307041b66e0d1f2e80e90e552d6 100644 (file)
@@ -1,6 +1,7 @@
 /* Scan Bison Skeletons.                                       -*- C -*-
 
-   Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
+   Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 #undef skel_wrap
 #define skel_wrap() 1
 
-#include "system.h"
+#define FLEX_NO_OBSTACK
+#define FLEX_PREFIX(Id) skel_ ## Id
+#include "flex-scanner.h"
 
+#include <dirname.h>
 #include <error.h>
 #include <quotearg.h>
 
 #include "files.h"
 #include "scan-skel.h"
 
+int skel_lex (void);
+
 #define QPUTS(String) \
-   fputs (quotearg_style (c_quoting_style, (String)), yyout)
+   fputs (quotearg_style (c_quoting_style, String), yyout)
+
+#define BASE_QPUTS(File) \
+   QPUTS (last_component (File))
 
 %}
 %%
@@ -66,7 +75,6 @@
       else
        fatal ("invalid token in skeleton: %s", yytext);
     }
-
   if (outname)
     {
       free (outname);
@@ -84,8 +92,8 @@
 "@oline@"  fprintf (yyout, "%d", lineno + 1);
 "@ofile@"  QPUTS (outname);
 "@dir_prefix@" QPUTS (dir_prefix);
-"@output_parser_name@" QPUTS (base_name (parser_file_name));
-"@output_header_name@" QPUTS (base_name (spec_defines_file));
+"@output_parser_name@" BASE_QPUTS (parser_file_name);
+"@output_header_name@" BASE_QPUTS (spec_defines_file);
 
   /* This pattern must not match more than the previous @ patterns. */
 @[^{}@\n]* fatal ("invalid @ in skeleton: %s", yytext);
@@ -113,5 +121,5 @@ scan_skel (FILE *in)
   skel__flex_debug = trace_flag & trace_skeleton;
   skel_lex ();
   /* Reclaim Flex's buffers.  */
-  yy_delete_buffer (YY_CURRENT_BUFFER);
+  yylex_destroy ();
 }