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);
475 tmp.move_to_subtypes(dest);
476 tmp.add_source_location()=location;
484 sub.emplace(sub.begin(), src);
490#define ERROR_TOKENS 4
500 source_location.
set_file(t[0].filename);
501 source_location.
set_line(std::to_string(t[0].line_no));
503 std::string message =
"parse error before '";
558 std::cout << std::string(
__indent,
' ') <<
"Parser::rDefinition 1 " << t
615 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypedef 1\n";
644 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypedefUsing 1\n";
660 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypedefUsing 2\n";
677 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypedefUsing 3\n";
701 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 0\n";
712 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 0.1\n";
724 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 1\n";
732 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 2\n";
740 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 3\n";
749 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeSpecifier 4\n";
824 bool is_inline=
false;
965 items.push_back(
item);
969 items.push_back(
item);
1001 typet template_type;
1020 std::cout << std::string(
__indent,
' ') <<
"BODY: "
1021 << body.
pretty() <<
'\n';
1022 std::cout << std::string(
__indent,
' ') <<
"TEMPLATE_TYPE: "
1023 << template_type.
pretty() <<
'\n';
1094 if(template_parameters.
get_sub().empty())
1147 std::cout << std::string(
__indent,
' ') <<
"Parser::rTempArgDeclaration 0\n";
1163 declaration.
type()=
typet(
"cpp-template-type");
1173 bool has_ellipsis=
false;
1222 std::cout << std::string(
__indent,
' ') <<
"Parser::rTempArgDeclaration 1\n";
1229 typet template_type;
1259 std::cout << std::string(
__indent,
' ')
1260 <<
"Parser::rTempArgDeclaration 2\n";
1270 std::cout << std::string(
__indent,
' ')
1271 <<
"Parser::rTempArgDeclaration 3\n";
1274 bool has_ellipsis=
false;
1291 std::cout << std::string(
__indent,
' ')
1292 <<
"Parser::rTempArgDeclaration 4\n";
1378 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 0.1 token: "
1390 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 0.2\n";
1398 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 1\n";
1406 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 3\n";
1427 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 4\n";
1441 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 5\n";
1445 declaration, storage_spec, member_spec,
integral,
cv_q);
1452 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclaration 6 " << t
1457 cv_q.is_not_nil() &&
1536 std::cout << std::string(
__indent,
' ')
1537 <<
"Parser::rIntegralDeclaration 1 token: "
1545 std::cout << std::string(
__indent,
' ') <<
"Parser::rIntegralDeclaration 2\n";
1551 std::cout << std::string(
__indent,
' ') <<
"Parser::rIntegralDeclaration 3\n";
1564 std::cout << std::string(
__indent,
' ')
1565 <<
"Parser::rIntegralDeclaration 4\n";
1573 std::cout << std::string(
__indent,
' ')
1574 <<
"Parser::rIntegralDeclaration 5\n";
1594 std::cout << std::string(
__indent,
' ') <<
"Parser::rIntegralDeclaration 6 "
1606 declaration.
declarators().front().type().add_subtype().is_not_nil())
1608 declaration.
type() =
1611 declaration.
declarators().front().type().add_subtype().make_nil();
1615 std::cout << std::string(
__indent,
' ')
1616 <<
"Parser::rIntegralDeclaration 7\n";
1622 std::cout << std::string(
__indent,
' ')
1623 <<
"Parser::rIntegralDeclaration 8 "
1624 << declaration.
pretty() <<
'\n';
1632 std::cout << std::string(
__indent,
' ')
1633 <<
"Parser::rIntegralDeclaration 9\n";
1643 std::cout << std::string(
__indent,
' ')
1644 <<
"Parser::rIntegralDeclaration 10\n";
1656 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstDeclaration\n";
1681 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 1\n";
1690 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 2\n";
1704 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 3\n";
1713 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 4\n";
1718 for(std::size_t i=0; i <
type_name.get_sub().size(); i++)
1731 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 5\n";
1751 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 6\n";
1756 bool is_destructor=
false;
1757 for(
const auto &irep :
type_name.get_sub())
1759 if(irep.id() ==
"~")
1773 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 7\n";
1787 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 8\n";
1805 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 9\n";
1822 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 10\n";
1828 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 11\n";
1837 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclaration 12\n";
1861 std::cout << std::string(
__indent,
' ') <<
"Parser::isConstructorDecl "
1870 if(t==
'*' || t==
'&' || t==
'(')
1923 else if(v==
'\0' || v==
';' || v==
'}')
1927 else if(
u==
'\0' ||
u==
';' ||
u==
'}')
1952 member_spec.
clear();
2167 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAttribute "
2421 std::cout << std::string(
__indent,
' ')
2422 <<
"Parser::optIntegralTypeOrClassSpec 0\n";
2442 std::cout << std::string(
__indent,
' ')
2443 <<
"Parser::optIntegralTypeOrClassSpec 1\n";
2495 std::cout << std::string(
__indent,
' ')
2496 <<
"Parser::optIntegralTypeOrClassSpec 2\n";
2503 std::cout << std::string(
__indent,
' ')
2504 <<
"Parser::optIntegralTypeOrClassSpec 3\n";
2514 std::cout << std::string(
__indent,
' ')
2515 <<
"Parser::optIntegralTypeOrClassSpec 4\n";
2522 std::cout << std::string(
__indent,
' ')
2523 <<
"Parser::optIntegralTypeOrClassSpec 5\n";
2552 std::cout << std::string(
__indent,
' ')
2553 <<
"Parser::optIntegralTypeOrClassSpec 6\n";
2561 std::cout << std::string(
__indent,
' ')
2562 <<
"Parser::optIntegralTypeOrClassSpec 7\n";
2569 std::cout << std::string(
__indent,
' ')
2570 <<
"Parser::optIntegralTypeOrClassSpec 8\n";
2649 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 0\n";
2663 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 1\n";
2676 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 2\n";
2688 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 3\n";
2700 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 4\n";
2714 std::cout << std::string(
__indent,
' ') <<
"Parser::rConstructorDecl 5\n";
2726 constructor.
value()=
codet(
"cpp-pure-virtual");
2853 declarators.push_back(declarator);
2967 dw.swap(declarator);
3021 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 1\n";
3043 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 2\n";
3051 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 3\n";
3062 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 4\n";
3075 if(t!=
'[' && t!=
'(')
3081 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 5\n";
3092 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 6\n";
3101 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 7\n";
3114 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 8\n";
3146 init_args.
swap(args);
3151 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 9\n";
3160 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 10\n";
3172 if(
d_outer.add_subtype().is_not_nil())
3175 d_outer.add_subtype().swap(return_type);
3181 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 11\n";
3199 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 12\n";
3214 std::list<typet>
tl;
3218 tl.push_back(
tl.back().add_subtype());
3247 std::cout << std::string(
__indent,
' ') <<
"Parser::rDeclarator2 13\n";
3273 std::cout << std::string(
__indent,
' ') <<
"Parser::optPtrOperator 1\n";
3283 std::cout << std::string(
__indent,
' ') <<
"Parser::optPtrOperator 2 " << t
3362 for(std::list<typet>::reverse_iterator
3375 it->add_subtype().swap(
ptrs);
3425 std::cout << std::string(
__indent,
' ') <<
"Parser::rMemberInit 1\n";
3434 std::cout << std::string(
__indent,
' ') <<
"Parser::rMemberInit 2\n";
3448 std::cout << std::string(
__indent,
' ') <<
"Parser::rMemberInit 3\n";
3458 if(
tk2.kind!=
'}' &&
tk2.kind!=
')')
3467 std::cout << std::string(
__indent,
' ') <<
"Parser::rMemberInit 4\n";
3507 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 0\n";
3527 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 1\n";
3535 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 2 "
3543 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 3\n";
3553 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 4\n";
3572 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 5\n";
3588 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 6\n";
3591 components.push_back(
irept(
"::"));
3597 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 7\n";
3605 components.push_back(
irept(
"~"));
3611 std::cout << std::string(
__indent,
' ') <<
"Parser::rName 8\n";
3618 components.push_back(
irept());
3671 operator_id = std::string(1,
static_cast<char>(t));
3795 std::cout << std::string(
__indent,
' ') <<
"Parser::rPtrToMember 0\n";
3854 components.push_back(
irept(
"::"));
3864 std::cout << std::string(
__indent,
' ') <<
"Parser::rPtrToMember 1\n";
3895 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 0\n";
3906 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 1\n";
3918 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 2\n";
3927 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 3\n";
3942 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 4\n";
3956 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 4.1\n";
3968 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 4.2\n";
3975 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 5\n";
3993 std::cout << std::string(
__indent,
' ') <<
"Parser::rTemplateArgs 6\n";
4102 list.
get_sub().back().swap(declaration);
4308 std::cout << std::string(
__indent,
' ') <<
"Parser::rEnumSpec 1\n";
4342 std::cout << std::string(
__indent,
' ') <<
"Parser::rEnumSpec 2\n";
4354 std::cout << std::string(
__indent,
' ') <<
"Parser::rEnumSpec 3\n";
4377 std::cout << std::string(
__indent,
' ') <<
"Parser::rEnumSpec 4\n";
4449 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 1\n";
4458 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 2\n";
4481 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 3\n";
4488 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 4\n";
4507 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 5\n";
4527 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 6\n";
4539 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassSpec 7\n";
4612 bases.
get_sub().back().swap(base);
4630 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassBody 0\n";
4655 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassBody "
4656 << member.
pretty() <<
'\n';
4660 std::move(
static_cast<exprt &
>(
static_cast<irept &
>(member))));
4692 std::cout << std::string(
__indent,
' ') <<
"Parser::rClassMember 0 " << t
4701 member.
id(
"cpp-public");
4705 member.
id(
"cpp-protected");
4709 member.
id(
"cpp-private");
4783 std::cout << std::string(
__indent,
' ') <<
"Parser::rCommaExpression 0\n";
4790 std::cout << std::string(
__indent,
' ') <<
"Parser::rCommaExpression 1\n";
4812 std::cout << std::string(
__indent,
' ') <<
"Parser::rCommaExpression 2\n";
4828 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 0\n";
4835 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 1\n";
4849 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 2\n";
4857 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 3\n";
4893 std::cout << std::string(
__indent,
' ') <<
"Parser::rExpression 4\n";
4907 std::cout << std::string(
__indent,
' ') <<
"Parser::rConditionalExpr 0\n";
4914 std::cout << std::string(
__indent,
' ') <<
"Parser::rConditionalExpr 1\n";
4927 std::cout << std::string(
__indent,
' ') <<
"Parser::rConditionalExpr 2\n";
4956 std::cout << std::string(
__indent,
' ') <<
"Parser::rLogicalOrExpr 0\n";
4963 std::cout << std::string(
__indent,
' ') <<
"Parser::rLogicalOrExpr 1\n";
4995 std::cout << std::string(
__indent,
' ') <<
"Parser::rLogicalAndExpr 1\n";
5002 std::cout << std::string(
__indent,
' ') <<
"Parser::rLogicalAndExpr 1\n";
5034 std::cout << std::string(
__indent,
' ') <<
"Parser::rInclusiveOrExpr 0\n";
5041 std::cout << std::string(
__indent,
' ') <<
"Parser::rInclusiveOrExpr 1\n";
5073 std::cout << std::string(
__indent,
' ') <<
"Parser::rExclusiveOrExpr 0\n";
5080 std::cout << std::string(
__indent,
' ') <<
"Parser::rExclusiveOrExpr 1\n";
5112 std::cout << std::string(
__indent,
' ') <<
"Parser::rAndExpr 0\n";
5119 std::cout << std::string(
__indent,
' ') <<
"Parser::rAndExpr 1\n";
5151 std::cout << std::string(
__indent,
' ') <<
"Parser::rEqualityExpr 0\n";
5158 std::cout << std::string(
__indent,
' ') <<
"Parser::rEqualityExpr 1\n";
5191 std::cout << std::string(
__indent,
' ') <<
"Parser::rRelationalExpr 0\n";
5198 std::cout << std::string(
__indent,
' ') <<
"Parser::rRelationalExpr 1\n";
5222 case '<':
id=
ID_lt;
break;
5223 case '>':
id=
ID_gt;
break;
5243 std::cout << std::string(
__indent,
' ') <<
"Parser::rShiftExpr 0\n";
5250 std::cout << std::string(
__indent,
' ') <<
"Parser::rShiftExpr 1\n";
5283 std::cout << std::string(
__indent,
' ') <<
"Parser::rAdditiveExpr 0\n";
5290 std::cout << std::string(
__indent,
' ') <<
"Parser::rAdditiveExpr 1\n";
5330 std::cout << std::string(
__indent,
' ') <<
"Parser::rMultiplyExpr 0\n";
5337 std::cout << std::string(
__indent,
' ') <<
"Parser::rMultiplyExpr 1\n";
5341 while(t=
lex.
LookAhead(0), (t==
'*' || t==
'/' || t==
'%'))
5357 case '/':
id=
ID_div;
break;
5358 case '%':
id=
ID_mod;
break;
5367 std::cout << std::string(
__indent,
' ') <<
"Parser::rMultiplyExpr 2\n";
5383 std::cout << std::string(
__indent,
' ') <<
"Parser::rPmExpr 0\n";
5390 std::cout << std::string(
__indent,
' ') <<
"Parser::rPmExpr 1\n";
5412 std::cout << std::string(
__indent,
' ') <<
"Parser::rPmExpr 2\n";
5427 std::cout << std::string(
__indent,
' ') <<
"Parser::rCastExpr 0\n";
5443 std::cout << std::string(
__indent,
' ') <<
"Parser::rCastExpr 1\n";
5464 exp=
exprt(
"explicit-typecast");
5487 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeName 0\n";
5496 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeName 1\n";
5516 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeName 2\n";
5531 std::cout << std::string(
__indent,
' ')
5532 <<
"Parser::rTypeNameOrFunctionType 0\n";
5540 std::cout << std::string(
__indent,
' ')
5541 <<
"Parser::rTypeNameOrFunctionType 1\n";
5553 std::cout << std::string(
__indent,
' ')
5554 <<
"Parser::rTypeNameOrFunctionType 2\n";
5562 std::cout << std::string(
__indent,
' ')
5563 <<
"Parser::rTypeNameOrFunctionType 3\n";
5568 tname.swap(return_type);
5577 std::cout << std::string(
__indent,
' ')
5578 <<
"Parser::rTypeNameOrFunctionType 4\n";
5624 std::cout << std::string(
__indent,
' ')
5625 <<
"Parser::rTypeNameOrFunctionType 5\n";
5635 type.make_ellipsis();
5659 type.make_ellipsis();
5667 std::cout << std::string(
__indent,
' ')
5668 <<
"Parser::rTypeNameOrFunctionType 6\n";
5679 std::cout << std::string(
__indent,
' ')
5680 <<
"Parser::rTypeNameOrFunctionType 7\n";
5690 std::cout << std::string(
__indent,
' ')
5691 <<
"Parser::rTypeNameOrFunctionType 8\n";
5713 std::cout << std::string(
__indent,
' ') <<
"Parser::rUnaryExpr 0\n";
5716 if(t==
'*' || t==
'&' || t==
'+' ||
5717 t==
'-' || t==
'!' || t==
'~' ||
5724 std::cout << std::string(
__indent,
' ') <<
"Parser::rUnaryExpr 1\n";
5732 std::cout << std::string(
__indent,
' ') <<
"Parser::rUnaryExpr 2\n";
5820 std::cout << std::string(
__indent,
' ') <<
"Parser::rThrowExpr 0\n";
5831 if(t==
':' || t==
';')
5859 std::cout << std::string(
__indent,
' ') <<
"Parser::rTypeidExpr 0\n";
5925 std::cout << std::string(
__indent,
' ') <<
"Parser::rSizeofExpr 0\n";
6025 std::cout << std::string(
__indent,
' ') <<
"Parser::rNoexceptExpr 0\n";
6076 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 0\n";
6087 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 1\n";
6093 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 2\n";
6128 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 3\n";
6135 exprt arguments, initializer;
6141 std::cout << std::string(
__indent,
' ') <<
"Parser::rAllocateExpr 4\n";
6347 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 0\n";
6354 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 1\n";
6371 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 2\n";
6389 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 3\n";
6400 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 4\n";
6410 fc.arguments().push_back(*it);
6421 tmp.add_to_operands(std::move(exp));
6443 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 5\n";
6450 std::cout << std::string(
__indent,
' ') <<
"Parser::rPostfixExpr 6\n";
6606 block.
add(std::move(*statement));
6621 return std::move(code);
6699 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 0 "
6712 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 1\n";
6721 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 2\n";
6727 exp=
exprt(
"cpp-this");
6730 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 3\n";
6739 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 4\n";
6748 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 5\n";
6758 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 6\n";
6764 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 7\n";
6791 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 8\n";
6801 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 9\n";
6807 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 10\n";
6817 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 11\n";
6823 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 12\n";
6832 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 13\n";
6838 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 14\n";
6847 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 15\n";
6860 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 16\n";
6870 exp=
exprt(
"explicit-constructor-call");
6886 exp=
exprt(
"explicit-constructor-call");
6910 std::cout << std::string(
__indent,
' ') <<
"Parser::rPrimaryExpr 17\n";
6931 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarName 0\n";
6944 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 0\n";
6964 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 1\n";
6972 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 1.1 "
6982 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 2\n";
6993 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 3\n";
7006 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 4\n";
7026 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 5\n";
7030 components.push_back(
irept(
"::"));
7036 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 6\n";
7044 components.push_back(
irept(
"~"));
7050 std::cout << std::string(
__indent,
' ') <<
"Parser::rVarNameCore 7\n";
7063 components.push_back(op);
7097 std::cout << std::string(
__indent,
' ') <<
"Parser::maybeTemplateArgs 0\n";
7106 if(
u==
'\0' ||
u==
';' ||
u==
'}')
7119 std::cout << std::string(
__indent,
' ')
7120 <<
"Parser::maybeTemplateArgs 1\n";
7126 std::cout << std::string(
__indent,
' ')
7127 <<
"Parser::maybeTemplateArgs 2\n";
7142 std::cout << std::string(
__indent,
' ')
7143 <<
"Parser::maybeTemplateArgs 3\n";
7150 else if(v==
'\0' || v==
';' || v==
'}')
7154 else if(
u==
'\0' ||
u==
';' ||
u==
'}')
7160 std::cout << std::string(
__indent,
' ')
7161 <<
"Parser::maybeTemplateArgs 4\n";
7166 std::cout << std::string(
__indent,
' ') <<
"Parser::maybeTemplateArgs 5\n";
7172 std::cout << std::string(
__indent,
' ') <<
"Parser::maybeTemplateArgs 6\n";
7180 std::cout << std::string(
__indent,
' ') <<
"Parser::maybeTemplateArgs 7\n";
7211 declarator.
value()=body;
7221 declarator.
value() = std::move(*body);
7244 std::cout << std::string(
__indent,
' ') <<
"Parser::rCompoundStatement 1\n";
7251 std::cout << std::string(
__indent,
' ') <<
"Parser::rCompoundStatement 2\n";
7268 return std::move(statement);
7275 return std::move(statement);
7306 std::cout << std::string(
__indent,
' ') <<
"Parser::rStatement 0 "
7353 return std::move(statement);
7358 std::cout << std::string(
__indent,
' ') <<
"Parser::rStatement RETURN 0\n";
7369 std::cout << std::string(
__indent,
' ')
7370 <<
"Parser::rStatement RETURN 1\n";
7377 std::cout << std::string(
__indent,
' ')
7378 <<
"Parser::rStatement RETURN 2\n";
7385 std::cout << std::string(
__indent,
' ')
7386 <<
"Parser::rStatement RETURN 3\n";
7393 return std::move(statement);
7408 return std::move(statement);
7436 return std::move(code);
7451 return std::move(statement);
7470 return std::move(statement);
7499 return std::move(label);
7517 return std::move(statement);
7539 return std::move(statement);
7569 if(!
then.has_value())
7581 return std::move(statement);
7590 return std::move(statement);
7617 code_switcht statement(std::move(exp), std::move(*body));
7619 return std::move(statement);
7648 code_whilet statement(std::move(exp), std::move(*body));
7650 return std::move(statement);
7668 if(!body.has_value())
7689 return std::move(statement);
7709 if(!
exp1.has_value())
7739 std::move(*
exp1), std::move(
exp2), std::move(
exp3), std::move(*body));
7741 return std::move(statement);
7799 declaration.
declarators().size() == 1,
"exactly one declarator");
7801 if(declaration.
declarators().front().name().is_nil())
7827 return std::move(statement);
7842 if(!
body1.has_value())
7867 std::move(*
body1), std::move(exp), std::move(*
body2));
7868 return std::move(statement);
7883 return std::move(statement);
7905 return std::move(statement);
7914 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 1\n";
7929 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 3\n";
7940 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 3\n";
7946 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 4\n";
7967 std::cout << std::string(
__indent,
' ')
7968 <<
"Parser::rGCCAsmStatement 5\n";
7976 std::cout << std::string(
__indent,
' ')
7977 <<
"Parser::rGCCAsmStatement 6\n";
7992 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 7\n";
8001 std::cout << std::string(
__indent,
' ') <<
"Parser::rGCCAsmStatement 8\n";
8004 return std::move(statement);
8013 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 1\n";
8027 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 2\n";
8035 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 3\n";
8048 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 4\n";
8054 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 5\n";
8058 return std::move(statement);
8064 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 6\n";
8069 std::cout << std::string(
__indent,
' ') <<
"Parser::rMSCAsmStatement 7\n";
8072 return std::move(statement);
8089 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 0\n";
8095 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 1\n";
8101 return std::move(statement);
8106 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 2\n";
8114 std::cout << std::string(
__indent,
' ') <<
"rDe " << statement->pretty()
8126 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 3\n";
8133 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 4\n";
8137 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 5 "
8145 std::cout << std::string(
__indent,
' ') <<
"Parser::rExprStatement 6\n";
8202 std::cout << std::string(
__indent,
' ')
8203 <<
"Parser::rDeclarationStatement 1\n";
8225 std::cout << std::string(
__indent,
' ')
8226 <<
"Parser::rDeclarationStatement 2\n";
8236 std::cout << std::string(
__indent,
' ')
8237 <<
"Parser::rDeclarationStatement 3 " << t <<
'\n';
8241 cv_q.is_not_nil() &&
8245 std::cout << std::string(
__indent,
' ')
8246 <<
"Parser::rDeclarationStatement 4\n";
8286 return std::move(statement);
8299 return std::move(statement);
8315 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclStatement 1\n";
8322 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclStatement 2\n";
8329 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclStatement 3\n";
8342 std::cout << std::string(
__indent,
' ') <<
"Parser::rOtherDeclStatement 4\n";
8351 return std::move(statement);
8366 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 rGCCAttribute(typet &)
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.
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_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 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
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)