Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile Bison input in C++ mode #77

Closed
Benlewis9000 opened this issue Jun 8, 2021 · 2 comments
Closed

Cannot compile Bison input in C++ mode #77

Benlewis9000 opened this issue Jun 8, 2021 · 2 comments
Assignees

Comments

@Benlewis9000
Copy link

I am trying to use both Bison and Flex in C++ mode so I can utilise features like vectors. I am using Visual Studio 2019 and the pre-compiled win_flex_bison3-latest.zip as found here to make my custom build rules (version 3.7.4).

I have attempted to enable C++ input by adding %require "3.7.4" and %language "c++" to the prologue. When I then try to rebuild my solution it results in some 109 errors.

Bison Input

%require "3.7.4"
%language "c++"
%define api.value.type variant

%{
#include <stdlib.h>
#include <stdio.h>
#include <vector>
extern "C" int yylex();
void yyerror(const char*);
extern int yy_flex_debug;
float *stmts;
void print(float *start, float *end);
%}

// Assign tokens to member of union
%token <ival> INTEGER
%token <fval> FLOAT
%type <fval> expr 
%type <std::vector<float>> stmt_list;
// Associativity
%left '-' '+'
%left '*' '/'

%%

// Formal grammar
program:	
			stmt_list '\n'			{
										for (std::vector<float>::iterator it = $1.begin; it != $1.end(); ++it){
											printf("Result: %g\n", *p);
										}
									}
			| program stmt_list '\n'	{
										for (std::vector<float>::iterator it = $2.begin; it != $2.end(); ++it) {
											printf("Result: %g\n", *p);
										}
									}
			;

stmt_list:
			expr ';'				{
										$$ = {$1};
									}
			| stmt_list expr ';'	{
										$$ = $1;
										$$.push_back($2);
									}
			| error ';'				{
										$$ = {};	// Empty vector
									}
			| stmt_list error ';'	{ $$ = $1; }	// Do nothing 
			;

/*stmt:
			expr ';'			{ $$ = $1; }
			| error ';'
			;
*/
expr:
			INTEGER		{ $$ = $1; }
			| FLOAT			{ $$ = $1; }
			| expr '-' expr	{ $$ = $1 - $3; }
			| expr '+' expr { $$ = $1 + $3; }
			| expr '*' expr { $$ = $1 * $3; }
			| expr '/' expr { $$ = $1 / $3; }
			| '(' expr ')'	{ $$ = $2; }
			;

%%

void yyerror(const char* msg){
	fprintf(stderr, "ERROR: %s\n", msg);
}

void print(float *start, float *end){
	for (float* p = start; p < end; p++) {
		printf("Result: %g\n", *p);
	}
}

int main(void){
	// Explicitly disable lex tracing
	yy_flex_debug = 1;
	yydebug = 0;
	yyparse();
	return 0;
}

Output

1>------ Rebuild All started: Project: Calculator, Configuration: Debug Win32 ------
1>Build started 08/06/2021 20:50:49.
1>Target _PrepareForClean:
1>  Deleting file "Debug\Calculator.tlog\Calculator.lastbuildstate".
1>Target InitializeBuildStatus:
1>  Touching "Debug\Calculator.tlog\unsuccessfulbuild".
1>Target BisonTarget:
1>  Process "calculator.y" bison file
1>Target FlexTarget:
1>  Process "calculator.l" flex file
1>Target VcpkgTripletSelection:
1>  Using triplet "x86-windows" from "C:\Users\benja\vcpkg\vcpkg\scripts\buildsystems\msbuild\..\..\..\installed\x86-windows\"
1>Target ClCompile:
1>  calculator.flex.cpp
1>  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(49,1): warning C4005: 'INT8_MIN': macro redefinition
1>  C:\repos\Calculator\Calculator\calculator.flex.cpp(83): message : see previous definition of 'INT8_MIN'
1>  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(50,1): warning C4005: 'INT16_MIN': macro redefinition
1>  C:\repos\Calculator\Calculator\calculator.flex.cpp(86): message : see previous definition of 'INT16_MIN'
1>  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(51,1): warning C4005: 'INT32_MIN': macro redefinition
1>  C:\repos\Calculator\Calculator\calculator.flex.cpp(89): message : see previous definition of 'INT32_MIN'
1>  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(53,1): warning C4005: 'INT8_MAX': macro redefinition
1>  C:\repos\Calculator\Calculator\calculator.flex.cpp(92): message : see previous definition of 'INT8_MAX'
1>  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(54,1): warning C4005: 'INT16_MAX': macro redefinition
1>  C:\repos\Calculator\Calculator\calculator.flex.cpp(95): message : see previous definition of 'INT16_MAX'
1>  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(55,1): warning C4005: 'INT32_MAX': macro redefinition
1>  C:\repos\Calculator\Calculator\calculator.flex.cpp(98): message : see previous definition of 'INT32_MAX'
1>  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(57,1): warning C4005: 'UINT8_MAX': macro redefinition
1>  C:\repos\Calculator\Calculator\calculator.flex.cpp(101): message : see previous definition of 'UINT8_MAX'
1>  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(58,1): warning C4005: 'UINT16_MAX': macro redefinition
1>  C:\repos\Calculator\Calculator\calculator.flex.cpp(104): message : see previous definition of 'UINT16_MAX'
1>  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(59,1): warning C4005: 'UINT32_MAX': macro redefinition
1>  C:\repos\Calculator\Calculator\calculator.flex.cpp(107): message : see previous definition of 'UINT32_MAX'
1>  C:\repos\Calculator\Calculator\calculator.flex.cpp(368,10): fatal error C1083: Cannot open include file: 'FlexLexer.h': No such file or directory
1>  calculator.tab.cpp
1>  C:\repos\Calculator\Calculator\calculator.tab.h(368,27): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.h(371,27): error C2065: 'ival': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.h(528,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>  C:\repos\Calculator\Calculator\calculator.tab.h(626): message : see reference to class template instantiation 'yy::parser::basic_symbol<Base>' being compiled
1>  C:\repos\Calculator\Calculator\calculator.tab.h(528,59): error C2143: syntax error: missing ',' before '&'
1>  C:\repos\Calculator\Calculator\calculator.tab.h(540,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>  C:\repos\Calculator\Calculator\calculator.tab.h(540,59): error C2143: syntax error: missing ',' before '&'
1>  C:\repos\Calculator\Calculator\calculator.tab.h(540,1): error C2535: 'yy::parser::basic_symbol<Base>::basic_symbol(basic_symbol<Base>::Base::kind_type,const int)': member function already defined or declared
1>  C:\repos\Calculator\Calculator\calculator.tab.h(528): message : see declaration of 'yy::parser::basic_symbol<Base>::basic_symbol'
1>  C:\repos\Calculator\Calculator\calculator.tab.h(540,1): error C2535: 'yy::parser::basic_symbol<yy::parser::by_kind>::basic_symbol(yy::parser::by_kind::kind_type,const int)': member function already defined or declared
1>  C:\repos\Calculator\Calculator\calculator.tab.h(528): message : see declaration of 'yy::parser::basic_symbol<yy::parser::by_kind>::basic_symbol'
1>  C:\repos\Calculator\Calculator\calculator.tab.h(691,19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>  C:\repos\Calculator\Calculator\calculator.tab.h(691,39): error C2143: syntax error: missing ',' before '&'
1>  C:\repos\Calculator\Calculator\calculator.tab.h(699,19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>  C:\repos\Calculator\Calculator\calculator.tab.h(699,39): error C2143: syntax error: missing ',' before '&'
1>  C:\repos\Calculator\Calculator\calculator.tab.h(699,19): error C2535: 'yy::parser::symbol_type::symbol_type(int,const int)': member function already defined or declared
1>  C:\repos\Calculator\Calculator\calculator.tab.h(691): message : see declaration of 'yy::parser::symbol_type::symbol_type'
1>  C:\repos\Calculator\Calculator\calculator.tab.h(808,31): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>  C:\repos\Calculator\Calculator\calculator.tab.h(808,31): error C2143: syntax error: missing ',' before '&'
1>  C:\repos\Calculator\Calculator\calculator.tab.h(823,29): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>  C:\repos\Calculator\Calculator\calculator.tab.h(823,29): error C2143: syntax error: missing ',' before '&'
1>  C:\repos\Calculator\Calculator\calculator.tab.h(540,1): error C2535: 'yy::parser::basic_symbol<yy::parser::by_state>::basic_symbol(yy::parser::by_state::kind_type,const int)': member function already defined or declared
1>  C:\repos\Calculator\Calculator\calculator.tab.h(528): message : see declaration of 'yy::parser::basic_symbol<yy::parser::by_state>::basic_symbol'
1>  C:\repos\Calculator\Calculator\calculator.tab.h(530,3): error C3861: 'v': identifier not found
1>  C:\repos\Calculator\Calculator\calculator.tab.h(542,3): error C3861: 'v': identifier not found
1>  C:\repos\Calculator\Calculator\calculator.tab.h(582,33): error C3861: 'fval': identifier not found
1>  C:\repos\Calculator\Calculator\calculator.tab.h(586,33): error C3861: 'ival': identifier not found
1>  C:\repos\Calculator\Calculator\calculator.tab.h(692,40): error C2065: 'v': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.h(700,40): error C2065: 'v': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.h(810,45): error C2065: 'v': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.h(825,43): error C2065: 'v': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.h(1199,21): error C3861: 'fval': identifier not found
1>  C:\repos\Calculator\Calculator\calculator.tab.h(1203,21): error C3861: 'ival': identifier not found
1>  C:\repos\Calculator\Calculator\calculator.tab.h(1241,21): error C3861: 'fval': identifier not found
1>  C:\repos\Calculator\Calculator\calculator.tab.h(1245,21): error C3861: 'ival': identifier not found
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(198,32): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(198,14): error C2672: 'yy::parser::semantic_type::copy': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(198,60): error C2974: 'yy::parser::semantic_type::copy': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(324): message : see declaration of 'yy::parser::semantic_type::copy'
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(202,32): error C2065: 'ival': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(202,14): error C2672: 'yy::parser::semantic_type::copy': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(202,60): error C2974: 'yy::parser::semantic_type::copy': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(324): message : see declaration of 'yy::parser::semantic_type::copy'
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(226,21): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(226,14): error C2672: 'yy::parser::semantic_type::move': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(226,49): error C2974: 'yy::parser::semantic_type::move': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(299): message : see declaration of 'yy::parser::semantic_type::move'
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(230,21): error C2065: 'ival': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(230,14): error C2672: 'yy::parser::semantic_type::move': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(230,49): error C2974: 'yy::parser::semantic_type::move': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(299): message : see declaration of 'yy::parser::semantic_type::move'
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(254,21): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(254,14): error C2672: 'yy::parser::semantic_type::copy': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(254,39): error C2974: 'yy::parser::semantic_type::copy': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(324): message : see declaration of 'yy::parser::semantic_type::copy'
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(258,21): error C2065: 'ival': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(258,14): error C2672: 'yy::parser::semantic_type::copy': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(258,39): error C2974: 'yy::parser::semantic_type::copy': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(324): message : see declaration of 'yy::parser::semantic_type::copy'
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(280,21): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(280,14): error C2672: 'yy::parser::semantic_type::move': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(280,39): error C2974: 'yy::parser::semantic_type::move': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(299): message : see declaration of 'yy::parser::semantic_type::move'
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(284,21): error C2065: 'ival': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(284,14): error C2672: 'yy::parser::semantic_type::move': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(284,39): error C2974: 'yy::parser::semantic_type::move': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(299): message : see declaration of 'yy::parser::semantic_type::move'
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(547,30): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(547,20): error C2672: 'yy::parser::semantic_type::emplace': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(547,38): error C2974: 'yy::parser::semantic_type::emplace': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(239): message : see declaration of 'yy::parser::semantic_type::emplace'
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(551,30): error C2065: 'ival': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(551,20): error C2672: 'yy::parser::semantic_type::emplace': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.tab.cpp(551,38): error C2974: 'yy::parser::semantic_type::emplace': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(239): message : see declaration of 'yy::parser::semantic_type::emplace'
1>  C:\repos\Calculator\Calculator\calculator.y(43,11): error C3867: 'std::vector<float,std::allocator<float>>::begin': non-standard syntax; use '&' to create a pointer to member
1>  C:\repos\Calculator\Calculator\calculator.y(44,36): error C2065: 'p': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(51,11): error C3867: 'std::vector<float,std::allocator<float>>::begin': non-standard syntax; use '&' to create a pointer to member
1>  C:\repos\Calculator\Calculator\calculator.y(52,36): error C2065: 'p': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(68,78): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(68,72): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.y(68,86): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(274): message : see declaration of 'yy::parser::semantic_type::as'
1>  C:\repos\Calculator\Calculator\calculator.y(77,85): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(77,79): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.y(77,93): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(274): message : see declaration of 'yy::parser::semantic_type::as'
1>  C:\repos\Calculator\Calculator\calculator.y(93,60): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(93,54): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.y(93,68): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(274): message : see declaration of 'yy::parser::semantic_type::as'
1>  C:\repos\Calculator\Calculator\calculator.y(93,95): error C2065: 'ival': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(93,89): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.y(93,103): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(274): message : see declaration of 'yy::parser::semantic_type::as'
1>  C:\repos\Calculator\Calculator\calculator.y(94,68): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(94,62): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.y(94,76): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(274): message : see declaration of 'yy::parser::semantic_type::as'
1>  C:\repos\Calculator\Calculator\calculator.y(94,103): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(94,97): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.y(94,111): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(274): message : see declaration of 'yy::parser::semantic_type::as'
1>  C:\repos\Calculator\Calculator\calculator.y(95,60): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(95,54): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.y(95,68): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(274): message : see declaration of 'yy::parser::semantic_type::as'
1>  C:\repos\Calculator\Calculator\calculator.y(95,95): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(95,89): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.y(95,103): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(274): message : see declaration of 'yy::parser::semantic_type::as'
1>  C:\repos\Calculator\Calculator\calculator.y(95,130): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(95,124): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.y(95,138): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(274): message : see declaration of 'yy::parser::semantic_type::as'
1>  C:\repos\Calculator\Calculator\calculator.y(96,60): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(96,54): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.y(96,68): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(274): message : see declaration of 'yy::parser::semantic_type::as'
1>  C:\repos\Calculator\Calculator\calculator.y(96,95): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(96,89): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.y(96,103): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(274): message : see declaration of 'yy::parser::semantic_type::as'
1>  C:\repos\Calculator\Calculator\calculator.y(96,130): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(96,124): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.y(96,138): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(274): message : see declaration of 'yy::parser::semantic_type::as'
1>  C:\repos\Calculator\Calculator\calculator.y(97,60): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(97,54): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.y(97,68): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(274): message : see declaration of 'yy::parser::semantic_type::as'
1>  C:\repos\Calculator\Calculator\calculator.y(97,95): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(97,89): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>  C:\repos\Calculator\Calculator\calculator.y(97,103): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>  C:\repos\Calculator\Calculator\calculator.tab.h(274): message : see declaration of 'yy::parser::semantic_type::as'
1>  C:\repos\Calculator\Calculator\calculator.y(97,130): error C2065: 'fval': undeclared identifier
1>  C:\repos\Calculator\Calculator\calculator.y(97,135): fatal error C1003: error count exceeds 100; stopping compilation
1>  Generating Code...
1>Done building target "ClCompile" in project "Calculator.vcxproj" -- FAILED.
1>
1>Done building project "Calculator.vcxproj" -- FAILED.
1>
1>Build FAILED.
1>
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(49,1): warning C4005: 'INT8_MIN': macro redefinition
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(50,1): warning C4005: 'INT16_MIN': macro redefinition
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(51,1): warning C4005: 'INT32_MIN': macro redefinition
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(53,1): warning C4005: 'INT8_MAX': macro redefinition
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(54,1): warning C4005: 'INT16_MAX': macro redefinition
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(55,1): warning C4005: 'INT32_MAX': macro redefinition
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(57,1): warning C4005: 'UINT8_MAX': macro redefinition
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(58,1): warning C4005: 'UINT16_MAX': macro redefinition
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\stdint.h(59,1): warning C4005: 'UINT32_MAX': macro redefinition
1>C:\repos\Calculator\Calculator\calculator.flex.cpp(368,10): fatal error C1083: Cannot open include file: 'FlexLexer.h': No such file or directory
1>C:\repos\Calculator\Calculator\calculator.tab.h(368,27): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.h(371,27): error C2065: 'ival': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.h(528,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\repos\Calculator\Calculator\calculator.tab.h(528,59): error C2143: syntax error: missing ',' before '&'
1>C:\repos\Calculator\Calculator\calculator.tab.h(540,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\repos\Calculator\Calculator\calculator.tab.h(540,59): error C2143: syntax error: missing ',' before '&'
1>C:\repos\Calculator\Calculator\calculator.tab.h(540,1): error C2535: 'yy::parser::basic_symbol<Base>::basic_symbol(basic_symbol<Base>::Base::kind_type,const int)': member function already defined or declared
1>C:\repos\Calculator\Calculator\calculator.tab.h(540,1): error C2535: 'yy::parser::basic_symbol<yy::parser::by_kind>::basic_symbol(yy::parser::by_kind::kind_type,const int)': member function already defined or declared
1>C:\repos\Calculator\Calculator\calculator.tab.h(691,19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\repos\Calculator\Calculator\calculator.tab.h(691,39): error C2143: syntax error: missing ',' before '&'
1>C:\repos\Calculator\Calculator\calculator.tab.h(699,19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\repos\Calculator\Calculator\calculator.tab.h(699,39): error C2143: syntax error: missing ',' before '&'
1>C:\repos\Calculator\Calculator\calculator.tab.h(699,19): error C2535: 'yy::parser::symbol_type::symbol_type(int,const int)': member function already defined or declared
1>C:\repos\Calculator\Calculator\calculator.tab.h(808,31): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\repos\Calculator\Calculator\calculator.tab.h(808,31): error C2143: syntax error: missing ',' before '&'
1>C:\repos\Calculator\Calculator\calculator.tab.h(823,29): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\repos\Calculator\Calculator\calculator.tab.h(823,29): error C2143: syntax error: missing ',' before '&'
1>C:\repos\Calculator\Calculator\calculator.tab.h(540,1): error C2535: 'yy::parser::basic_symbol<yy::parser::by_state>::basic_symbol(yy::parser::by_state::kind_type,const int)': member function already defined or declared
1>C:\repos\Calculator\Calculator\calculator.tab.h(530,3): error C3861: 'v': identifier not found
1>C:\repos\Calculator\Calculator\calculator.tab.h(542,3): error C3861: 'v': identifier not found
1>C:\repos\Calculator\Calculator\calculator.tab.h(582,33): error C3861: 'fval': identifier not found
1>C:\repos\Calculator\Calculator\calculator.tab.h(586,33): error C3861: 'ival': identifier not found
1>C:\repos\Calculator\Calculator\calculator.tab.h(692,40): error C2065: 'v': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.h(700,40): error C2065: 'v': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.h(810,45): error C2065: 'v': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.h(825,43): error C2065: 'v': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.h(1199,21): error C3861: 'fval': identifier not found
1>C:\repos\Calculator\Calculator\calculator.tab.h(1203,21): error C3861: 'ival': identifier not found
1>C:\repos\Calculator\Calculator\calculator.tab.h(1241,21): error C3861: 'fval': identifier not found
1>C:\repos\Calculator\Calculator\calculator.tab.h(1245,21): error C3861: 'ival': identifier not found
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(198,32): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(198,14): error C2672: 'yy::parser::semantic_type::copy': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(198,60): error C2974: 'yy::parser::semantic_type::copy': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(202,32): error C2065: 'ival': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(202,14): error C2672: 'yy::parser::semantic_type::copy': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(202,60): error C2974: 'yy::parser::semantic_type::copy': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(226,21): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(226,14): error C2672: 'yy::parser::semantic_type::move': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(226,49): error C2974: 'yy::parser::semantic_type::move': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(230,21): error C2065: 'ival': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(230,14): error C2672: 'yy::parser::semantic_type::move': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(230,49): error C2974: 'yy::parser::semantic_type::move': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(254,21): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(254,14): error C2672: 'yy::parser::semantic_type::copy': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(254,39): error C2974: 'yy::parser::semantic_type::copy': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(258,21): error C2065: 'ival': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(258,14): error C2672: 'yy::parser::semantic_type::copy': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(258,39): error C2974: 'yy::parser::semantic_type::copy': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(280,21): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(280,14): error C2672: 'yy::parser::semantic_type::move': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(280,39): error C2974: 'yy::parser::semantic_type::move': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(284,21): error C2065: 'ival': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(284,14): error C2672: 'yy::parser::semantic_type::move': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(284,39): error C2974: 'yy::parser::semantic_type::move': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(547,30): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(547,20): error C2672: 'yy::parser::semantic_type::emplace': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(547,38): error C2974: 'yy::parser::semantic_type::emplace': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(551,30): error C2065: 'ival': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(551,20): error C2672: 'yy::parser::semantic_type::emplace': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.tab.cpp(551,38): error C2974: 'yy::parser::semantic_type::emplace': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(43,11): error C3867: 'std::vector<float,std::allocator<float>>::begin': non-standard syntax; use '&' to create a pointer to member
1>C:\repos\Calculator\Calculator\calculator.y(44,36): error C2065: 'p': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(51,11): error C3867: 'std::vector<float,std::allocator<float>>::begin': non-standard syntax; use '&' to create a pointer to member
1>C:\repos\Calculator\Calculator\calculator.y(52,36): error C2065: 'p': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(68,78): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(68,72): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.y(68,86): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(77,85): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(77,79): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.y(77,93): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(93,60): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(93,54): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.y(93,68): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(93,95): error C2065: 'ival': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(93,89): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.y(93,103): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(94,68): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(94,62): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.y(94,76): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(94,103): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(94,97): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.y(94,111): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(95,60): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(95,54): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.y(95,68): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(95,95): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(95,89): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.y(95,103): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(95,130): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(95,124): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.y(95,138): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(96,60): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(96,54): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.y(96,68): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(96,95): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(96,89): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.y(96,103): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(96,130): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(96,124): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.y(96,138): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(97,60): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(97,54): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.y(97,68): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(97,95): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(97,89): error C2672: 'yy::parser::semantic_type::as': no matching overloaded function found
1>C:\repos\Calculator\Calculator\calculator.y(97,103): error C2974: 'yy::parser::semantic_type::as': invalid template argument for 'T', type expected
1>C:\repos\Calculator\Calculator\calculator.y(97,130): error C2065: 'fval': undeclared identifier
1>C:\repos\Calculator\Calculator\calculator.y(97,135): fatal error C1003: error count exceeds 100; stopping compilation
1>    9 Warning(s)
1>    109 Error(s)
1>
1>Time Elapsed 00:00:01.96
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

I'm unsure if I'm doing something wrong or if this is a bug, I tried to follow the bison manual as closely as possible.

@lexxmark lexxmark self-assigned this Jun 8, 2021
@lexxmark
Copy link
Owner

For the warnings see #29

The 1st error is that C++ flex source code requires FlexLexer.h to be available in include paths (add include path to FlexLexer.h or copy it to folder where C++ compiler can find it).
See #69 (comment)

1>C:\repos\Calculator\Calculator\calculator.flex.cpp(368,10): fatal error C1083: Cannot open include file: 'FlexLexer.h': No such file or directory

@lexxmark
Copy link
Owner

Feel free to reopen it if something else needed to be clarified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants