summaryrefslogtreecommitdiff
path: root/BUGS
blob: f456b696fbb9943ef61779f367bbe38ea43d5351 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
This is a list of bugs still in the queue at lex.sf.net at the time we closed
out the project and moved it to flex.sf.net.

-------------------------------------------------------------

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
<FlexLexer.h> 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 <FlexLexer.h>

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 "derived_lexer.h"
%}

%option yyclass="derived_lexer"

%%
[0-9]+ {
x = atoi(yytext);
}
%%

main.cpp:

#include "derived_lexer.h"
#include <fstream>

int main()
{
std::ifstream input;
input.open("input");
derived_lexer lexer(&input);
lexer.yylex();
}

-------------------------------------------------------------

Hi, the anomally is that if I generate a c++ parser it will not make 
yy_scan_buffer and friends.
this is happenning on flex version 2.5.4.
Is this the intent, if so how do I make a c++ parser read from my buffer?

P.S. in c++ it will only generate:
#ifndef YY_NO_SCAN_BUFFER
#endif


#ifndef YY_NO_SCAN_STRING
#endif


#ifndef YY_NO_SCAN_BYTES
#endif
-------------------------------------------------------------