[cmake-commits] king committed cmDependsFortran.cxx 1.20 1.21 cmDependsFortranLexer.cxx 1.9 1.10 cmDependsFortranLexer.h 1.6 1.7 cmDependsFortranLexer.in.l 1.9 1.10 cmDependsFortranParser.cxx 1.7 1.8 cmDependsFortranParser.h 1.3 1.4 cmDependsFortranParser.y 1.11 1.12 cmDependsFortranParserTokens.h 1.4 1.5

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Oct 3 15:41:41 EDT 2007


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv5346/Source

Modified Files:
	cmDependsFortran.cxx cmDependsFortranLexer.cxx 
	cmDependsFortranLexer.h cmDependsFortranLexer.in.l 
	cmDependsFortranParser.cxx cmDependsFortranParser.h 
	cmDependsFortranParser.y cmDependsFortranParserTokens.h 
Log Message:
BUG: Fix for bug#5809.  Applied patch supplied in the bug report.  Updated pre-generated lexer and parser sources.  This updates the makedepf90 version to 2.8.8.  The parser actions have been updated to ignore "use" in comments properly.


Index: cmDependsFortran.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortran.cxx,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- cmDependsFortran.cxx	29 Aug 2007 15:30:53 -0000	1.20
+++ cmDependsFortran.cxx	3 Oct 2007 19:41:39 -0000	1.21
@@ -47,6 +47,7 @@
   YY_BUFFER_STATE Buffer;
   std::string Directory;
 };
+
 struct cmDependsFortranParser_s
 {
   cmDependsFortranParser_s(cmDependsFortran* self);
@@ -65,7 +66,12 @@
   std::string TokenString;
 
   // Flag for whether lexer is reading from inside an interface.
-  int InInterface;
+  bool InInterface;
+
+  int OldStartcond;
+  bool InPPFalseBranch;
+  std::vector<bool> SkipToEnd;
+  int StepI;
 
   // Set of provided and required modules.
   std::set<cmStdString> Provides;
@@ -347,7 +353,7 @@
 }
 
 //----------------------------------------------------------------------------
-int cmDependsFortranParser_FilePush(cmDependsFortranParser* parser,
+bool cmDependsFortranParser_FilePush(cmDependsFortranParser* parser,
                                     const char* fname)
 {
   // Open the new file and push it onto the stack.  Save the old
@@ -371,7 +377,7 @@
 }
 
 //----------------------------------------------------------------------------
-int cmDependsFortranParser_FilePop(cmDependsFortranParser* parser)
+bool cmDependsFortranParser_FilePop(cmDependsFortranParser* parser)
 {
   // Pop one file off the stack and close it.  Switch the lexer back
   // to the next one on the stack.
@@ -426,18 +432,31 @@
 
 //----------------------------------------------------------------------------
 void cmDependsFortranParser_SetInInterface(cmDependsFortranParser* parser,
-                                           int in)
+                                           bool in)
 {
   parser->InInterface = in;
 }
 
 //----------------------------------------------------------------------------
-int cmDependsFortranParser_GetInInterface(cmDependsFortranParser* parser)
+bool cmDependsFortranParser_GetInInterface(cmDependsFortranParser* parser)
 {
   return parser->InInterface;
 }
 
 //----------------------------------------------------------------------------
+void cmDependsFortranParser_SetOldStartcond(cmDependsFortranParser* parser,
+                                            int arg)
+{
+  parser->OldStartcond = arg;
+}
+
+//----------------------------------------------------------------------------
+int cmDependsFortranParser_GetOldStartcond(cmDependsFortranParser* parser)
+{
+  return parser->OldStartcond;
+}
+
+//----------------------------------------------------------------------------
 void cmDependsFortranParser_Error(cmDependsFortranParser*, const char*)
 {
   // If there is a parser error just ignore it.  The source will not
@@ -449,7 +468,7 @@
 void cmDependsFortranParser_RuleUse(cmDependsFortranParser* parser,
                                     const char* name)
 {
-  parser->Requires.insert(name);
+  parser->Requires.insert(cmSystemTools::LowerCase(name) );
 }
 
 //----------------------------------------------------------------------------
@@ -482,7 +501,7 @@
 void cmDependsFortranParser_RuleModule(cmDependsFortranParser* parser,
                                        const char* name)
 {
-  parser->Provides.insert(name);
+  parser->Provides.insert(cmSystemTools::LowerCase(name) );
 }
 
 //----------------------------------------------------------------------------

Index: cmDependsFortranLexer.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortranLexer.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cmDependsFortranLexer.h	27 Jul 2007 14:55:24 -0000	1.6
+++ cmDependsFortranLexer.h	3 Oct 2007 19:41:39 -0000	1.7
@@ -25,7 +25,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 31
+#define YY_FLEX_SUBMINOR_VERSION 33
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -47,7 +47,15 @@
 
 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
 
-#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#if __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
 #include <inttypes.h>
 typedef int8_t flex_int8_t;
 typedef uint8_t flex_uint8_t;
@@ -201,24 +209,16 @@
 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
 void cmDependsFortran_yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void cmDependsFortran_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,
-  yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsFortran_yy_create_buffer (FILE *file,int size ,
-  yyscan_t yyscanner );
-void cmDependsFortran_yy_delete_buffer (YY_BUFFER_STATE b ,
-  yyscan_t yyscanner );
-void cmDependsFortran_yy_flush_buffer (YY_BUFFER_STATE b ,
-  yyscan_t yyscanner );
-void cmDependsFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,
-  yyscan_t yyscanner );
+void cmDependsFortran_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+YY_BUFFER_STATE cmDependsFortran_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
+void cmDependsFortran_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void cmDependsFortran_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void cmDependsFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
 void cmDependsFortran_yypop_buffer_state (yyscan_t yyscanner );
 
-YY_BUFFER_STATE cmDependsFortran_yy_scan_buffer (char *base,yy_size_t size ,
-  yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsFortran_yy_scan_string (yyconst char *yy_str ,
-  yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsFortran_yy_scan_bytes (yyconst char *bytes,int len ,
-  yyscan_t yyscanner );
+YY_BUFFER_STATE cmDependsFortran_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
+YY_BUFFER_STATE cmDependsFortran_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
+YY_BUFFER_STATE cmDependsFortran_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
 
 void *cmDependsFortran_yyalloc (yy_size_t ,yyscan_t yyscanner );
 void *cmDependsFortran_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
@@ -255,8 +255,7 @@
 
 YY_EXTRA_TYPE cmDependsFortran_yyget_extra (yyscan_t yyscanner );
 
-void cmDependsFortran_yyset_extra (YY_EXTRA_TYPE user_defined ,
-  yyscan_t yyscanner );
+void cmDependsFortran_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
 
 FILE *cmDependsFortran_yyget_in (yyscan_t yyscanner );
 
@@ -319,15 +318,13 @@
 #define YY_DECL int cmDependsFortran_yylex (yyscan_t yyscanner)
 #endif /* !YY_DECL */
 
-/* yy_get_previous_state - get the state just before the EOB char was reached
- */
+/* yy_get_previous_state - get the state just before the EOB char was reached */
 
 #undef YY_NEW_FILE
 #undef YY_FLUSH_BUFFER
 #undef yy_set_bol
 #undef yy_new_buffer
 #undef yy_set_interactive
-#undef yytext_ptr
 #undef YY_DO_BEFORE_ACTION
 
 #ifdef YY_DECL_IS_OURS

Index: cmDependsFortranParser.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortranParser.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cmDependsFortranParser.h	15 May 2006 14:19:57 -0000	1.3
+++ cmDependsFortranParser.h	3 Oct 2007 19:41:39 -0000	1.4
@@ -23,20 +23,33 @@
 typedef struct cmDependsFortranParser_s cmDependsFortranParser;
 
 /* Functions to enter/exit #include'd files in order.  */
-int cmDependsFortranParser_FilePush(cmDependsFortranParser* parser,
+bool cmDependsFortranParser_FilePush(cmDependsFortranParser* parser,
                                     const char* fname);
-int cmDependsFortranParser_FilePop(cmDependsFortranParser* parser);
+bool cmDependsFortranParser_FilePop(cmDependsFortranParser* parser);
 
 /* Callbacks for lexer.  */
 int cmDependsFortranParser_Input(cmDependsFortranParser* parser,
                                  char* buffer, size_t bufferSize);
+
+
 void cmDependsFortranParser_StringStart(cmDependsFortranParser* parser);
 const char* cmDependsFortranParser_StringEnd(cmDependsFortranParser* parser);
 void cmDependsFortranParser_StringAppend(cmDependsFortranParser* parser,
                                          char c);
+
 void cmDependsFortranParser_SetInInterface(cmDependsFortranParser* parser,
-                                           int in);
-int cmDependsFortranParser_GetInInterface(cmDependsFortranParser* parser);
+                                           bool is_in);
+bool cmDependsFortranParser_GetInInterface(cmDependsFortranParser* parser);
+
+
+void cmDependsFortranParser_SetInPPFalseBranch(cmDependsFortranParser* parser,
+                                               bool is_in);
+bool cmDependsFortranParser_GetInPPFalseBranch(cmDependsFortranParser* parser);
+
+
+void cmDependsFortranParser_SetOldStartcond(cmDependsFortranParser* parser,
+                                            int arg);
+int cmDependsFortranParser_GetOldStartcond(cmDependsFortranParser* parser);
 
 /* Callbacks for parser.  */
 void cmDependsFortranParser_Error(cmDependsFortranParser* parser,

Index: cmDependsFortranParser.y
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortranParser.y,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- cmDependsFortranParser.y	1 Aug 2006 15:38:41 -0000	1.11
+++ cmDependsFortranParser.y	3 Oct 2007 19:41:39 -0000	1.12
@@ -76,7 +76,7 @@
 %}
 
 /* Generate a reentrant parser object.  */
-%pure_parser
+%pure-parser
 
 %union {
   char* string;
@@ -84,90 +84,128 @@
 
 /*-------------------------------------------------------------------------*/
 /* Tokens */
-%token USE F_INCLUDE MODULE EOSTMT
+%token EOSTMT ASSIGNMENT_OP GARBAGE
 %token CPP_INCLUDE F90PPR_INCLUDE COCO_INCLUDE
 %token F90PPR_DEFINE CPP_DEFINE F90PPR_UNDEF CPP_UNDEF
 %token CPP_IFDEF CPP_IFNDEF CPP_IF CPP_ELSE CPP_ELIF CPP_ENDIF
 %token F90PPR_IFDEF F90PPR_IFNDEF F90PPR_IF F90PPR_ELSE F90PPR_ELIF F90PPR_ENDIF
-%token UNTERMINATED_STRING
-%token <string> CPP_TOENDL STRING WORD
+%token <string> CPP_TOENDL
+%token <number> UNTERMINATED_STRING
+%token <string> STRING WORD
 
 /*-------------------------------------------------------------------------*/
 /* grammar */
 %%
 
-code: /* empty */ | code stmt ;
+code: /* empty */ | code stmt;
 
-stmt:
-  USE WORD other eostmt
+stmt: keyword_stmt | assignment_stmt;
+
+assignment_stmt: WORD ASSIGNMENT_OP other EOSTMT    /* Ignore */
+
+keyword_stmt:
+  WORD EOSTMT
     {
-    cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
-    cmDependsFortranParser_RuleUse(parser, $2);
-    free($2);
+    if (strcasecmp($1, "interface") == 0)
+      {
+      cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
+      cmDependsFortranParser_SetInInterface(parser, true);
+      }
+    free($1);
     }
-| include STRING other eostmt
+| WORD WORD other EOSTMT
     {
-    cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
-    cmDependsFortranParser_RuleInclude(parser, $2);
-    free($2);
+    if (strcasecmp($1, "use") == 0)
+      {
+      cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
+      cmDependsFortranParser_RuleUse(parser, $2);
+      free($2);
+      }
+    else if (strcasecmp($1, "module") == 0)
+      {
+      cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
+      cmDependsFortranParser_RuleModule(parser, $2);
+      free($2);
+      }
+    else if (strcasecmp($1, "interface") == 0)
+      {
+      cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
+      cmDependsFortranParser_SetInInterface(parser, true);
+      free($2);
+      }
+    else if (strcasecmp($2, "interface") == 0 && strcasecmp($1, "end") == 0)
+      {
+      cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
+      cmDependsFortranParser_SetInInterface(parser, false);
+      free($2);
+      }
+    free($1);
     }
-| CPP_INCLUDE WORD other eostmt /* Ignore */
-| MODULE WORD eostmt
+| WORD STRING other EOSTMT
     {
-    cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
-    cmDependsFortranParser_RuleModule(parser, $2);
+    if (strcasecmp($1, "include") == 0)
+      {
+      cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
+      cmDependsFortranParser_RuleInclude(parser, $2);
+      }
+    free($1);
     free($2);
     }
-| define WORD other eostmt
+| CPP_INCLUDE WORD other EOSTMT /* Ignore */
+| define WORD other EOSTMT
     {
     cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
     cmDependsFortranParser_RuleDefine(parser, $2);
     free($2);
     }
-| undef WORD other eostmt
+| undef WORD other EOSTMT
     {
     cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
     cmDependsFortranParser_RuleUndef(parser, $2);
     free($2);
     }
-| ifdef WORD other eostmt
+| ifdef WORD other EOSTMT
     {
     cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
     cmDependsFortranParser_RuleIfdef(parser, $2);
     free($2);
     }
-| ifndef WORD other eostmt
+| ifndef WORD other EOSTMT
     {
     cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
     cmDependsFortranParser_RuleIfndef(parser, $2);
     free($2);
     }
-| if other eostmt
+| if other EOSTMT
     {
     cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
     cmDependsFortranParser_RuleIf(parser);
     }
-| elif other eostmt
+| elif other EOSTMT
     {
     cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
     cmDependsFortranParser_RuleElif(parser);
     }
-| else other eostmt
+| else other EOSTMT
     {
     cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
     cmDependsFortranParser_RuleElse(parser);
     }
-| endif other eostmt
+| endif other EOSTMT
     {
     cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
     cmDependsFortranParser_RuleEndif(parser);
     }
-| other eostmt /* Ignore */
+| WORD GARBAGE other EOSTMT             /* Ignore */
+| GARBAGE other EOSTMT
+| EOSTMT
+| error
 ;
 
-eostmt: /* empty */ | EOSTMT ;
-include: F_INCLUDE | CPP_INCLUDE | F90PPR_INCLUDE | COCO_INCLUDE ;
-define: CPP_DEFINE | F90PPR_DEFINE ;
+
+
+include: CPP_INCLUDE | F90PPR_INCLUDE | COCO_INCLUDE ;
+define: CPP_DEFINE | F90PPR_DEFINE;
 undef: CPP_UNDEF | F90PPR_UNDEF ;
 ifdef: CPP_IFDEF | F90PPR_IFDEF ;
 ifndef: CPP_IFNDEF | F90PPR_IFNDEF ;
@@ -180,6 +218,8 @@
 misc_code:
   WORD                { free ($1); }
 | STRING              { free ($1); }
+| GARBAGE
+| ASSIGNMENT_OP
 | UNTERMINATED_STRING
 ;
 

Index: cmDependsFortranLexer.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortranLexer.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cmDependsFortranLexer.cxx	16 Aug 2006 18:22:40 -0000	1.9
+++ cmDependsFortranLexer.cxx	3 Oct 2007 19:41:39 -0000	1.10
@@ -9,7 +9,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 31
+#define YY_FLEX_SUBMINOR_VERSION 33
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -31,7 +31,15 @@
 
 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
[...1234 lines suppressed...]
-#undef yy_set_bol
-#undef yy_new_buffer
-#undef yy_set_interactive
-#undef yytext_ptr
-#undef YY_DO_BEFORE_ACTION
-
-#ifdef YY_DECL_IS_OURS
-#undef YY_DECL_IS_OURS
-#undef YY_DECL
-#endif
-#line 194 "cmDependsFortranLexer.in.l"
+#line 176 "cmDependsFortranLexer.in.l"
 
 
 
@@ -2315,3 +2292,4 @@
   struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
   return YY_CURRENT_BUFFER;
 }
+

Index: cmDependsFortranParserTokens.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortranParserTokens.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cmDependsFortranParserTokens.h	10 Mar 2006 18:54:57 -0000	1.4
+++ cmDependsFortranParserTokens.h	3 Oct 2007 19:41:39 -0000	1.5
@@ -1,7 +1,9 @@
-/* A Bison parser, made by GNU Bison 1.875d.  */
+/* A Bison parser, made by GNU Bison 2.3.  */
 
-/* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984,
-   1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   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
@@ -15,13 +17,21 @@
 
    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.  */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, 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.  */
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
 
 /* Tokens.  */
 #ifndef YYTOKENTYPE
@@ -29,79 +39,75 @@
    /* Put the tokens into the symbol table, so that GDB and other debuggers
       know about them.  */
    enum yytokentype {
-     USE = 258,
-     F_INCLUDE = 259,
-     MODULE = 260,
-     EOSTMT = 261,
-     CPP_INCLUDE = 262,
-     F90PPR_INCLUDE = 263,
-     COCO_INCLUDE = 264,
-     F90PPR_DEFINE = 265,
-     CPP_DEFINE = 266,
-     F90PPR_UNDEF = 267,
-     CPP_UNDEF = 268,
-     CPP_IFDEF = 269,
-     CPP_IFNDEF = 270,
-     CPP_IF = 271,
-     CPP_ELSE = 272,
-     CPP_ELIF = 273,
-     CPP_ENDIF = 274,
-     F90PPR_IFDEF = 275,
-     F90PPR_IFNDEF = 276,
-     F90PPR_IF = 277,
-     F90PPR_ELSE = 278,
-     F90PPR_ELIF = 279,
-     F90PPR_ENDIF = 280,
+     EOSTMT = 258,
+     ASSIGNMENT_OP = 259,
+     GARBAGE = 260,
+     CPP_INCLUDE = 261,
+     F90PPR_INCLUDE = 262,
+     COCO_INCLUDE = 263,
+     F90PPR_DEFINE = 264,
+     CPP_DEFINE = 265,
+     F90PPR_UNDEF = 266,
+     CPP_UNDEF = 267,
+     CPP_IFDEF = 268,
+     CPP_IFNDEF = 269,
+     CPP_IF = 270,
+     CPP_ELSE = 271,
+     CPP_ELIF = 272,
+     CPP_ENDIF = 273,
+     F90PPR_IFDEF = 274,
+     F90PPR_IFNDEF = 275,
+     F90PPR_IF = 276,
+     F90PPR_ELSE = 277,
+     F90PPR_ELIF = 278,
+     F90PPR_ENDIF = 279,
+     CPP_TOENDL = 280,
      UNTERMINATED_STRING = 281,
-     CPP_TOENDL = 282,
-     STRING = 283,
-     WORD = 284
+     STRING = 282,
+     WORD = 283
    };
 #endif
-#define USE 258
-#define F_INCLUDE 259
-#define MODULE 260
-#define EOSTMT 261
-#define CPP_INCLUDE 262
-#define F90PPR_INCLUDE 263
-#define COCO_INCLUDE 264
-#define F90PPR_DEFINE 265
-#define CPP_DEFINE 266
-#define F90PPR_UNDEF 267
-#define CPP_UNDEF 268
-#define CPP_IFDEF 269
-#define CPP_IFNDEF 270
-#define CPP_IF 271
-#define CPP_ELSE 272
-#define CPP_ELIF 273
-#define CPP_ENDIF 274
-#define F90PPR_IFDEF 275
-#define F90PPR_IFNDEF 276
-#define F90PPR_IF 277
-#define F90PPR_ELSE 278
-#define F90PPR_ELIF 279
-#define F90PPR_ENDIF 280
+/* Tokens.  */
+#define EOSTMT 258
+#define ASSIGNMENT_OP 259
+#define GARBAGE 260
+#define CPP_INCLUDE 261
+#define F90PPR_INCLUDE 262
+#define COCO_INCLUDE 263
+#define F90PPR_DEFINE 264
+#define CPP_DEFINE 265
+#define F90PPR_UNDEF 266
+#define CPP_UNDEF 267
+#define CPP_IFDEF 268
+#define CPP_IFNDEF 269
+#define CPP_IF 270
+#define CPP_ELSE 271
+#define CPP_ELIF 272
+#define CPP_ENDIF 273
+#define F90PPR_IFDEF 274
+#define F90PPR_IFNDEF 275
+#define F90PPR_IF 276
+#define F90PPR_ELSE 277
+#define F90PPR_ELIF 278
+#define F90PPR_ENDIF 279
+#define CPP_TOENDL 280
 #define UNTERMINATED_STRING 281
-#define CPP_TOENDL 282
-#define STRING 283
-#define WORD 284
+#define STRING 282
+#define WORD 283
 
 
 
 
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 75 "cmDependsFortranParser.y"
-typedef union YYSTYPE {
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 81 "cmDependsFortranParser.y"
+{
   char* string;
-} YYSTYPE;
-/* Line 1285 of yacc.c.  */
-#line 99 "cmDependsFortranParserTokens.h"
+}
+/* Line 1489 of yacc.c.  */
+#line 109 "cmDependsFortranParserTokens.h"
+        YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 # define YYSTYPE_IS_TRIVIAL 1
 #endif
-
-
-
-
-

Index: cmDependsFortranParser.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortranParser.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- cmDependsFortranParser.cxx	5 Mar 2007 15:36:06 -0000	1.7
+++ cmDependsFortranParser.cxx	3 Oct 2007 19:41:39 -0000	1.8
@@ -1,7 +1,9 @@
-/* A Bison parser, made by GNU Bison 1.875d.  */
+/* A Bison parser, made by GNU Bison 2.3.  */
 
-/* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984,
-   1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
[...2042 lines suppressed...]
+    }
 #ifndef yyoverflow
   if (yyss != yyssa)
     YYSTACK_FREE (yyss);
 #endif
-  return yyresult;
+#if YYERROR_VERBOSE
+  if (yymsg != yymsgbuf)
+    YYSTACK_FREE (yymsg);
+#endif
+  /* Make sure YYID is used.  */
+  return YYID (yyresult);
 }
 
 
-#line 180 "cmDependsFortranParser.y"
+#line 226 "cmDependsFortranParser.y"
 
 /* End of grammar */
 

Index: cmDependsFortranLexer.in.l
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortranLexer.in.l,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cmDependsFortranLexer.in.l	16 Aug 2006 18:22:40 -0000	1.9
+++ cmDependsFortranLexer.in.l	3 Oct 2007 19:41:39 -0000	1.10
@@ -16,7 +16,7 @@
 
 =========================================================================*/
 /*-------------------------------------------------------------------------
-  Portions of this source have been derived from makefdep90 version 2.6.2,
+  Portions of this source have been derived from makefdep90 version 2.8.8,
 
    Copyright (C) 2000,2001 Erik Edelmann <eedelman at beam.helsinki.fi>.
 
@@ -64,6 +64,7 @@
 /*--------------------------------------------------------------------------*/
 %}
 
+
 %option reentrant
 %option noyywrap
 %pointer
@@ -75,16 +76,19 @@
 
 \"              {
   cmDependsFortranParser_StringStart(yyextra);
+  cmDependsFortranParser_SetOldStartcond(yyextra, YY_START);
   BEGIN(str_dq);
 }
 
 '               {
   cmDependsFortranParser_StringStart(yyextra);
+  cmDependsFortranParser_SetOldStartcond(yyextra, YY_START);
   BEGIN(str_sq);
 }
 
 <str_dq>\" |
 <str_sq>'  {
+  BEGIN(cmDependsFortranParser_GetOldStartcond(yyextra) );
   yylvalp->string = strdup(cmDependsFortranParser_StringEnd(yyextra));
   return STRING;
 }
@@ -92,7 +96,15 @@
 <str_dq,str_sq>&[ \t]*\n |
 <str_dq,str_sq>&[ \t]*\n[ \t]*&  /* Ignore (continued strings, free fmt) */
 
-<fixed_fmt,str_dq,str_sq>\n[ ]{5}[^ \t\n] /*Ignore (cont. strings, fixed fmt) */
+<fixed_fmt,str_dq,str_sq>\n[ ]{5}[^ \t\n] {
+  if (cmDependsFortranParser_GetOldStartcond(yyextra) == fixed_fmt)
+    ; /* Ignore (cont. strings, fixed fmt) */
+  else
+    {
+    unput(yytext[strlen(yytext)-1]);
+    }
+}
+
 
 <str_dq,str_sq>\n {
   unput ('\n');
@@ -110,23 +122,6 @@
 #[ \t]*include  { return CPP_INCLUDE; }
 \$[ \t]*include { return F90PPR_INCLUDE; }
 \?\?[ \t]*include { return COCO_INCLUDE; }
-INCLUDE         { return F_INCLUDE; }
-USE             { return USE; }
-
-END" "*INTERFACE {
-  cmDependsFortranParser_SetInInterface(yyextra, 0);
-}
-INTERFACE        {
-  cmDependsFortranParser_SetInInterface(yyextra, 1);
-}
-
-END" "*MODULE   /* Ignore */
-MODULE          {
- if(!cmDependsFortranParser_GetInInterface(yyextra))
-   {
-   return MODULE;
-   }
-}
 
 #[ \t]*define   { return CPP_DEFINE; }
 \$[ \t]*DEFINE   { return F90PPR_DEFINE; }
@@ -148,23 +143,34 @@
 $[ \t]*else     { return F90PPR_ELSE; }
 $[ \t]*endif    { return F90PPR_ENDIF; }
 
-&[ \t]*\n |
-&[ \t]*\n[ \t]*& /* Ignore */
+ /* Line continuations, possible involving comments.  */
+&([ \t\n]*|!.*)*
+&([ \t\n]*|!.*)*&
 
+<fixed_fmt>\n[ ]{5}[^ ]  { return GARBAGE; }
 
-[^ \t\n\r;,!'""']+ { yylvalp->string = strdup(yytext); return WORD; }
+=|=>                     { return ASSIGNMENT_OP; }
+
+[a-zA-Z_][a-zA-Z_0-9]* {
+  yylvalp->string = strdup(yytext);
+  return WORD;
+}
+
+[^ \t\n\r;,!'"a-zA-Z=&]+ { return GARBAGE; }
+
+;|\n { return EOSTMT; }
 
-;|\n          { return EOSTMT; }
 
 [ \t\r,]         /* Ignore */
+\\[ \t]*\n       /* Ignore line-endings preceeded by \ */
 
-.               { return *yytext; }
+. { return *yytext; }
 
 <<EOF>> {
- if(!cmDependsFortranParser_FilePop(yyextra))
-   {
-   return YY_NULL;
-   }
+  if(!cmDependsFortranParser_FilePop(yyextra) )
+    {
+    return YY_NULL;
+    }
 }
 
 %%



More information about the Cmake-commits mailing list