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),
281 typet &trailing_return_type);
402 if(p->
id()==ID_merged_type)
421 if(cpp_name.
get_sub().size()==1 &&
422 cpp_name.
get_sub().front().id()==ID_name)
423 id=cpp_name.
get_sub().front().get(ID_identifier);
470 if(dest.
id()!=ID_merged_type)
473 typet tmp(ID_merged_type);
483 sub.emplace(sub.begin(), src);
490 #define ERROR_TOKENS 4 500 source_location.
set_file(t[0].filename);
503 std::string message=
"parse error before `";
558 std::cout << std::string(__indent,
' ') <<
"Parser::rDefinition 1 " << t
613 std::cout << std::string(__indent,
' ') <<
"Parser::rTypedef 1\n";
642 std::cout << std::string(__indent,
' ') <<
"Parser::rTypedefUsing 1\n";
658 std::cout << std::string(__indent,
' ') <<
"Parser::rTypedefUsing 2\n";
675 std::cout << std::string(__indent,
' ') <<
"Parser::rTypedefUsing 3\n";
683 statement=
codet(ID_decl);
696 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 0\n";
707 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 0.1\n";
719 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 1\n";
727 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 2\n";
735 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 3\n";
744 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 4\n";
811 linkage_spec.
items().push_back(item);
827 bool is_inline=
false;
845 name=tk2.
data.
get(ID_C_base_name);
970 items.push_back(item);
974 items.push_back(item);
1006 typet template_type;
1025 std::cout << std::string(__indent,
' ') <<
"BODY: " 1026 << body.
pretty() <<
'\n';
1027 std::cout << std::string(__indent,
' ') <<
"TEMPLATE_TYPE: " 1028 << template_type.
pretty() <<
'\n';
1030 body.
add(ID_template_type).
swap(template_type);
1031 body.
set(ID_is_template,
true);
1041 body.
add(ID_template_type).
swap(template_type);
1042 body.
set(ID_is_template,
true);
1061 decl=
typet(ID_template);
1074 irept &template_parameters=decl.
add(ID_template_parameters);
1098 if(template_parameters.
get_sub().empty())
1123 args.
get_sub().back().swap(a);
1134 args.
get_sub().back().swap(a);
1151 std::cout << std::string(__indent,
' ') <<
"Parser::rTempArgDeclaration 0\n";
1166 declaration.
set(ID_is_type,
true);
1167 declaration.
type()=
typet(
"cpp-template-type");
1177 bool has_ellipsis=
false;
1193 exprt name(ID_name);
1194 name.
set(ID_identifier, tk2.
data.
get(ID_C_base_name));
1196 cpp_name.
get_sub().push_back(name);
1230 std::cout << std::string(__indent,
' ') <<
"Parser::rTempArgDeclaration 1\n";
1237 typet template_type;
1268 std::cout << std::string(__indent,
' ')
1269 <<
"Parser::rTempArgDeclaration 2\n";
1273 declaration.
set(ID_is_type,
false);
1279 std::cout << std::string(__indent,
' ')
1280 <<
"Parser::rTempArgDeclaration 3\n";
1283 bool has_ellipsis=
false;
1300 std::cout << std::string(__indent,
' ')
1301 <<
"Parser::rTempArgDeclaration 4\n";
1387 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 0.1 token: " 1399 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 0.2\n";
1407 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 1\n";
1415 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 3\n";
1418 typet cv_q, integral;
1432 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 4\n";
1446 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 5\n";
1450 declaration, storage_spec, member_spec, integral, cv_q);
1457 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 6 " << t
1473 typet cv_q, integral;
1499 integral.
swap(cv_q);
1538 std::cout << std::string(__indent,
' ')
1539 <<
"Parser::rIntegralDeclaration 1 token: " 1547 std::cout << std::string(__indent,
' ') <<
"Parser::rIntegralDeclaration 2\n";
1553 std::cout << std::string(__indent,
' ') <<
"Parser::rIntegralDeclaration 3\n";
1566 std::cout << std::string(__indent,
' ')
1567 <<
"Parser::rIntegralDeclaration 4\n";
1575 std::cout << std::string(__indent,
' ')
1576 <<
"Parser::rIntegralDeclaration 5\n";
1596 std::cout << std::string(__indent,
' ')
1597 <<
"Parser::rIntegralDeclaration 6 " 1606 declaration.
type().
id() == ID_auto &&
1608 declaration.
declarators().front().type().id() == ID_function_type &&
1609 declaration.
declarators().front().type().subtype().is_not_nil())
1611 declaration.
type() = declaration.
declarators().front().type().subtype();
1612 declaration.
declarators().front().type().subtype().make_nil();
1616 std::cout << std::string(__indent,
' ')
1617 <<
"Parser::rIntegralDeclaration 7\n";
1623 std::cout << std::string(__indent,
' ')
1624 <<
"Parser::rIntegralDeclaration 8 " 1625 << declaration.
pretty() <<
'\n';
1633 std::cout << std::string(__indent,
' ')
1634 <<
"Parser::rIntegralDeclaration 9\n";
1644 std::cout << std::string(__indent,
' ')
1645 <<
"Parser::rIntegralDeclaration 10\n";
1657 std::cout << std::string(__indent,
' ') <<
"Parser::rConstDeclaration\n";
1682 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 1\n";
1685 if(!
rName(type_name))
1691 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 2\n";
1705 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 3\n";
1709 bool is_operator =
false;
1714 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 4\n";
1717 assert(!type_name.
get_sub().empty());
1719 for(std::size_t i=0; i < type_name.
get_sub().size(); i++)
1721 if(type_name.
get_sub()[i].id() == ID_operator)
1732 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 5\n";
1736 typet type = type_name;
1740 typet trailing_return_type;
1742 conv_operator_declarator, type_name, trailing_return_type))
1745 type_name=
typet(
"cpp-cast-operator");
1747 declaration.
declarators().push_back(conv_operator_declarator);
1752 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 6\n";
1755 assert(!type_name.
get_sub().empty());
1757 bool is_destructor=
false;
1766 typet trailing_return_type;
1768 constructor_declarator, type_name, trailing_return_type))
1772 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 7\n";
1777 type_name=trailing_return_type;
1779 type_name=
typet(is_destructor?ID_destructor:ID_constructor);
1781 declaration.
declarators().push_back(constructor_declarator);
1786 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 8\n";
1804 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 9\n";
1816 declaration.
type().
swap(type_name);
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();
2037 p=
typet(ID_constexpr);
2049 p=
typet(ID_volatile);
2055 p=
typet(ID_restrict);
2127 exprt exp(ID_alignof);
2128 exp.
add(ID_type_arg).
swap(tname);
2131 typet attr(ID_aligned);
2133 attr.
add(ID_size, exp);
2150 typet attr(ID_aligned);
2152 attr.
add(ID_size, exp);
2166 std::cout << std::string(__indent,
' ') <<
"Parser::rAttribute " 2185 typet attr(ID_packed);
2193 typet attr(ID_transparent_union);
2221 typet attr(ID_aligned);
2238 attr.
add(ID_size, exp);
2259 typet attr(ID_gcc_attribute_mode);
2261 attr.
set(ID_size, name.
get(ID_identifier));
2268 typet attr(ID_static);
2276 typet attr(ID_weak);
2295 typet attr(ID_alias);
2315 typet attr(ID_section);
2324 typet attr(ID_noreturn);
2332 typet attr(ID_constructor);
2340 typet attr(ID_destructor);
2384 typet attr(ID_noreturn);
2411 std::cout << std::string(__indent,
' ')
2412 <<
"Parser::optIntegralTypeOrClassSpec 0\n";
2422 bool is_integral=
false;
2432 std::cout << std::string(__indent,
' ')
2433 <<
"Parser::optIntegralTypeOrClassSpec 1\n";
2440 case TOK_CHAR: type_id=ID_char;
break;
2443 case TOK_INT: type_id=ID_int;
break;
2444 case TOK_SHORT: type_id=ID_short;
break;
2445 case TOK_LONG: type_id=ID_long;
break;
2450 case TOK_FLOAT: type_id=ID_float;
break;
2452 case TOK_VOID: type_id=ID_void;
break;
2453 case TOK_INT8: type_id=ID_int8;
break;
2454 case TOK_INT16: type_id=ID_int16;
break;
2455 case TOK_INT32: type_id=ID_int32;
break;
2456 case TOK_INT64: type_id=ID_int64;
break;
2460 case TOK_BOOL: type_id=ID_bool;
break;
2462 case TOK_AUTO: type_id = ID_auto;
break;
2466 if(!type_id.
empty())
2483 std::cout << std::string(__indent,
' ')
2484 <<
"Parser::optIntegralTypeOrClassSpec 2\n";
2491 std::cout << std::string(__indent,
' ')
2492 <<
"Parser::optIntegralTypeOrClassSpec 3\n";
2502 std::cout << std::string(__indent,
' ')
2503 <<
"Parser::optIntegralTypeOrClassSpec 4\n";
2510 std::cout << std::string(__indent,
' ')
2511 <<
"Parser::optIntegralTypeOrClassSpec 5\n";
2531 p.
add(ID_type_arg).
swap(tname);
2540 std::cout << std::string(__indent,
' ')
2541 <<
"Parser::optIntegralTypeOrClassSpec 6\n";
2549 std::cout << std::string(__indent,
' ')
2550 <<
"Parser::optIntegralTypeOrClassSpec 7\n";
2557 std::cout << std::string(__indent,
' ')
2558 <<
"Parser::optIntegralTypeOrClassSpec 8\n";
2561 p.
add(ID_expr_arg).
swap(expr);
2570 p=
typet(ID_decltype);
2586 p.
add(ID_expr_arg).
swap(expr);
2597 p=
typet(ID_msc_underlying_type);
2614 p.
add(ID_type_arg).
swap(tname);
2633 typet &trailing_return_type)
2637 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 0\n";
2644 constructor.
name().
swap(type_name);
2651 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 1\n";
2654 irept ¶meters=constructor.
type().
add(ID_parameters);
2664 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 2\n";
2667 typet &cv=
static_cast<typet &
>(constructor.
add(ID_method_qualifier));
2676 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 3\n";
2688 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 4\n";
2702 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 5\n";
2714 constructor.
value()=
codet(
"cpp-pure-virtual");
2830 bool should_be_declarator,
2841 declarators.push_back(declarator);
2859 bool should_be_declarator,
2872 typet bit_field_type(ID_c_bit_field);
2873 bit_field_type.
set(ID_size, e);
2886 declarator,
kDeclarator, should_be_declarator, is_statement))
2931 if(declarator.
type().
id()!=ID_function_type)
2947 typet bit_field_type(ID_c_bit_field);
2948 bit_field_type.
set(ID_size, e);
2955 dw.
swap(declarator);
3002 bool should_be_declarator,
3009 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 1\n";
3016 typet d_outer, d_inner;
3031 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 2\n";
3039 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 3\n";
3050 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 4\n";
3058 if(!should_be_declarator)
3063 if(t!=
'[' && t!=
'(')
3069 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 5\n";
3079 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 6\n";
3088 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 7\n";
3101 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 8\n";
3121 typet function_type(ID_function_type);
3123 function_type.
add(ID_parameters).
swap(args);
3127 d_outer.
swap(d_inner);
3133 init_args.
swap(args);
3138 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 9\n";
3147 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 10\n";
3168 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 11\n";
3186 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 12\n";
3201 std::list<typet> tl;
3202 tl.push_back(d_outer);
3203 while(tl.back().id() == ID_array)
3205 tl.push_back(tl.back().subtype());
3210 d_outer.
swap(array_type);
3213 tl.back().subtype().swap(d_outer);
3214 d_outer.
swap(tl.back());
3225 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 13\n";
3251 std::cout << std::string(__indent,
' ') <<
"Parser::optPtrOperator 1\n";
3254 std::list<typet> t_list;
3261 std::cout << std::string(__indent,
' ') <<
"Parser::optPtrOperator 2 " 3267 typet op(ID_frontend_pointer);
3278 t_list.push_back(op);
3283 typet op(ID_block_pointer);
3294 t_list.push_back(op);
3308 t_list.push_back(cv);
3311 t_list.push_back(op);
3324 typet op(ID_frontend_pointer);
3325 op.
set(ID_C_reference,
true);
3327 t_list.push_front(op);
3333 typet op(ID_frontend_pointer);
3334 op.
set(ID_C_rvalue_reference,
true);
3336 t_list.push_front(op);
3340 for(std::list<typet>::reverse_iterator
3345 if(it->id()==ID_merged_type)
3347 assert(!it->subtypes().empty());
3348 it->subtypes().back().subtype().swap(ptrs);
3352 assert(it->is_not_nil());
3353 it->subtype().swap(ptrs);
3373 init=
irept(ID_member_initializers);
3403 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 1\n";
3412 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 2\n";
3415 init=
codet(ID_member_initializer);
3416 init.
add(ID_member).
swap(name);
3426 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 3\n";
3445 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 4\n";
3485 std::cout << std::string(__indent,
' ') <<
"Parser::rName 0\n";
3495 name.
set(ID_typename,
true);
3505 std::cout << std::string(__indent,
' ') <<
"Parser::rName 1\n";
3513 std::cout << std::string(__indent,
' ') <<
"Parser::rName 2 " 3521 std::cout << std::string(__indent,
' ') <<
"Parser::rName 3\n";
3531 std::cout << std::string(__indent,
' ') <<
"Parser::rName 4\n";
3538 components.push_back(
irept(ID_template_args));
3539 components.back().
add(ID_arguments).
swap(args);
3549 std::cout << std::string(__indent,
' ') <<
"Parser::rName 5\n";
3552 components.push_back(
irept(ID_name));
3553 components.back().set(ID_identifier, tk.
data.
get(ID_C_base_name));
3566 std::cout << std::string(__indent,
' ') <<
"Parser::rName 6\n";
3569 components.push_back(
irept(
"::"));
3575 std::cout << std::string(__indent,
' ') <<
"Parser::rName 7\n";
3583 components.push_back(
irept(
"~"));
3589 std::cout << std::string(__indent,
' ') <<
"Parser::rName 8\n";
3593 components.push_back(
irept(ID_operator));
3596 components.push_back(
irept());
3649 operator_id = std::string(1, static_cast<char>(t));
3664 case TOK_EQ: operator_id=
"==";
break;
3665 case TOK_NE: operator_id=
"!=";
break;
3666 case TOK_LE: operator_id=
"<=";
break;
3667 case TOK_GE: operator_id=
">=";
break;
3669 case TOK_OROR: operator_id=
"||";
break;
3670 case TOK_INCR: operator_id=
"++";
break;
3671 case TOK_DECR: operator_id=
"--";
break;
3672 case TOK_DOTPM: operator_id=
".*";
break;
3674 case TOK_ARROW: operator_id=
"->";
break;
3688 name=
irept(t==
TOK_NEW?ID_cpp_new_array:ID_cpp_delete_array);
3715 assert(!operator_id.
empty());
3717 name=
irept(operator_id);
3731 typet cv1, cv2, type_name, ptr;
3746 if(!
rName(type_name))
3773 std::cout << std::string(__indent,
' ') <<
"Parser::rPtrToMember 0\n";
3776 typet ptm(ID_frontend_pointer);
3777 irept &name = ptm.
add(
"to-member");
3787 bool loop_cond =
true;
3807 components.push_back(
irept(ID_template_args));
3808 components.back().
add(ID_arguments).
swap(args);
3817 components.push_back(
irept(ID_name));
3818 components.back().set(ID_identifier, tk.
data.
get(ID_C_base_name));
3830 components.push_back(
irept(
"::"));
3837 ptr_to_mem.
swap(ptm);
3841 std::cout << std::string(__indent,
' ') <<
"Parser::rPtrToMember 1\n";
3872 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 0\n";
3883 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 1\n";
3895 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 2\n";
3904 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 3\n";
3919 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 4\n";
3931 exp.
id(
"ambiguous");
3933 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 4.1\n";
3945 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 4.2\n";
3952 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 5\n";
3970 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 6\n";
3974 template_args.
get_sub().back().swap(exp);
4079 list.
get_sub().back().swap(declaration);
4117 header=
typet(ID_register);
4133 declaration.
declarators().push_back(arg_declarator);
4163 expr.
id(ID_initializer_list);
4284 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 1\n";
4301 spec.
set(ID_C_class,
true);
4318 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 2\n";
4330 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 3\n";
4353 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 4\n";
4425 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 1\n";
4434 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 2\n";
4439 spec=
typet(ID_struct);
4440 spec.
set(ID_C_class,
true);
4444 spec=
typet(ID_struct);
4445 spec.
set(ID_C_interface,
true);
4448 spec=
typet(ID_struct);
4450 spec=
typet(ID_union);
4457 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 3\n";
4464 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 4\n";
4489 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 5\n";
4509 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 6\n";
4521 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 7\n";
4524 ((
exprt&)spec.
add(ID_body)).operands().
swap(body.operands());
4545 irept base(ID_base);
4550 base.
set(ID_virtual,
true);
4559 base.
set(ID_protection, ID_public);
4563 base.
set(ID_protection, ID_protected);
4567 base.
set(ID_protection, ID_private);
4580 base.
set(ID_virtual,
true);
4594 bases.
get_sub().back().swap(base);
4612 std::cout << std::string(__indent,
' ') <<
"Parser::rClassBody 0\n";
4637 std::cout << std::string(__indent,
' ') <<
"Parser::rClassBody " 4638 << member.
pretty() <<
'\n';
4642 static_cast<exprt &>(static_cast<irept &>(member)));
4674 std::cout << std::string(__indent,
' ') <<
"Parser::rClassMember 0 " << t
4683 member.
id(
"cpp-public");
4687 member.
id(
"cpp-protected");
4691 member.
id(
"cpp-private");
4746 name_decl.
name() = name;
4763 std::cout << std::string(__indent,
' ') <<
"Parser::rCommaExpression 0\n";
4770 std::cout << std::string(__indent,
' ') <<
"Parser::rCommaExpression 1\n";
4786 exp=
exprt(ID_comma);
4792 std::cout << std::string(__indent,
' ') <<
"Parser::rCommaExpression 2\n";
4808 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 0\n";
4815 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 1\n";
4829 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 2\n";
4837 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 3\n";
4843 exp=
exprt(ID_side_effect);
4846 exp.
set(ID_statement, ID_assign);
4848 exp.
set(ID_statement, ID_assign_plus);
4850 exp.
set(ID_statement, ID_assign_minus);
4852 exp.
set(ID_statement, ID_assign_mult);
4854 exp.
set(ID_statement, ID_assign_div);
4856 exp.
set(ID_statement, ID_assign_mod);
4858 exp.
set(ID_statement, ID_assign_shl);
4860 exp.
set(ID_statement, ID_assign_shr);
4862 exp.
set(ID_statement, ID_assign_bitand);
4864 exp.
set(ID_statement, ID_assign_bitxor);
4866 exp.
set(ID_statement, ID_assign_bitor);
4873 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 4\n";
4887 std::cout << std::string(__indent,
' ') <<
"Parser::rConditionalExpr 0\n";
4894 std::cout << std::string(__indent,
' ') <<
"Parser::rConditionalExpr 1\n";
4900 exprt then, otherwise;
4907 std::cout << std::string(__indent,
' ') <<
"Parser::rConditionalExpr 2\n";
4936 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalOrExpr 0\n";
4943 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalOrExpr 1\n";
4975 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalAndExpr 1\n";
4982 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalAndExpr 1\n";
5014 std::cout << std::string(__indent,
' ') <<
"Parser::rInclusiveOrExpr 0\n";
5021 std::cout << std::string(__indent,
' ') <<
"Parser::rInclusiveOrExpr 1\n";
5036 exp=
exprt(ID_bitor);
5053 std::cout << std::string(__indent,
' ') <<
"Parser::rExclusiveOrExpr 0\n";
5060 std::cout << std::string(__indent,
' ') <<
"Parser::rExclusiveOrExpr 1\n";
5069 if(!
rAndExpr(right, template_args))
5075 exp=
exprt(ID_bitxor);
5092 std::cout << std::string(__indent,
' ') <<
"Parser::rAndExpr 0\n";
5099 std::cout << std::string(__indent,
' ') <<
"Parser::rAndExpr 1\n";
5114 exp=
exprt(ID_bitand);
5131 std::cout << std::string(__indent,
' ') <<
"Parser::rEqualityExpr 0\n";
5138 std::cout << std::string(__indent,
' ') <<
"Parser::rEqualityExpr 1\n";
5171 std::cout << std::string(__indent,
' ') <<
"Parser::rRelationalExpr 0\n";
5178 std::cout << std::string(__indent,
' ') <<
"Parser::rRelationalExpr 1\n";
5184 (t==
TOK_LE || t==
TOK_GE || t==
'<' || (t==
'>' && !template_args)))
5200 case TOK_LE:
id=ID_le;
break;
5201 case TOK_GE:
id=ID_ge;
break;
5202 case '<':
id=ID_lt;
break;
5203 case '>':
id=ID_gt;
break;
5223 std::cout << std::string(__indent,
' ') <<
"Parser::rShiftExpr 0\n";
5230 std::cout << std::string(__indent,
' ') <<
"Parser::rShiftExpr 1\n";
5263 std::cout << std::string(__indent,
' ') <<
"Parser::rAdditiveExpr 0\n";
5270 std::cout << std::string(__indent,
' ') <<
"Parser::rAdditiveExpr 1\n";
5289 case '+':
id=ID_plus;
break;
5290 case '-':
id=ID_minus;
break;
5310 std::cout << std::string(__indent,
' ') <<
"Parser::rMultiplyExpr 0\n";
5317 std::cout << std::string(__indent,
' ') <<
"Parser::rMultiplyExpr 1\n";
5321 while(t=
lex.
LookAhead(0), (t==
'*' || t==
'/' || t==
'%'))
5336 case '*':
id=ID_mult;
break;
5337 case '/':
id=ID_div;
break;
5338 case '%':
id=ID_mod;
break;
5347 std::cout << std::string(__indent,
' ') <<
"Parser::rMultiplyExpr 2\n";
5363 std::cout << std::string(__indent,
' ') <<
"Parser::rPmExpr 0\n";
5370 std::cout << std::string(__indent,
' ') <<
"Parser::rPmExpr 1\n";
5386 exp=
exprt(
"pointer-to-member");
5392 std::cout << std::string(__indent,
' ') <<
"Parser::rPmExpr 2\n";
5407 std::cout << std::string(__indent,
' ') <<
"Parser::rCastExpr 0\n";
5423 std::cout << std::string(__indent,
' ') <<
"Parser::rCastExpr 1\n";
5444 exp=
exprt(
"explicit-typecast");
5467 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeName 0\n";
5476 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeName 1\n";
5496 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeName 2\n";
5511 std::cout << std::string(__indent,
' ')
5512 <<
"Parser::rTypeNameOrFunctionType 0\n";
5520 std::cout << std::string(__indent,
' ')
5521 <<
"Parser::rTypeNameOrFunctionType 1\n";
5533 std::cout << std::string(__indent,
' ')
5534 <<
"Parser::rTypeNameOrFunctionType 2\n";
5542 std::cout << std::string(__indent,
' ')
5543 <<
"Parser::rTypeNameOrFunctionType 3\n";
5548 tname.
swap(return_type);
5557 std::cout << std::string(__indent,
' ')
5558 <<
"Parser::rTypeNameOrFunctionType 4\n";
5585 type.set(ID_identifier, op.data.get(ID_C_base_name));
5596 type.set(ID_identifier, op.data.get(ID_C_base_name));
5606 std::cout << std::string(__indent,
' ')
5607 <<
"Parser::rTypeNameOrFunctionType 5\n";
5617 type.make_ellipsis();
5626 parameter.
swap(parameter_declaration);
5627 type.parameters().push_back(parameter);
5641 type.make_ellipsis();
5649 std::cout << std::string(__indent,
' ')
5650 <<
"Parser::rTypeNameOrFunctionType 6\n";
5661 std::cout << std::string(__indent,
' ')
5662 <<
"Parser::rTypeNameOrFunctionType 7\n";
5672 std::cout << std::string(__indent,
' ')
5673 <<
"Parser::rTypeNameOrFunctionType 8\n";
5695 std::cout << std::string(__indent,
' ') <<
"Parser::rUnaryExpr 0\n";
5698 if(t==
'*' || t==
'&' || t==
'+' ||
5699 t==
'-' || t==
'!' || t==
'~' ||
5706 std::cout << std::string(__indent,
' ') <<
"Parser::rUnaryExpr 1\n";
5714 std::cout << std::string(__indent,
' ') <<
"Parser::rUnaryExpr 2\n";
5720 exp=
exprt(ID_dereference);
5724 exp=
exprt(ID_address_of);
5728 exp=
exprt(ID_unary_plus);
5732 exp=
exprt(ID_unary_minus);
5740 exp=
exprt(ID_bitnot);
5744 exp=
exprt(ID_side_effect);
5745 exp.
set(ID_statement, ID_preincrement);
5749 exp=
exprt(ID_side_effect);
5750 exp.
set(ID_statement, ID_predecrement);
5802 std::cout << std::string(__indent,
' ') <<
"Parser::rThrowExpr 0\n";
5813 if(t==
':' || t==
';')
5841 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeidExpr 0\n";
5863 exp=
exprt(
"typeid");
5882 exp=
exprt(
"typeid");
5907 std::cout << std::string(__indent,
' ') <<
"Parser::rSizeofExpr 0\n";
5925 exp=
exprt(ID_sizeof);
5926 exp.
add(ID_type_arg).
swap(tname);
5947 exp=
exprt(ID_sizeof);
5948 exp.
add(ID_type_arg).
swap(tname);
5962 exp=
exprt(ID_sizeof);
5991 exp=
exprt(ID_alignof);
5992 exp.
add(ID_type_arg).
swap(tname);
6007 std::cout << std::string(__indent,
' ') <<
"Parser::rNoexceptExpr 0\n";
6025 exp=
exprt(ID_noexcept);
6058 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 0\n";
6069 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 1\n";
6075 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 2\n";
6089 exp=
exprt(ID_side_effect);
6090 exp.
set(ID_statement, ID_cpp_delete_array);
6094 exp=
exprt(ID_side_effect);
6095 exp.
set(ID_statement, ID_cpp_delete);
6110 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 3\n";
6113 exp=
exprt(ID_side_effect);
6114 exp.
set(ID_statement, ID_cpp_new);
6117 exprt arguments, initializer;
6123 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 4\n";
6126 exp.
add(ID_initializer).
swap(initializer);
6258 decl.
swap(array_type);
6329 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 0\n";
6336 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 1\n";
6353 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 2\n";
6363 exp=
exprt(ID_index);
6371 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 3\n";
6382 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 4\n";
6425 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 5\n";
6432 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 6\n";
6440 exp=
exprt(ID_member);
6442 exp=
exprt(ID_ptrmember);
6448 exp.
add(ID_component_cpp_name).
swap(e);
6484 expr=
exprt(ID_msc_uuidof);
6485 expr.
add(ID_type_arg).
swap(tname);
6502 expr=
exprt(ID_msc_uuidof);
6549 ID_msc_if_not_exists);
6601 ID_msc_if_not_exists);
6626 typet tname1, tname2;
6637 expr.
add(ID_type_arg).
swap(tname1);
6651 expr.
add(
"type_arg1").
swap(tname1);
6652 expr.
add(
"type_arg2").
swap(tname2);
6685 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 0 " 6698 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 1\n";
6707 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 2\n";
6713 exp=
exprt(
"cpp-this");
6716 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 3\n";
6725 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 4\n";
6734 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 5\n";
6744 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 6\n";
6750 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 7\n";
6761 exp=
exprt(ID_side_effect);
6762 exp.
set(ID_statement, ID_statement_expression);
6777 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 8\n";
6787 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 9\n";
6793 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 10\n";
6803 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 11\n";
6809 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 12\n";
6818 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 13\n";
6824 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 14\n";
6833 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 15\n";
6846 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 16\n";
6856 exp=
exprt(
"explicit-constructor-call");
6872 exp=
exprt(
"explicit-constructor-call");
6896 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 17\n";
6917 std::cout << std::string(__indent,
' ') <<
"Parser::rVarName 0\n";
6930 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 0\n";
6933 name=
exprt(ID_cpp_name);
6940 name.
set(ID_typename,
true);
6950 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 1\n";
6958 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 1.1 " 6968 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 2\n";
6978 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 3\n";
6982 components.push_back(
irept(ID_name));
6983 components.back().set(ID_identifier, tk.
data.
get(ID_C_base_name));
6992 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 4\n";
7002 components.push_back(
irept(ID_template_args));
7003 components.back().add(ID_arguments).swap(args);
7012 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 5\n";
7016 components.push_back(
irept(
"::"));
7022 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 6\n";
7030 components.push_back(
irept(
"~"));
7036 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 7\n";
7041 components.push_back(
irept(ID_operator));
7049 components.push_back(op);
7083 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 0\n";
7092 if(u==
'\0' || u==
';' || u==
'}')
7105 std::cout << std::string(__indent,
' ')
7106 <<
"Parser::maybeTemplateArgs 1\n";
7112 std::cout << std::string(__indent,
' ')
7113 <<
"Parser::maybeTemplateArgs 2\n";
7128 std::cout << std::string(__indent,
' ')
7129 <<
"Parser::maybeTemplateArgs 3\n";
7136 else if(v==
'\0' || v==
';' || v==
'}')
7140 else if(u==
'\0' || u==
';' || u==
'}')
7146 std::cout << std::string(__indent,
' ')
7147 <<
"Parser::maybeTemplateArgs 4\n";
7152 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 5\n";
7158 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 6\n";
7166 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 7\n";
7197 declarator.
value()=body;
7213 declarator.
value()=body;
7231 std::cout << std::string(__indent,
' ') <<
"Parser::rCompoundStatement 1\n";
7238 std::cout << std::string(__indent,
' ') <<
"Parser::rCompoundStatement 2\n";
7295 std::cout << std::string(__indent,
' ') <<
"Parser::rStatement 0 " 7336 statement=
codet(ID_break);
7338 statement=
codet(ID_continue);
7349 std::cout << std::string(__indent,
' ') <<
"Parser::rStatement RETURN 0\n";
7354 statement=
codet(ID_return);
7360 std::cout << std::string(__indent,
' ')
7361 <<
"Parser::rStatement RETURN 1\n";
7368 std::cout << std::string(__indent,
' ')
7369 <<
"Parser::rStatement RETURN 2\n";
7378 std::cout << std::string(__indent,
' ')
7379 <<
"Parser::rStatement RETURN 3\n";
7393 statement=
codet(ID_goto);
7402 statement.
set(ID_destination, tk2.
data.
get(ID_C_base_name));
7424 statement=
codet(ID_gcc_switch_case_range);
7426 statement.
op0()=case_expr;
7427 statement.
op1()=range_end;
7437 statement.
op2().
swap(statement2);
7443 statement.
op0()=case_expr;
7452 statement.
op1().
swap(statement2);
7462 statement.
set(ID_default,
true);
7472 statement.
op1().
swap(statement2);
7491 statement=
codet(ID_label);
7493 statement.
set(ID_label, tk1.
data.
get(ID_C_base_name));
7512 statement=
codet(ID_decl);
7557 statement=
codet(ID_ifthenelse);
7586 statement.
op2().
swap(otherwise);
7605 statement=
codet(ID_switch);
7638 statement=
codet(ID_while);
7671 statement=
codet(ID_dowhile);
7711 statement=
codet(ID_for);
7776 statement=
codet(ID_try_catch);
7805 codet ellipsis(ID_ellipsis);
7819 if(declaration.
declarators().front().name().is_nil())
7821 irept name(ID_name);
7822 name.
set(ID_identifier,
"#anon");
7824 declaration.
declarators().front().name().get_sub().push_back(name);
7919 statement=
codet(
"msc_leave");
7931 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 1\n";
7939 statement=
codet(ID_asm);
7940 statement.
set(ID_flavor, ID_gcc);
7948 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 3\n";
7959 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 3\n";
7965 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 4\n";
7986 std::cout << std::string(__indent,
' ')
7987 <<
"Parser::rGCCAsmStatement 5\n";
7995 std::cout << std::string(__indent,
' ')
7996 <<
"Parser::rGCCAsmStatement 6\n";
8011 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 7\n";
8020 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 8\n";
8032 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 1\n";
8041 statement=
codet(ID_asm);
8042 statement.
set(ID_flavor, ID_msc);
8046 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 2\n";
8054 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 3\n";
8067 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 4\n";
8073 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 5\n";
8083 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 6\n";
8088 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 7\n";
8108 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 0\n";
8114 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 1\n";
8118 statement=
codet(ID_skip);
8125 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 2\n";
8133 std::cout << std::string(__indent,
' ') <<
"rDe " 8134 << statement.
pretty() <<
'\n';
8145 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 3\n";
8152 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 4\n";
8156 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 5 " 8164 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 6\n";
8167 statement=
codet(ID_expression);
8185 statement=
codet(ID_decl);
8217 typet cv_q, integral;
8222 std::cout << std::string(__indent,
' ')
8223 <<
"Parser::rDeclarationStatement 1\n";
8245 std::cout << std::string(__indent,
' ')
8246 <<
"Parser::rDeclarationStatement 2\n";
8256 std::cout << std::string(__indent,
' ')
8257 <<
"Parser::rDeclarationStatement 3 " << t <<
"\n";
8264 std::cout << std::string(__indent,
' ')
8265 <<
"Parser::rDeclarationStatement 4\n";
8268 statement=
codet(ID_decl);
8302 statement=
codet(ID_decl);
8314 statement=
codet(ID_decl);
8337 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 1\n";
8340 if(!
rName(type_name))
8344 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 2\n";
8351 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 3\n";
8357 declaration.
type().
swap(type_name);
8364 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 4\n";
8370 statement=
codet(ID_decl);
8389 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 rDeclarator(cpp_declaratort &, DeclKind, bool, bool)
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 rCommaExpression(exprt &)
bool MaybeTypeNameOrClassTemplate(cpp_tokent &)
bool rAccessDecl(cpp_declarationt &)
bool rSwitchStatement(codet &)
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 rDoStatement(codet &)
bool optAttribute(typet &)
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)
C++ Language Type Checking.
bool rEqualityExpr(exprt &, bool)
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
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 rExternTemplateDecl(cpp_declarationt &)
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
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
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 rConstDeclaration(cpp_declarationt &)
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)
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)