I compiled the files created in the bison in Visual Studio and received these errors:
... \ position.hh (83): error C2589: '(': illegal token on the right side of '::'
... \ position.hh (83): error C2059: syntax error: '::'
... \ position.hh (83): error C2589: '(': illegal token on the right side of '::'
... \ position.hh (83): error C2059: syntax error: '::'
Relevant Code:
inline void columns (int count = 1) { column = std::max (1u, column + count); }
I think the problem is related to std :: max; if I change std :: max to equivalent code, then there are no more problems, but is there a better solution instead of changing the generated code?
Here is the bison file I wrote:
// // bison.yy // %skeleton "lalr1.cc" %require "2.4.2" %defines %define parser_class_name "cmd_parser" %locations %debug %error-verbose %code requires { class ParserDriver; } %parse-param { ParserDriver& driver } %lex-param { ParserDriver& driver } %union { struct ast *a; double d; struct symbol *s; struct symlist *sl; int fn; } %code {
c ++ windows visual-c ++ bison
Haiyang May 7, '10 at 14:54 2010-05-07 14:54
source share