• Advertisement

Archived

This topic is now archived and is closed to further replies.

bison++ problems

This topic is 5368 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is the code that I added to the first example (a postfix calculator) provided with the documentation for bison++ and flex++.
  
void parse :: yyerror (char* msg)
{
	printf ("%s", msg);
}

int parse :: yylex ()
{
	int c =  0;
	while ((c = getchar ()) == '' '' || c == ''\t'');
	if (c == ''.'' || isdigit (c))
	{
		ungetc (c, stdin);
		scanf ("%lf", yylval);
		return NUM;
	}
	if (c == EOF)
	{
		return c;
	}
	return c;
}

int main (int argc, char** argv)
{
	parse* parser = new parse ();
	parser->yylex ();
	delete parser;
	parser = 0;
	return 0;
}

  
The code compiles fine, with a few tweaks, like defining that alloc should not be used. However, on execution, when I enter the line 4 5 +, expecting 9, I instead get a runtime error: R6002 - runtime error, floating point not loaded. What is this, and how can I prevent it from occuring? I''m very new to both compiler compilers, and especially bison, having messed around a bit in SableCC. Any help is much appreciated.
I''m from the north of England. We live in huts.

Share this post


Link to post
Share on other sites
Advertisement
Well done for mis-posting the error message in the other forum

Look here and post again if you can''t fix it. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/r6002.asp

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]

Share this post


Link to post
Share on other sites

  • Advertisement