これがコードです
lexer.l
---------------------------------------------------------------------------
parser.y
---------------------------------------------------------------------------
variable.hpp
---------------------------------------------------------------------------
補足
上から順に、lexer.l、parser.y、variable.hppです。
考察
parser.tab.c:995:9: error: use of deleted function ‘YYSTYPE::YYSTYPE()’
995 | YYSTYPE yylval;
| ^~~~~~
In file included from parser.tab.c:114:
parser.tab.h:92:7: note: ‘YYSTYPE::YYSTYPE()’ is implicitly deleted because the default definition would be ill-formed:
92 | union YYSTYPE
| ^~~~~~~
In file included from parser.tab.c:114:
parser.y:24:17: error: union member ‘YYSTYPE::str’ with non-trivial ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’
24 | std::string str;
| ^~~
parser.tab.c: In function ‘int yyparse()’:
parser.tab.c:1031:30: error: use of deleted function ‘YYSTYPE::YYSTYPE()’
1031 | YYSTYPE yyvsa[YYINITDEPTH];
| ^
parser.tab.c:1031:30: error: use of deleted function ‘YYSTYPE::~YYSTYPE()’
In file included from parser.tab.c:114:
parser.tab.h:92:7: note: ‘YYSTYPE::~YYSTYPE()’ is implicitly deleted because the default definition would be ill-formed:
92 | union YYSTYPE
| ^~~~~~~
In file included from parser.tab.c:114:
parser.y:24:17: error: union member ‘YYSTYPE::str’ with non-trivial ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::~basic_string() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’
24 | std::string str;
| ^~~
parser.tab.c:1031:30: error: use of deleted function ‘YYSTYPE::~YYSTYPE()’
1031 | YYSTYPE yyvsa[YYINITDEPTH];
| ^
parser.tab.c:1047:11: error: use of deleted function ‘YYSTYPE::YYSTYPE()’
1047 | YYSTYPE yyval;
| ^~~~~
parser.tab.c:1047:11: error: use of deleted function ‘YYSTYPE::~YYSTYPE()’
parser.tab.c:1231:14: error: use of deleted function ‘YYSTYPE& YYSTYPE::operator=(const YYSTYPE&)’
1231 | *++yyvsp = yylval;
| ^~~~~~
In file included from parser.tab.c:114:
parser.tab.h:92:7: note: ‘YYSTYPE& YYSTYPE::operator=(const YYSTYPE&)’ is implicitly deleted because the default definition would be ill-formed:
92 | union YYSTYPE
| ^~~~~~~
In file included from parser.tab.c:114:
parser.y:24:17: error: union member ‘YYSTYPE::str’ with non-trivial ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’
24 | std::string str;
| ^~~
parser.tab.c:1265:24: error: use of deleted function ‘YYSTYPE& YYSTYPE::operator=(const YYSTYPE&)’
1265 | yyval = yyvsp[1-yylen];
| ^
parser.y:91:40: error: expected unqualified-id before ‘void’
91 | $<void>T;
| ^
parser.y:91:40: error: expected ‘)’ before ‘void’
91 | $<void>T;
| ~ ^
| )
parser.y:95:39: error: expected unqualified-id before ‘void’
95 | $<void>F;
| ^
parser.y:95:39: error: expected ‘)’ before ‘void’
95 | $<void>F;
| ~ ^
| )
parser.y:100:54: error: expected ‘;’ before ‘<’ token
100 | for (int i=$on, i<$tw, i+=$th)
| ^
| ;
parser.y:100:54: error: expected primary-expression before ‘<’ token
parser.y:100:90: error: expected ‘;’ before ‘)’ token
100 | for (int i=$on, i<$tw, i+=$th)
| ^
| ;
parser.y:102:39: error: expected unqualified-id before ‘void’
102 | $<void>statements;
| ^~~~
parser.y:102:39: error: expected ‘)’ before ‘void’
102 | $<void>statements;
| ~ ^~~~
| )
parser.y:109:39: error: expected unqualified-id before ‘void’
109 | $<void>statements;
| ^~~~
parser.y:109:39: error: expected ‘)’ before ‘void’
109 | $<void>statements;
| ~ ^~~~
| )
parser.y:122:37: error: invalid use of ‘struct variableValue::value’
122 | tmp.value.integer = $expr_large;
| ^~~~~
parser.y:138:37: error: invalid use of ‘struct variableValue::value’
138 | tmp.value.decimal = $expr_large;
| ^~~~~
parser.y:154:37: error: invalid use of ‘struct variableValue::value’
154 | tmp.value.str = $expr_large;
| ^~~~~
parser.y:173:37: error: invalid use of ‘struct variableValue::value’
173 | tmp.value.integer = $expr_large;
| ^~~~~
parser.y:174:43: error: ‘class setVariable’ has no member named ‘push’
174 | variables.push(tmp);
| ^~~~
parser.y:189:37: error: invalid use of ‘struct variableValue::value’
189 | tmp.value.decimal = $expr_large;
| ^~~~~
parser.y:190:43: error: ‘class setVariable’ has no member named ‘push’
190 | variables.push(tmp);
| ^~~~
parser.y:205:37: error: invalid use of ‘struct variableValue::value’
205 | tmp.value.str = $expr_large;
| ^~~~~
parser.y:206:43: error: ‘class setVariable’ has no member named ‘push’
206 | variables.push(tmp);
| ^~~~
parser.y:263:73: error: expected ‘)’ before ‘;’ token
263 | for (variableValue element : variables.showVar();)
| ~ ^
| )
parser.y:263:74: error: expected primary-expression before ‘)’ token
263 | for (variableValue element : variables.showVar();)
| ^
parser.tab.c:1588:14: error: use of deleted function ‘YYSTYPE& YYSTYPE::operator=(const YYSTYPE&)’
1588 | *++yyvsp = yyval;
| ^~~~~
parser.tab.c:1697:14: error: use of deleted function ‘YYSTYPE& YYSTYPE::operator=(const YYSTYPE&)’
1697 | *++yyvsp = yylval;
| ^~~~~~
parser.tab.c: In function ‘void __static_initialization_and_destruction_0(int, int)’:
parser.tab.c:995:9: error: use of deleted function ‘YYSTYPE::~YYSTYPE()’
995 | YYSTYPE yylval;
| ^~~~~~
このエラーメッセージから考察するに、YYSTYPEすなわち型関係のエラーが中心である。(当たり前)
さて、どうやって修正するかだが、正直言ってさっぱりわからん。
仕方ないが、少しずつ書き直していく他ないだろう。
有識者の方は、なぜ動かないのか教えてくださると助かります。
*1:"_"|([a-z]|[A-Z]