Hello all,
I've been trying to build a compiler for learning purposes. I'm creating the lexer with gnu flex and a parser with bison. I've been using these tools on Linux but my main development platform is windows (Visual Studio). But last week I ran into a problem: When I run the parser, the application freezes. If I pause the application (using VS' debugger pause) it always stops at the same location in the C library.
The callstack:
The line of code at which the application pauses:
else if ( !ReadFile( (HANDLE)_osfhnd(fh), buffer, cnt, (LPDWORD)&os_read,
NULL ) || os_read < 0 || (size_t)os_read > cnt)
I validated that the stream is valid and is the correct file.
I'm using the gnuwin32 version of flex on windows to generate the lexer.
I've reduced the flex file to:
%{
#include <iostream>
using namespace std;
#include "muse.tab.h"
#define YY_DECL extern "C" int yylex()
%}
%option yylineno
%%
.* { std::cout << "hello"; return T_USING; } ;
%%
Is there anyone who has encountered this issue before?