]> granicus.if.org Git - flex/commitdiff
Transfered bugs list from lex.sf.net to BUGS file.
authorJohn Millaway <john43@users.sourceforge.net>
Wed, 15 Feb 2006 18:31:06 +0000 (18:31 +0000)
committerJohn Millaway <john43@users.sourceforge.net>
Wed, 15 Feb 2006 18:31:06 +0000 (18:31 +0000)
BUGS [new file with mode: 0644]
flex.skl

diff --git a/BUGS b/BUGS
new file mode 100644 (file)
index 0000000..bf2752d
--- /dev/null
+++ b/BUGS
@@ -0,0 +1,89 @@
+This is a list of bugs still in the queue at lex.sf.net at the time we closed
+out the project.
+
+-------------------------------------------------------------
+
+Some strict compilers warn about a few internal flex variables signedness. They
+are bogus warnings and can be ignored, but people send in reports nonethless.
+
+-------------------------------------------------------------
+
+The initializer of the yy_transition array in the
+generated scanner
+contains fewer entries than the declared size of the array.
+
+Examples include yy_transition[6504] with 6250 entries,
+yy_transition[13215] with 12961 entries. This looks
+like it
+is always 254 fewer entries than the declared size.
+
+This bug is present in flex 2.5.4a as well. It appears to be harmless.
+
+-------------------------------------------------------------
+The examples in the chapter "Generating C++ Scanners"
+contain suspicious code. Attached is a patch that
+corrects this, and after these
+modifications this example compiles and works.
+
+-------------------------------------------------------------
+
+C++ scanners derived from the yyFlexLexer base class
+will not compile with flex-2.5.31 because the
+&lt;FlexLexer.h&gt; automatically gets included into the
+scanner twice. Because yyFlexLexer is now defined by
+default even if no prefix is specified, including
+FlexLexer.h twice causes the class yyFlexLexer to be
+declared twice. In flex-2.5.4 because yyFlexLexer was
+not defined by flex in the scanner code, including
+FlexLexer.h more than once only declared yyFlexLexer
+once. I appreciate that this is because of the M4
+additions to flex, but I can not find a way to stop
+flex defining yyFlexLexer if it is not needed.
+
+Here is an example of a class that will not compile:
+
+derived_lexer.h:
+
+#ifndef __derived_lexer__
+#define __derived_lexer__
+
+#include &lt;FlexLexer.h&gt;
+
+class derived_lexer : public yyFlexLexer
+{
+public:
+derived_lexer(std::istream* arg_yyin = 0) :
+yyFlexLexer(arg_yyin){}
+int yylex();
+int x;
+};
+#endif
+
+derived_lexer.l:
+
+%{
+#include &quot;derived_lexer.h&quot;
+%}
+
+%option yyclass=&quot;derived_lexer&quot;
+
+%%
+[0-9]+ {
+x = atoi(yytext);
+}
+%%
+
+main.cpp:
+
+#include &quot;derived_lexer.h&quot;
+#include &lt;fstream&gt;
+
+int main()
+{
+std::ifstream input;
+input.open(&quot;input&quot;);
+derived_lexer lexer(&amp;input);
+lexer.yylex();
+}
+
+-------------------------------------------------------------
index 7f32501254856985738887d73cdddd0dc0f8db1b..32c65d22f12dbbca35a4bb17ade57f887a12fe35 100644 (file)
--- a/flex.skl
+++ b/flex.skl
@@ -82,7 +82,10 @@ m4preproc_define(`M4_GEN_PREFIX',
 
 %if-c++-only
     /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
-     * following macro.
+     * following macro. This is required in order to pass the c++-multiple-scanners
+     * test in the regression suite. We get reports that it breaks inheritance.
+     * We will address this in a future release of flex, or omit the C++ scanner
+     * altogether.
      */
     #define yyFlexLexer M4_YY_PREFIX[[FlexLexer]]
 %endif