33 static unsigned __indent;
37 indenter() { __indent+=2; }
38 ~indenter() { __indent-=2; }
44 lex.LookAhead(0, _tk); \ 45 std::cout << std::string(__indent, ' ') << "Text [" << _tk.line_no << "]: " \ 46 << _tk.text << '\n'; \ 122 return "CLASS_TEMPLATE";
124 return "MEMBER_TEMPLATE";
126 return "FUNCTION_TEMPLATE";
130 return "NON_TYPE_TEMPLATE_PARAMETER";
132 return "TYPE_TEMPLATE_PARAMETER";
134 return "TEMPLATE_TEMPLATE_PARAMETER";
140 typedef std::map<irep_idt, new_scopet>
id_mapt;
147 inline void print(std::ostream &out)
const 165 void print_rec(std::ostream &,
unsigned indent)
const;
188 for(id_mapt::const_iterator
193 out << std::string(indent,
' ')
197 it->second.print_rec(out, indent+2);
205 lex(_cpp_parser.token_buffer),
282 typet &trailing_return_type);
390 static_cast<source_locationt &>(dest.
add(ID_C_source_location));
403 if(p->
id()==ID_merged_type)
406 p = &merged_type.last_type();
422 if(cpp_name.
get_sub().size()==1 &&
423 cpp_name.
get_sub().front().id()==ID_name)
424 id=cpp_name.
get_sub().front().get(ID_identifier);
471 if(dest.
id()!=ID_merged_type)
484 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;
1226 std::cout << std::string(__indent,
' ') <<
"Parser::rTempArgDeclaration 1\n";
1233 typet template_type;
1264 std::cout << std::string(__indent,
' ')
1265 <<
"Parser::rTempArgDeclaration 2\n";
1269 declaration.
set(ID_is_type,
false);
1275 std::cout << std::string(__indent,
' ')
1276 <<
"Parser::rTempArgDeclaration 3\n";
1279 bool has_ellipsis=
false;
1296 std::cout << std::string(__indent,
' ')
1297 <<
"Parser::rTempArgDeclaration 4\n";
1383 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 0.1 token: " 1395 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 0.2\n";
1403 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 1\n";
1411 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 3\n";
1414 typet cv_q, integral;
1428 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 4\n";
1442 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 5\n";
1446 declaration, storage_spec, member_spec, integral, cv_q);
1453 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 6 " << t
1469 typet cv_q, integral;
1495 integral.
swap(cv_q);
1534 std::cout << std::string(__indent,
' ')
1535 <<
"Parser::rIntegralDeclaration 1 token: " 1543 std::cout << std::string(__indent,
' ') <<
"Parser::rIntegralDeclaration 2\n";
1549 std::cout << std::string(__indent,
' ') <<
"Parser::rIntegralDeclaration 3\n";
1562 std::cout << std::string(__indent,
' ')
1563 <<
"Parser::rIntegralDeclaration 4\n";
1571 std::cout << std::string(__indent,
' ')
1572 <<
"Parser::rIntegralDeclaration 5\n";
1592 std::cout << std::string(__indent,
' ')
1593 <<
"Parser::rIntegralDeclaration 6 " 1602 declaration.
type().
id() == ID_auto &&
1604 declaration.
declarators().front().type().id() == ID_function_type &&
1605 declaration.
declarators().front().type().subtype().is_not_nil())
1607 declaration.
type() = declaration.
declarators().front().type().subtype();
1608 declaration.
declarators().front().type().subtype().make_nil();
1612 std::cout << std::string(__indent,
' ')
1613 <<
"Parser::rIntegralDeclaration 7\n";
1619 std::cout << std::string(__indent,
' ')
1620 <<
"Parser::rIntegralDeclaration 8 " 1621 << declaration.
pretty() <<
'\n';
1629 std::cout << std::string(__indent,
' ')
1630 <<
"Parser::rIntegralDeclaration 9\n";
1640 std::cout << std::string(__indent,
' ')
1641 <<
"Parser::rIntegralDeclaration 10\n";
1653 std::cout << std::string(__indent,
' ') <<
"Parser::rConstDeclaration\n";
1678 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 1\n";
1681 if(!
rName(type_name))
1687 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 2\n";
1701 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 3\n";
1705 bool is_operator =
false;
1710 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 4\n";
1713 assert(!type_name.
get_sub().empty());
1715 for(std::size_t i=0; i < type_name.
get_sub().size(); i++)
1717 if(type_name.
get_sub()[i].id() == ID_operator)
1728 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 5\n";
1732 typet type = type_name;
1736 typet trailing_return_type;
1738 conv_operator_declarator, type_name, trailing_return_type))
1741 type_name=
typet(
"cpp-cast-operator");
1743 declaration.
declarators().push_back(conv_operator_declarator);
1748 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 6\n";
1751 assert(!type_name.
get_sub().empty());
1753 bool is_destructor=
false;
1762 typet trailing_return_type;
1764 constructor_declarator, type_name, trailing_return_type))
1768 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 7\n";
1773 type_name=trailing_return_type;
1775 type_name=
typet(is_destructor?ID_destructor:ID_constructor);
1777 declaration.
declarators().push_back(constructor_declarator);
1782 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 8\n";
1800 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 9\n";
1812 declaration.
type().
swap(type_name);
1817 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 10\n";
1823 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 11\n";
1832 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 12\n";
1856 std::cout << std::string(__indent,
' ') <<
"Parser::isConstructorDecl " 1865 if(t==
'*' || t==
'&' || t==
'(')
1918 else if(v==
'\0' || v==
';' || v==
'}')
1922 else if(u==
'\0' || u==
';' || u==
'}')
1947 member_spec.
clear();
2033 p=
typet(ID_constexpr);
2045 p=
typet(ID_volatile);
2051 p=
typet(ID_restrict);
2123 exprt exp(ID_alignof);
2124 exp.
add(ID_type_arg).
swap(tname);
2127 typet attr(ID_aligned);
2129 attr.
add(ID_size, exp);
2146 typet attr(ID_aligned);
2148 attr.
add(ID_size, exp);
2162 std::cout << std::string(__indent,
' ') <<
"Parser::rAttribute " 2181 typet attr(ID_packed);
2189 typet attr(ID_transparent_union);
2217 typet attr(ID_aligned);
2234 attr.
add(ID_size, exp);
2255 typet attr(ID_gcc_attribute_mode);
2257 attr.
set(ID_size, name.
get(ID_identifier));
2264 typet attr(ID_static);
2272 typet attr(ID_weak);
2291 typet attr(ID_alias);
2311 typet attr(ID_section);
2320 typet attr(ID_noreturn);
2328 typet attr(ID_constructor);
2336 typet attr(ID_destructor);
2380 typet attr(ID_noreturn);
2407 std::cout << std::string(__indent,
' ')
2408 <<
"Parser::optIntegralTypeOrClassSpec 0\n";
2418 bool is_integral=
false;
2428 std::cout << std::string(__indent,
' ')
2429 <<
"Parser::optIntegralTypeOrClassSpec 1\n";
2436 case TOK_CHAR: type_id=ID_char;
break;
2439 case TOK_INT: type_id=ID_int;
break;
2440 case TOK_SHORT: type_id=ID_short;
break;
2441 case TOK_LONG: type_id=ID_long;
break;
2446 case TOK_FLOAT: type_id=ID_float;
break;
2448 case TOK_VOID: type_id=ID_void;
break;
2449 case TOK_INT8: type_id=ID_int8;
break;
2450 case TOK_INT16: type_id=ID_int16;
break;
2451 case TOK_INT32: type_id=ID_int32;
break;
2452 case TOK_INT64: type_id=ID_int64;
break;
2457 type_id = ID_c_bool;
2460 case TOK_AUTO: type_id = ID_auto;
break;
2464 if(!type_id.
empty())
2481 std::cout << std::string(__indent,
' ')
2482 <<
"Parser::optIntegralTypeOrClassSpec 2\n";
2489 std::cout << std::string(__indent,
' ')
2490 <<
"Parser::optIntegralTypeOrClassSpec 3\n";
2500 std::cout << std::string(__indent,
' ')
2501 <<
"Parser::optIntegralTypeOrClassSpec 4\n";
2508 std::cout << std::string(__indent,
' ')
2509 <<
"Parser::optIntegralTypeOrClassSpec 5\n";
2529 p.
add(ID_type_arg).
swap(tname);
2538 std::cout << std::string(__indent,
' ')
2539 <<
"Parser::optIntegralTypeOrClassSpec 6\n";
2547 std::cout << std::string(__indent,
' ')
2548 <<
"Parser::optIntegralTypeOrClassSpec 7\n";
2555 std::cout << std::string(__indent,
' ')
2556 <<
"Parser::optIntegralTypeOrClassSpec 8\n";
2559 p.
add(ID_expr_arg).
swap(expr);
2568 p=
typet(ID_decltype);
2584 p.
add(ID_expr_arg).
swap(expr);
2595 p=
typet(ID_msc_underlying_type);
2612 p.
add(ID_type_arg).
swap(tname);
2631 typet &trailing_return_type)
2635 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 0\n";
2642 constructor.
name().
swap(type_name);
2649 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 1\n";
2652 irept ¶meters=constructor.
type().
add(ID_parameters);
2662 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 2\n";
2665 typet &cv=static_cast<typet &>(constructor.
add(ID_method_qualifier));
2674 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 3\n";
2686 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 4\n";
2700 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 5\n";
2712 constructor.
value()=
codet(
"cpp-pure-virtual");
2828 bool should_be_declarator,
2839 declarators.push_back(declarator);
2857 bool should_be_declarator,
2870 typet bit_field_type(ID_c_bit_field);
2871 bit_field_type.
set(ID_size, e);
2884 declarator,
kDeclarator, should_be_declarator, is_statement))
2929 if(declarator.
type().
id()!=ID_function_type)
2945 typet bit_field_type(ID_c_bit_field);
2946 bit_field_type.
set(ID_size, e);
2953 dw.
swap(declarator);
3000 bool should_be_declarator,
3007 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 1\n";
3014 typet d_outer, d_inner;
3029 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 2\n";
3037 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 3\n";
3048 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 4\n";
3056 if(!should_be_declarator)
3061 if(t!=
'[' && t!=
'(')
3067 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 5\n";
3077 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 6\n";
3086 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 7\n";
3099 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 8\n";
3119 typet function_type(ID_function_type);
3121 function_type.
add(ID_parameters).
swap(args);
3125 d_outer.
swap(d_inner);
3131 init_args.
swap(args);
3136 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 9\n";
3145 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 10\n";
3166 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 11\n";
3184 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 12\n";
3199 std::list<typet> tl;
3200 tl.push_back(d_outer);
3201 while(tl.back().id() == ID_array)
3203 tl.push_back(tl.back().subtype());
3208 d_outer.
swap(array_type);
3211 tl.back().subtype().swap(d_outer);
3212 d_outer.
swap(tl.back());
3223 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 13\n";
3249 std::cout << std::string(__indent,
' ') <<
"Parser::optPtrOperator 1\n";
3252 std::list<typet> t_list;
3259 std::cout << std::string(__indent,
' ') <<
"Parser::optPtrOperator 2 " 3265 typet op(ID_frontend_pointer);
3276 t_list.push_back(op);
3281 typet op(ID_block_pointer);
3292 t_list.push_back(op);
3306 t_list.push_back(cv);
3309 t_list.push_back(op);
3322 typet op(ID_frontend_pointer);
3323 op.
set(ID_C_reference,
true);
3325 t_list.push_front(op);
3331 typet op(ID_frontend_pointer);
3332 op.
set(ID_C_rvalue_reference,
true);
3334 t_list.push_front(op);
3338 for(std::list<typet>::reverse_iterator
3343 if(it->id()==ID_merged_type)
3346 merged_type.last_type().subtype().swap(ptrs);
3350 assert(it->is_not_nil());
3351 it->subtype().swap(ptrs);
3371 init=
irept(ID_member_initializers);
3401 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 1\n";
3410 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 2\n";
3413 init=
codet(ID_member_initializer);
3414 init.
add(ID_member).
swap(name);
3424 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 3\n";
3443 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 4\n";
3483 std::cout << std::string(__indent,
' ') <<
"Parser::rName 0\n";
3493 name.
set(ID_typename,
true);
3503 std::cout << std::string(__indent,
' ') <<
"Parser::rName 1\n";
3511 std::cout << std::string(__indent,
' ') <<
"Parser::rName 2 " 3519 std::cout << std::string(__indent,
' ') <<
"Parser::rName 3\n";
3529 std::cout << std::string(__indent,
' ') <<
"Parser::rName 4\n";
3536 components.push_back(
irept(ID_template_args));
3537 components.back().
add(ID_arguments).
swap(args);
3547 std::cout << std::string(__indent,
' ') <<
"Parser::rName 5\n";
3563 std::cout << std::string(__indent,
' ') <<
"Parser::rName 6\n";
3566 components.push_back(
irept(
"::"));
3572 std::cout << std::string(__indent,
' ') <<
"Parser::rName 7\n";
3580 components.push_back(
irept(
"~"));
3586 std::cout << std::string(__indent,
' ') <<
"Parser::rName 8\n";
3590 components.push_back(
irept(ID_operator));
3593 components.push_back(
irept());
3646 operator_id = std::string(1, static_cast<char>(t));
3661 case TOK_EQ: operator_id=
"==";
break;
3662 case TOK_NE: operator_id=
"!=";
break;
3663 case TOK_LE: operator_id=
"<=";
break;
3664 case TOK_GE: operator_id=
">=";
break;
3666 case TOK_OROR: operator_id=
"||";
break;
3667 case TOK_INCR: operator_id=
"++";
break;
3668 case TOK_DECR: operator_id=
"--";
break;
3669 case TOK_DOTPM: operator_id=
".*";
break;
3671 case TOK_ARROW: operator_id=
"->";
break;
3685 name=
irept(t==
TOK_NEW?ID_cpp_new_array:ID_cpp_delete_array);
3712 assert(!operator_id.
empty());
3714 name=
irept(operator_id);
3728 typet cv1, cv2, type_name, ptr;
3743 if(!
rName(type_name))
3770 std::cout << std::string(__indent,
' ') <<
"Parser::rPtrToMember 0\n";
3773 typet ptm(ID_frontend_pointer);
3774 irept &name = ptm.
add(
"to-member");
3784 bool loop_cond =
true;
3804 components.push_back(
irept(ID_template_args));
3805 components.back().
add(ID_arguments).
swap(args);
3826 components.push_back(
irept(
"::"));
3833 ptr_to_mem.
swap(ptm);
3837 std::cout << std::string(__indent,
' ') <<
"Parser::rPtrToMember 1\n";
3868 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 0\n";
3879 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 1\n";
3891 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 2\n";
3900 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 3\n";
3915 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 4\n";
3927 exp.
id(ID_ambiguous);
3929 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 4.1\n";
3941 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 4.2\n";
3948 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 5\n";
3966 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 6\n";
3970 template_args.
get_sub().back().swap(exp);
4075 list.
get_sub().back().swap(declaration);
4113 header=
typet(ID_register);
4129 declaration.
declarators().push_back(arg_declarator);
4159 expr.
id(ID_initializer_list);
4279 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 1\n";
4296 spec.
set(ID_C_class,
true);
4313 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 2\n";
4325 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 3\n";
4348 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 4\n";
4420 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 1\n";
4429 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 2\n";
4434 spec=
typet(ID_struct);
4435 spec.
set(ID_C_class,
true);
4439 spec=
typet(ID_struct);
4440 spec.
set(ID_C_interface,
true);
4443 spec=
typet(ID_struct);
4445 spec=
typet(ID_union);
4452 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 3\n";
4459 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 4\n";
4483 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 5\n";
4503 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 6\n";
4515 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 7\n";
4518 ((
exprt&)spec.
add(ID_body)).operands().
swap(body.operands());
4539 irept base(ID_base);
4544 base.
set(ID_virtual,
true);
4553 base.
set(ID_protection, ID_public);
4557 base.
set(ID_protection, ID_protected);
4561 base.
set(ID_protection, ID_private);
4574 base.
set(ID_virtual,
true);
4588 bases.
get_sub().back().swap(base);
4606 std::cout << std::string(__indent,
' ') <<
"Parser::rClassBody 0\n";
4631 std::cout << std::string(__indent,
' ') <<
"Parser::rClassBody " 4632 << member.
pretty() <<
'\n';
4636 static_cast<exprt &>(static_cast<irept &>(member)));
4668 std::cout << std::string(__indent,
' ') <<
"Parser::rClassMember 0 " << t
4677 member.
id(
"cpp-public");
4681 member.
id(
"cpp-protected");
4685 member.
id(
"cpp-private");
4740 name_decl.
name() = name;
4757 std::cout << std::string(__indent,
' ') <<
"Parser::rCommaExpression 0\n";
4764 std::cout << std::string(__indent,
' ') <<
"Parser::rCommaExpression 1\n";
4780 exp=
exprt(ID_comma);
4786 std::cout << std::string(__indent,
' ') <<
"Parser::rCommaExpression 2\n";
4802 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 0\n";
4809 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 1\n";
4823 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 2\n";
4831 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 3\n";
4837 exp=
exprt(ID_side_effect);
4840 exp.
set(ID_statement, ID_assign);
4842 exp.
set(ID_statement, ID_assign_plus);
4844 exp.
set(ID_statement, ID_assign_minus);
4846 exp.
set(ID_statement, ID_assign_mult);
4848 exp.
set(ID_statement, ID_assign_div);
4850 exp.
set(ID_statement, ID_assign_mod);
4852 exp.
set(ID_statement, ID_assign_shl);
4854 exp.
set(ID_statement, ID_assign_shr);
4856 exp.
set(ID_statement, ID_assign_bitand);
4858 exp.
set(ID_statement, ID_assign_bitxor);
4860 exp.
set(ID_statement, ID_assign_bitor);
4867 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 4\n";
4881 std::cout << std::string(__indent,
' ') <<
"Parser::rConditionalExpr 0\n";
4888 std::cout << std::string(__indent,
' ') <<
"Parser::rConditionalExpr 1\n";
4894 exprt then, otherwise;
4901 std::cout << std::string(__indent,
' ') <<
"Parser::rConditionalExpr 2\n";
4930 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalOrExpr 0\n";
4937 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalOrExpr 1\n";
4969 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalAndExpr 1\n";
4976 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalAndExpr 1\n";
5008 std::cout << std::string(__indent,
' ') <<
"Parser::rInclusiveOrExpr 0\n";
5015 std::cout << std::string(__indent,
' ') <<
"Parser::rInclusiveOrExpr 1\n";
5030 exp=
exprt(ID_bitor);
5047 std::cout << std::string(__indent,
' ') <<
"Parser::rExclusiveOrExpr 0\n";
5054 std::cout << std::string(__indent,
' ') <<
"Parser::rExclusiveOrExpr 1\n";
5063 if(!
rAndExpr(right, template_args))
5069 exp=
exprt(ID_bitxor);
5086 std::cout << std::string(__indent,
' ') <<
"Parser::rAndExpr 0\n";
5093 std::cout << std::string(__indent,
' ') <<
"Parser::rAndExpr 1\n";
5108 exp=
exprt(ID_bitand);
5125 std::cout << std::string(__indent,
' ') <<
"Parser::rEqualityExpr 0\n";
5132 std::cout << std::string(__indent,
' ') <<
"Parser::rEqualityExpr 1\n";
5165 std::cout << std::string(__indent,
' ') <<
"Parser::rRelationalExpr 0\n";
5172 std::cout << std::string(__indent,
' ') <<
"Parser::rRelationalExpr 1\n";
5178 (t==
TOK_LE || t==
TOK_GE || t==
'<' || (t==
'>' && !template_args)))
5194 case TOK_LE:
id=ID_le;
break;
5195 case TOK_GE:
id=ID_ge;
break;
5196 case '<':
id=ID_lt;
break;
5197 case '>':
id=ID_gt;
break;
5217 std::cout << std::string(__indent,
' ') <<
"Parser::rShiftExpr 0\n";
5224 std::cout << std::string(__indent,
' ') <<
"Parser::rShiftExpr 1\n";
5257 std::cout << std::string(__indent,
' ') <<
"Parser::rAdditiveExpr 0\n";
5264 std::cout << std::string(__indent,
' ') <<
"Parser::rAdditiveExpr 1\n";
5283 case '+':
id=ID_plus;
break;
5284 case '-':
id=ID_minus;
break;
5304 std::cout << std::string(__indent,
' ') <<
"Parser::rMultiplyExpr 0\n";
5311 std::cout << std::string(__indent,
' ') <<
"Parser::rMultiplyExpr 1\n";
5315 while(t=
lex.
LookAhead(0), (t==
'*' || t==
'/' || t==
'%'))
5330 case '*':
id=ID_mult;
break;
5331 case '/':
id=ID_div;
break;
5332 case '%':
id=ID_mod;
break;
5341 std::cout << std::string(__indent,
' ') <<
"Parser::rMultiplyExpr 2\n";
5357 std::cout << std::string(__indent,
' ') <<
"Parser::rPmExpr 0\n";
5364 std::cout << std::string(__indent,
' ') <<
"Parser::rPmExpr 1\n";
5380 exp=
exprt(
"pointer-to-member");
5386 std::cout << std::string(__indent,
' ') <<
"Parser::rPmExpr 2\n";
5401 std::cout << std::string(__indent,
' ') <<
"Parser::rCastExpr 0\n";
5417 std::cout << std::string(__indent,
' ') <<
"Parser::rCastExpr 1\n";
5438 exp=
exprt(
"explicit-typecast");
5461 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeName 0\n";
5470 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeName 1\n";
5490 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeName 2\n";
5505 std::cout << std::string(__indent,
' ')
5506 <<
"Parser::rTypeNameOrFunctionType 0\n";
5514 std::cout << std::string(__indent,
' ')
5515 <<
"Parser::rTypeNameOrFunctionType 1\n";
5527 std::cout << std::string(__indent,
' ')
5528 <<
"Parser::rTypeNameOrFunctionType 2\n";
5536 std::cout << std::string(__indent,
' ')
5537 <<
"Parser::rTypeNameOrFunctionType 3\n";
5542 tname.
swap(return_type);
5551 std::cout << std::string(__indent,
' ')
5552 <<
"Parser::rTypeNameOrFunctionType 4\n";
5579 type.set(ID_identifier, op.data.get(ID_C_base_name));
5590 type.set(ID_identifier, op.data.get(ID_C_base_name));
5600 std::cout << std::string(__indent,
' ')
5601 <<
"Parser::rTypeNameOrFunctionType 5\n";
5611 type.make_ellipsis();
5620 parameter.
swap(parameter_declaration);
5621 type.parameters().push_back(parameter);
5635 type.make_ellipsis();
5643 std::cout << std::string(__indent,
' ')
5644 <<
"Parser::rTypeNameOrFunctionType 6\n";
5655 std::cout << std::string(__indent,
' ')
5656 <<
"Parser::rTypeNameOrFunctionType 7\n";
5666 std::cout << std::string(__indent,
' ')
5667 <<
"Parser::rTypeNameOrFunctionType 8\n";
5689 std::cout << std::string(__indent,
' ') <<
"Parser::rUnaryExpr 0\n";
5692 if(t==
'*' || t==
'&' || t==
'+' ||
5693 t==
'-' || t==
'!' || t==
'~' ||
5700 std::cout << std::string(__indent,
' ') <<
"Parser::rUnaryExpr 1\n";
5708 std::cout << std::string(__indent,
' ') <<
"Parser::rUnaryExpr 2\n";
5714 exp=
exprt(ID_dereference);
5718 exp=
exprt(ID_address_of);
5722 exp=
exprt(ID_unary_plus);
5726 exp=
exprt(ID_unary_minus);
5734 exp=
exprt(ID_bitnot);
5738 exp=
exprt(ID_side_effect);
5739 exp.
set(ID_statement, ID_preincrement);
5743 exp=
exprt(ID_side_effect);
5744 exp.
set(ID_statement, ID_predecrement);
5796 std::cout << std::string(__indent,
' ') <<
"Parser::rThrowExpr 0\n";
5807 if(t==
':' || t==
';')
5835 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeidExpr 0\n";
5857 exp =
exprt(ID_typeid);
5876 exp =
exprt(ID_typeid);
5901 std::cout << std::string(__indent,
' ') <<
"Parser::rSizeofExpr 0\n";
5919 exp=
exprt(ID_sizeof);
5920 exp.
add(ID_type_arg).
swap(tname);
5941 exp=
exprt(ID_sizeof);
5942 exp.
add(ID_type_arg).
swap(tname);
5956 exp=
exprt(ID_sizeof);
5985 exp=
exprt(ID_alignof);
5986 exp.
add(ID_type_arg).
swap(tname);
6001 std::cout << std::string(__indent,
' ') <<
"Parser::rNoexceptExpr 0\n";
6019 exp=
exprt(ID_noexcept);
6052 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 0\n";
6063 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 1\n";
6069 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 2\n";
6083 exp=
exprt(ID_side_effect);
6084 exp.
set(ID_statement, ID_cpp_delete_array);
6088 exp=
exprt(ID_side_effect);
6089 exp.
set(ID_statement, ID_cpp_delete);
6104 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 3\n";
6107 exp=
exprt(ID_side_effect);
6108 exp.
set(ID_statement, ID_cpp_new);
6111 exprt arguments, initializer;
6117 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 4\n";
6120 exp.
add(ID_initializer).
swap(initializer);
6252 decl.
swap(array_type);
6323 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 0\n";
6330 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 1\n";
6347 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 2\n";
6357 exp=
exprt(ID_index);
6365 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 3\n";
6376 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 4\n";
6419 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 5\n";
6426 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 6\n";
6434 exp=
exprt(ID_member);
6436 exp=
exprt(ID_ptrmember);
6442 exp.
add(ID_component_cpp_name).
swap(e);
6478 expr=
exprt(ID_msc_uuidof);
6479 expr.
add(ID_type_arg).
swap(tname);
6496 expr=
exprt(ID_msc_uuidof);
6543 ID_msc_if_not_exists);
6595 ID_msc_if_not_exists);
6620 typet tname1, tname2;
6631 expr.
add(ID_type_arg).
swap(tname1);
6645 expr.
add(
"type_arg1").
swap(tname1);
6646 expr.
add(
"type_arg2").
swap(tname2);
6679 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 0 " 6692 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 1\n";
6701 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 2\n";
6707 exp=
exprt(
"cpp-this");
6710 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 3\n";
6719 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 4\n";
6728 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 5\n";
6738 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 6\n";
6744 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 7\n";
6755 exp=
exprt(ID_side_effect);
6756 exp.
set(ID_statement, ID_statement_expression);
6771 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 8\n";
6781 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 9\n";
6787 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 10\n";
6797 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 11\n";
6803 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 12\n";
6812 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 13\n";
6818 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 14\n";
6827 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 15\n";
6840 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 16\n";
6850 exp=
exprt(
"explicit-constructor-call");
6866 exp=
exprt(
"explicit-constructor-call");
6890 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 17\n";
6911 std::cout << std::string(__indent,
' ') <<
"Parser::rVarName 0\n";
6924 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 0\n";
6934 name.
set(ID_typename,
true);
6944 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 1\n";
6952 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 1.1 " 6962 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 2\n";
6972 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 3\n";
6985 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 4\n";
6995 components.push_back(
irept(ID_template_args));
6996 components.back().add(ID_arguments).swap(args);
7005 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 5\n";
7009 components.push_back(
irept(
"::"));
7015 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 6\n";
7023 components.push_back(
irept(
"~"));
7029 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 7\n";
7034 components.push_back(
irept(ID_operator));
7042 components.push_back(op);
7076 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 0\n";
7085 if(u==
'\0' || u==
';' || u==
'}')
7098 std::cout << std::string(__indent,
' ')
7099 <<
"Parser::maybeTemplateArgs 1\n";
7105 std::cout << std::string(__indent,
' ')
7106 <<
"Parser::maybeTemplateArgs 2\n";
7121 std::cout << std::string(__indent,
' ')
7122 <<
"Parser::maybeTemplateArgs 3\n";
7129 else if(v==
'\0' || v==
';' || v==
'}')
7133 else if(u==
'\0' || u==
';' || u==
'}')
7139 std::cout << std::string(__indent,
' ')
7140 <<
"Parser::maybeTemplateArgs 4\n";
7145 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 5\n";
7151 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 6\n";
7159 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 7\n";
7190 declarator.
value()=body;
7206 declarator.
value()=body;
7224 std::cout << std::string(__indent,
' ') <<
"Parser::rCompoundStatement 1\n";
7231 std::cout << std::string(__indent,
' ') <<
"Parser::rCompoundStatement 2\n";
7288 std::cout << std::string(__indent,
' ') <<
"Parser::rStatement 0 " 7329 statement=
codet(ID_break);
7331 statement=
codet(ID_continue);
7342 std::cout << std::string(__indent,
' ') <<
"Parser::rStatement RETURN 0\n";
7347 statement=
codet(ID_return);
7353 std::cout << std::string(__indent,
' ')
7354 <<
"Parser::rStatement RETURN 1\n";
7361 std::cout << std::string(__indent,
' ')
7362 <<
"Parser::rStatement RETURN 2\n";
7371 std::cout << std::string(__indent,
' ')
7372 <<
"Parser::rStatement RETURN 3\n";
7386 statement=
codet(ID_goto);
7395 statement.
set(ID_destination, tk2.
data.
get(ID_C_base_name));
7417 statement=
codet(ID_gcc_switch_case_range);
7419 statement.
op0()=case_expr;
7420 statement.
op1()=range_end;
7430 statement.
op2().
swap(statement2);
7436 statement.
op0()=case_expr;
7445 statement.
op1().
swap(statement2);
7455 statement.
set(ID_default,
true);
7465 statement.
op1().
swap(statement2);
7484 statement=
codet(ID_label);
7486 statement.
set(ID_label, tk1.
data.
get(ID_C_base_name));
7505 statement=
codet(ID_decl);
7550 statement=
codet(ID_ifthenelse);
7579 statement.
op2().
swap(otherwise);
7598 statement=
codet(ID_switch);
7631 statement=
codet(ID_while);
7664 statement=
codet(ID_dowhile);
7704 statement=
codet(ID_for);
7795 codet ellipsis(ID_ellipsis);
7809 if(declaration.
declarators().front().name().is_nil())
7904 statement =
codet(ID_msc_leave);
7916 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 1\n";
7924 statement=
codet(ID_asm);
7925 statement.
set(ID_flavor, ID_gcc);
7933 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 3\n";
7944 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 3\n";
7950 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 4\n";
7971 std::cout << std::string(__indent,
' ')
7972 <<
"Parser::rGCCAsmStatement 5\n";
7980 std::cout << std::string(__indent,
' ')
7981 <<
"Parser::rGCCAsmStatement 6\n";
7996 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 7\n";
8005 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 8\n";
8017 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 1\n";
8026 statement=
codet(ID_asm);
8027 statement.
set(ID_flavor, ID_msc);
8031 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 2\n";
8039 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 3\n";
8052 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 4\n";
8058 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 5\n";
8068 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 6\n";
8073 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 7\n";
8093 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 0\n";
8099 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 1\n";
8110 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 2\n";
8118 std::cout << std::string(__indent,
' ') <<
"rDe " 8119 << statement.
pretty() <<
'\n';
8130 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 3\n";
8137 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 4\n";
8141 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 5 " 8149 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 6\n";
8152 statement=
codet(ID_expression);
8170 statement=
codet(ID_decl);
8202 typet cv_q, integral;
8207 std::cout << std::string(__indent,
' ')
8208 <<
"Parser::rDeclarationStatement 1\n";
8230 std::cout << std::string(__indent,
' ')
8231 <<
"Parser::rDeclarationStatement 2\n";
8241 std::cout << std::string(__indent,
' ')
8242 <<
"Parser::rDeclarationStatement 3 " << t <<
"\n";
8249 std::cout << std::string(__indent,
' ')
8250 <<
"Parser::rDeclarationStatement 4\n";
8253 statement=
codet(ID_decl);
8287 statement=
codet(ID_decl);
8299 statement=
codet(ID_decl);
8322 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 1\n";
8325 if(!
rName(type_name))
8329 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 2\n";
8336 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 3\n";
8342 declaration.
type().
swap(type_name);
8349 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 4\n";
8355 statement=
codet(ID_decl);
8374 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, extends irept.
bool rTemplateArgs(irept &)
bool rShiftExpr(exprt &, bool)
void set_function(const irep_idt &function)
bool rInclusiveOrExpr(exprt &, bool)
Semantic type conversion.
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)
const type_with_subtypest & to_type_with_subtypes(const typet &type)
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 &)
codet representation of a try/catch block.
C++ Parser: Token Buffer.
void set_explicit(bool value)
const exprt & as_expr() const
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)
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.
bool rStaticAssert(cpp_static_assertt &)
bool rVarNameCore(exprt &)
bool rDeclarator(cpp_declaratort &, DeclKind, bool, bool)
bool rDeclarationStatement(codet &)
void move_to_operands(exprt &expr)
Move the given argument to the end of exprt's operands.
bool rDeclaratorQualifier()
void set_namespace(bool value)
bool rTypedefStatement(codet &)
typet & type()
Return the type of the expression.
bool rMemberInitializers(irept &)
bool rArgDeclList(irept &)
bool rExprStatement(codet &)
A constant literal expression.
bool rTypePredicate(exprt &)
bool rString(cpp_tokent &tk)
bool rConditionalExpr(exprt &, bool)
bool rNullDeclaration(cpp_declarationt &)
bool rNewDeclarator(typet &)
holds a combination of types
bool optMemberSpec(cpp_member_spect &)
bool rMSC_tryStatement(codet &)
A side_effect_exprt representation of a side effect that throws an exception.
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()
const merged_typet & to_merged_type(const typet &type)
conversion to merged_typet
source_locationt source_location
bool rPostfixExpr(exprt &)
void set_file(const irep_idt &file)
bool rArgDeclaration(cpp_declarationt &)
bool rMultiplyExpr(exprt &)
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)
const itemst & items() const
void move_to_subtypes(typet &type)
Move the provided type to the subtypes of this type.
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 side_effect_exprt representation of 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()
bool rAdditiveExpr(exprt &)
source_locationt & add_source_location()
const source_locationt & source_location() const
bool rAlignofExpr(exprt &)
#define UNREACHABLE
This should be used to mark dead code.
bool rArgDeclListOrInit(exprt &, bool &, bool)
irept & add(const irep_namet &name)
bool rInitializeExpr(exprt &)
The NIL type, i.e., an invalid type, no value.
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 &)
A codet representing sequential composition of program statements.
A codet representing a skip statement.
bool rDefinition(cpp_itemt &)
codet representation of a switch-case, i.e. a case statement within a switch.
bool rForStatement(codet &)
Data structure for representing an arbitrary statement in a program.
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)