मैं दृश्य स्टूडियो में मेरी जंगली भैंसों-उत्पन्न फ़ाइलों संकलित और मिल गया इन त्रुटियों:समस्या बुला std :: अधिकतम
... \ position.hh (83): त्रुटि C2589: '(': अवैध टोकन '::'
... \ position.hh (83): त्रुटि C2059: वाक्यविन्यास त्रुटि: '::'
... \ position.hh (83): त्रुटि C2589: '(' : के दाईं ओर अवैध टोकन '::'
... \ position.hh (83): त्रुटि C2059: सिंटेक्स त्रुटि: '::'
सह संबंधित कोड है:
inline void columns (int count = 1)
{
column = std::max (1u, column + count);
}
मुझे लगता है कि समस्या std :: max के साथ है; अगर मैं std :: max को समकक्ष कोड में बदलता हूं तो अब कोई समस्या नहीं है, लेकिन क्या जेनरेट कोड बदलने के बजाय कोई बेहतर समाधान है?
//
// 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 {
#include "helper_func.h"
#include "ParserDriver.h"
std::string error_msg = "";
}
%token <d> NUMBER
%token <s> NAME
%token <fn> FUNC
%token EOL
%token IF THEN ELSE WHILE DO LET
%token SYM_TABLE_OVERFLOW
%token UNKNOWN_CHARACTER
%nonassoc <fn> CMP
%right '='
%left '+' '-'
%left '*' '/'
%nonassoc '|' UMINUS
%type <a> exp stmt list explist
%type <sl> symlist
%{
extern int yylex(yy::cmd_parser::semantic_type *yylval,
yy::cmd_parser::location_type* yylloc);
%}
%start calclist
%%
... grammar rules ...