success
};
-template <class C>
- const char* parse_type(const char* first, const char* last, C& db);
-template <class C>
- const char* parse_encoding(const char* first, const char* last, C& db);
-template <class C>
- const char* parse_name(const char* first, const char* last, C& db,
- bool* ends_with_template_args = 0);
-template <class C>
- const char* parse_expression(const char* first, const char* last, C& db);
-template <class C>
- const char* parse_template_args(const char* first, const char* last, C& db);
-template <class C>
- const char* parse_operator_name(const char* first, const char* last, C& db);
-template <class C>
- const char* parse_unqualified_name(const char* first, const char* last, C& db);
-template <class C>
- const char* parse_decltype(const char* first, const char* last, C& db);
template <std::size_t N>
class arena
{
{}
};
+
+const char* parse_type(const char* first, const char* last, Db& db);
+const char* parse_encoding(const char* first, const char* last, Db& db);
+const char* parse_name(const char* first, const char* last, Db& db,
+ bool* ends_with_template_args = 0);
+const char* parse_expression(const char* first, const char* last, Db& db);
+const char* parse_template_args(const char* first, const char* last, Db& db);
+const char* parse_operator_name(const char* first, const char* last, Db& db);
+const char* parse_unqualified_name(const char* first, const char* last, Db& db);
+const char* parse_decltype(const char* first, const char* last, Db& db);
+
template <class C>
void
print_stack(const C& db)
constexpr const char* float_data<long double>::spec;
-template <class Float, class C>
+template <class Float>
const char*
-parse_floating_number(const char* first, const char* last, C& db)
+parse_floating_number(const char* first, const char* last, Db& db)
{
const size_t N = float_data<Float>::mangled_size;
if (static_cast<std::size_t>(last - first) > N)
int n = snprintf(num, sizeof(num), float_data<Float>::spec, value);
if (static_cast<std::size_t>(n) >= sizeof(num))
return first;
- db.names.push_back(typename C::String(num, static_cast<std::size_t>(n)));
+ db.names.push_back(Db::String(num, static_cast<std::size_t>(n)));
first = t+1;
}
}
// <source-name> ::= <positive length number> <identifier>
-template <class C>
const char*
-parse_source_name(const char* first, const char* last, C& db)
+parse_source_name(const char* first, const char* last, Db& db)
{
if (first != last)
{
}
if (static_cast<size_t>(last - t) >= n)
{
- typename C::String r(t, n);
+ Db::String r(t, n);
if (r.substr(0, 10) == "_GLOBAL__N")
db.names.push_back("(anonymous namespace)");
else
// <substitution> ::= So # ::std::basic_ostream<char, std::char_traits<char> >
// <substitution> ::= Sd # ::std::basic_iostream<char, std::char_traits<char> >
-template <class C>
const char*
-parse_substitution(const char* first, const char* last, C& db)
+parse_substitution(const char* first, const char* last, Db& db)
{
if (last - first >= 2)
{
// ::= Dn # std::nullptr_t (i.e., decltype(nullptr))
// ::= u <source-name> # vendor extended type
-template <class C>
const char*
-parse_builtin_type(const char* first, const char* last, C& db)
+parse_builtin_type(const char* first, const char* last, Db& db)
{
if (first != last)
{
// <template-param> ::= T_ # first template parameter
// ::= T <parameter-2 non-negative number> _
-template <class C>
const char*
-parse_template_param(const char* first, const char* last, C& db)
+parse_template_param(const char* first, const char* last, Db& db)
{
if (last - first >= 2)
{
}
else
{
- db.names.push_back(typename C::String(first, t+1));
+ db.names.push_back(Db::String(first, t+1));
first = t+1;
db.fix_forward_references = true;
}
// cc <type> <expression> # const_cast<type> (expression)
-template <class C>
const char*
-parse_const_cast_expr(const char* first, const char* last, C& db)
+parse_const_cast_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 'c' && first[1] == 'c')
{
// dc <type> <expression> # dynamic_cast<type> (expression)
-template <class C>
const char*
-parse_dynamic_cast_expr(const char* first, const char* last, C& db)
+parse_dynamic_cast_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 'd' && first[1] == 'c')
{
// rc <type> <expression> # reinterpret_cast<type> (expression)
-template <class C>
const char*
-parse_reinterpret_cast_expr(const char* first, const char* last, C& db)
+parse_reinterpret_cast_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 'r' && first[1] == 'c')
{
// sc <type> <expression> # static_cast<type> (expression)
-template <class C>
const char*
-parse_static_cast_expr(const char* first, const char* last, C& db)
+parse_static_cast_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 's' && first[1] == 'c')
{
// sp <expression> # pack expansion
-template <class C>
const char*
-parse_pack_expansion(const char* first, const char* last, C& db)
+parse_pack_expansion(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 's' && first[1] == 'p')
{
// st <type> # sizeof (a type)
-template <class C>
const char*
-parse_sizeof_type_expr(const char* first, const char* last, C& db)
+parse_sizeof_type_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 's' && first[1] == 't')
{
// sz <expr> # sizeof (a expression)
-template <class C>
const char*
-parse_sizeof_expr_expr(const char* first, const char* last, C& db)
+parse_sizeof_expr_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 's' && first[1] == 'z')
{
// sZ <template-param> # size of a parameter pack
-template <class C>
const char*
-parse_sizeof_param_pack_expr(const char* first, const char* last, C& db)
+parse_sizeof_param_pack_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 's' && first[1] == 'Z' && first[2] == 'T')
{
size_t k1 = db.names.size();
if (t != first+2)
{
- typename C::String tmp("sizeof...(");
+ Db::String tmp("sizeof...(");
size_t k = k0;
if (k != k1)
{
// ::= fL <L-1 non-negative number> p <top-level CV-qualifiers> _ # L > 0, first parameter
// ::= fL <L-1 non-negative number> p <top-level CV-qualifiers> <parameter-2 non-negative number> _ # L > 0, second and later parameters
-template <class C>
const char*
-parse_function_param(const char* first, const char* last, C& db)
+parse_function_param(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && *first == 'f')
{
const char* t1 = parse_number(t, last);
if (t1 != last && *t1 == '_')
{
- db.names.push_back("fp" + typename C::String(t, t1));
+ db.names.push_back("fp" + Db::String(t, t1));
first = t1+1;
}
}
const char* t1 = parse_number(t, last);
if (t1 != last && *t1 == '_')
{
- db.names.push_back("fp" + typename C::String(t, t1));
+ db.names.push_back("fp" + Db::String(t, t1));
first = t1+1;
}
}
// sZ <function-param> # size of a function parameter pack
-template <class C>
const char*
-parse_sizeof_function_param_pack_expr(const char* first, const char* last, C& db)
+parse_sizeof_function_param_pack_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 's' && first[1] == 'Z' && first[2] == 'f')
{
// te <expression> # typeid (expression)
// ti <type> # typeid (type)
-template <class C>
const char*
-parse_typeid_expr(const char* first, const char* last, C& db)
+parse_typeid_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 't' && (first[1] == 'e' || first[1] == 'i'))
{
// tw <expression> # throw expression
-template <class C>
const char*
-parse_throw_expr(const char* first, const char* last, C& db)
+parse_throw_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 't' && first[1] == 'w')
{
// ds <expression> <expression> # expr.*expr
-template <class C>
const char*
-parse_dot_star_expr(const char* first, const char* last, C& db)
+parse_dot_star_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 'd' && first[1] == 's')
{
// <simple-id> ::= <source-name> [ <template-args> ]
-template <class C>
const char*
-parse_simple_id(const char* first, const char* last, C& db)
+parse_simple_id(const char* first, const char* last, Db& db)
{
if (first != last)
{
// ::= <decltype>
// ::= <substitution>
-template <class C>
const char*
-parse_unresolved_type(const char* first, const char* last, C& db)
+parse_unresolved_type(const char* first, const char* last, Db& db)
{
if (first != last)
{
size_t k1 = db.names.size();
if (t != first && k1 == k0 + 1)
{
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
first = t;
}
else
{
if (db.names.empty())
return first;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
first = t;
}
break;
if (db.names.empty())
return first;
db.names.back().first.insert(0, "std::");
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
first = t;
}
}
// <destructor-name> ::= <unresolved-type> # e.g., ~T or ~decltype(f())
// ::= <simple-id> # e.g., ~A<2*N>
-template <class C>
const char*
-parse_destructor_name(const char* first, const char* last, C& db)
+parse_destructor_name(const char* first, const char* last, Db& db)
{
if (first != last)
{
// ::= dn <destructor-name> # destructor or pseudo-destructor;
// # e.g. ~X or ~X<N-1>
-template <class C>
const char*
-parse_base_unresolved_name(const char* first, const char* last, C& db)
+parse_base_unresolved_name(const char* first, const char* last, Db& db)
{
if (last - first >= 2)
{
// <unresolved-qualifier-level> ::= <simple-id>
-template <class C>
const char*
-parse_unresolved_qualifier_level(const char* first, const char* last, C& db)
+parse_unresolved_qualifier_level(const char* first, const char* last, Db& db)
{
return parse_simple_id(first, last, db);
}
// # T::N::x /decltype(p)::N::x
// (ignored) ::= srN <unresolved-type> <unresolved-qualifier-level>+ E <base-unresolved-name>
-template <class C>
const char*
-parse_unresolved_name(const char* first, const char* last, C& db)
+parse_unresolved_name(const char* first, const char* last, Db& db)
{
if (last - first > 2)
{
// dt <expression> <unresolved-name> # expr.name
-template <class C>
const char*
-parse_dot_expr(const char* first, const char* last, C& db)
+parse_dot_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 'd' && first[1] == 't')
{
// cl <expression>+ E # call
-template <class C>
const char*
-parse_call_expr(const char* first, const char* last, C& db)
+parse_call_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 4 && first[0] == 'c' && first[1] == 'l')
{
if (db.names.empty())
return first;
db.names.back().first += db.names.back().second;
- db.names.back().second = typename C::String();
+ db.names.back().second = Db::String();
db.names.back().first.append("(");
bool first_expr = true;
while (*t != 'E')
// [gs] na <expression>* _ <type> <initializer> # new[] (expr-list) type (init)
// <initializer> ::= pi <expression>* E # parenthesized initialization
-template <class C>
const char*
-parse_new_expr(const char* first, const char* last, C& db)
+parse_new_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 4)
{
}
if (*t != 'E')
return first;
- typename C::String init_list;
+ Db::String init_list;
if (has_init)
{
if (db.names.empty())
return first;
auto type = db.names.back().move_full();
db.names.pop_back();
- typename C::String expr_list;
+ Db::String expr_list;
if (has_expr_list)
{
if (db.names.empty())
expr_list = db.names.back().move_full();
db.names.pop_back();
}
- typename C::String r;
+ Db::String r;
if (parsed_gs)
r = "::";
if (is_array)
// cv <type> <expression> # conversion with one argument
// cv <type> _ <expression>* E # conversion with a different number of arguments
-template <class C>
const char*
-parse_conversion_expr(const char* first, const char* last, C& db)
+parse_conversion_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 'c' && first[1] == 'v')
{
// pt <expression> <expression> # expr->name
-template <class C>
const char*
-parse_arrow_expr(const char* first, const char* last, C& db)
+parse_arrow_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 'p' && first[1] == 't')
{
// <function-type> ::= F [Y] <bare-function-type> [<ref-qualifier>] E
-template <class C>
const char*
-parse_function_type(const char* first, const char* last, C& db)
+parse_function_type(const char* first, const char* last, Db& db)
{
if (first != last && *first == 'F')
{
if (t1 != t)
{
t = t1;
- typename C::String sig("(");
+ Db::String sig("(");
int ref_qual = 0;
while (true)
{
// <pointer-to-member-type> ::= M <class type> <member type>
-template <class C>
const char*
-parse_pointer_to_member_type(const char* first, const char* last, C& db)
+parse_pointer_to_member_type(const char* first, const char* last, Db& db)
{
if (first != last && *first == 'M')
{
// <array-type> ::= A <positive dimension number> _ <element type>
// ::= A [<dimension expression>] _ <element type>
-template <class C>
const char*
-parse_array_type(const char* first, const char* last, C& db)
+parse_array_type(const char* first, const char* last, Db& db)
{
if (first != last && *first == 'A' && first+1 != last)
{
return first;
if (db.names.back().second.substr(0, 2) == " [")
db.names.back().second.erase(0, 1);
- db.names.back().second.insert(0, " [" + typename C::String(first+1, t) + "]");
+ db.names.back().second.insert(0, " [" + Db::String(first+1, t) + "]");
first = t2;
}
}
// <decltype> ::= Dt <expression> E # decltype of an id-expression or class member access (C++0x)
// ::= DT <expression> E # decltype of an expression (C++0x)
-template <class C>
const char*
-parse_decltype(const char* first, const char* last, C& db)
+parse_decltype(const char* first, const char* last, Db& db)
{
if (last - first >= 4 && first[0] == 'D')
{
// <extended element type> ::= <element type>
// ::= p # AltiVec vector pixel
-template <class C>
const char*
-parse_vector_type(const char* first, const char* last, C& db)
+parse_vector_type(const char* first, const char* last, Db& db)
{
if (last - first > 3 && first[0] == 'D' && first[1] == 'v')
{
{
if (db.names.empty())
return first;
- db.names.back().first += " vector[" + typename C::String(num, sz) + "]";
+ db.names.back().first += " vector[" + Db::String(num, sz) + "]";
first = t1;
}
}
else
{
++t;
- db.names.push_back("pixel vector[" + typename C::String(num, sz) + "]");
+ db.names.push_back("pixel vector[" + Db::String(num, sz) + "]");
first = t;
}
}
}
else
{
- typename C::String num;
+ Db::String num;
const char* t1 = first+2;
if (*t1 != '_')
{
// <objc-name> ::= <k0 number> objcproto <k1 number> <identifier> # k0 = 9 + <number of digits in k1> + k1
// <objc-type> := <source-name> # PU<11+>objcproto 11objc_object<source-name> 11objc_object -> id<source-name>
-template <class C>
const char*
-parse_type(const char* first, const char* last, C& db)
+parse_type(const char* first, const char* last, Db& db)
{
if (first != last)
{
if (db.names.empty())
return first;
first = t;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
}
break;
case 'C':
return first;
db.names.back().first.append(" complex");
first = t;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
}
break;
case 'F':
if (db.names.empty())
return first;
first = t;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
}
break;
case 'G':
return first;
db.names.back().first.append(" imaginary");
first = t;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
}
break;
case 'M':
if (db.names.empty())
return first;
first = t;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
}
break;
case 'O':
auto args = db.names.back().move_full();
db.names.pop_back();
db.names.back().first += std::move(args);
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
t = t1;
}
}
db.names.push_back(type + " " + proto);
}
}
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
first = t2;
}
}
{
if (db.names.empty())
return first;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
first = t;
}
}
db.names.pop_back();
db.names.back().first += template_args;
// Need to create substitution for <template-template-param> <template-args>
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
first = t;
}
}
{
if (db.names.empty())
return first;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
first = t;
return first;
}
{
if (db.names.empty())
return first;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
first = t;
return first;
}
{
if (db.names.empty())
return first;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
first = t;
}
}
// ::= rS # >>=
// ::= v <digit> <source-name> # vendor extended operator
-template <class C>
const char*
-parse_operator_name(const char* first, const char* last, C& db)
+parse_operator_name(const char* first, const char* last, Db& db)
{
if (last - first >= 2)
{
return first;
}
-template <class C>
const char*
-parse_integer_literal(const char* first, const char* last, const typename C::String& lit, C& db)
+parse_integer_literal(const char* first, const char* last, const Db::String& lit, Db& db)
{
const char* t = parse_number(first, last);
if (t != first && t != last && *t == 'E')
// ::= L <type> <real-part float> _ <imag-part float> E # complex floating point literal (C 2000)
// ::= L <mangled-name> E # external name
-template <class C>
const char*
-parse_expr_primary(const char* first, const char* last, C& db)
+parse_expr_primary(const char* first, const char* last, Db& db)
{
if (last - first >= 4 && *first == 'L')
{
{
if (db.names.empty())
return first;
- db.names.back() = "(" + db.names.back().move_full() + ")" + typename C::String(t, n);
+ db.names.back() = "(" + db.names.back().move_full() + ")" + Db::String(t, n);
first = n+1;
break;
}
// ::= D2 # base object destructor
// extension ::= D5 # ?
-template <class C>
const char*
-parse_ctor_dtor_name(const char* first, const char* last, C& db)
+parse_ctor_dtor_name(const char* first, const char* last, Db& db)
{
if (last-first >= 2 && !db.names.empty())
{
//
// <lambda-sig> ::= <parameter type>+ # Parameter types or "v" if the lambda has no parameters
-template <class C>
const char*
-parse_unnamed_type_name(const char* first, const char* last, C& db)
+parse_unnamed_type_name(const char* first, const char* last, Db& db)
{
if (last - first > 2 && first[0] == 'U')
{
{
case 't':
{
- db.names.push_back(typename C::String("'unnamed"));
+ db.names.push_back(Db::String("'unnamed"));
const char* t0 = first+2;
if (t0 == last)
{
case 'l':
{
size_t lambda_pos = db.names.size();
- db.names.push_back(typename C::String("'lambda'("));
+ db.names.push_back(Db::String("'lambda'("));
const char* t0 = first+2;
if (first[2] == 'v')
{
// inserted into the name table. Walk through the names,
// appending each onto the lambda's parameter list.
std::for_each(db.names.begin() + k0, db.names.begin() + k1,
- [&](typename C::sub_type::value_type &pair) {
+ [&](Db::sub_type::value_type &pair) {
if (pair.empty())
return;
auto &lambda = db.names[lambda_pos].first;
// ::= <source-name>
// ::= <unnamed-type-name>
-template <class C>
const char*
-parse_unqualified_name(const char* first, const char* last, C& db)
+parse_unqualified_name(const char* first, const char* last, Db& db)
{
if (first != last)
{
// ::= St <unqualified-name> # ::std::
// extension ::= StL<unqualified-name>
-template <class C>
const char*
-parse_unscoped_name(const char* first, const char* last, C& db)
+parse_unscoped_name(const char* first, const char* last, Db& db)
{
if (last - first >= 2)
{
// at <type> # alignof (a type)
-template <class C>
const char*
-parse_alignof_type(const char* first, const char* last, C& db)
+parse_alignof_type(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 'a' && first[1] == 't')
{
// az <expression> # alignof (a expression)
-template <class C>
const char*
-parse_alignof_expr(const char* first, const char* last, C& db)
+parse_alignof_expr(const char* first, const char* last, Db& db)
{
if (last - first >= 3 && first[0] == 'a' && first[1] == 'z')
{
return first;
}
-template <class C>
const char*
-parse_noexcept_expression(const char* first, const char* last, C& db)
+parse_noexcept_expression(const char* first, const char* last, Db& db)
{
const char* t1 = parse_expression(first, last, db);
if (t1 != first)
return first;
}
-template <class C>
const char*
-parse_prefix_expression(const char* first, const char* last, const typename C::String& op, C& db)
+parse_prefix_expression(const char* first, const char* last, const Db::String& op, Db& db)
{
const char* t1 = parse_expression(first, last, db);
if (t1 != first)
return first;
}
-template <class C>
const char*
-parse_binary_expression(const char* first, const char* last, const typename C::String& op, C& db)
+parse_binary_expression(const char* first, const char* last, const Db::String& op, Db& db)
{
const char* t1 = parse_expression(first, last, db);
if (t1 != first)
// # objectless nonstatic member reference
// ::= <expr-primary>
-template <class C>
const char*
-parse_expression(const char* first, const char* last, C& db)
+parse_expression(const char* first, const char* last, Db& db)
{
if (last - first >= 2)
{
{
if (db.names.empty())
return first;
- db.names.back().first = (parsed_gs ? typename C::String("::") : typename C::String()) +
+ db.names.back().first = (parsed_gs ? Db::String("::") : Db::String()) +
"delete[] " + db.names.back().move_full();
first = t1;
}
{
if (db.names.empty())
return first;
- db.names.back().first = (parsed_gs ? typename C::String("::") : typename C::String()) +
+ db.names.back().first = (parsed_gs ? Db::String("::") : Db::String()) +
"delete " + db.names.back().move_full();
first = t1;
}
// ::= J <template-arg>* E # argument pack
// ::= LZ <encoding> E # extension
-template <class C>
const char*
-parse_template_arg(const char* first, const char* last, C& db)
+parse_template_arg(const char* first, const char* last, Db& db)
{
if (first != last)
{
// <template-args> ::= I <template-arg>* E
// extension, the abi says <template-arg>+
-template <class C>
const char*
-parse_template_args(const char* first, const char* last, C& db)
+parse_template_args(const char* first, const char* last, Db& db)
{
if (last - first >= 2 && *first == 'I')
{
if (db.tag_templates)
db.template_param.back().clear();
const char* t = first+1;
- typename C::String args("<");
+ Db::String args("<");
while (*t != 'E')
{
if (db.tag_templates)
// ::= <template-param>
// ::= <substitution>
-template <class C>
const char*
-parse_nested_name(const char* first, const char* last, C& db,
+parse_nested_name(const char* first, const char* last, Db& db,
bool* ends_with_template_args)
{
if (first != last && *first == 'N')
if (!db.names.back().first.empty())
{
db.names.back().first += "::" + name;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
}
else
db.names.back().first = name;
db.names.back().first += "::" + name;
else
db.names.back().first = name;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
pop_subs = true;
t0 = t1;
}
db.names.back().first += "::" + name;
else
db.names.back().first = name;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
pop_subs = true;
t0 = t1;
}
if (db.names.empty())
return first;
db.names.back().first += name;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
t0 = t1;
component_ends_with_template_args = true;
}
db.names.back().first += "::" + name;
else
db.names.back().first = name;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
pop_subs = true;
t0 = t1;
}
// := Z <function encoding> E s [<discriminator>]
// := Z <function encoding> Ed [ <parameter number> ] _ <entity name>
-template <class C>
const char*
-parse_local_name(const char* first, const char* last, C& db,
+parse_local_name(const char* first, const char* last, Db& db,
bool* ends_with_template_args)
{
if (first != last && *first == 'Z')
// <unscoped-template-name> ::= <unscoped-name>
// ::= <substitution>
-template <class C>
const char*
-parse_name(const char* first, const char* last, C& db,
+parse_name(const char* first, const char* last, Db& db,
bool* ends_with_template_args)
{
if (last - first >= 2)
{
if (db.names.empty())
return first;
- db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
+ db.subs.push_back(Db::sub_type(1, db.names.back(), db.names.get_allocator()));
t0 = t1;
t1 = parse_template_args(t0, last, db);
if (t1 != t0)
// extension ::= TC <first type> <number> _ <second type> # construction vtable for second-in-first
// extension ::= GR <object name> # reference temporary for object
-template <class C>
const char*
-parse_special_name(const char* first, const char* last, C& db)
+parse_special_name(const char* first, const char* last, Db& db)
{
if (last - first > 2)
{
// ::= <data name>
// ::= <special-name>
-template <class C>
const char*
-parse_encoding(const char* first, const char* last, C& db)
+parse_encoding(const char* first, const char* last, Db& db)
{
if (first != last)
{
save_value<bool> sb2(db.tag_templates);
db.tag_templates = false;
const char* t2;
- typename C::String ret2;
+ Db::String ret2;
if (db.names.empty())
return first;
- const typename C::String& nm = db.names.back().first;
+ const Db::String& nm = db.names.back().first;
if (nm.empty())
return first;
if (!db.parsed_ctor_dtor_cv && ends_with_template_args)
break;
if (k1 > k0)
{
- typename C::String tmp;
+ Db::String tmp;
for (size_t k = k0; k < k1; ++k)
{
if (!tmp.empty())
// _block_invoke<decimal-digit>+
// _block_invoke_<decimal-digit>+
-template <class C>
const char*
-parse_block_invoke(const char* first, const char* last, C& db)
+parse_block_invoke(const char* first, const char* last, Db& db)
{
if (last - first >= 13)
{
// extension
// <dot-suffix> := .<anything and everything>
-template <class C>
const char*
-parse_dot_suffix(const char* first, const char* last, C& db)
+parse_dot_suffix(const char* first, const char* last, Db& db)
{
if (first != last && *first == '.')
{
if (db.names.empty())
return first;
- db.names.back().first += " (" + typename C::String(first, last) + ")";
+ db.names.back().first += " (" + Db::String(first, last) + ")";
first = last;
}
return first;
// <mangled-name> ::= _Z<encoding>
// ::= <type>
-template <class C>
void
-demangle(const char* first, const char* last, C& db, int& status)
+demangle(const char* first, const char* last, Db& db, int& status)
{
if (first >= last)
{