]> git.cworth.org Git - ttt/blobdiff - src/ttt-lex.l
2005-12-08 Carl Worth <cworth@cworth.org>
[ttt] / src / ttt-lex.l
index 06685c4a178565ed9d969a2dad82296a6ba24f4e..9720efb6188886b46100b8aa63a507438d660970 100644 (file)
@@ -1,3 +1,24 @@
+ /* ttt-lex.l - flex-based lexical analyzer
+ *
+ * Copyright © 2005 Carl Worth
+ *
+ * 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.
+ *
+ * Author: Carl Worth <cworth@cworth.org>
+ */
+
   /* Definitions */
 
 %option reentrant
@@ -7,8 +28,13 @@
 #include "ttt-token.h"
 
 #define YY_DECL int yylex (yyscan_t yyscanner, ttt_token_t *token)
-
 #define STRING_BUF_SIZE 8000
+
+ /* Shut off some compiler warnings due to annoying flex bugs. */
+YY_DECL;
+int yyget_column  (yyscan_t yyscanner);
+void yyset_column (int  column_no , yyscan_t yyscanner);
+
 %}
 
 %x STRING
 \r\n           {
                        token->type = TTT_TOKEN_TYPE_NEWLINE;
                        return token->type;
+
+                       /* This dead code is just to shut off a
+                        * compiler warning due to an annoying flex
+                        * bug. */
+                       unput('?');
                }
 
 \"             {