I am trying to run a Bison code where I have implemented a parser. But after running the code in Git Bash, it is generating some errors. Please help me fix the errors. These are the errors I am getting: 20141009.y:272:56: error: invalid operands of types 'const char [3]' and 'const char [2]' to binary 'operator+' 272 | $$ = new symbol_info("if" + " " + "(" + $3->getname() + ")" + $5->getname(), "stmnt"); | ~~~~ ^ ~~~ | | | | | const char [2] | const char [3] 20141009.y:281:56: error: invalid operands of types 'const char [3]' and 'const char [2]' to binary 'operator+' 281 | $$ = new symbol_info("if" + " " + "(" + $3->getname() + ")" + " " + $5->getname() + "\n" + "else" + "\n" + $6->getname(),"stmnt"); | ~~~~ ^ ~~~ | | | | | const char [2] | const char [3] 20141009.y:291:59: error: invalid operands of types 'const char [6]' and 'const char [2]' to binary 'operator+' 291 | $$ = new symbol_info("while" + " " + "(" + $3->getname()+ ")" + " " <<$5->getname(),"stmnt"); | ~~~~~~~ ^ ~~~ | | | | | const char [2] | const char [6] 20141009.y:308:59: error: invalid operands of types 'const char [7]' and 'const char [2]' to binary 'operator+' 308 | $$ = new symbol_info("return"+ " " + $2->getname()+ ";" , "stmnt"); | ~~~~~~~~^ ~~~ | | | | | const char [2] | const char [7]
I am trying to run a Bison code where I have implemented a parser. But after running the code in Git Bash, it is generating some errors. Please help me fix the errors.
These are the errors I am getting:
20141009.y:272:56: error: invalid operands of types 'const char [3]' and 'const char [2]' to binary 'operator+'
272 | $$ = new symbol_info("if" + " " + "(" + $3->getname() + ")" + $5->getname(), "stmnt");
| ~~~~ ^ ~~~
| | |
| | const char [2]
| const char [3]
20141009.y:281:56: error: invalid operands of types 'const char [3]' and 'const char [2]' to binary 'operator+'
281 | $$ = new symbol_info("if" + " " + "(" + $3->getname() + ")" + " " + $5->getname() + "\n" + "else" + "\n" + $6->getname(),"stmnt");
| ~~~~ ^ ~~~
| | |
| | const char [2]
| const char [3]
20141009.y:291:59: error: invalid operands of types 'const char [6]' and 'const char [2]' to binary 'operator+'
291 | $$ = new symbol_info("while" + " " + "(" + $3->getname()+ ")" + " " <<$5->getname(),"stmnt");
| ~~~~~~~ ^ ~~~
| | |
| | const char [2]
| const char [6]
20141009.y:308:59: error: invalid operands of types 'const char [7]' and 'const char [2]' to binary 'operator+'
308 | $$ = new symbol_info("return"+ " " + $2->getname()+ ";" , "stmnt");
| ~~~~~~~~^ ~~~
| | |
| | const char [2]
| const char [7]
Step by step
Solved in 3 steps