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
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);
471 tmp.add_source_location()=location;
479 sub.emplace(sub.begin(), src);
485#define ERROR_TOKENS 4
495 source_location.
set_file(t[0].filename);
496 source_location.
set_line(std::to_string(t[0].line_no));
498 std::string message =
"parse error before '";
553 std::cout << std::string(
__indent,
' ') <<
"Parser::rDefinition 1 " << t
608 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypedef 1\n";
637 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypedefUsing 1\n";
653 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypedefUsing 2\n";
670 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypedefUsing 3\n";
694 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 0\n";
705 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 0.1\n";
717 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 1\n";
725 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 2\n";
733 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 3\n";
742 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 4\n";
825 bool is_inline=
false;
972 items.push_back(
item);
976 items.push_back(
item);
1008 typet template_type;
1027 std::cout << std::string(
__indent,
' ') <<
"BODY: "
1028 << body.
pretty() <<
'\n';
1029 std::cout << std::string(
__indent,
' ') <<
"TEMPLATE_TYPE: "
1030 << template_type.
pretty() <<
'\n';
1101 if(template_parameters.
get_sub().empty())
1154 std::cout << std::string(
__indent,
' ') <<
"Parser::rTempArgDeclaration 0\n";
1180 bool has_ellipsis=
false;
1229 std::cout << std::string(
__indent,
' ') <<
"Parser::rTempArgDeclaration 1\n";
1236 typet template_type;
1267 std::cout << std::string(
__indent,
' ')
1268 <<
"Parser::rTempArgDeclaration 2\n";
1278 std::cout << std::string(
__indent,
' ')
1279 <<
"Parser::rTempArgDeclaration 3\n";
1282 bool has_ellipsis=
false;
1299 std::cout << std::string(
__indent,
' ')
1300 <<
"Parser::rTempArgDeclaration 4\n";
1386 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 0.1 token: "
1398 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 0.2\n";
1406 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 1\n";
1414 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 3\n";
1431 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 4\n";
1445 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 5\n";
1456 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 6 " << t
1460 if(
cv_q.is_not_nil() &&
1537 std::cout << std::string(
__indent,
' ')
1538 <<
"Parser::rIntegralDeclaration 1 token: "
1546 std::cout << std::string(
__indent,
' ') <<
"Parser::rIntegralDeclaration 2\n";
1552 std::cout << std::string(
__indent,
' ') <<
"Parser::rIntegralDeclaration 3\n";
1565 std::cout << std::string(
__indent,
' ')
1566 <<
"Parser::rIntegralDeclaration 4\n";
1574 std::cout << std::string(
__indent,
' ')
1575 <<
"Parser::rIntegralDeclaration 5\n";
1595 std::cout << std::string(
__indent,
' ') <<
"Parser::rIntegralDeclaration 6 "
1607 declaration.declarators().front().type().subtype().is_not_nil())
1610 declaration.declarators().front().type().subtype().make_nil();
1614 std::cout << std::string(
__indent,
' ')
1615 <<
"Parser::rIntegralDeclaration 7\n";
1621 std::cout << std::string(
__indent,
' ')
1622 <<
"Parser::rIntegralDeclaration 8 "
1631 std::cout << std::string(
__indent,
' ')
1632 <<
"Parser::rIntegralDeclaration 9\n";
1642 std::cout << std::string(
__indent,
' ')
1643 <<
"Parser::rIntegralDeclaration 10\n";
1655 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstDeclaration\n";
1680 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 1\n";
1689 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 2\n";
1703 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 3\n";
1712 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 4\n";
1717 for(std::size_t
i=0;
i <
type_name.get_sub().size();
i++)
1730 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 5\n";
1750 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 6\n";
1755 bool is_destructor=
false;
1756 for(
const auto &irep :
type_name.get_sub())
1758 if(irep.id() ==
"~")
1772 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 7\n";
1786 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 8\n";
1804 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 9\n";
1821 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 10\n";
1827 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 11\n";
1836 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 12\n";
1860 std::cout << std::string(
__indent,
' ') <<
"Parser::isConstructorDecl "
1869 if(t==
'*' || t==
'&' || t==
'(')
1922 else if(v==
'\0' || v==
';' || v==
'}')
1926 else if(
u==
'\0' ||
u==
';' ||
u==
'}')
1951 member_spec.
clear();
2166 std::cout << std::string(
__indent,
' ') <<
"Parser::rAttribute "
2412 std::cout << std::string(
__indent,
' ')
2413 <<
"Parser::optIntegralTypeOrClassSpec 0\n";
2433 std::cout << std::string(
__indent,
' ')
2434 <<
"Parser::optIntegralTypeOrClassSpec 1\n";
2486 std::cout << std::string(
__indent,
' ')
2487 <<
"Parser::optIntegralTypeOrClassSpec 2\n";
2494 std::cout << std::string(
__indent,
' ')
2495 <<
"Parser::optIntegralTypeOrClassSpec 3\n";
2505 std::cout << std::string(
__indent,
' ')
2506 <<
"Parser::optIntegralTypeOrClassSpec 4\n";
2513 std::cout << std::string(
__indent,
' ')
2514 <<
"Parser::optIntegralTypeOrClassSpec 5\n";
2543 std::cout << std::string(
__indent,
' ')
2544 <<
"Parser::optIntegralTypeOrClassSpec 6\n";
2552 std::cout << std::string(
__indent,
' ')
2553 <<
"Parser::optIntegralTypeOrClassSpec 7\n";
2560 std::cout << std::string(
__indent,
' ')
2561 <<
"Parser::optIntegralTypeOrClassSpec 8\n";
2640 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 0\n";
2654 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 1\n";
2667 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 2\n";
2679 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 3\n";
2691 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 4\n";
2705 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 5\n";
2717 constructor.
value()=
codet(
"cpp-pure-virtual");
2844 declarators.push_back(declarator);
2958 dw.swap(declarator);
3012 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 1\n";
3034 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 2\n";
3042 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 3\n";
3053 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 4\n";
3066 if(t!=
'[' && t!=
'(')
3072 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 5\n";
3082 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 6\n";
3091 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 7\n";
3104 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 8\n";
3136 init_args.
swap(args);
3141 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 9\n";
3150 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 10\n";
3162 if(
d_outer.subtype().is_not_nil())
3165 d_outer.subtype().swap(return_type);
3171 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 11\n";
3189 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 12\n";
3204 std::list<typet>
tl;
3208 tl.push_back(
tl.back().subtype());
3237 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 13\n";
3263 std::cout << std::string(
__indent,
' ') <<
"Parser::optPtrOperator 1\n";
3273 std::cout << std::string(
__indent,
' ') <<
"Parser::optPtrOperator 2 " << t
3352 for(std::list<typet>::reverse_iterator
3364 assert(it->is_not_nil());
3365 it->subtype().swap(
ptrs);
3415 std::cout << std::string(
__indent,
' ') <<
"Parser::rMemberInit 1\n";
3424 std::cout << std::string(
__indent,
' ') <<
"Parser::rMemberInit 2\n";
3438 std::cout << std::string(
__indent,
' ') <<
"Parser::rMemberInit 3\n";
3448 if(
tk2.kind!=
'}' &&
tk2.kind!=
')')
3457 std::cout << std::string(
__indent,
' ') <<
"Parser::rMemberInit 4\n";
3497 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 0\n";
3517 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 1\n";
3525 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 2 "
3533 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 3\n";
3543 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 4\n";
3561 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 5\n";
3577 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 6\n";
3580 components.push_back(
irept(
"::"));
3586 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 7\n";
3594 components.push_back(
irept(
"~"));
3600 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 8\n";
3607 components.push_back(
irept());
3660 operator_id = std::string(1,
static_cast<char>(t));
3784 std::cout << std::string(
__indent,
' ') <<
"Parser::rPtrToMember 0\n";
3840 components.push_back(
irept(
"::"));
3850 std::cout << std::string(
__indent,
' ') <<
"Parser::rPtrToMember 1\n";
3881 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 0\n";
3892 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 1\n";
3904 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 2\n";
3913 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 3\n";
3928 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 4\n";
3942 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 4.1\n";
3954 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 4.2\n";
3961 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 5\n";
3979 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 6\n";
4294 std::cout << std::string(
__indent,
' ') <<
"Parser::rEnumSpec 1\n";
4328 std::cout << std::string(
__indent,
' ') <<
"Parser::rEnumSpec 2\n";
4340 std::cout << std::string(
__indent,
' ') <<
"Parser::rEnumSpec 3\n";
4363 std::cout << std::string(
__indent,
' ') <<
"Parser::rEnumSpec 4\n";
4435 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 1\n";
4444 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 2\n";
4467 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 3\n";
4474 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 4\n";
4498 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 5\n";
4518 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 6\n";
4530 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 7\n";
4603 bases.
get_sub().back().swap(base);
4621 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassBody 0\n";
4646 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassBody "
4647 << member.
pretty() <<
'\n';
4651 std::move(
static_cast<exprt &
>(
static_cast<irept &
>(member))));
4683 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassMember 0 " << t
4692 member.
id(
"cpp-public");
4696 member.
id(
"cpp-protected");
4700 member.
id(
"cpp-private");
4772 std::cout << std::string(
__indent,
' ') <<
"Parser::rCommaExpression 0\n";
4779 std::cout << std::string(
__indent,
' ') <<
"Parser::rCommaExpression 1\n";
4801 std::cout << std::string(
__indent,
' ') <<
"Parser::rCommaExpression 2\n";
4817 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 0\n";
4824 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 1\n";
4838 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 2\n";
4846 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 3\n";
4882 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 4\n";
4896 std::cout << std::string(
__indent,
' ') <<
"Parser::rConditionalExpr 0\n";
4903 std::cout << std::string(
__indent,
' ') <<
"Parser::rConditionalExpr 1\n";
4916 std::cout << std::string(
__indent,
' ') <<
"Parser::rConditionalExpr 2\n";
4945 std::cout << std::string(
__indent,
' ') <<
"Parser::rLogicalOrExpr 0\n";
4952 std::cout << std::string(
__indent,
' ') <<
"Parser::rLogicalOrExpr 1\n";
4984 std::cout << std::string(
__indent,
' ') <<
"Parser::rLogicalAndExpr 1\n";
4991 std::cout << std::string(
__indent,
' ') <<
"Parser::rLogicalAndExpr 1\n";
5023 std::cout << std::string(
__indent,
' ') <<
"Parser::rInclusiveOrExpr 0\n";
5030 std::cout << std::string(
__indent,
' ') <<
"Parser::rInclusiveOrExpr 1\n";
5062 std::cout << std::string(
__indent,
' ') <<
"Parser::rExclusiveOrExpr 0\n";
5069 std::cout << std::string(
__indent,
' ') <<
"Parser::rExclusiveOrExpr 1\n";
5101 std::cout << std::string(
__indent,
' ') <<
"Parser::rAndExpr 0\n";
5108 std::cout << std::string(
__indent,
' ') <<
"Parser::rAndExpr 1\n";
5140 std::cout << std::string(
__indent,
' ') <<
"Parser::rEqualityExpr 0\n";
5147 std::cout << std::string(
__indent,
' ') <<
"Parser::rEqualityExpr 1\n";
5180 std::cout << std::string(
__indent,
' ') <<
"Parser::rRelationalExpr 0\n";
5187 std::cout << std::string(
__indent,
' ') <<
"Parser::rRelationalExpr 1\n";
5211 case '<':
id=
ID_lt;
break;
5212 case '>':
id=
ID_gt;
break;
5232 std::cout << std::string(
__indent,
' ') <<
"Parser::rShiftExpr 0\n";
5239 std::cout << std::string(
__indent,
' ') <<
"Parser::rShiftExpr 1\n";
5272 std::cout << std::string(
__indent,
' ') <<
"Parser::rAdditiveExpr 0\n";
5279 std::cout << std::string(
__indent,
' ') <<
"Parser::rAdditiveExpr 1\n";
5319 std::cout << std::string(
__indent,
' ') <<
"Parser::rMultiplyExpr 0\n";
5326 std::cout << std::string(
__indent,
' ') <<
"Parser::rMultiplyExpr 1\n";
5330 while(t=
lex.
LookAhead(0), (t==
'*' || t==
'/' || t==
'%'))
5346 case '/':
id=
ID_div;
break;
5347 case '%':
id=
ID_mod;
break;
5356 std::cout << std::string(
__indent,
' ') <<
"Parser::rMultiplyExpr 2\n";
5372 std::cout << std::string(
__indent,
' ') <<
"Parser::rPmExpr 0\n";
5379 std::cout << std::string(
__indent,
' ') <<
"Parser::rPmExpr 1\n";
5401 std::cout << std::string(
__indent,
' ') <<
"Parser::rPmExpr 2\n";
5416 std::cout << std::string(
__indent,
' ') <<
"Parser::rCastExpr 0\n";
5432 std::cout << std::string(
__indent,
' ') <<
"Parser::rCastExpr 1\n";
5453 exp=
exprt(
"explicit-typecast");
5476 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeName 0\n";
5485 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeName 1\n";
5505 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeName 2\n";
5520 std::cout << std::string(
__indent,
' ')
5521 <<
"Parser::rTypeNameOrFunctionType 0\n";
5529 std::cout << std::string(
__indent,
' ')
5530 <<
"Parser::rTypeNameOrFunctionType 1\n";
5542 std::cout << std::string(
__indent,
' ')
5543 <<
"Parser::rTypeNameOrFunctionType 2\n";
5551 std::cout << std::string(
__indent,
' ')
5552 <<
"Parser::rTypeNameOrFunctionType 3\n";
5557 tname.swap(return_type);
5566 std::cout << std::string(
__indent,
' ')
5567 <<
"Parser::rTypeNameOrFunctionType 4\n";
5615 std::cout << std::string(
__indent,
' ')
5616 <<
"Parser::rTypeNameOrFunctionType 5\n";
5626 type.make_ellipsis();
5650 type.make_ellipsis();
5658 std::cout << std::string(
__indent,
' ')
5659 <<
"Parser::rTypeNameOrFunctionType 6\n";
5670 std::cout << std::string(
__indent,
' ')
5671 <<
"Parser::rTypeNameOrFunctionType 7\n";
5681 std::cout << std::string(
__indent,
' ')
5682 <<
"Parser::rTypeNameOrFunctionType 8\n";
5704 std::cout << std::string(
__indent,
' ') <<
"Parser::rUnaryExpr 0\n";
5707 if(t==
'*' || t==
'&' || t==
'+' ||
5708 t==
'-' || t==
'!' || t==
'~' ||
5715 std::cout << std::string(
__indent,
' ') <<
"Parser::rUnaryExpr 1\n";
5723 std::cout << std::string(
__indent,
' ') <<
"Parser::rUnaryExpr 2\n";
5811 std::cout << std::string(
__indent,
' ') <<
"Parser::rThrowExpr 0\n";
5822 if(t==
':' || t==
';')
5850 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeidExpr 0\n";
5916 std::cout << std::string(
__indent,
' ') <<
"Parser::rSizeofExpr 0\n";
6016 std::cout << std::string(
__indent,
' ') <<
"Parser::rNoexceptExpr 0\n";
6067 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 0\n";
6078 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 1\n";
6084 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 2\n";
6119 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 3\n";
6126 exprt arguments, initializer;
6132 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 4\n";
6338 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 0\n";
6345 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 1\n";
6362 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 2\n";
6380 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 3\n";
6391 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 4\n";
6401 fc.arguments().push_back(*it);
6412 tmp.add_to_operands(std::move(exp));
6434 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 5\n";
6441 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 6\n";
6597 block.
add(std::move(*statement));
6612 return std::move(code);
6690 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 0 "
6703 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 1\n";
6712 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 2\n";
6718 exp=
exprt(
"cpp-this");
6721 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 3\n";
6730 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 4\n";
6739 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 5\n";
6749 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 6\n";
6755 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 7\n";
6782 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 8\n";
6792 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 9\n";
6798 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 10\n";
6808 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 11\n";
6814 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 12\n";
6823 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 13\n";
6829 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 14\n";
6838 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 15\n";
6851 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 16\n";
6861 exp=
exprt(
"explicit-constructor-call");
6877 exp=
exprt(
"explicit-constructor-call");
6901 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 17\n";
6922 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarName 0\n";
6935 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 0\n";
6955 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 1\n";
6963 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 1.1 "
6973 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 2\n";
6983 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 3\n";
6996 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 4\n";
7016 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 5\n";
7020 components.push_back(
irept(
"::"));
7026 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 6\n";
7034 components.push_back(
irept(
"~"));
7040 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 7\n";
7053 components.push_back(op);
7087 std::cout << std::string(
__indent,
' ') <<
"Parser::maybeTemplateArgs 0\n";
7096 if(
u==
'\0' ||
u==
';' ||
u==
'}')
7109 std::cout << std::string(
__indent,
' ')
7110 <<
"Parser::maybeTemplateArgs 1\n";
7116 std::cout << std::string(
__indent,
' ')
7117 <<
"Parser::maybeTemplateArgs 2\n";
7132 std::cout << std::string(
__indent,
' ')
7133 <<
"Parser::maybeTemplateArgs 3\n";
7140 else if(v==
'\0' || v==
';' || v==
'}')
7144 else if(
u==
'\0' ||
u==
';' ||
u==
'}')
7150 std::cout << std::string(
__indent,
' ')
7151 <<
"Parser::maybeTemplateArgs 4\n";
7156 std::cout << std::string(
__indent,
' ') <<
"Parser::maybeTemplateArgs 5\n";
7162 std::cout << std::string(
__indent,
' ') <<
"Parser::maybeTemplateArgs 6\n";
7170 std::cout << std::string(
__indent,
' ') <<
"Parser::maybeTemplateArgs 7\n";
7201 declarator.
value()=body;
7211 declarator.
value() = std::move(*body);
7234 std::cout << std::string(
__indent,
' ') <<
"Parser::rCompoundStatement 1\n";
7241 std::cout << std::string(
__indent,
' ') <<
"Parser::rCompoundStatement 2\n";
7258 return std::move(statement);
7265 return std::move(statement);
7296 std::cout << std::string(
__indent,
' ') <<
"Parser::rStatement 0 "
7343 return std::move(statement);
7348 std::cout << std::string(
__indent,
' ') <<
"Parser::rStatement RETURN 0\n";
7359 std::cout << std::string(
__indent,
' ')
7360 <<
"Parser::rStatement RETURN 1\n";
7367 std::cout << std::string(
__indent,
' ')
7368 <<
"Parser::rStatement RETURN 2\n";
7375 std::cout << std::string(
__indent,
' ')
7376 <<
"Parser::rStatement RETURN 3\n";
7383 return std::move(statement);
7398 return std::move(statement);
7426 return std::move(code);
7441 return std::move(statement);
7460 return std::move(statement);
7488 return std::move(label);
7507 return std::move(statement);
7529 return std::move(statement);
7559 if(!
then.has_value())
7571 return std::move(statement);
7580 return std::move(statement);
7607 code_switcht statement(std::move(exp), std::move(*body));
7609 return std::move(statement);
7638 code_whilet statement(std::move(exp), std::move(*body));
7640 return std::move(statement);
7658 if(!body.has_value())
7679 return std::move(statement);
7699 if(!
exp1.has_value())
7729 std::move(*
exp1), std::move(
exp2), std::move(
exp3), std::move(*body));
7731 return std::move(statement);
7790 if(
declaration.declarators().front().name().is_nil())
7816 return std::move(statement);
7831 if(!
body1.has_value())
7856 std::move(*
body1), std::move(exp), std::move(*
body2));
7857 return std::move(statement);
7872 return std::move(statement);
7894 return std::move(statement);
7903 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 1\n";
7918 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 3\n";
7929 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 3\n";
7935 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 4\n";
7956 std::cout << std::string(
__indent,
' ')
7957 <<
"Parser::rGCCAsmStatement 5\n";
7965 std::cout << std::string(
__indent,
' ')
7966 <<
"Parser::rGCCAsmStatement 6\n";
7981 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 7\n";
7990 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 8\n";
7993 return std::move(statement);
8002 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 1\n";
8016 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 2\n";
8024 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 3\n";
8037 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 4\n";
8043 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 5\n";
8047 return std::move(statement);
8053 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 6\n";
8058 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 7\n";
8061 return std::move(statement);
8078 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 0\n";
8084 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 1\n";
8090 return std::move(statement);
8095 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 2\n";
8103 std::cout << std::string(
__indent,
' ') <<
"rDe " << statement->pretty()
8115 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 3\n";
8122 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 4\n";
8126 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 5 "
8134 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 6\n";
8191 std::cout << std::string(
__indent,
' ')
8192 <<
"Parser::rDeclarationStatement 1\n";
8214 std::cout << std::string(
__indent,
' ')
8215 <<
"Parser::rDeclarationStatement 2\n";
8225 std::cout << std::string(
__indent,
' ')
8226 <<
"Parser::rDeclarationStatement 3 " << t <<
'\n';
8229 if(
cv_q.is_not_nil() &&
8233 std::cout << std::string(
__indent,
' ')
8234 <<
"Parser::rDeclarationStatement 4\n";
8274 return std::move(statement);
8287 return std::move(statement);
8303 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclStatement 1\n";
8310 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclStatement 2\n";
8317 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclStatement 3\n";
8330 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclStatement 4\n";
8339 return std::move(statement);
8354 if(t==token || t==
'\0')
ansi_c_parsert ansi_c_parser
pointer_typet pointer_type(const typet &subtype)
bool optCvQualify(typet &)
bool rDeclaratorQualifier()
bool rShiftExpr(exprt &, bool)
optionalt< codet > rStatement()
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 &)
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 &)
Parser(cpp_parsert &_cpp_parser)
bool rLogicalAndExpr(exprt &, bool)
bool rExpression(exprt &, bool)
optionalt< codet > rTypedefStatement()
bool rString(cpp_tokent &tk)
bool rOtherDeclaration(cpp_declarationt &, cpp_storage_spect &, cpp_member_spect &, typet &)
optionalt< codet > rWhileStatement()
bool optAttribute(typet &)
bool rAdditiveExpr(exprt &)
bool rMemberInit(exprt &)
optionalt< codet > rExprStatement()
bool rConstDeclaration(cpp_declarationt &)
bool rSimpleDeclaration(cpp_declarationt &)
bool rInclusiveOrExpr(exprt &, bool)
bool rAllocateInitializer(exprt &)
bool rPrimaryExpr(exprt &)
bool rStaticAssert(cpp_static_assertt &)
optionalt< codet > rDoStatement()
bool rArgDeclListOrInit(exprt &, bool &, bool)
bool rNewDeclarator(typet &)
void make_subtype(const typet &src, typet &dest)
optionalt< codet > rIntegralDeclStatement(cpp_storage_spect &, typet &, typet &)
optionalt< codet > rTryStatement()
bool rAccessDecl(cpp_declarationt &)
optionalt< codet > rDeclarationStatement()
bool rRelationalExpr(exprt &, bool)
bool rNoexceptExpr(exprt &)
bool rNamespaceSpec(cpp_namespace_spect &)
bool rArgDeclaration(cpp_declarationt &)
optionalt< codet > rCompoundStatement()
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)
optionalt< codet > rIfStatement()
bool rEqualityExpr(exprt &, bool)
bool rCommaExpression(exprt &)
bool rTempArgList(irept &)
optionalt< codet > rMSC_leaveStatement()
bool rArgDeclList(irept &)
bool rMultiplyExpr(exprt &)
optionalt< codet > rMSC_if_existsStatement()
optionalt< codet > rMSCAsmStatement()
bool rTypedef(cpp_declarationt &)
bool rTemplateArgs(irept &)
bool rSizeofExpr(exprt &)
optionalt< codet > rGCCAsmStatement()
bool rTypeNameOrFunctionType(typet &)
bool rMemberInitializers(irept &)
bool rDeclaratorWithInit(cpp_declaratort &, bool, bool)
optionalt< codet > rForStatement()
bool rFunctionArguments(exprt &)
optionalt< codet > rOtherDeclStatement(cpp_storage_spect &, typet &)
irep_idt current_function
new_scopet * current_scope
bool optIntegralTypeOrClassSpec(typet &)
bool rTempArgDeclaration(cpp_declarationt &)
bool rLogicalOrExpr(exprt &, bool)
bool rProgram(cpp_itemt &item)
optionalt< codet > rSwitchStatement()
bool rTemplateDecl2(typet &, TemplateDeclKind &kind)
bool rTypeidExpr(exprt &)
void merge_types(const typet &src, typet &dest)
bool rAlignofExpr(exprt &)
optionalt< codet > rMSC_tryStatement()
bool rCastOperatorName(irept &)
bool rInitializeExpr(exprt &)
bool rFunctionBody(cpp_declaratort &)
bool optStorageSpec(cpp_storage_spect &)
bool rDeclaration(cpp_declarationt &)
bool rUsing(cpp_usingt &)
void set_location(irept &dest, const cpp_tokent &token)
std::size_t number_of_errors
bool rOperatorName(irept &)
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.
std::vector< cpp_declaratort > declaratorst
irept & member_initializers()
irept & method_qualifier()
cpp_static_assertt & make_static_assert()
cpp_usingt & make_using()
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
cpp_parse_treet parse_tree
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
source_locationt source_location
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 typet & subtype() 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
#define UNREACHABLE
This should be used to mark dead code.
const code_blockt & to_code_block(const codet &code)
const type_with_subtypest & to_type_with_subtypes(const typet &type)