31 static unsigned __indent;
35 indenter() { __indent+=2; }
36 ~indenter() { __indent-=2; }
42 lex.LookAhead(0, _tk); \ 43 std::cout << std::string(__indent, ' ') << "Text [" << _tk.line_no << "]: " \ 44 << _tk.text << '\n'; \ 120 return "CLASS_TEMPLATE";
122 return "MEMBER_TEMPLATE";
124 return "FUNCTION_TEMPLATE";
128 return "NON_TYPE_TEMPLATE_PARAMETER";
130 return "TYPE_TEMPLATE_PARAMETER";
132 return "TEMPLATE_TEMPLATE_PARAMETER";
138 typedef std::map<irep_idt, new_scopet>
id_mapt;
145 inline void print(std::ostream &out)
const 163 void print_rec(std::ostream &,
unsigned indent)
const;
186 for(id_mapt::const_iterator
191 out << std::string(indent,
' ')
195 it->second.print_rec(out, indent+2);
203 lex(_cpp_parser.token_buffer),
283 typet &trailing_return_type);
404 if(p->
id()==ID_merged_type)
423 if(cpp_name.
get_sub().size()==1 &&
424 cpp_name.
get_sub().front().id()==ID_name)
425 id=cpp_name.
get_sub().front().get(ID_identifier);
472 if(dest.
id()!=ID_merged_type)
474 typet tmp(ID_merged_type);
485 #define ERROR_TOKENS 4 495 source_location.
set_file(t[0].filename);
496 source_location.
set_line(std::to_string(t[0].line_no));
498 std::string message=
"parse error before `";
553 std::cout << std::string(__indent,
' ') <<
"Parser::rDefinition 1 " << t
608 std::cout << std::string(__indent,
' ') <<
"Parser::rTypedef 1\n";
637 std::cout << std::string(__indent,
' ') <<
"Parser::rTypedefUsing 1\n";
653 std::cout << std::string(__indent,
' ') <<
"Parser::rTypedefUsing 2\n";
670 std::cout << std::string(__indent,
' ') <<
"Parser::rTypedefUsing 3\n";
678 statement=
codet(ID_decl);
691 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 0\n";
702 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 0.1\n";
714 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 1\n";
722 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 2\n";
730 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 3\n";
739 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeSpecifier 4\n";
806 linkage_spec.
items().push_back(item);
822 bool is_inline=
false;
840 name=tk2.
data.
get(ID_C_base_name);
951 items.push_back(item);
955 items.push_back(item);
1006 std::cout << std::string(__indent,
' ') <<
"BODY: " 1007 << body.
pretty() <<
'\n';
1008 std::cout << std::string(__indent,
' ') <<
"TEMPLATE_TYPE: " 1009 << template_type.
pretty() <<
'\n';
1011 body.
add(ID_template_type).
swap(template_type);
1012 body.
set(ID_is_template,
true);
1022 body.
add(ID_template_type).
swap(template_type);
1023 body.
set(ID_is_template,
true);
1042 decl=
typet(ID_template);
1055 irept &template_parameters=decl.
add(ID_template_parameters);
1079 if(template_parameters.
get_sub().empty())
1104 args.
get_sub().back().swap(a);
1115 args.
get_sub().back().swap(a);
1132 std::cout << std::string(__indent,
' ') <<
"Parser::rTempArgDeclaration 0\n";
1147 declaration.
set(ID_is_type,
true);
1148 declaration.
type()=
typet(
"cpp-template-type");
1158 bool has_ellipsis=
false;
1174 exprt name(ID_name);
1175 name.
set(ID_identifier, tk2.
data.
get(ID_C_base_name));
1177 cpp_name.
get_sub().push_back(name);
1211 std::cout << std::string(__indent,
' ') <<
"Parser::rTempArgDeclaration 1\n";
1218 typet template_type;
1249 std::cout << std::string(__indent,
' ')
1250 <<
"Parser::rTempArgDeclaration 2\n";
1254 declaration.
set(ID_is_type,
false);
1260 std::cout << std::string(__indent,
' ')
1261 <<
"Parser::rTempArgDeclaration 3\n";
1264 bool has_ellipsis=
false;
1281 std::cout << std::string(__indent,
' ')
1282 <<
"Parser::rTempArgDeclaration 4\n";
1369 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 0.1 token: " 1381 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 0.2\n";
1389 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 1\n";
1397 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 3\n";
1400 typet cv_q, integral;
1414 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 4\n";
1428 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 5\n";
1432 declaration, storage_spec, member_spec, integral, cv_q);
1439 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclaration 6 " << t
1455 typet cv_q, integral;
1481 integral.
swap(cv_q);
1520 std::cout << std::string(__indent,
' ')
1521 <<
"Parser::rIntegralDeclaration 1 token: " 1529 std::cout << std::string(__indent,
' ') <<
"Parser::rIntegralDeclaration 2\n";
1535 std::cout << std::string(__indent,
' ') <<
"Parser::rIntegralDeclaration 3\n";
1548 std::cout << std::string(__indent,
' ')
1549 <<
"Parser::rIntegralDeclaration 4\n";
1557 std::cout << std::string(__indent,
' ')
1558 <<
"Parser::rIntegralDeclaration 5\n";
1578 std::cout << std::string(__indent,
' ')
1579 <<
"Parser::rIntegralDeclaration 6 " 1587 std::cout << std::string(__indent,
' ')
1588 <<
"Parser::rIntegralDeclaration 7\n";
1594 std::cout << std::string(__indent,
' ')
1595 <<
"Parser::rIntegralDeclaration 8 " 1596 << declaration.
pretty() <<
'\n';
1604 std::cout << std::string(__indent,
' ')
1605 <<
"Parser::rIntegralDeclaration 9\n";
1615 std::cout << std::string(__indent,
' ')
1616 <<
"Parser::rIntegralDeclaration 10\n";
1632 std::cout << std::string(__indent,
' ') <<
"Parser::rConstDeclaration\n";
1659 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 1\n";
1662 if(!
rName(type_name))
1668 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 2\n";
1682 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 3\n";
1686 bool is_operator =
false;
1691 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 4\n";
1694 assert(!type_name.
get_sub().empty());
1696 for(
unsigned i=0; i < type_name.
get_sub().size(); i++)
1698 if(type_name.
get_sub()[i].id() == ID_operator)
1706 if(is_operator && is_constructor)
1709 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 5\n";
1713 typet type = type_name;
1717 typet trailing_return_type;
1719 conv_operator_declarator, type_name, trailing_return_type))
1722 type_name=
typet(
"cpp-cast-operator");
1724 declaration.
declarators().push_back(conv_operator_declarator);
1726 else if(cv_q.
is_nil() && is_constructor)
1729 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 6\n";
1732 assert(!type_name.
get_sub().empty());
1734 bool is_destructor=
false;
1743 typet trailing_return_type;
1745 constructor_declarator, type_name, trailing_return_type))
1749 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 7\n";
1754 type_name=trailing_return_type;
1756 type_name=
typet(is_destructor?ID_destructor:ID_constructor);
1758 declaration.
declarators().push_back(constructor_declarator);
1763 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 8\n";
1781 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 9\n";
1793 declaration.
type().
swap(type_name);
1798 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 10\n";
1804 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 11\n";
1813 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclaration 12\n";
1837 std::cout << std::string(__indent,
' ') <<
"Parser::isConstructorDecl " 1846 if(t==
'*' || t==
'&' || t==
'(')
1899 else if(v==
'\0' || v==
';' || v==
'}')
1903 else if(u==
'\0' || u==
';' || u==
'}')
1928 member_spec.
clear();
1943 default: assert(
false);
1980 default: assert(
false);
2009 p=
typet(ID_constexpr);
2021 p=
typet(ID_volatile);
2027 p=
typet(ID_restrict);
2175 std::cout << std::string(__indent,
' ')
2176 <<
"Parser::optIntegralTypeOrClassSpec 0\n";
2186 bool is_integral=
false;
2196 std::cout << std::string(__indent,
' ')
2197 <<
"Parser::optIntegralTypeOrClassSpec 1\n";
2204 case TOK_CHAR: type_id=ID_char;
break;
2207 case TOK_INT: type_id=ID_int;
break;
2208 case TOK_SHORT: type_id=ID_short;
break;
2209 case TOK_LONG: type_id=ID_long;
break;
2214 case TOK_FLOAT: type_id=ID_float;
break;
2216 case TOK_VOID: type_id=ID_void;
break;
2217 case TOK_INT8: type_id=ID_int8;
break;
2218 case TOK_INT16: type_id=ID_int16;
break;
2219 case TOK_INT32: type_id=ID_int32;
break;
2220 case TOK_INT64: type_id=ID_int64;
break;
2223 case TOK_BOOL: type_id=ID_bool;
break;
2228 if(!type_id.
empty())
2245 std::cout << std::string(__indent,
' ')
2246 <<
"Parser::optIntegralTypeOrClassSpec 2\n";
2253 std::cout << std::string(__indent,
' ')
2254 <<
"Parser::optIntegralTypeOrClassSpec 3\n";
2264 std::cout << std::string(__indent,
' ')
2265 <<
"Parser::optIntegralTypeOrClassSpec 4\n";
2272 std::cout << std::string(__indent,
' ')
2273 <<
"Parser::optIntegralTypeOrClassSpec 5\n";
2293 p.
add(ID_type_arg).
swap(tname);
2302 std::cout << std::string(__indent,
' ')
2303 <<
"Parser::optIntegralTypeOrClassSpec 6\n";
2311 std::cout << std::string(__indent,
' ')
2312 <<
"Parser::optIntegralTypeOrClassSpec 7\n";
2319 std::cout << std::string(__indent,
' ')
2320 <<
"Parser::optIntegralTypeOrClassSpec 8\n";
2323 p.
add(ID_expr_arg).
swap(expr);
2332 p=
typet(ID_decltype);
2348 p.
add(ID_expr_arg).
swap(expr);
2359 p=
typet(ID_msc_underlying_type);
2376 p.
add(ID_type_arg).
swap(tname);
2395 typet &trailing_return_type)
2399 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 0\n";
2406 constructor.
name().
swap(type_name);
2413 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 1\n";
2416 irept ¶meters=constructor.
type().
add(ID_parameters);
2426 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 2\n";
2429 typet &cv=
static_cast<typet &
>(constructor.
add(ID_method_qualifier));
2438 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 3\n";
2450 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 4\n";
2464 std::cout << std::string(__indent,
' ') <<
"Parser::rConstructorDecl 5\n";
2476 constructor.
value()=
codet(
"cpp-pure-virtual");
2580 bool should_be_declarator,
2591 declarators.push_back(declarator);
2609 bool should_be_declarator,
2622 typet bit_field_type(ID_c_bit_field);
2623 bit_field_type.
set(ID_size, e);
2636 should_be_declarator, is_statement))
2685 if(declarator.
type().
id()!=ID_function_type)
2701 typet bit_field_type(ID_c_bit_field);
2702 bit_field_type.
set(ID_size, e);
2709 dw.
swap(declarator);
2757 bool should_be_declarator,
2764 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 1\n";
2771 typet d_outer, d_inner;
2786 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 2\n";
2794 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 3\n";
2801 if(!
rDeclarator(declarator2, kind,
true,
true,
false))
2805 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 4\n";
2813 if(!should_be_declarator)
2818 if(t!=
'[' && t!=
'(')
2824 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 5\n";
2834 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 6\n";
2843 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 7\n";
2856 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 8\n";
2876 typet function_type(ID_function_type);
2878 function_type.
add(ID_parameters).
swap(args);
2882 d_outer.
swap(d_inner);
2888 init_args.
swap(args);
2893 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 9\n";
2902 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 10\n";
2918 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 11\n";
2936 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 12\n";
2951 std::list<typet> tl;
2952 tl.push_back(d_outer);
2953 while(tl.back().id() == ID_array)
2955 tl.push_back(tl.back().subtype());
2958 typet array_type(ID_array);
2959 array_type.
add(ID_size).
swap(expr);
2962 d_outer.
swap(array_type);
2965 tl.back().subtype().swap(d_outer);
2966 d_outer.
swap(tl.back());
2975 std::cout << std::string(__indent,
' ') <<
"Parser::rDeclarator2 13\n";
3001 std::cout << std::string(__indent,
' ') <<
"Parser::optPtrOperator 1\n";
3004 std::list<typet> t_list;
3011 std::cout << std::string(__indent,
' ') <<
"Parser::optPtrOperator 2 " 3028 t_list.push_back(cv);
3031 t_list.push_back(op);
3036 typet op(ID_block_pointer);
3047 t_list.push_back(cv);
3050 t_list.push_back(op);
3064 t_list.push_back(cv);
3067 t_list.push_back(op);
3080 typet op(ID_pointer);
3081 op.
set(ID_C_reference,
true);
3083 t_list.push_front(op);
3089 typet op(ID_pointer);
3090 op.
set(ID_C_rvalue_reference,
true);
3092 t_list.push_front(op);
3096 for(std::list<typet>::reverse_iterator
3101 if(it->id()==ID_merged_type)
3103 assert(!it->subtypes().empty());
3104 it->subtypes().back().subtype().swap(ptrs);
3108 assert(it->is_not_nil());
3109 it->subtype().swap(ptrs);
3129 init=
irept(ID_member_initializers);
3159 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 1\n";
3168 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 2\n";
3171 init=
codet(ID_member_initializer);
3172 init.
add(ID_member).
swap(name);
3182 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 3\n";
3201 std::cout << std::string(__indent,
' ') <<
"Parser::rMemberInit 4\n";
3241 std::cout << std::string(__indent,
' ') <<
"Parser::rName 0\n";
3251 name.
set(ID_typename,
true);
3261 std::cout << std::string(__indent,
' ') <<
"Parser::rName 1\n";
3269 std::cout << std::string(__indent,
' ') <<
"Parser::rName 2 " 3277 std::cout << std::string(__indent,
' ') <<
"Parser::rName 3\n";
3287 std::cout << std::string(__indent,
' ') <<
"Parser::rName 4\n";
3294 components.push_back(
irept(ID_template_args));
3295 components.back().
add(ID_arguments).
swap(args);
3305 std::cout << std::string(__indent,
' ') <<
"Parser::rName 5\n";
3308 components.push_back(
irept(ID_name));
3309 components.back().set(ID_identifier, tk.
data.
get(ID_C_base_name));
3322 std::cout << std::string(__indent,
' ') <<
"Parser::rName 6\n";
3325 components.push_back(
irept(
"::"));
3331 std::cout << std::string(__indent,
' ') <<
"Parser::rName 7\n";
3339 components.push_back(
irept(
"~"));
3345 std::cout << std::string(__indent,
' ') <<
"Parser::rName 8\n";
3349 components.push_back(
irept(ID_operator));
3352 components.push_back(
irept());
3405 operator_id=
irep_idt(std::string(static_cast<char>(t), 1));
3420 case TOK_EQ: operator_id=
"==";
break;
3421 case TOK_NE: operator_id=
"!=";
break;
3422 case TOK_LE: operator_id=
"<=";
break;
3423 case TOK_GE: operator_id=
">=";
break;
3425 case TOK_OROR: operator_id=
"||";
break;
3426 case TOK_INCR: operator_id=
"++";
break;
3427 case TOK_DECR: operator_id=
"--";
break;
3428 case TOK_DOTPM: operator_id=
".*";
break;
3430 case TOK_ARROW: operator_id=
"->";
break;
3444 name=
irept(t==
TOK_NEW?ID_cpp_new_array:ID_cpp_delete_array);
3471 assert(!operator_id.
empty());
3473 name=
irept(operator_id);
3487 typet cv1, cv2, type_name, ptr;
3502 if(!
rName(type_name))
3529 std::cout << std::string(__indent,
' ') <<
"Parser::rPtrToMember 0\n";
3532 irept ptm(ID_pointer);
3533 irept &name = ptm.
add(
"to-member");
3543 bool loop_cond =
true;
3563 components.push_back(
irept(ID_template_args));
3564 components.back().
add(ID_arguments).
swap(args);
3573 components.push_back(
irept(ID_name));
3574 components.back().set(ID_identifier, tk.
data.
get(ID_C_base_name));
3586 components.push_back(
irept(
"::"));
3593 ptr_to_mem.
swap(ptm);
3597 std::cout << std::string(__indent,
' ') <<
"Parser::rPtrToMember 1\n";
3628 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 0\n";
3639 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 1\n";
3651 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 2\n";
3660 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 3\n";
3675 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 4\n";
3687 exp.
id(
"ambiguous");
3689 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 4.1\n";
3701 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 4.2\n";
3708 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 5\n";
3726 std::cout << std::string(__indent,
' ') <<
"Parser::rTemplateArgs 6\n";
3730 template_args.
get_sub().back().swap(exp);
3833 list.
get_sub().back().swap(declaration);
3871 header=
typet(ID_register);
3887 declaration.
declarators().push_back(arg_declarator);
3917 expr.
id(ID_initializer_list);
4038 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 1\n";
4073 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 2\n";
4085 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 3\n";
4108 std::cout << std::string(__indent,
' ') <<
"Parser::rEnumSpec 4\n";
4180 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 1\n";
4189 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 2\n";
4194 spec=
typet(ID_struct);
4195 spec.
set(ID_C_class,
true);
4199 spec=
typet(ID_struct);
4200 spec.
set(ID_C_interface,
true);
4203 spec=
typet(ID_struct);
4205 spec=
typet(ID_union);
4212 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 3\n";
4219 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 4\n";
4234 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 5\n";
4254 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 6\n";
4266 std::cout << std::string(__indent,
' ') <<
"Parser::rClassSpec 7\n";
4269 ((
exprt&)spec.
add(ID_body)).operands().
swap(body.operands());
4290 irept base(ID_base);
4295 base.
set(ID_virtual,
true);
4304 base.
set(ID_protection, ID_public);
4308 base.
set(ID_protection, ID_protected);
4312 base.
set(ID_protection, ID_private);
4325 base.
set(ID_virtual,
true);
4339 bases.
get_sub().back().swap(base);
4357 std::cout << std::string(__indent,
' ') <<
"Parser::rClassBody 0\n";
4382 std::cout << std::string(__indent,
' ') <<
"Parser::rClassBody " 4383 << member.
pretty() <<
'\n';
4387 static_cast<exprt &>(static_cast<irept &>(member)));
4419 std::cout << std::string(__indent,
' ') <<
"Parser::rClassMember 0 " << t
4428 member.
id(
"cpp-public");
4432 member.
id(
"cpp-protected");
4436 member.
id(
"cpp-private");
4504 std::cout << std::string(__indent,
' ') <<
"Parser::rCommaExpression 0\n";
4511 std::cout << std::string(__indent,
' ') <<
"Parser::rCommaExpression 1\n";
4527 exp=
exprt(ID_comma);
4533 std::cout << std::string(__indent,
' ') <<
"Parser::rCommaExpression 2\n";
4549 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 0\n";
4556 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 1\n";
4570 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 2\n";
4578 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 3\n";
4584 exp=
exprt(ID_side_effect);
4587 exp.
set(ID_statement, ID_assign);
4589 exp.
set(ID_statement, ID_assign_plus);
4591 exp.
set(ID_statement, ID_assign_minus);
4593 exp.
set(ID_statement, ID_assign_mult);
4595 exp.
set(ID_statement, ID_assign_div);
4597 exp.
set(ID_statement, ID_assign_mod);
4599 exp.
set(ID_statement, ID_assign_shl);
4601 exp.
set(ID_statement, ID_assign_shr);
4603 exp.
set(ID_statement, ID_assign_bitand);
4605 exp.
set(ID_statement, ID_assign_bitxor);
4607 exp.
set(ID_statement, ID_assign_bitor);
4614 std::cout << std::string(__indent,
' ') <<
"Parser::rExpression 4\n";
4628 std::cout << std::string(__indent,
' ') <<
"Parser::rConditionalExpr 0\n";
4635 std::cout << std::string(__indent,
' ') <<
"Parser::rConditionalExpr 1\n";
4641 exprt then, otherwise;
4648 std::cout << std::string(__indent,
' ') <<
"Parser::rConditionalExpr 2\n";
4677 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalOrExpr 0\n";
4684 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalOrExpr 1\n";
4716 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalAndExpr 1\n";
4723 std::cout << std::string(__indent,
' ') <<
"Parser::rLogicalAndExpr 1\n";
4755 std::cout << std::string(__indent,
' ') <<
"Parser::rInclusiveOrExpr 0\n";
4762 std::cout << std::string(__indent,
' ') <<
"Parser::rInclusiveOrExpr 1\n";
4777 exp=
exprt(ID_bitor);
4794 std::cout << std::string(__indent,
' ') <<
"Parser::rExclusiveOrExpr 0\n";
4801 std::cout << std::string(__indent,
' ') <<
"Parser::rExclusiveOrExpr 1\n";
4810 if(!
rAndExpr(right, template_args))
4816 exp=
exprt(ID_bitxor);
4833 std::cout << std::string(__indent,
' ') <<
"Parser::rAndExpr 0\n";
4840 std::cout << std::string(__indent,
' ') <<
"Parser::rAndExpr 1\n";
4855 exp=
exprt(ID_bitand);
4872 std::cout << std::string(__indent,
' ') <<
"Parser::rEqualityExpr 0\n";
4879 std::cout << std::string(__indent,
' ') <<
"Parser::rEqualityExpr 1\n";
4912 std::cout << std::string(__indent,
' ') <<
"Parser::rRelationalExpr 0\n";
4919 std::cout << std::string(__indent,
' ') <<
"Parser::rRelationalExpr 1\n";
4925 (t==
TOK_LE || t==
TOK_GE || t==
'<' || (t==
'>' && !template_args)))
4941 case TOK_LE:
id=ID_le;
break;
4942 case TOK_GE:
id=ID_ge;
break;
4943 case '<':
id=ID_lt;
break;
4944 case '>':
id=ID_gt;
break;
4964 std::cout << std::string(__indent,
' ') <<
"Parser::rShiftExpr 0\n";
4971 std::cout << std::string(__indent,
' ') <<
"Parser::rShiftExpr 1\n";
5004 std::cout << std::string(__indent,
' ') <<
"Parser::rAdditiveExpr 0\n";
5011 std::cout << std::string(__indent,
' ') <<
"Parser::rAdditiveExpr 1\n";
5030 case '+':
id=ID_plus;
break;
5031 case '-':
id=ID_minus;
break;
5051 std::cout << std::string(__indent,
' ') <<
"Parser::rMultiplyExpr 0\n";
5058 std::cout << std::string(__indent,
' ') <<
"Parser::rMultiplyExpr 1\n";
5062 while(t=
lex.
LookAhead(0), (t==
'*' || t==
'/' || t==
'%'))
5077 case '*':
id=ID_mult;
break;
5078 case '/':
id=ID_div;
break;
5079 case '%':
id=ID_mod;
break;
5088 std::cout << std::string(__indent,
' ') <<
"Parser::rMultiplyExpr 2\n";
5104 std::cout << std::string(__indent,
' ') <<
"Parser::rPmExpr 0\n";
5111 std::cout << std::string(__indent,
' ') <<
"Parser::rPmExpr 1\n";
5127 exp=
exprt(
"pointer-to-member");
5133 std::cout << std::string(__indent,
' ') <<
"Parser::rPmExpr 2\n";
5148 std::cout << std::string(__indent,
' ') <<
"Parser::rCastExpr 0\n";
5164 std::cout << std::string(__indent,
' ') <<
"Parser::rCastExpr 1\n";
5185 exp=
exprt(
"explicit-typecast");
5208 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeName 0\n";
5217 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeName 1\n";
5231 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeName 2\n";
5246 std::cout << std::string(__indent,
' ')
5247 <<
"Parser::rTypeNameOrFunctionType 0\n";
5255 std::cout << std::string(__indent,
' ')
5256 <<
"Parser::rTypeNameOrFunctionType 1\n";
5268 std::cout << std::string(__indent,
' ')
5269 <<
"Parser::rTypeNameOrFunctionType 2\n";
5278 std::cout << std::string(__indent,
' ')
5279 <<
"Parser::rTypeNameOrFunctionType 3\n";
5293 std::cout << std::string(__indent,
' ')
5294 <<
"Parser::rTypeNameOrFunctionType 4\n";
5320 type.
set(ID_identifier, op.
data.
get(ID_C_base_name));
5331 type.
set(ID_identifier, op.
data.
get(ID_C_base_name));
5341 std::cout << std::string(__indent,
' ')
5342 <<
"Parser::rTypeNameOrFunctionType 5\n";
5361 parameter.
swap(parameter_declaration);
5384 std::cout << std::string(__indent,
' ')
5385 <<
"Parser::rTypeNameOrFunctionType 6\n";
5396 std::cout << std::string(__indent,
' ')
5397 <<
"Parser::rTypeNameOrFunctionType 7\n";
5407 std::cout << std::string(__indent,
' ')
5408 <<
"Parser::rTypeNameOrFunctionType 8\n";
5430 std::cout << std::string(__indent,
' ') <<
"Parser::rUnaryExpr 0\n";
5433 if(t==
'*' || t==
'&' || t==
'+' ||
5434 t==
'-' || t==
'!' || t==
'~' ||
5441 std::cout << std::string(__indent,
' ') <<
"Parser::rUnaryExpr 1\n";
5449 std::cout << std::string(__indent,
' ') <<
"Parser::rUnaryExpr 2\n";
5455 exp=
exprt(ID_dereference);
5459 exp=
exprt(ID_address_of);
5463 exp=
exprt(ID_unary_plus);
5467 exp=
exprt(ID_unary_minus);
5475 exp=
exprt(ID_bitnot);
5479 exp=
exprt(ID_side_effect);
5480 exp.
set(ID_statement, ID_preincrement);
5484 exp=
exprt(ID_side_effect);
5485 exp.
set(ID_statement, ID_predecrement);
5537 std::cout << std::string(__indent,
' ') <<
"Parser::rThrowExpr 0\n";
5548 if(t==
':' || t==
';')
5576 std::cout << std::string(__indent,
' ') <<
"Parser::rTypeidExpr 0\n";
5598 exp=
exprt(
"typeid");
5617 exp=
exprt(
"typeid");
5642 std::cout << std::string(__indent,
' ') <<
"Parser::rSizeofExpr 0\n";
5660 exp=
exprt(ID_sizeof);
5661 exp.
add(ID_type_arg).
swap(tname);
5682 exp=
exprt(ID_sizeof);
5683 exp.
add(ID_type_arg).
swap(tname);
5697 exp=
exprt(ID_sizeof);
5726 exp=
exprt(ID_alignof);
5727 exp.
add(ID_type_arg).
swap(tname);
5742 std::cout << std::string(__indent,
' ') <<
"Parser::rNoexceptExpr 0\n";
5760 exp=
exprt(ID_noexcept);
5793 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 0\n";
5804 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 1\n";
5810 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 2\n";
5824 exp=
exprt(ID_side_effect);
5825 exp.
set(ID_statement, ID_cpp_delete_array);
5829 exp=
exprt(ID_side_effect);
5830 exp.
set(ID_statement, ID_cpp_delete);
5845 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 3\n";
5848 exp=
exprt(ID_side_effect);
5849 exp.
set(ID_statement, ID_cpp_new);
5852 exprt arguments, initializer;
5858 std::cout << std::string(__indent,
' ') <<
"Parser::rAllocateExpr 4\n";
5861 exp.
add(ID_initializer).
swap(initializer);
5995 decl.
swap(array_type);
6066 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 0\n";
6073 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 1\n";
6090 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 2\n";
6100 exp=
exprt(ID_index);
6108 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 3\n";
6119 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 4\n";
6139 exprt tmp(ID_side_effect);
6141 tmp.
set(ID_statement, ID_postincrement);
6151 exprt tmp(ID_side_effect);
6153 tmp.
set(ID_statement, ID_postdecrement);
6164 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 5\n";
6171 std::cout << std::string(__indent,
' ') <<
"Parser::rPostfixExpr 6\n";
6179 exp=
exprt(ID_member);
6181 exp=
exprt(ID_ptrmember);
6187 exp.
add(ID_component_cpp_name).
swap(e);
6223 expr=
exprt(ID_msc_uuidof);
6224 expr.
add(ID_type_arg).
swap(tname);
6241 expr=
exprt(ID_msc_uuidof);
6288 ID_msc_if_not_exists);
6340 ID_msc_if_not_exists);
6365 typet tname1, tname2;
6376 expr.
add(ID_type_arg).
swap(tname1);
6390 expr.
add(
"type_arg1").
swap(tname1);
6391 expr.
add(
"type_arg2").
swap(tname2);
6424 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 0 " 6437 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 1\n";
6446 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 2\n";
6452 exp=
exprt(
"cpp-this");
6455 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 3\n";
6464 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 4\n";
6473 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 5\n";
6482 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 6\n";
6488 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 7\n";
6499 exp=
exprt(ID_side_effect);
6500 exp.
set(ID_statement, ID_statement_expression);
6515 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 8\n";
6525 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 9\n";
6531 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 10\n";
6541 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 11\n";
6547 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 12\n";
6556 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 13\n";
6562 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 14\n";
6571 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 15\n";
6584 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 16\n";
6594 exp=
exprt(
"explicit-constructor-call");
6610 exp=
exprt(
"explicit-constructor-call");
6634 std::cout << std::string(__indent,
' ') <<
"Parser::rPrimaryExpr 17\n";
6655 std::cout << std::string(__indent,
' ') <<
"Parser::rVarName 0\n";
6668 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 0\n";
6671 name=
exprt(ID_cpp_name);
6678 name.
set(ID_typename,
true);
6688 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 1\n";
6696 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 1.1 " 6706 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 2\n";
6716 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 3\n";
6720 components.push_back(
irept(ID_name));
6721 components.back().set(ID_identifier, tk.
data.
get(ID_C_base_name));
6730 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 4\n";
6740 components.push_back(
irept(ID_template_args));
6741 components.back().add(ID_arguments).swap(args);
6750 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 5\n";
6754 components.push_back(
irept(
"::"));
6760 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 6\n";
6768 components.push_back(
irept(
"~"));
6774 std::cout << std::string(__indent,
' ') <<
"Parser::rVarNameCore 7\n";
6779 components.push_back(
irept(ID_operator));
6787 components.push_back(op);
6821 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 0\n";
6830 if(u==
'\0' || u==
';' || u==
'}')
6843 std::cout << std::string(__indent,
' ')
6844 <<
"Parser::maybeTemplateArgs 1\n";
6850 std::cout << std::string(__indent,
' ')
6851 <<
"Parser::maybeTemplateArgs 2\n";
6866 std::cout << std::string(__indent,
' ')
6867 <<
"Parser::maybeTemplateArgs 3\n";
6874 else if(v==
'\0' || v==
';' || v==
'}')
6878 else if(u==
'\0' || u==
';' || u==
'}')
6884 std::cout << std::string(__indent,
' ')
6885 <<
"Parser::maybeTemplateArgs 4\n";
6890 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 5\n";
6896 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 6\n";
6904 std::cout << std::string(__indent,
' ') <<
"Parser::maybeTemplateArgs 7\n";
6935 declarator.
value()=body;
6951 declarator.
value()=body;
6969 std::cout << std::string(__indent,
' ') <<
"Parser::rCompoundStatement 1\n";
6976 std::cout << std::string(__indent,
' ') <<
"Parser::rCompoundStatement 2\n";
7033 std::cout << std::string(__indent,
' ') <<
"Parser::rStatement 0 " 7074 statement=
codet(ID_break);
7076 statement=
codet(ID_continue);
7087 std::cout << std::string(__indent,
' ') <<
"Parser::rStatement RETURN 0\n";
7092 statement=
codet(ID_return);
7098 std::cout << std::string(__indent,
' ')
7099 <<
"Parser::rStatement RETURN 1\n";
7106 std::cout << std::string(__indent,
' ')
7107 <<
"Parser::rStatement RETURN 2\n";
7116 std::cout << std::string(__indent,
' ')
7117 <<
"Parser::rStatement RETURN 3\n";
7131 statement=
codet(ID_goto);
7140 statement.
set(ID_destination, tk2.
data.
get(ID_C_base_name));
7162 statement=
codet(ID_gcc_switch_case_range);
7164 statement.
op0()=case_expr;
7165 statement.
op1()=range_end;
7175 statement.
op2().
swap(statement2);
7181 statement.
op0()=case_expr;
7190 statement.
op1().
swap(statement2);
7200 statement.
set(ID_default,
true);
7210 statement.
op1().
swap(statement2);
7229 statement=
codet(ID_label);
7231 statement.
set(ID_label, tk1.
data.
get(ID_C_base_name));
7250 statement=
codet(ID_decl);
7295 statement=
codet(ID_ifthenelse);
7324 statement.
op2().
swap(otherwise);
7343 statement=
codet(ID_switch);
7376 statement=
codet(ID_while);
7409 statement=
codet(ID_dowhile);
7449 statement=
codet(ID_for);
7514 statement=
codet(ID_try_catch);
7543 codet ellipsis(ID_ellipsis);
7557 if(declaration.
declarators().front().name().is_nil())
7559 irept name(ID_name);
7560 name.
set(ID_identifier,
"#anon");
7562 declaration.
declarators().front().name().get_sub().push_back(name);
7657 statement=
codet(
"msc_leave");
7669 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 1\n";
7677 statement=
codet(ID_asm);
7678 statement.
set(ID_flavor, ID_gcc);
7686 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 3\n";
7697 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 3\n";
7703 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 4\n";
7724 std::cout << std::string(__indent,
' ')
7725 <<
"Parser::rGCCAsmStatement 5\n";
7733 std::cout << std::string(__indent,
' ')
7734 <<
"Parser::rGCCAsmStatement 6\n";
7749 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 7\n";
7758 std::cout << std::string(__indent,
' ') <<
"Parser::rGCCAsmStatement 8\n";
7770 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 1\n";
7779 statement=
codet(ID_asm);
7780 statement.
set(ID_flavor, ID_msc);
7784 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 2\n";
7792 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 3\n";
7805 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 4\n";
7811 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 5\n";
7821 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 6\n";
7826 std::cout << std::string(__indent,
' ') <<
"Parser::rMSCAsmStatement 7\n";
7846 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 0\n";
7852 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 1\n";
7856 statement=
codet(ID_skip);
7863 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 2\n";
7871 std::cout << std::string(__indent,
' ') <<
"rDe " 7872 << statement.
pretty() <<
'\n';
7883 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 3\n";
7890 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 4\n";
7894 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 5 " 7902 std::cout << std::string(__indent,
' ') <<
"Parser::rExprStatement 6\n";
7905 statement=
codet(ID_expression);
7923 statement=
codet(ID_decl);
7955 typet cv_q, integral;
7960 std::cout << std::string(__indent,
' ')
7961 <<
"Parser::rDeclarationStatement 1\n";
7983 std::cout << std::string(__indent,
' ')
7984 <<
"Parser::rDeclarationStatement 2\n";
7994 std::cout << std::string(__indent,
' ')
7995 <<
"Parser::rDeclarationStatement 3 " << t <<
"\n";
8002 std::cout << std::string(__indent,
' ')
8003 <<
"Parser::rDeclarationStatement 4\n";
8006 statement=
codet(ID_decl);
8040 statement=
codet(ID_decl);
8052 statement=
codet(ID_decl);
8075 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 1\n";
8078 if(!
rName(type_name))
8082 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 2\n";
8089 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 3\n";
8095 declaration.
type().
swap(type_name);
8102 std::cout << std::string(__indent,
' ') <<
"Parser::rOtherDeclStatement 4\n";
8108 statement=
codet(ID_decl);
8127 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)
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)
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 &)
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
unsigned number_of_errors
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 &)
bool optPtrOperator(typet &)
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 &)
void copy_to_subtypes(const typet &type)
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()
const exprt & size() const
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)
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)
const parameterst & parameters() const
bool rGCCAsmStatement(codet &)
irept & member_initializers()
bool rAdditiveExpr(exprt &)
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
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)