19#include <ansi-c/ansi_c_y.tab.h>
40 lex.LookAhead(0, _tk); \
41 std::cout << std::string(__indent, ' ') << "Text [" << _tk.line_no << "]: " \
42 << _tk.text << '\n'; \
118 return "CLASS_TEMPLATE";
120 return "MEMBER_TEMPLATE";
122 return "FUNCTION_TEMPLATE";
126 return "NON_TYPE_TEMPLATE_PARAMETER";
128 return "TYPE_TEMPLATE_PARAMETER";
130 return "TEMPLATE_TEMPLATE_PARAMETER";
136 typedef std::map<irep_idt, new_scopet>
id_mapt;
143 inline void print(std::ostream &out)
const
143 inline void print(std::ostream &out)
const {
…}
161 void print_rec(std::ostream &,
unsigned indent)
const;
184 for(id_mapt::const_iterator
189 out << std::string(indent,
' ') << it->first <<
": "
191 it->second.print_rec(out, indent+2);
204 config.cpp.cpp_standard ==
configt::cppt::cpp_standardt::CPP11 ||
205 config.cpp.cpp_standard ==
configt::cppt::cpp_standardt::CPP14 ||
206 config.cpp.cpp_standard ==
configt::cppt::cpp_standardt::CPP17)
483 tmp.move_to_subtypes(dest);
484 tmp.add_source_location()=location;
492 sub.emplace(sub.begin(), src);
498#define ERROR_TOKENS 4
508 source_location.
set_file(t[0].filename);
509 source_location.
set_line(std::to_string(t[0].line_no));
511 std::string message =
"parse error before '";
524 log.error().source_location = source_location;
567 std::cout << std::string(
__indent,
' ') <<
"Parser::rDefinition 1 " << t
618 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypedef 1\n";
647 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypedefUsing 1\n";
663 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypedefUsing 2\n";
683 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypedefUsing 3\n";
707 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 0\n";
718 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 0.1\n";
730 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 1\n";
738 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 2\n";
746 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 3\n";
755 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 4\n";
831 bool is_inline=
false;
1003 items.push_back(
item);
1007 items.push_back(
item);
1039 typet template_type;
1058 std::cout << std::string(
__indent,
' ') <<
"BODY: "
1059 << body.
pretty() <<
'\n';
1060 std::cout << std::string(
__indent,
' ') <<
"TEMPLATE_TYPE: "
1061 << template_type.
pretty() <<
'\n';
1132 if(template_parameters.
get_sub().empty())
1185 std::cout << std::string(
__indent,
' ') <<
"Parser::rTempArgDeclaration 0\n";
1201 declaration.
type()=
typet(
"cpp-template-type");
1211 bool has_ellipsis=
false;
1260 std::cout << std::string(
__indent,
' ') <<
"Parser::rTempArgDeclaration 1\n";
1267 typet template_type;
1297 std::cout << std::string(
__indent,
' ')
1298 <<
"Parser::rTempArgDeclaration 2\n";
1308 std::cout << std::string(
__indent,
' ')
1309 <<
"Parser::rTempArgDeclaration 3\n";
1312 bool has_ellipsis=
false;
1329 std::cout << std::string(
__indent,
' ')
1330 <<
"Parser::rTempArgDeclaration 4\n";
1416 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 0.1 token: "
1428 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 0.2\n";
1436 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 1\n";
1444 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 3\n";
1465 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 4\n";
1479 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 5\n";
1483 declaration, storage_spec, member_spec,
integral,
cv_q);
1490 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 6 " << t
1495 cv_q.is_not_nil() &&
1574 std::cout << std::string(
__indent,
' ')
1575 <<
"Parser::rIntegralDeclaration 1 token: "
1583 std::cout << std::string(
__indent,
' ') <<
"Parser::rIntegralDeclaration 2\n";
1589 std::cout << std::string(
__indent,
' ') <<
"Parser::rIntegralDeclaration 3\n";
1602 std::cout << std::string(
__indent,
' ')
1603 <<
"Parser::rIntegralDeclaration 4\n";
1611 std::cout << std::string(
__indent,
' ')
1612 <<
"Parser::rIntegralDeclaration 5\n";
1632 std::cout << std::string(
__indent,
' ') <<
"Parser::rIntegralDeclaration 6 "
1644 declaration.
declarators().front().type().add_subtype().is_not_nil())
1646 declaration.
type() =
1649 declaration.
declarators().front().type().add_subtype().make_nil();
1653 std::cout << std::string(
__indent,
' ')
1654 <<
"Parser::rIntegralDeclaration 7\n";
1660 std::cout << std::string(
__indent,
' ')
1661 <<
"Parser::rIntegralDeclaration 8 "
1662 << declaration.
pretty() <<
'\n';
1670 std::cout << std::string(
__indent,
' ')
1671 <<
"Parser::rIntegralDeclaration 9\n";
1681 std::cout << std::string(
__indent,
' ')
1682 <<
"Parser::rIntegralDeclaration 10\n";
1694 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstDeclaration\n";
1719 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 1\n";
1728 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 2\n";
1742 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 3\n";
1751 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 4\n";
1756 for(std::size_t i=0; i <
type_name.get_sub().size(); i++)
1769 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 5\n";
1789 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 6\n";
1794 bool is_destructor=
false;
1795 for(
const auto &irep :
type_name.get_sub())
1797 if(irep.id() ==
"~")
1811 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 7\n";
1825 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 8\n";
1843 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 9\n";
1860 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 10\n";
1866 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 11\n";
1875 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 12\n";
1899 std::cout << std::string(
__indent,
' ') <<
"Parser::isConstructorDecl "
1908 if(t==
'*' || t==
'&' || t==
'(')
1961 else if(v==
'\0' || v==
';' || v==
'}')
1965 else if(
u==
'\0' ||
u==
';' ||
u==
'}')
1990 member_spec.
clear();
2201 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAttribute "
2250 attr.add_source_location()=
exp.source_location();
2467 std::cout << std::string(
__indent,
' ')
2468 <<
"Parser::optIntegralTypeOrClassSpec 0\n";
2488 std::cout << std::string(
__indent,
' ')
2489 <<
"Parser::optIntegralTypeOrClassSpec 1\n";
2544 std::cout << std::string(
__indent,
' ')
2545 <<
"Parser::optIntegralTypeOrClassSpec 2\n";
2552 std::cout << std::string(
__indent,
' ')
2553 <<
"Parser::optIntegralTypeOrClassSpec 3\n";
2563 std::cout << std::string(
__indent,
' ')
2564 <<
"Parser::optIntegralTypeOrClassSpec 4\n";
2571 std::cout << std::string(
__indent,
' ')
2572 <<
"Parser::optIntegralTypeOrClassSpec 5\n";
2601 std::cout << std::string(
__indent,
' ')
2602 <<
"Parser::optIntegralTypeOrClassSpec 6\n";
2610 std::cout << std::string(
__indent,
' ')
2611 <<
"Parser::optIntegralTypeOrClassSpec 7\n";
2618 std::cout << std::string(
__indent,
' ')
2619 <<
"Parser::optIntegralTypeOrClassSpec 8\n";
2698 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 0\n";
2712 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 1\n";
2725 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 2\n";
2737 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 3\n";
2749 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 4\n";
2763 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 5\n";
2775 constructor.
value()=
codet(
"cpp-pure-virtual");
2902 declarators.push_back(declarator);
3016 dw.swap(declarator);
3070 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 1\n";
3092 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 2\n";
3100 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 3\n";
3111 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 4\n";
3124 if(t!=
'[' && t!=
'(')
3130 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 5\n";
3141 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 6\n";
3150 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 7\n";
3163 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 8\n";
3195 init_args.
swap(args);
3200 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 9\n";
3209 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 10\n";
3221 if(
d_outer.add_subtype().is_not_nil())
3224 d_outer.add_subtype().swap(return_type);
3230 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 11\n";
3248 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 12\n";
3263 std::list<typet>
tl;
3267 tl.push_back(
tl.back().add_subtype());
3296 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 13\n";
3322 std::cout << std::string(
__indent,
' ') <<
"Parser::optPtrOperator 1\n";
3332 std::cout << std::string(
__indent,
' ') <<
"Parser::optPtrOperator 2 " << t
3411 for(std::list<typet>::reverse_iterator
3424 it->add_subtype().swap(
ptrs);
3474 std::cout << std::string(
__indent,
' ') <<
"Parser::rMemberInit 1\n";
3483 std::cout << std::string(
__indent,
' ') <<
"Parser::rMemberInit 2\n";
3497 std::cout << std::string(
__indent,
' ') <<
"Parser::rMemberInit 3\n";
3507 if(
tk2.kind!=
'}' &&
tk2.kind!=
')')
3516 std::cout << std::string(
__indent,
' ') <<
"Parser::rMemberInit 4\n";
3556 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 0\n";
3576 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 1\n";
3584 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 2 "
3592 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 3\n";
3602 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 4\n";
3621 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 5\n";
3637 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 6\n";
3640 components.push_back(
irept(
"::"));
3646 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 7\n";
3654 components.push_back(
irept(
"~"));
3660 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 8\n";
3667 components.push_back(
irept());
3720 operator_id = std::string(1,
static_cast<char>(t));
3844 std::cout << std::string(
__indent,
' ') <<
"Parser::rPtrToMember 0\n";
3903 components.push_back(
irept(
"::"));
3913 std::cout << std::string(
__indent,
' ') <<
"Parser::rPtrToMember 1\n";
3944 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 0\n";
3955 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 1\n";
3967 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 2\n";
3976 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 3\n";
3991 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 4\n";
3996 exp.add_source_location()=
a.source_location();
4005 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 4.1\n";
4017 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 4.2\n";
4024 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 5\n";
4042 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 6\n";
4151 list.
get_sub().back().swap(declaration);
4357 std::cout << std::string(
__indent,
' ') <<
"Parser::rEnumSpec 1\n";
4391 std::cout << std::string(
__indent,
' ') <<
"Parser::rEnumSpec 2\n";
4403 std::cout << std::string(
__indent,
' ') <<
"Parser::rEnumSpec 3\n";
4426 std::cout << std::string(
__indent,
' ') <<
"Parser::rEnumSpec 4\n";
4498 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 1\n";
4507 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 2\n";
4530 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 3\n";
4543 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 4\n";
4556 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 5\n";
4576 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 6\n";
4588 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 7\n";
4661 bases.
get_sub().back().swap(base);
4679 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassBody 0\n";
4704 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassBody "
4705 << member.
pretty() <<
'\n';
4709 std::move(
static_cast<exprt &
>(
static_cast<irept &
>(member))));
4741 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassMember 0 " << t
4750 member.
id(
"cpp-public");
4754 member.
id(
"cpp-protected");
4758 member.
id(
"cpp-private");
4826 std::cout << std::string(
__indent,
' ') <<
"Parser::rCommaExpression 0\n";
4833 std::cout << std::string(
__indent,
' ') <<
"Parser::rCommaExpression 1\n";
4850 exp.add_to_operands(std::move(left), std::move(right));
4855 std::cout << std::string(
__indent,
' ') <<
"Parser::rCommaExpression 2\n";
4871 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 0\n";
4878 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 1\n";
4892 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 2\n";
4900 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 3\n";
4931 exp.add_to_operands(std::move(left), std::move(right));
4936 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 4\n";
4950 std::cout << std::string(
__indent,
' ') <<
"Parser::rConditionalExpr 0\n";
4957 std::cout << std::string(
__indent,
' ') <<
"Parser::rConditionalExpr 1\n";
4970 std::cout << std::string(
__indent,
' ') <<
"Parser::rConditionalExpr 2\n";
4999 std::cout << std::string(
__indent,
' ') <<
"Parser::rLogicalOrExpr 0\n";
5006 std::cout << std::string(
__indent,
' ') <<
"Parser::rLogicalOrExpr 1\n";
5022 exp.add_to_operands(std::move(left), std::move(right));
5038 std::cout << std::string(
__indent,
' ') <<
"Parser::rLogicalAndExpr 1\n";
5045 std::cout << std::string(
__indent,
' ') <<
"Parser::rLogicalAndExpr 1\n";
5061 exp.add_to_operands(std::move(left), std::move(right));
5077 std::cout << std::string(
__indent,
' ') <<
"Parser::rInclusiveOrExpr 0\n";
5084 std::cout << std::string(
__indent,
' ') <<
"Parser::rInclusiveOrExpr 1\n";
5100 exp.add_to_operands(std::move(left), std::move(right));
5116 std::cout << std::string(
__indent,
' ') <<
"Parser::rExclusiveOrExpr 0\n";
5123 std::cout << std::string(
__indent,
' ') <<
"Parser::rExclusiveOrExpr 1\n";
5139 exp.add_to_operands(std::move(left), std::move(right));
5155 std::cout << std::string(
__indent,
' ') <<
"Parser::rAndExpr 0\n";
5162 std::cout << std::string(
__indent,
' ') <<
"Parser::rAndExpr 1\n";
5178 exp.add_to_operands(std::move(left), std::move(right));
5194 std::cout << std::string(
__indent,
' ') <<
"Parser::rEqualityExpr 0\n";
5201 std::cout << std::string(
__indent,
' ') <<
"Parser::rEqualityExpr 1\n";
5218 exp.add_to_operands(std::move(left), std::move(right));
5234 std::cout << std::string(
__indent,
' ') <<
"Parser::rRelationalExpr 0\n";
5241 std::cout << std::string(
__indent,
' ') <<
"Parser::rRelationalExpr 1\n";
5265 case '<':
id=
ID_lt;
break;
5266 case '>':
id=
ID_gt;
break;
5270 exp.add_to_operands(std::move(left), std::move(right));
5286 std::cout << std::string(
__indent,
' ') <<
"Parser::rShiftExpr 0\n";
5293 std::cout << std::string(
__indent,
' ') <<
"Parser::rShiftExpr 1\n";
5310 exp.add_to_operands(std::move(left), std::move(right));
5326 std::cout << std::string(
__indent,
' ') <<
"Parser::rAdditiveExpr 0\n";
5333 std::cout << std::string(
__indent,
' ') <<
"Parser::rAdditiveExpr 1\n";
5357 exp.add_to_operands(std::move(left), std::move(right));
5373 std::cout << std::string(
__indent,
' ') <<
"Parser::rMultiplyExpr 0\n";
5380 std::cout << std::string(
__indent,
' ') <<
"Parser::rMultiplyExpr 1\n";
5384 while(t=
lex.
LookAhead(0), (t==
'*' || t==
'/' || t==
'%'))
5400 case '/':
id=
ID_div;
break;
5401 case '%':
id=
ID_mod;
break;
5405 exp.add_to_operands(std::move(left), std::move(right));
5410 std::cout << std::string(
__indent,
' ') <<
"Parser::rMultiplyExpr 2\n";
5426 std::cout << std::string(
__indent,
' ') <<
"Parser::rPmExpr 0\n";
5433 std::cout << std::string(
__indent,
' ') <<
"Parser::rPmExpr 1\n";
5450 exp.add_to_operands(std::move(left), std::move(right));
5455 std::cout << std::string(
__indent,
' ') <<
"Parser::rPmExpr 2\n";
5470 std::cout << std::string(
__indent,
' ') <<
"Parser::rCastExpr 0\n";
5486 std::cout << std::string(
__indent,
' ') <<
"Parser::rCastExpr 1\n";
5509 exp.add_to_operands(std::move(op));
5530 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeName 0\n";
5539 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeName 1\n";
5559 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeName 2\n";
5574 std::cout << std::string(
__indent,
' ')
5575 <<
"Parser::rTypeNameOrFunctionType 0\n";
5583 std::cout << std::string(
__indent,
' ')
5584 <<
"Parser::rTypeNameOrFunctionType 1\n";
5596 std::cout << std::string(
__indent,
' ')
5597 <<
"Parser::rTypeNameOrFunctionType 2\n";
5605 std::cout << std::string(
__indent,
' ')
5606 <<
"Parser::rTypeNameOrFunctionType 3\n";
5611 tname.swap(return_type);
5620 std::cout << std::string(
__indent,
' ')
5621 <<
"Parser::rTypeNameOrFunctionType 4\n";
5667 std::cout << std::string(
__indent,
' ')
5668 <<
"Parser::rTypeNameOrFunctionType 5\n";
5678 type.make_ellipsis();
5702 type.make_ellipsis();
5710 std::cout << std::string(
__indent,
' ')
5711 <<
"Parser::rTypeNameOrFunctionType 6\n";
5722 std::cout << std::string(
__indent,
' ')
5723 <<
"Parser::rTypeNameOrFunctionType 7\n";
5733 std::cout << std::string(
__indent,
' ')
5734 <<
"Parser::rTypeNameOrFunctionType 8\n";
5756 std::cout << std::string(
__indent,
' ') <<
"Parser::rUnaryExpr 0\n";
5759 if(t==
'*' || t==
'&' || t==
'+' ||
5760 t==
'-' || t==
'!' || t==
'~' ||
5767 std::cout << std::string(
__indent,
' ') <<
"Parser::rUnaryExpr 1\n";
5775 std::cout << std::string(
__indent,
' ') <<
"Parser::rUnaryExpr 2\n";
5818 exp.add_to_operands(std::move(right));
5843 exp.add_to_operands(std::move(unary));
5863 std::cout << std::string(
__indent,
' ') <<
"Parser::rThrowExpr 0\n";
5874 if(t==
':' || t==
';')
5885 exp.add_to_operands(std::move(e));
5902 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeidExpr 0\n";
5968 std::cout << std::string(
__indent,
' ') <<
"Parser::rSizeofExpr 0\n";
6024 exp.add_to_operands(std::move(unary));
6068 std::cout << std::string(
__indent,
' ') <<
"Parser::rNoexceptExpr 0\n";
6119 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 0\n";
6130 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 1\n";
6136 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 2\n";
6164 exp.add_to_operands(std::move(
obj));
6171 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 3\n";
6178 exprt arguments, initializer;
6184 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 4\n";
6390 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 0\n";
6397 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 1\n";
6414 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 2\n";
6425 exp.add_to_operands(std::move(left), std::move(e));
6432 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 3\n";
6443 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 4\n";
6453 fc.arguments().push_back(*it);
6464 tmp.add_to_operands(std::move(
exp));
6486 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 5\n";
6493 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 6\n";
6505 exp.add_to_operands(std::move(left));
6649 block.
add(std::move(*statement));
6664 return std::move(code);
6742 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 0 "
6755 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 1\n";
6764 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 2\n";
6773 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 3\n";
6782 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 4\n";
6791 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 5\n";
6801 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 6\n";
6807 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 7\n";
6818 exp.add_to_operands(std::move(*code));
6834 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 8\n";
6844 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 9\n";
6850 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 10\n";
6860 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 11\n";
6866 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 12\n";
6875 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 13\n";
6881 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 14\n";
6890 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 15\n";
6903 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 16\n";
6913 exp=
exprt(
"explicit-constructor-call");
6914 exp.type().swap(type);
6915 exp.add_to_operands(std::move(
exp2));
6929 exp=
exprt(
"explicit-constructor-call");
6930 exp.type().swap(type);
6931 exp.operands().swap(
exp2.operands());
6953 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 17\n";
6974 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarName 0\n";
6987 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 0\n";
7007 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 1\n";
7015 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 1.1 "
7025 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 2\n";
7036 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 3\n";
7049 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 4\n";
7069 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 5\n";
7073 components.push_back(
irept(
"::"));
7079 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 6\n";
7087 components.push_back(
irept(
"~"));
7093 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 7\n";
7106 components.push_back(op);
7140 std::cout << std::string(
__indent,
' ') <<
"Parser::maybeTemplateArgs 0\n";
7149 if(
u==
'\0' ||
u==
';' ||
u==
'}')
7162 std::cout << std::string(
__indent,
' ')
7163 <<
"Parser::maybeTemplateArgs 1\n";
7169 std::cout << std::string(
__indent,
' ')
7170 <<
"Parser::maybeTemplateArgs 2\n";
7185 std::cout << std::string(
__indent,
' ')
7186 <<
"Parser::maybeTemplateArgs 3\n";
7193 else if(v==
'\0' || v==
';' || v==
'}')
7197 else if(
u==
'\0' ||
u==
';' ||
u==
'}')
7203 std::cout << std::string(
__indent,
' ')
7204 <<
"Parser::maybeTemplateArgs 4\n";
7209 std::cout << std::string(
__indent,
' ') <<
"Parser::maybeTemplateArgs 5\n";
7215 std::cout << std::string(
__indent,
' ') <<
"Parser::maybeTemplateArgs 6\n";
7223 std::cout << std::string(
__indent,
' ') <<
"Parser::maybeTemplateArgs 7\n";
7254 declarator.
value()=body;
7264 declarator.
value() = std::move(*body);
7287 std::cout << std::string(
__indent,
' ') <<
"Parser::rCompoundStatement 1\n";
7294 std::cout << std::string(
__indent,
' ') <<
"Parser::rCompoundStatement 2\n";
7311 return std::move(statement);
7318 return std::move(statement);
7349 std::cout << std::string(
__indent,
' ') <<
"Parser::rStatement 0 "
7396 return std::move(statement);
7401 std::cout << std::string(
__indent,
' ') <<
"Parser::rStatement RETURN 0\n";
7412 std::cout << std::string(
__indent,
' ')
7413 <<
"Parser::rStatement RETURN 1\n";
7420 std::cout << std::string(
__indent,
' ')
7421 <<
"Parser::rStatement RETURN 2\n";
7428 std::cout << std::string(
__indent,
' ')
7429 <<
"Parser::rStatement RETURN 3\n";
7436 return std::move(statement);
7451 return std::move(statement);
7479 return std::move(code);
7494 return std::move(statement);
7513 return std::move(statement);
7542 return std::move(label);
7560 return std::move(statement);
7582 return std::move(statement);
7612 if(!
then.has_value())
7624 return std::move(statement);
7633 return std::move(statement);
7662 return std::move(statement);
7693 return std::move(statement);
7711 if(!body.has_value())
7732 return std::move(statement);
7752 if(!
exp1.has_value())
7782 std::move(*
exp1), std::move(
exp2), std::move(
exp3), std::move(*body));
7784 return std::move(statement);
7842 declaration.
declarators().size() == 1,
"exactly one declarator");
7844 if(declaration.
declarators().front().name().is_nil())
7870 return std::move(statement);
7885 if(!
body1.has_value())
7911 return std::move(statement);
7926 return std::move(statement);
7948 return std::move(statement);
7957 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 1\n";
7972 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 3\n";
7983 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 3\n";
7989 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 4\n";
8010 std::cout << std::string(
__indent,
' ')
8011 <<
"Parser::rGCCAsmStatement 5\n";
8019 std::cout << std::string(
__indent,
' ')
8020 <<
"Parser::rGCCAsmStatement 6\n";
8035 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 7\n";
8044 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 8\n";
8047 return std::move(statement);
8056 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 1\n";
8070 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 2\n";
8078 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 3\n";
8091 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 4\n";
8097 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 5\n";
8101 return std::move(statement);
8107 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 6\n";
8112 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 7\n";
8115 return std::move(statement);
8132 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 0\n";
8138 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 1\n";
8144 return std::move(statement);
8149 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 2\n";
8157 std::cout << std::string(
__indent,
' ') <<
"rDe " << statement->pretty()
8169 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 3\n";
8176 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 4\n";
8180 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 5 "
8188 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 6\n";
8245 std::cout << std::string(
__indent,
' ')
8246 <<
"Parser::rDeclarationStatement 1\n";
8268 std::cout << std::string(
__indent,
' ')
8269 <<
"Parser::rDeclarationStatement 2\n";
8279 std::cout << std::string(
__indent,
' ')
8280 <<
"Parser::rDeclarationStatement 3 " << t <<
'\n';
8284 cv_q.is_not_nil() &&
8288 std::cout << std::string(
__indent,
' ')
8289 <<
"Parser::rDeclarationStatement 4\n";
8329 return std::move(statement);
8342 return std::move(statement);
8358 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclStatement 1\n";
8365 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclStatement 2\n";
8372 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclStatement 3\n";
8385 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclStatement 4\n";
8394 return std::move(statement);
8409 if(t==token || t==
'\0')
pointer_typet pointer_type(const typet &subtype)
bool optCvQualify(typet &)
bool rDeclaratorQualifier()
bool rShiftExpr(exprt &, bool)
std::optional< codet > rIfStatement()
bool rPostfixExpr(exprt &)
bool rIntegralDeclaration(cpp_declarationt &, cpp_storage_spect &, cpp_member_spect &, typet &, typet &)
bool MaybeTypeNameOrClassTemplate(cpp_tokent &)
bool rClassMember(cpp_itemt &)
bool rDefinition(cpp_itemt &)
bool rTypedefUsing(cpp_declarationt &)
bool rAllocateExpr(exprt &)
bool rMSC_if_existsExpr(exprt &)
message_handlert & message_handler
bool rBaseSpecifiers(irept &)
bool rPtrToMember(irept &)
bool optMemberSpec(cpp_member_spect &)
void make_sub_scope(const irept &name, new_scopet::kindt)
bool rLinkageBody(cpp_linkage_spect::itemst &)
bool rTypePredicate(exprt &)
bool rAndExpr(exprt &, bool)
bool optPtrOperator(typet &)
std::optional< codet > rForStatement()
std::optional< codet > rDeclarationStatement()
bool rLogicalAndExpr(exprt &, bool)
bool rExpression(exprt &, bool)
std::optional< codet > rDoStatement()
std::optional< codet > rMSC_leaveStatement()
bool rString(cpp_tokent &tk)
std::optional< codet > rTryStatement()
bool rOtherDeclaration(cpp_declarationt &, cpp_storage_spect &, cpp_member_spect &, typet &)
bool optAttribute(typet &)
bool rAdditiveExpr(exprt &)
bool rMemberInit(exprt &)
bool rConstDeclaration(cpp_declarationt &)
bool rSimpleDeclaration(cpp_declarationt &)
bool rInclusiveOrExpr(exprt &, bool)
bool rAllocateInitializer(exprt &)
bool rPrimaryExpr(exprt &)
bool rStaticAssert(cpp_static_assertt &)
std::optional< codet > rCompoundStatement()
bool rArgDeclListOrInit(exprt &, bool &, bool)
bool rNewDeclarator(typet &)
void make_subtype(const typet &src, typet &dest)
bool rAccessDecl(cpp_declarationt &)
bool rRelationalExpr(exprt &, bool)
bool rNoexceptExpr(exprt &)
bool rNamespaceSpec(cpp_namespace_spect &)
cpp_parse_treet & parse_tree
bool rArgDeclaration(cpp_declarationt &)
std::optional< codet > rGCCAsmStatement()
std::optional< codet > rSwitchStatement()
new_scopet & add_id(const irept &name, new_scopet::kindt)
bool rVarNameCore(exprt &)
bool rDeclarators(cpp_declarationt::declaratorst &, bool, bool=false)
bool rLinkageSpec(cpp_linkage_spect &)
bool rDeclarator(cpp_declaratort &, DeclKind, bool, bool)
bool rAllocateType(exprt &, typet &, exprt &)
bool rTypeSpecifier(typet &, bool)
bool optThrowDecl(irept &)
bool rExclusiveOrExpr(exprt &, bool)
bool rEqualityExpr(exprt &, bool)
bool rCommaExpression(exprt &)
bool rGCCAttribute(typet &)
bool rTempArgList(irept &)
bool rArgDeclList(irept &)
bool rMultiplyExpr(exprt &)
bool rTypedef(cpp_declarationt &)
bool rTemplateArgs(irept &)
bool rSizeofExpr(exprt &)
bool rTypeNameOrFunctionType(typet &)
bool rMemberInitializers(irept &)
bool rDeclaratorWithInit(cpp_declaratort &, bool, bool)
bool rFunctionArguments(exprt &)
std::optional< codet > rExprStatement()
irep_idt current_function
new_scopet * current_scope
bool optIntegralTypeOrClassSpec(typet &)
bool rTempArgDeclaration(cpp_declarationt &)
bool rLogicalOrExpr(exprt &, bool)
bool rProgram(cpp_itemt &item)
std::optional< codet > rMSC_if_existsStatement()
bool rTemplateDecl2(typet &, TemplateDeclKind &kind)
bool rUsingOrTypedef(cpp_itemt &)
std::optional< codet > rWhileStatement()
bool rTypeidExpr(exprt &)
std::optional< codet > rIntegralDeclStatement(cpp_storage_spect &, typet &, typet &)
std::optional< codet > rOtherDeclStatement(cpp_storage_spect &, typet &)
void merge_types(const typet &src, typet &dest)
bool rAlignofExpr(exprt &)
std::optional< codet > rStatement()
bool rCastOperatorName(irept &)
bool rInitializeExpr(exprt &)
bool rFunctionBody(cpp_declaratort &)
bool optStorageSpec(cpp_storage_spect &)
std::optional< codet > rTypedefStatement()
bool rDeclaration(cpp_declarationt &)
Parser(cpp_parsert &_cpp_parser, message_handlert &message_handler)
std::optional< codet > rMSC_tryStatement()
bool rUsing(cpp_usingt &)
void set_location(irept &dest, const cpp_tokent &token)
std::size_t number_of_errors
bool rOperatorName(irept &)
std::optional< codet > rMSCAsmStatement()
bool rExternTemplateDecl(cpp_declarationt &)
bool rNullDeclaration(cpp_declarationt &)
bool rTemplateDecl(cpp_declarationt &)
bool rConstructorDecl(cpp_declaratort &, typet &, typet &trailing_return_type)
bool rConditionalExpr(exprt &, bool)
virtual void clear()
Reset the abstract state.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
codet representation of an inline assembler statement, for the gcc flavor.
codet representation of an inline assembler statement.
void set_flavor(const irep_idt &f)
A codet representing sequential composition of program statements.
code_operandst & statements()
void add(const codet &code)
codet representation of a do while statement.
codet representation of an expression statement.
codet representation of a for statement.
A codet representing the declaration of a local variable.
codet representation of a "return from a function" statement.
const exprt & return_value() const
codet representation of a switch-case, i.e. a case statement within a switch.
codet representation of a goto statement.
codet representation of an if-then-else statement.
codet representation of a label for branch targets.
A codet representing a skip statement.
codet representation of a switch-case, i.e. a case statement within a switch.
codet representing a switch statement.
codet representation of a try/catch block.
codet representing a while statement.
Data structure for representing an arbitrary statement in a program.
Globally accessible architectural configuration.
const declaratorst & declarators() const
const cpp_member_spect & member_spec() const
const cpp_storage_spect & storage_spec() const
std::vector< cpp_declaratort > declaratorst
irept & member_initializers()
irept & method_qualifier()
cpp_static_assertt & make_static_assert()
cpp_declarationt & make_declaration()
std::vector< class cpp_itemt > itemst
const itemst & items() const
void set_inline(bool value)
void set_virtual(bool value)
void set_friend(bool value)
void set_explicit(bool value)
const exprt & as_expr() const
int LookAhead(unsigned offset)
int get_token(cpp_tokent &token)
void Replace(const cpp_tokent &token)
cpp_tokent & current_token()
void Insert(const cpp_tokent &token)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
typet & type()
Return the type of the expression.
const source_locationt & source_location() const
source_locationt & add_source_location()
void add_to_operands(const exprt &expr)
Add the given argument to the end of exprt's operands.
The Boolean constant false.
The trinary if-then-else operator.
There are a large number of kinds of tree structured or tree-like data in CPROVER.
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
const irept & find(const irep_idt &name) const
void set(const irep_idt &name, const irep_idt &value)
void move_to_sub(irept &irep)
const irep_idt & id() const
irept & add(const irep_idt &name)
holds a combination of types
Class that provides messages with a built-in verbosity 'level'.
void print_rec(std::ostream &, unsigned indent) const
std::string full_name() const
std::map< irep_idt, new_scopet > id_mapt
@ TYPE_TEMPLATE_PARAMETER
@ TEMPLATE_TEMPLATE_PARAMETER
@ NON_TYPE_TEMPLATE_PARAMETER
void print(std::ostream &out) const
bool is_named_scope() const
static const char * kind2string(kindt kind)
The null pointer constant.
save_scopet(new_scopet *&_scope)
A side_effect_exprt representation of a function call side effect.
A side_effect_exprt representation of a side effect that throws an exception.
An expression containing a side effect.
void set_file(const irep_idt &file)
void set_line(const irep_idt &line)
void set_function(const irep_idt &function)
Expression to hold a symbol (variable)
The Boolean constant true.
Type with a single subtype.
Semantic type conversion.
The type of an expression, extends irept.
const source_locationt & source_location() const
C++ Language Type Checking.
cpp_namet & to_cpp_name(irept &cpp_name)
C++ Parser: Token Buffer.
static bool is_operator(const ctokent &t)
#define Forall_operands(it, expr)
std::string get_base_name(const std::string &in, bool strip_suffix)
cleans a filename from path and extension
const irept & get_nil_irep()
const std::string & id2string(const irep_idt &d)
static bool is_constructor(const irep_idt &method_name)
const merged_typet & to_merged_type(const typet &type)
conversion to merged_typet
bool cpp_parse(cpp_parsert &cpp_parser, message_handlert &message_handler)
static bool is_identifier(int token)
#define UNREACHABLE
This should be used to mark dead code.
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
const code_blockt & to_code_block(const codet &code)
const type_with_subtypest & to_type_with_subtypes(const typet &type)
const type_with_subtypet & to_type_with_subtype(const typet &type)