32 static unsigned __indent;
36 indenter() { __indent+=2; }
37 ~indenter() { __indent-=2; }
43 lex.LookAhead(0, _tk); \ 44 std::cout << std::string(__indent, ' ') << "Text [" << _tk.line_no << "]: " \ 45 << _tk.text << '\n'; \ 121 return "CLASS_TEMPLATE";
123 return "MEMBER_TEMPLATE";
125 return "FUNCTION_TEMPLATE";
129 return "NON_TYPE_TEMPLATE_PARAMETER";
131 return "TYPE_TEMPLATE_PARAMETER";
133 return "TEMPLATE_TEMPLATE_PARAMETER";
139 typedef std::map<irep_idt, new_scopet>
id_mapt;
146 inline void print(std::ostream &out)
const 164 void print_rec(std::ostream &,
unsigned indent)
const;
187 for(id_mapt::const_iterator
192 out << std::string(indent,
' ')
196 it->second.print_rec(out, indent+2);
204 lex(_cpp_parser.token_buffer),
285 typet &trailing_return_type);
406 if(p->
id()==ID_merged_type)
425 if(cpp_name.
get_sub().size()==1 &&
426 cpp_name.
get_sub().front().id()==ID_name)
427 id=cpp_name.
get_sub().front().get(ID_identifier);
474 if(dest.
id()!=ID_merged_type)
477 typet tmp(ID_merged_type);
487 sub.emplace(sub.begin(), src);
494 #define ERROR_TOKENS 4 504 source_location.
set_file(t[0].filename);
507 std::string message=
"parse error before `";
562 std::cout << std::string(__indent,
' ') <<
"Parser::rDefinition 1 " << t
617 std::cout << std::string(__indent,
' ') <<
"Parser::rTypedef 1\n";
646 std::cout << std::string(__indent,
' ') <<
"Parser::rTypedefUsing 1\n";
662 std::cout << std::string(__indent,
' ') <<
"Parser::rTypedefUsing 2\n";
679 std::cout << std::string(__indent,
' ') <<
"Parser::rTypedefUsing 3\n";
687 statement=
codet(ID_decl);
700 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 0\n";
711 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 0.1\n";
723 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 1\n";
731 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 2\n";
739 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 3\n";
748 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 4\n";
815 linkage_spec.
items().push_back(item);
831 bool is_inline=
false;
849 name=tk2.
data.
get(ID_C_base_name);
974 items.push_back(item);
978 items.push_back(item);
1010 typet template_type;
1029 std::cout << std::string(__indent,
' ') <<
"BODY: " 1030 << body.
pretty() <<
'\n';
1031 std::cout << std::string(__indent,
' ') <<
"TEMPLATE_TYPE: " 1032 << template_type.
pretty() <<
'\n';
1034 body.
add(ID_template_type).
swap(template_type);
1035 body.
set(ID_is_template,
true);
1045 body.
add(ID_template_type).
swap(template_type);
1046 body.
set(ID_is_template,
true);
1065 decl=
typet(ID_template);
1078 irept &template_parameters=decl.
add(ID_template_parameters);
1102 if(template_parameters.
get_sub().empty())
1127 args.
get_sub().back().swap(a);
1138 args.
get_sub().back().swap(a);
1155 std::cout << std::string(__indent,
' ') <<
"Parser::rTempArgDeclaration 0\n";
1170 declaration.
set(ID_is_type,
true);
1171 declaration.
type()=
typet(
"cpp-template-type");
1181 bool has_ellipsis=
false;
1197 exprt name(ID_name);
1198 name.
set(ID_identifier, tk2.
data.
get(ID_C_base_name));
1200 cpp_name.
get_sub().push_back(name);
1234 std::cout << std::string(__indent,
' ') <<
"Parser::rTempArgDeclaration 1\n";
1241 typet template_type;
1272 std::cout << std::string(__indent,
' ')
1273 <<
"Parser::rTempArgDeclaration 2\n";
1277 declaration.
set(ID_is_type,
false);
1283 std::cout << std::string(__indent,
' ')
1284 <<
"Parser::rTempArgDeclaration 3\n";
1287 bool has_ellipsis=
false;
1304 std::cout << std::string(__indent,
' ')
1305 <<
"Parser::rTempArgDeclaration 4\n";
1392 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 0.1 token: " 1404 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 0.2\n";
1412 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 1\n";
1420 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 3\n";
1423 typet cv_q, integral;
1437 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 4\n";
1451 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 5\n";
1455 declaration, storage_spec, member_spec, integral, cv_q);
1462 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 6 " << t
1478 typet cv_q, integral;
1504 integral.
swap(cv_q);
1543 std::cout << std::string(__indent,
' ')
1544 <<
"Parser::rIntegralDeclaration 1 token: " 1552 std::cout << std::string(__indent,
' ') <<
"Parser::rIntegralDeclaration 2\n";
1558 std::cout << std::string(__indent,
' ') <<
"Parser::rIntegralDeclaration 3\n";
1571 std::cout << std::string(__indent,
' ')
1572 <<
"Parser::rIntegralDeclaration 4\n";
1580 std::cout << std::string(__indent,
' ')
1581 <<
"Parser::rIntegralDeclaration 5\n";
1601 std::cout << std::string(__indent,
' ')
1602 <<
"Parser::rIntegralDeclaration 6 " 1611 declaration.
type().
id() == ID_auto &&
1613 declaration.
declarators().front().type().id() == ID_function_type &&
1614 declaration.
declarators().front().type().subtype().is_not_nil())
1616 declaration.
type() = declaration.
declarators().front().type().subtype();
1617 declaration.
declarators().front().type().subtype().make_nil();
1621 std::cout << std::string(__indent,
' ')
1622 <<
"Parser::rIntegralDeclaration 7\n";
1628 std::cout << std::string(__indent,
' ')
1629 <<
"Parser::rIntegralDeclaration 8 " 1630 << declaration.
pretty() <<
'\n';
1638 std::cout << std::string(__indent,
' ')
1639 <<
"Parser::rIntegralDeclaration 9\n";
1649 std::cout << std::string(__indent,
' ')
1650 <<
"Parser::rIntegralDeclaration 10\n";
1666 std::cout << std::string(__indent,
' ') <<
"Parser::rConstDeclaration\n";
1693 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 1\n";
1696 if(!
rName(type_name))
1702 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 2\n";
1716 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 3\n";
1720 bool is_operator =
false;
1725 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 4\n";
1728 assert(!type_name.
get_sub().empty());
1730 for(std::size_t i=0; i < type_name.
get_sub().size(); i++)
1732 if(type_name.
get_sub()[i].id() == ID_operator)
1743 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 5\n";
1747 typet type = type_name;
1751 typet trailing_return_type;
1753 conv_operator_declarator, type_name, trailing_return_type))
1756 type_name=
typet(
"cpp-cast-operator");
1758 declaration.
declarators().push_back(conv_operator_declarator);
1763 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 6\n";
1766 assert(!type_name.
get_sub().empty());
1768 bool is_destructor=
false;
1777 typet trailing_return_type;
1779 constructor_declarator, type_name, trailing_return_type))
1783 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 7\n";
1788 type_name=trailing_return_type;
1790 type_name=
typet(is_destructor?ID_destructor:ID_constructor);
1792 declaration.
declarators().push_back(constructor_declarator);
1797 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 8\n";
1815 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 9\n";
1827 declaration.
type().
swap(type_name);
1832 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 10\n";
1838 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 11\n";
1847 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 12\n";
1871 std::cout << std::string(__indent,
' ') <<
"Parser::isConstructorDecl " 1880 if(t==
'*' || t==
'&' || t==
'(')
1933 else if(v==
'\0' || v==
';' || v==
'}')
1937 else if(u==
'\0' || u==
';' || u==
'}')
1962 member_spec.
clear();
2043 p=
typet(ID_constexpr);
2055 p=
typet(ID_volatile);
2061 p=
typet(ID_restrict);
2154 std::cout << std::string(__indent,
' ') <<
"Parser::rAttribute " 2173 typet attr(ID_packed);
2181 typet attr(ID_transparent_union);
2209 typet attr(ID_aligned);
2226 attr.
add(ID_size, exp);
2247 typet attr(ID_gcc_attribute_mode);
2249 attr.
set(ID_size, name.
get(ID_identifier));
2256 typet attr(ID_static);
2264 typet attr(ID_weak);
2283 typet attr(ID_alias);
2303 typet attr(ID_section);
2312 typet attr(ID_noreturn);
2320 typet attr(ID_constructor);
2328 typet attr(ID_destructor);
2397 std::cout << std::string(__indent,
' ')
2398 <<
"Parser::optIntegralTypeOrClassSpec 0\n";
2408 bool is_integral=
false;
2418 std::cout << std::string(__indent,
' ')
2419 <<
"Parser::optIntegralTypeOrClassSpec 1\n";
2426 case TOK_CHAR: type_id=ID_char;
break;
2429 case TOK_INT: type_id=ID_int;
break;
2430 case TOK_SHORT: type_id=ID_short;
break;
2431 case TOK_LONG: type_id=ID_long;
break;
2436 case TOK_FLOAT: type_id=ID_float;
break;
2438 case TOK_VOID: type_id=ID_void;
break;
2439 case TOK_INT8: type_id=ID_int8;
break;
2440 case TOK_INT16: type_id=ID_int16;
break;
2441 case TOK_INT32: type_id=ID_int32;
break;
2442 case TOK_INT64: type_id=ID_int64;
break;
2445 case TOK_BOOL: type_id=ID_bool;
break;
2447 case TOK_AUTO: type_id = ID_auto;
break;
2451 if(!type_id.
empty())
2468 std::cout << std::string(__indent,
' ')
2469 <<
"Parser::optIntegralTypeOrClassSpec 2\n";
2476 std::cout << std::string(__indent,
' ')
2477 <<
"Parser::optIntegralTypeOrClassSpec 3\n";
2487 std::cout << std::string(__indent,
' ')
2488 <<
"Parser::optIntegralTypeOrClassSpec 4\n";
2495 std::cout << std::string(__indent,
' ')
2496 <<
"Parser::optIntegralTypeOrClassSpec 5\n";
2516 p.
add(ID_type_arg).
swap(tname);
2525 std::cout << std::string(__indent,
' ')
2526 <<
"Parser::optIntegralTypeOrClassSpec 6\n";
2534 std::cout << std::string(__indent,
' ')
2535 <<
"Parser::optIntegralTypeOrClassSpec 7\n";
2542 std::cout << std::string(__indent,
' ')
2543 <<
"Parser::optIntegralTypeOrClassSpec 8\n";
2546 p.
add(ID_expr_arg).
swap(expr);
2555 p=
typet(ID_decltype);
2571 p.
add(ID_expr_arg).
swap(expr);
2582 p=
typet(ID_msc_underlying_type);
2599 p.
add(ID_type_arg).
swap(tname);
2618 typet &trailing_return_type)
2622 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 0\n";
2629 constructor.
name().
swap(type_name);
2636 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 1\n";
2639 irept ¶meters=constructor.
type().
add(ID_parameters);
2649 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 2\n";
2652 typet &cv=
static_cast<typet &
>(constructor.
add(ID_method_qualifier));
2661 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 3\n";
2673 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 4\n";
2687 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 5\n";
2699 constructor.
value()=
codet(
"cpp-pure-virtual");
2815 bool should_be_declarator,
2826 declarators.push_back(declarator);
2844 bool should_be_declarator,
2857 typet bit_field_type(ID_c_bit_field);
2858 bit_field_type.
set(ID_size, e);
2871 should_be_declarator, is_statement))
2916 if(declarator.
type().
id()!=ID_function_type)
2932 typet bit_field_type(ID_c_bit_field);
2933 bit_field_type.
set(ID_size, e);
2940 dw.
swap(declarator);
2988 bool should_be_declarator,
2995 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 1\n";
3002 typet d_outer, d_inner;
3017 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 2\n";
3025 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 3\n";
3032 if(!
rDeclarator(declarator2, kind,
true,
true,
false))
3036 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 4\n";
3044 if(!should_be_declarator)
3049 if(t!=
'[' && t!=
'(')
3055 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 5\n";
3065 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 6\n";
3074 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 7\n";
3087 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 8\n";
3107 typet function_type(ID_function_type);
3109 function_type.
add(ID_parameters).
swap(args);
3113 d_outer.
swap(d_inner);
3119 init_args.
swap(args);
3124 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 9\n";
3133 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 10\n";
3154 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 11\n";
3172 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 12\n";
3187 std::list<typet> tl;
3188 tl.push_back(d_outer);
3189 while(tl.back().id() == ID_array)
3191 tl.push_back(tl.back().subtype());
3196 d_outer.
swap(array_type);
3199 tl.back().subtype().swap(d_outer);
3200 d_outer.
swap(tl.back());
3211 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 13\n";
3237 std::cout << std::string(__indent,
' ') <<
"Parser::optPtrOperator 1\n";
3240 std::list<typet> t_list;
3247 std::cout << std::string(__indent,
' ') <<
"Parser::optPtrOperator 2 " 3253 typet op(ID_frontend_pointer);
3264 t_list.push_back(op);
3269 typet op(ID_block_pointer);
3280 t_list.push_back(op);
3294 t_list.push_back(cv);
3297 t_list.push_back(op);
3310 typet op(ID_frontend_pointer);
3311 op.
set(ID_C_reference,
true);
3313 t_list.push_front(op);
3319 typet op(ID_frontend_pointer);
3320 op.
set(ID_C_rvalue_reference,
true);
3322 t_list.push_front(op);
3326 for(std::list<typet>::reverse_iterator
3331 if(it->id()==ID_merged_type)
3333 assert(!it->subtypes().empty());
3334 it->subtypes().back().subtype().swap(ptrs);
3338 assert(it->is_not_nil());
3339 it->subtype().swap(ptrs);
3359 init=
irept(ID_member_initializers);
3389 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 1\n";
3398 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 2\n";
3401 init=
codet(ID_member_initializer);
3402 init.
add(ID_member).
swap(name);
3412 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 3\n";
3431 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 4\n";
3471 std::cout << std::string(__indent,
' ') <<
"Parser::rName 0\n";
3481 name.
set(ID_typename,
true);
3491 std::cout << std::string(__indent,
' ') <<
"Parser::rName 1\n";
3499 std::cout << std::string(__indent,
' ') <<
"Parser::rName 2 " 3507 std::cout << std::string(__indent,
' ') <<
"Parser::rName 3\n";
3517 std::cout << std::string(__indent,
' ') <<
"Parser::rName 4\n";
3524 components.push_back(
irept(ID_template_args));
3525 components.back().
add(ID_arguments).
swap(args);
3535 std::cout << std::string(__indent,
' ') <<
"Parser::rName 5\n";
3538 components.push_back(
irept(ID_name));
3539 components.back().set(ID_identifier, tk.
data.
get(ID_C_base_name));
3552 std::cout << std::string(__indent,
' ') <<
"Parser::rName 6\n";
3555 components.push_back(
irept(
"::"));
3561 std::cout << std::string(__indent,
' ') <<
"Parser::rName 7\n";
3569 components.push_back(
irept(
"~"));
3575 std::cout << std::string(__indent,
' ') <<
"Parser::rName 8\n";
3579 components.push_back(
irept(ID_operator));
3582 components.push_back(
irept());
3635 operator_id = std::string(1, static_cast<char>(t));
3650 case TOK_EQ: operator_id=
"==";
break;
3651 case TOK_NE: operator_id=
"!=";
break;
3652 case TOK_LE: operator_id=
"<=";
break;
3653 case TOK_GE: operator_id=
">=";
break;
3655 case TOK_OROR: operator_id=
"||";
break;
3656 case TOK_INCR: operator_id=
"++";
break;
3657 case TOK_DECR: operator_id=
"--";
break;
3658 case TOK_DOTPM: operator_id=
".*";
break;
3660 case TOK_ARROW: operator_id=
"->";
break;
3674 name=
irept(t==
TOK_NEW?ID_cpp_new_array:ID_cpp_delete_array);
3701 assert(!operator_id.
empty());
3703 name=
irept(operator_id);
3717 typet cv1, cv2, type_name, ptr;
3732 if(!
rName(type_name))
3759 std::cout << std::string(__indent,
' ') <<
"Parser::rPtrToMember 0\n";
3762 typet ptm(ID_frontend_pointer);
3763 irept &name = ptm.
add(
"to-member");
3773 bool loop_cond =
true;
3793 components.push_back(
irept(ID_template_args));
3794 components.back().
add(ID_arguments).
swap(args);
3803 components.push_back(
irept(ID_name));
3804 components.back().set(ID_identifier, tk.
data.
get(ID_C_base_name));
3816 components.push_back(
irept(
"::"));
3823 ptr_to_mem.
swap(ptm);
3827 std::cout << std::string(__indent,
' ') <<
"Parser::rPtrToMember 1\n";
3858 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 0\n";
3869 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 1\n";
3881 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 2\n";
3890 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 3\n";
3905 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 4\n";
3917 exp.
id(
"ambiguous");
3919 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 4.1\n";
3931 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 4.2\n";
3938 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 5\n";
3956 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 6\n";
3960 template_args.
get_sub().back().swap(exp);
4063 list.
get_sub().back().swap(declaration);
4101 header=
typet(ID_register);
4117 declaration.
declarators().push_back(arg_declarator);
4147 expr.
id(ID_initializer_list);
4268 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 1\n";
4285 spec.
set(ID_C_class,
true);
4302 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 2\n";
4314 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 3\n";
4337 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 4\n";
4409 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 1\n";
4418 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 2\n";
4423 spec=
typet(ID_struct);
4424 spec.
set(ID_C_class,
true);
4428 spec=
typet(ID_struct);
4429 spec.
set(ID_C_interface,
true);
4432 spec=
typet(ID_struct);
4434 spec=
typet(ID_union);
4441 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 3\n";
4448 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 4\n";
4473 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 5\n";
4493 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 6\n";
4505 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 7\n";
4508 ((
exprt&)spec.
add(ID_body)).operands().
swap(body.operands());
4529 irept base(ID_base);
4534 base.
set(ID_virtual,
true);
4543 base.
set(ID_protection, ID_public);
4547 base.
set(ID_protection, ID_protected);
4551 base.
set(ID_protection, ID_private);
4564 base.
set(ID_virtual,
true);
4578 bases.
get_sub().back().swap(base);
4596 std::cout << std::string(__indent,
' ') <<
"Parser::rClassBody 0\n";
4621 std::cout << std::string(__indent,
' ') <<
"Parser::rClassBody " 4622 << member.
pretty() <<
'\n';
4626 static_cast<exprt &>(static_cast<irept &>(member)));
4658 std::cout << std::string(__indent,
' ') <<
"Parser::rClassMember 0 " << t
4667 member.
id(
"cpp-public");
4671 member.
id(
"cpp-protected");
4675 member.
id(
"cpp-private");
4743 std::cout << std::string(__indent,
' ') <<
"Parser::rCommaExpression 0\n";
4750 std::cout << std::string(__indent,
' ') <<
"Parser::rCommaExpression 1\n";
4766 exp=
exprt(ID_comma);
4772 std::cout << std::string(__indent,
' ') <<
"Parser::rCommaExpression 2\n";
4788 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 0\n";
4795 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 1\n";
4809 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 2\n";
4817 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 3\n";
4823 exp=
exprt(ID_side_effect);
4826 exp.
set(ID_statement, ID_assign);
4828 exp.
set(ID_statement, ID_assign_plus);
4830 exp.
set(ID_statement, ID_assign_minus);
4832 exp.
set(ID_statement, ID_assign_mult);
4834 exp.
set(ID_statement, ID_assign_div);
4836 exp.
set(ID_statement, ID_assign_mod);
4838 exp.
set(ID_statement, ID_assign_shl);
4840 exp.
set(ID_statement, ID_assign_shr);
4842 exp.
set(ID_statement, ID_assign_bitand);
4844 exp.
set(ID_statement, ID_assign_bitxor);
4846 exp.
set(ID_statement, ID_assign_bitor);
4853 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 4\n";
4867 std::cout << std::string(__indent,
' ') <<
"Parser::rConditionalExpr 0\n";
4874 std::cout << std::string(__indent,
' ') <<
"Parser::rConditionalExpr 1\n";
4880 exprt then, otherwise;
4887 std::cout << std::string(__indent,
' ') <<
"Parser::rConditionalExpr 2\n";
4916 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalOrExpr 0\n";
4923 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalOrExpr 1\n";
4955 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalAndExpr 1\n";
4962 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalAndExpr 1\n";
4994 std::cout << std::string(__indent,
' ') <<
"Parser::rInclusiveOrExpr 0\n";
5001 std::cout << std::string(__indent,
' ') <<
"Parser::rInclusiveOrExpr 1\n";
5016 exp=
exprt(ID_bitor);
5033 std::cout << std::string(__indent,
' ') <<
"Parser::rExclusiveOrExpr 0\n";
5040 std::cout << std::string(__indent,
' ') <<
"Parser::rExclusiveOrExpr 1\n";
5049 if(!
rAndExpr(right, template_args))
5055 exp=
exprt(ID_bitxor);
5072 std::cout << std::string(__indent,
' ') <<
"Parser::rAndExpr 0\n";
5079 std::cout << std::string(__indent,
' ') <<
"Parser::rAndExpr 1\n";
5094 exp=
exprt(ID_bitand);
5111 std::cout << std::string(__indent,
' ') <<
"Parser::rEqualityExpr 0\n";
5118 std::cout << std::string(__indent,
' ') <<
"Parser::rEqualityExpr 1\n";
5151 std::cout << std::string(__indent,
' ') <<
"Parser::rRelationalExpr 0\n";
5158 std::cout << std::string(__indent,
' ') <<
"Parser::rRelationalExpr 1\n";
5164 (t==
TOK_LE || t==
TOK_GE || t==
'<' || (t==
'>' && !template_args)))
5180 case TOK_LE:
id=ID_le;
break;
5181 case TOK_GE:
id=ID_ge;
break;
5182 case '<':
id=ID_lt;
break;
5183 case '>':
id=ID_gt;
break;
5203 std::cout << std::string(__indent,
' ') <<
"Parser::rShiftExpr 0\n";
5210 std::cout << std::string(__indent,
' ') <<
"Parser::rShiftExpr 1\n";
5243 std::cout << std::string(__indent,
' ') <<
"Parser::rAdditiveExpr 0\n";
5250 std::cout << std::string(__indent,
' ') <<
"Parser::rAdditiveExpr 1\n";
5269 case '+':
id=ID_plus;
break;
5270 case '-':
id=ID_minus;
break;
5290 std::cout << std::string(__indent,
' ') <<
"Parser::rMultiplyExpr 0\n";
5297 std::cout << std::string(__indent,
' ') <<
"Parser::rMultiplyExpr 1\n";
5301 while(t=
lex.
LookAhead(0), (t==
'*' || t==
'/' || t==
'%'))
5316 case '*':
id=ID_mult;
break;
5317 case '/':
id=ID_div;
break;
5318 case '%':
id=ID_mod;
break;
5327 std::cout << std::string(__indent,
' ') <<
"Parser::rMultiplyExpr 2\n";
5343 std::cout << std::string(__indent,
' ') <<
"Parser::rPmExpr 0\n";
5350 std::cout << std::string(__indent,
' ') <<
"Parser::rPmExpr 1\n";
5366 exp=
exprt(
"pointer-to-member");
5372 std::cout << std::string(__indent,
' ') <<
"Parser::rPmExpr 2\n";
5387 std::cout << std::string(__indent,
' ') <<
"Parser::rCastExpr 0\n";
5403 std::cout << std::string(__indent,
' ') <<
"Parser::rCastExpr 1\n";
5424 exp=
exprt(
"explicit-typecast");
5447 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeName 0\n";
5456 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeName 1\n";
5476 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeName 2\n";
5491 std::cout << std::string(__indent,
' ')
5492 <<
"Parser::rTypeNameOrFunctionType 0\n";
5500 std::cout << std::string(__indent,
' ')
5501 <<
"Parser::rTypeNameOrFunctionType 1\n";
5513 std::cout << std::string(__indent,
' ')
5514 <<
"Parser::rTypeNameOrFunctionType 2\n";
5523 std::cout << std::string(__indent,
' ')
5524 <<
"Parser::rTypeNameOrFunctionType 3\n";
5538 std::cout << std::string(__indent,
' ')
5539 <<
"Parser::rTypeNameOrFunctionType 4\n";
5565 type.
set(ID_identifier, op.
data.
get(ID_C_base_name));
5576 type.
set(ID_identifier, op.
data.
get(ID_C_base_name));
5586 std::cout << std::string(__indent,
' ')
5587 <<
"Parser::rTypeNameOrFunctionType 5\n";
5606 parameter.
swap(parameter_declaration);
5629 std::cout << std::string(__indent,
' ')
5630 <<
"Parser::rTypeNameOrFunctionType 6\n";
5641 std::cout << std::string(__indent,
' ')
5642 <<
"Parser::rTypeNameOrFunctionType 7\n";
5652 std::cout << std::string(__indent,
' ')
5653 <<
"Parser::rTypeNameOrFunctionType 8\n";
5675 std::cout << std::string(__indent,
' ') <<
"Parser::rUnaryExpr 0\n";
5678 if(t==
'*' || t==
'&' || t==
'+' ||
5679 t==
'-' || t==
'!' || t==
'~' ||
5686 std::cout << std::string(__indent,
' ') <<
"Parser::rUnaryExpr 1\n";
5694 std::cout << std::string(__indent,
' ') <<
"Parser::rUnaryExpr 2\n";
5700 exp=
exprt(ID_dereference);
5704 exp=
exprt(ID_address_of);
5708 exp=
exprt(ID_unary_plus);
5712 exp=
exprt(ID_unary_minus);
5720 exp=
exprt(ID_bitnot);
5724 exp=
exprt(ID_side_effect);
5725 exp.
set(ID_statement, ID_preincrement);
5729 exp=
exprt(ID_side_effect);
5730 exp.
set(ID_statement, ID_predecrement);
5782 std::cout << std::string(__indent,
' ') <<
"Parser::rThrowExpr 0\n";
5793 if(t==
':' || t==
';')
5821 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeidExpr 0\n";
5843 exp=
exprt(
"typeid");
5862 exp=
exprt(
"typeid");
5887 std::cout << std::string(__indent,
' ') <<
"Parser::rSizeofExpr 0\n";
5905 exp=
exprt(ID_sizeof);
5906 exp.
add(ID_type_arg).
swap(tname);
5927 exp=
exprt(ID_sizeof);
5928 exp.
add(ID_type_arg).
swap(tname);
5942 exp=
exprt(ID_sizeof);
5971 exp=
exprt(ID_alignof);
5972 exp.
add(ID_type_arg).
swap(tname);
5987 std::cout << std::string(__indent,
' ') <<
"Parser::rNoexceptExpr 0\n";
6005 exp=
exprt(ID_noexcept);
6038 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 0\n";
6049 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 1\n";
6055 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 2\n";
6069 exp=
exprt(ID_side_effect);
6070 exp.
set(ID_statement, ID_cpp_delete_array);
6074 exp=
exprt(ID_side_effect);
6075 exp.
set(ID_statement, ID_cpp_delete);
6090 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 3\n";
6093 exp=
exprt(ID_side_effect);
6094 exp.
set(ID_statement, ID_cpp_new);
6097 exprt arguments, initializer;
6103 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 4\n";
6106 exp.
add(ID_initializer).
swap(initializer);
6238 decl.
swap(array_type);
6309 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 0\n";
6316 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 1\n";
6333 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 2\n";
6343 exp=
exprt(ID_index);
6351 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 3\n";
6362 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 4\n";
6405 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 5\n";
6412 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 6\n";
6420 exp=
exprt(ID_member);
6422 exp=
exprt(ID_ptrmember);
6428 exp.
add(ID_component_cpp_name).
swap(e);
6464 expr=
exprt(ID_msc_uuidof);
6465 expr.
add(ID_type_arg).
swap(tname);
6482 expr=
exprt(ID_msc_uuidof);
6529 ID_msc_if_not_exists);
6581 ID_msc_if_not_exists);
6606 typet tname1, tname2;
6617 expr.
add(ID_type_arg).
swap(tname1);
6631 expr.
add(
"type_arg1").
swap(tname1);
6632 expr.
add(
"type_arg2").
swap(tname2);
6665 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 0 " 6678 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 1\n";
6687 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 2\n";
6693 exp=
exprt(
"cpp-this");
6696 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 3\n";
6705 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 4\n";
6714 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 5\n";
6724 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 6\n";
6730 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 7\n";
6741 exp=
exprt(ID_side_effect);
6742 exp.
set(ID_statement, ID_statement_expression);
6757 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 8\n";
6767 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 9\n";
6773 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 10\n";
6783 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 11\n";
6789 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 12\n";
6798 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 13\n";
6804 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 14\n";
6813 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 15\n";
6826 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 16\n";
6836 exp=
exprt(
"explicit-constructor-call");
6852 exp=
exprt(
"explicit-constructor-call");
6876 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 17\n";
6897 std::cout << std::string(__indent,
' ') <<
"Parser::rVarName 0\n";
6910 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 0\n";
6913 name=
exprt(ID_cpp_name);
6920 name.
set(ID_typename,
true);
6930 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 1\n";
6938 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 1.1 " 6948 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 2\n";
6958 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 3\n";
6962 components.push_back(
irept(ID_name));
6963 components.back().set(ID_identifier, tk.
data.
get(ID_C_base_name));
6972 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 4\n";
6982 components.push_back(
irept(ID_template_args));
6983 components.back().add(ID_arguments).swap(args);
6992 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 5\n";
6996 components.push_back(
irept(
"::"));
7002 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 6\n";
7010 components.push_back(
irept(
"~"));
7016 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 7\n";
7021 components.push_back(
irept(ID_operator));
7029 components.push_back(op);
7063 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 0\n";
7072 if(u==
'\0' || u==
';' || u==
'}')
7085 std::cout << std::string(__indent,
' ')
7086 <<
"Parser::maybeTemplateArgs 1\n";
7092 std::cout << std::string(__indent,
' ')
7093 <<
"Parser::maybeTemplateArgs 2\n";
7108 std::cout << std::string(__indent,
' ')
7109 <<
"Parser::maybeTemplateArgs 3\n";
7116 else if(v==
'\0' || v==
';' || v==
'}')
7120 else if(u==
'\0' || u==
';' || u==
'}')
7126 std::cout << std::string(__indent,
' ')
7127 <<
"Parser::maybeTemplateArgs 4\n";
7132 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 5\n";
7138 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 6\n";
7146 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 7\n";
7177 declarator.
value()=body;
7193 declarator.
value()=body;
7211 std::cout << std::string(__indent,
' ') <<
"Parser::rCompoundStatement 1\n";
7218 std::cout << std::string(__indent,
' ') <<
"Parser::rCompoundStatement 2\n";
7275 std::cout << std::string(__indent,
' ') <<
"Parser::rStatement 0 " 7316 statement=
codet(ID_break);
7318 statement=
codet(ID_continue);
7329 std::cout << std::string(__indent,
' ') <<
"Parser::rStatement RETURN 0\n";
7334 statement=
codet(ID_return);
7340 std::cout << std::string(__indent,
' ')
7341 <<
"Parser::rStatement RETURN 1\n";
7348 std::cout << std::string(__indent,
' ')
7349 <<
"Parser::rStatement RETURN 2\n";
7358 std::cout << std::string(__indent,
' ')
7359 <<
"Parser::rStatement RETURN 3\n";
7373 statement=
codet(ID_goto);
7382 statement.
set(ID_destination, tk2.
data.
get(ID_C_base_name));
7404 statement=
codet(ID_gcc_switch_case_range);
7406 statement.
op0()=case_expr;
7407 statement.
op1()=range_end;
7417 statement.
op2().
swap(statement2);
7423 statement.
op0()=case_expr;
7432 statement.
op1().
swap(statement2);
7442 statement.
set(ID_default,
true);
7452 statement.
op1().
swap(statement2);
7471 statement=
codet(ID_label);
7473 statement.
set(ID_label, tk1.
data.
get(ID_C_base_name));
7492 statement=
codet(ID_decl);
7537 statement=
codet(ID_ifthenelse);
7566 statement.
op2().
swap(otherwise);
7585 statement=
codet(ID_switch);
7618 statement=
codet(ID_while);
7651 statement=
codet(ID_dowhile);
7691 statement=
codet(ID_for);
7756 statement=
codet(ID_try_catch);
7785 codet ellipsis(ID_ellipsis);
7799 if(declaration.
declarators().front().name().is_nil())
7801 irept name(ID_name);
7802 name.
set(ID_identifier,
"#anon");
7804 declaration.
declarators().front().name().get_sub().push_back(name);
7899 statement=
codet(
"msc_leave");
7911 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 1\n";
7919 statement=
codet(ID_asm);
7920 statement.
set(ID_flavor, ID_gcc);
7928 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 3\n";
7939 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 3\n";
7945 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 4\n";
7966 std::cout << std::string(__indent,
' ')
7967 <<
"Parser::rGCCAsmStatement 5\n";
7975 std::cout << std::string(__indent,
' ')
7976 <<
"Parser::rGCCAsmStatement 6\n";
7991 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 7\n";
8000 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 8\n";
8012 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 1\n";
8021 statement=
codet(ID_asm);
8022 statement.
set(ID_flavor, ID_msc);
8026 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 2\n";
8034 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 3\n";
8047 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 4\n";
8053 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 5\n";
8063 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 6\n";
8068 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 7\n";
8088 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 0\n";
8094 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 1\n";
8098 statement=
codet(ID_skip);
8105 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 2\n";
8113 std::cout << std::string(__indent,
' ') <<
"rDe " 8114 << statement.
pretty() <<
'\n';
8125 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 3\n";
8132 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 4\n";
8136 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 5 " 8144 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 6\n";
8147 statement=
codet(ID_expression);
8165 statement=
codet(ID_decl);
8197 typet cv_q, integral;
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";
8244 std::cout << std::string(__indent,
' ')
8245 <<
"Parser::rDeclarationStatement 4\n";
8248 statement=
codet(ID_decl);
8282 statement=
codet(ID_decl);
8294 statement=
codet(ID_decl);
8317 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 1\n";
8320 if(!
rName(type_name))
8324 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 2\n";
8331 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 3\n";
8337 declaration.
type().
swap(type_name);
8344 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 4\n";
8350 statement=
codet(ID_decl);
8369 if(t==token || t==
'\0')
const irept & get_nil_irep()
std::string full_name() const
const irep_idt & get_statement() const
The type of an expression.
bool rTemplateArgs(irept &)
bool rShiftExpr(exprt &, bool)
void set_function(const irep_idt &function)
bool rInclusiveOrExpr(exprt &, bool)
static bool is_constructor(const irep_idt &method_name)
bool rTryStatement(codet &)
void Replace(const cpp_tokent &token)
bool rIntegralDeclStatement(codet &, cpp_storage_spect &, typet &, typet &)
bool rTypeidExpr(exprt &)
const std::string & id2string(const irep_idt &d)
pointer_typet pointer_type(const typet &subtype)
bool rTypeNameOrFunctionType(typet &)
const cpp_storage_spect & storage_spec() const
bool rTypedefUsing(cpp_declarationt &)
bool rClassMember(cpp_itemt &)
C++ Parser: Token Buffer.
void set_explicit(bool value)
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
bool rMSC_leaveStatement(codet &)
std::vector< irept > subt
bool rAllocateType(exprt &, typet &, exprt &)
bool rNamespaceSpec(cpp_namespace_spect &)
void move_to_sub(irept &irep)
bool rStaticAssert(cpp_static_assertt &)
bool rVarNameCore(exprt &)
bool rDeclarationStatement(codet &)
void move_to_operands(exprt &expr)
bool rDeclaratorQualifier()
void set_namespace(bool value)
bool rTypedefStatement(codet &)
bool rMemberInitializers(irept &)
bool rArgDeclList(irept &)
bool rExprStatement(codet &)
A constant literal expression.
bool rTypePredicate(exprt &)
static mstreamt & eom(mstreamt &m)
bool rString(cpp_tokent &tk)
bool rConditionalExpr(exprt &, bool)
bool rNullDeclaration(cpp_declarationt &)
bool rNewDeclarator(typet &)
#define POSTCONDITION(CONDITION)
bool optMemberSpec(cpp_member_spect &)
bool rMSC_tryStatement(codet &)
A side effect that throws an exception.
void move_to_subtypes(typet &type)
const cpp_member_spect & member_spec() const
void set_inline(bool value)
bool rExpression(exprt &, bool)
bool optThrowDecl(irept &)
bool rProgram(cpp_itemt &item)
void Insert(const cpp_tokent &token)
Parser(cpp_parsert &_cpp_parser)
bool rMSC_if_existsStatement(codet &)
bool rPrimaryExpr(exprt &)
cpp_usingt & make_using()
bool rConstDeclaration(cpp_declarationt &, cpp_storage_spect &, cpp_member_spect &, typet &)
bool rCommaExpression(exprt &)
bool MaybeTypeNameOrClassTemplate(cpp_tokent &)
bool rSwitchStatement(codet &)
bool rExternTemplateDecl(irept &)
bool rMSCAsmStatement(codet &)
const irep_idt & id() const
bool rNoexceptExpr(exprt &)
bool rBaseSpecifiers(irept &)
const declaratorst & declarators() const
bool rLinkageBody(cpp_linkage_spect::itemst &)
The boolean constant true.
void make_sub_scope(const irept &name, new_scopet::kindt)
cpp_declarationt & make_declaration()
bool rAndExpr(exprt &, bool)
cpp_namespace_spect & make_namespace_spec()
new_scopet * current_scope
int get_token(cpp_tokent &token)
irep_idt current_function
bool rLogicalAndExpr(exprt &, bool)
bool rAccessDecl(irept &)
bool rDoStatement(codet &)
cpp_linkage_spect & make_linkage_spec()
source_locationt source_location
bool rPostfixExpr(exprt &)
void set_file(const irep_idt &file)
bool rArgDeclaration(cpp_declarationt &)
bool rMultiplyExpr(exprt &)
A constant-size array type.
bool optPtrOperator(typet &)
std::size_t number_of_errors
cpp_static_assertt & make_static_assert()
API to expression classes.
const irep_idt & get(const irep_namet &name) const
void set_line(const irep_idt &line)
bool rWhileStatement(codet &)
save_scopet(new_scopet *&_scope)
cpp_parse_treet parse_tree
bool rOperatorName(irept &)
bool rTypeSpecifier(typet &, bool)
void set_namespace(const irep_idt &_namespace)
bool rDeclaratorWithInit(cpp_declaratort &, bool, bool)
cpp_tokent & current_token()
bool rTempArgDeclaration(cpp_declarationt &)
irept & method_qualifier()
bool optIntegralTypeOrClassSpec(typet &)
Base class for tree-like data structures with sharing.
void set_friend(bool value)
bool optAttribute(cpp_declarationt &)
C++ Language Type Checking.
bool rEqualityExpr(exprt &, bool)
bool rIntegralDeclaration(cpp_declarationt &, cpp_storage_spect &, cpp_member_spect &, typet &, typet &)
bool rRelationalExpr(exprt &, bool)
std::vector< typet > subtypest
const itemst & items() const
The boolean constant false.
bool rMSC_if_existsExpr(exprt &)
bool rOtherDeclaration(cpp_declarationt &, cpp_storage_spect &, cpp_member_spect &, typet &)
bool rCastOperatorName(irept &)
bool rOtherDeclStatement(codet &, cpp_storage_spect &, typet &)
std::map< irep_idt, new_scopet > id_mapt
bool rConstructorDecl(cpp_declaratort &, typet &, typet &trailing_return_type)
const source_locationt & source_location() const
bool rIfStatement(codet &)
irep_idt get_base_name() const
A function call side effect.
bool rMemberInit(exprt &)
bool optStorageSpec(cpp_storage_spect &)
bool rLogicalOrExpr(exprt &, bool)
bool rTypedef(cpp_declarationt &)
std::vector< class cpp_itemt > itemst
bool rTempArgList(irept &)
bool rLinkageSpec(cpp_linkage_spect &)
void make_subtype(const typet &src, typet &dest)
bool rAllocateExpr(exprt &)
bool is_named_scope() const
bool rTemplateDecl(cpp_declarationt &)
void set_is_inline(bool value)
bool rDeclaration(cpp_declarationt &)
void set_statement(const irep_idt &statement)
Base class for all expressions.
void merge_types(const typet &src, typet &dest)
int LookAhead(unsigned offset)
ansi_c_parsert ansi_c_parser
const parameterst & parameters() const
bool rGCCAsmStatement(codet &)
irept & member_initializers()
std::string to_string(const string_constraintt &expr)
Used for debug printing.
bool rAdditiveExpr(exprt &)
source_locationt & add_source_location()
const source_locationt & source_location() const
bool rAlignofExpr(exprt &)
bool rArgDeclListOrInit(exprt &, bool &, bool)
irept & add(const irep_namet &name)
bool rInitializeExpr(exprt &)
exprt::operandst & arguments()
bool rPtrToMember(irept &)
#define Forall_operands(it, expr)
bool rTemplateDecl2(typet &, TemplateDeclKind &kind)
void set_location(irept &dest, const cpp_tokent &token)
source_locationt & add_source_location()
bool rCompoundStatement(codet &)
bool rDefinition(cpp_itemt &)
bool rForStatement(codet &)
A statement in a programming language.
new_scopet & add_id(const irept &name, new_scopet::kindt)
void print(std::ostream &out) const
bool rDeclarator(cpp_declaratort &, DeclKind, bool, bool, bool=false)
const typet & subtype() const
An expression containing a side effect.
bool rUsing(cpp_usingt &)
bool rFunctionArguments(exprt &)
const itemst & items() const
bool optCvQualify(typet &)
bool rSizeofExpr(exprt &)
static const char * kind2string(kindt kind)
bool rAllocateInitializer(exprt &)
std::vector< cpp_declaratort > declaratorst
void print_rec(std::ostream &, unsigned indent) const
const irept & find(const irep_namet &name) const
bool rExclusiveOrExpr(exprt &, bool)
const typet & return_type() const
void set_virtual(bool value)
bool rDeclarators(cpp_declarationt::declaratorst &, bool, bool=false)
void set(const irep_namet &name, const irep_idt &value)
bool rSimpleDeclaration(cpp_declarationt &)
void reserve_operands(operandst::size_type n)
const exprt & description() const
bool rFunctionBody(cpp_declaratort &)
#define forall_irep(it, irep)