Jump to content

  • Log In with Google      Sign In   
  • Create Account


bison++ problems


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 MDI   Members   -  Reputation: 266

Like
Likes
Like

Posted 12 May 2003 - 07:34 AM

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 ©)
	{
		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.

Sponsor:

#2 Kylotan   Moderators   -  Reputation: 3338

Like
Likes
Like

Posted 13 May 2003 - 11:57 PM

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]





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS