25#include "gdbsupport/gdb_obstack.h"
26#include "gdbsupport/gdb_regex.h"
29#include "gdbsupport/selftest.h"
49 "[0-9][0-9_]*\\.[0-9][0-9_]*([eE][-+]?[0-9][0-9_]*)?(f32|f64)?"
57 "[0-9][0-9_]*[eE][-+]?[0-9][0-9_]*(f32|f64)?"
71 "(0x[a-fA-F0-9_]+|0o[0-7_]+|0b[01_]+|[0-9][0-9_]*)"
72 "([iu](size|8|16|32|64))?"
76#define NUM_SUBEXPRESSIONS 8
154 {
"as",
KW_AS, OP_NULL },
156 {
"if", 0, OP_NULL },
157 {
"mut",
KW_MUT, OP_NULL },
163 {
"fn",
KW_FN, OP_NULL },
174 {
"<<",
LSH, OP_NULL },
175 {
">>",
RSH, OP_NULL },
176 {
"&&",
ANDAND, OP_NULL },
177 {
"||",
OROR, OP_NULL },
178 {
"==",
EQEQ, OP_NULL },
179 {
"!=",
NOTEQ, OP_NULL },
180 {
"<=",
LTEQ, OP_NULL },
181 {
">=",
GTEQ, OP_NULL },
193 {
"..",
DOTDOT, OP_NULL },
194 {
"->",
ARROW, OP_NULL }
230 error (_(
"Could not find Rust type %s"),
name);
235 std::string
super_name (
const std::string &ident,
unsigned int n_supers);
241 uint32_t
lex_hex (
int min,
int max);
266 error (_(
"'%c' expected"),
type);
315 void reset (
const char *input)
323 current_string_val = {};
365 error (_(
"Could not find crate for current location"));
366 return "::" + crate +
"::" +
name;
379 if (scope[0] ==
'\0')
380 error (_(
"Couldn't find namespace scope for self::"));
385 std::vector<int> offsets;
386 unsigned int current_len;
389 while (scope[current_len] !=
'\0')
391 offsets.push_back (current_len);
392 gdb_assert (scope[current_len] ==
':');
399 len = offsets.size ();
401 error (_(
"Too many super:: uses from '%s'"), scope);
403 offset = offsets[len - n_supers];
406 offset = strlen (scope);
408 return "::" + std::string (scope, offset) +
"::" + ident;
419 if (startswith (*
name,
"::"))
431 const domain_enum domain)
438 if (result.
symbol != NULL)
439 update_innermost_block (result);
455 if (result.
symbol != NULL)
487 int check_max = min == max;
489 while ((check_max ? len <= max : 1)
506 error (_(
"Not enough hex digits seen"));
509 gdb_assert (min != max);
510 error (_(
"Overlong hex escape"));
535 error (_(
"Unicode escape in byte literal"));
538 error (_(
"Missing '{' in Unicode escape"));
543 error (_(
"Missing '}' in Unicode escape"));
577 error (_(
"Invalid escape \\%c in literal"),
pstate->
lexptr[0]);
592 gdb_assert (text[0] !=
'\'');
593 for (quote = 1; text[quote] !=
'\0' && text[quote] !=
'\''; ++quote)
597 if (text[quote] ==
'\0')
602 (
const gdb_byte *) text,
605 int size = obstack_object_size (&result);
607 error (_(
"overlong character literal"));
609 memcpy (&
value, obstack_finish (&result),
size);
629 error (_(
"empty character literal"));
640 error (_(
"Unterminated character literal"));
655 const char *save = str;
660 while (str[0] ==
'#')
675 gdb_assert (str[0] ==
'"');
676 for (i = 0; i < n; ++i)
677 if (str[i + 1] !=
'#')
711 error (_(
"Unexpected EOF in string"));
714 if (is_byte &&
value > 127)
715 error (_(
"Non-ASCII value in raw byte string"));
739 error (_(
"Unexpected EOF in string"));
743 if (is_byte &&
value > 127)
744 error (_(
"Non-ASCII value in byte string"));
760 const char *p = string;
762 while (p[0] ==
' ' || p[0] ==
'\t')
767 return *p >=
'0' && *p <=
'9';
775 return ((c >=
'a' && c <=
'z')
776 || (c >=
'A' && c <=
'Z')
824 if (length == strlen (candidate.name)
825 && strncmp (candidate.name, start, length) == 0)
835 if (
token->value == 0)
842 else if (
token == NULL
844 && (strncmp (start,
"thread", length) == 0
845 || strncmp (start,
"task", length) == 0)
884 strlen (candidate.name)) == 0)
909 int could_be_decimal = 1;
910 int implicit_i32 = 0;
911 const char *type_name = NULL;
920 gdb_assert (match == 0);
926 end_index = subexps[
INT_TEXT].rm_eo;
935 could_be_decimal = 0;
953 end_index = subexps[0].rm_eo;
961 gdb_assert (subexps[0].rm_eo > 0);
964 const char *next = skip_spaces (&
pstate->
lexptr[subexps[0].rm_eo]);
970 end_index = subexps[0].rm_eo;
972 could_be_decimal = 1;
978 std::string type_name_holder;
979 if (type_name == NULL)
981 gdb_assert (type_index != -1);
983 + subexps[type_index].rm_so),
984 (subexps[type_index].rm_eo
985 - subexps[type_index].rm_so));
986 type_name = type_name_holder.c_str ();
997 could_be_decimal = 0;
1012 if (number[0] ==
'0')
1014 if (number[1] ==
'x')
1016 else if (number[1] ==
'o')
1018 else if (number[1] ==
'b')
1023 could_be_decimal = 0;
1027 const char *trailer;
1028 value = strtoulst (number.c_str () + offset, &trailer, radix);
1029 if (*trailer !=
'\0')
1030 error (_(
"Integer literal is too large"));
1031 if (implicit_i32 &&
value >= ((uint64_t) 1) << 31)
1040 bool parsed =
parse_float (number.c_str (), number.length (),
1043 gdb_assert (parsed);
1136 return make_operation<long_const_operation> (unit, 0);
1144 return make_operation<rust_parenthesized_operation> (std::move (
expr));
1147 std::vector<operation_up> ops;
1148 ops.push_back (std::move (
expr));
1152 error (_(
"',' or ')' expected"));
1162 error (_(
"Tuple expressions not supported yet"));
1181 result = make_operation<rust_array_operation> (std::move (
expr),
1186 std::vector<operation_up> ops;
1187 ops.push_back (std::move (
expr));
1191 error (_(
"',' or ']' expected"));
1195 ops.shrink_to_fit ();
1196 int len = ops.size () - 1;
1197 result = make_operation<array_operation> (0, len, std::move (ops));
1200 error (_(
"',', ';', or ']' expected"));
1216 return make_operation<var_value_operation> (sym);
1220 if (sym.
symbol !=
nullptr)
1225 if (
type ==
nullptr)
1227 if (
type ==
nullptr)
1228 error (_(
"No symbol '%s' in current context"),
name.c_str ());
1237 return make_operation<type_operation> (
type);
1247 if (
type->
code () != TYPE_CODE_STRUCT
1250 error (_(
"Struct expression applied to non-struct type"));
1252 std::vector<std::pair<std::string, operation_up>> field_v;
1256 error (_(
"'}', '..', or identifier expected"));
1270 field_v.emplace_back (std::move (
name), std::move (
expr));
1286 return make_operation<rust_aggregate_operation> (
type,
1288 std::move (field_v));
1299 op (
std::move (op_))
1327 OPERATION ('*', 10, mul_operation) \
1328 OPERATION ('/', 10, div_operation) \
1329 OPERATION ('%', 10, rem_operation) \
1330 OPERATION ('@', 9, repeat_operation) \
1331 OPERATION ('+', 8, add_operation) \
1332 OPERATION ('-', 8, sub_operation) \
1333 OPERATION (LSH, 7, lsh_operation) \
1334 OPERATION (RSH, 7, rsh_operation) \
1335 OPERATION ('&', 6, bitwise_and_operation) \
1336 OPERATION ('^', 5, bitwise_xor_operation) \
1337 OPERATION ('|', 4, bitwise_ior_operation) \
1338 OPERATION (EQEQ, 3, equal_operation) \
1339 OPERATION (NOTEQ, 3, notequal_operation) \
1340 OPERATION ('<', 3, less_operation) \
1341 OPERATION (LTEQ, 3, leq_operation) \
1342 OPERATION ('>', 3, gtr_operation) \
1343 OPERATION (GTEQ, 3, geq_operation) \
1344 OPERATION (ANDAND, 2, logical_and_operation) \
1345 OPERATION (OROR, 1, logical_or_operation)
1347#define ASSIGN_PREC 0
1350 if (start ==
nullptr)
1352 gdb_assert (!required);
1356 std::vector<rustop_item> operator_stack;
1357 operator_stack.emplace_back (0, -1, OP_NULL, std::move (start));
1362 enum exp_opcode compound_assign_op = OP_NULL;
1363 int precedence = -2;
1367#define OPERATION(TOKEN, PRECEDENCE, TYPE) \
1369 precedence = PRECEDENCE; \
1391 lhs.
op = make_operation<unop_cast_operation> (std::move (lhs.
op),
1406 ? precedence < operator_stack.back ().precedence
1407 : precedence <= operator_stack.back ().precedence)
1408 && operator_stack.size () > 1)
1410 rustop_item rhs = std::move (operator_stack.back ());
1411 operator_stack.pop_back ();
1417#define OPERATION(TOKEN, PRECEDENCE, TYPE) \
1419 lhs.op = make_operation<TYPE> (std::move (lhs.op), \
1420 std::move (rhs.op)); \
1430 if (rhs.
token ==
'=')
1431 lhs.
op = (make_operation<assign_operation>
1432 (std::move (lhs.
op), std::move (rhs.
op)));
1434 lhs.
op = (make_operation<assign_modify_operation>
1436 std::move (rhs.
op)));
1441 lhs.
op = (make_operation<comma_operation>
1442 (std::move (lhs.
op), std::move (nil)));
1447 gdb_assert_not_reached (
"bad binary operator");
1451 if (precedence == -2)
1454 operator_stack.emplace_back (this_token, precedence, compound_assign_op,
1458 gdb_assert (operator_stack.size () == 1);
1459 return std::move (operator_stack[0].op);
1475 kind &= ~RANGE_LOW_BOUND_DEFAULT;
1488 kind &= ~RANGE_HIGH_BOUND_DEFAULT;
1490 return make_operation<rust_range_operation> (kind,
1526 return make_operation<rust_unop_addr_operation> (
parse_atom (
true));
1550 error (_(
"not really an error"));
1552 result.reset (struct_op);
1563 error (_(
"'_' not allowed in integers in anonymous field references"));
1566 error (_(
"field name expected"));
1581 return make_operation<rust_subscript_operation> (std::move (lhs),
1587std::vector<operation_up>
1592 std::vector<operation_up> args;
1598 error (_(
"',' or ')' expected"));
1617 return make_operation<funcall_operation> (std::move (lhs),
1623std::vector<struct type *>
1626 std::vector<struct type *> result;
1638std::vector<struct type *>
1642 std::vector<struct type *> types;
1659 error (_(
"integer expected"));
1713 error (_(
"'(' expected"));
1718 error (_(
"'->' expected"));
1723 struct type **argtypes =
nullptr;
1724 if (!types.empty ())
1725 argtypes = types.data ();
1741 obstack_1grow (&
obstack,
'(');
1742 for (
int i = 0; i < types.size (); ++i)
1747 obstack_1grow (&
obstack,
',');
1748 obstack_grow_str (&
obstack, type_name.c_str ());
1751 obstack_grow_str0 (&
obstack,
")");
1752 const char *
name = (
const char *) obstack_finish (&
obstack);
1757 if (result ==
nullptr)
1758 error (_(
"could not find tuple type '%s'"),
name);
1788 if (result ==
nullptr)
1789 error (_(
"No type name '%s' in current context"), path.c_str ());
1793 error (_(
"type expected"));
1802 unsigned n_supers = 0;
1819 error (_(
"'::' expected"));
1837 error (_(
"identifier expected"));
1839 bool saw_ident =
true;
1860 error (_(
"unexpected '::'"));
1893 error (_(
"'>' expected"));
1896 for (
int i = 0; i < types.size (); ++i)
1906 switch (first_token)
1922 gdb_assert_not_reached (
"missing case in path parsing");
1935 if (
type ==
nullptr)
1936 error (_(
"Could not find type '&str'"));
1938 std::vector<std::pair<std::string, operation_up>> field_v;
1943 = make_operation<rust_unop_addr_operation> (std::move (str));
1944 field_v.emplace_back (
"data_ptr", std::move (addr));
1947 operation_up lenop = make_operation<long_const_operation> (valtype, len);
1948 field_v.emplace_back (
"length", std::move (lenop));
1950 return make_operation<rust_aggregate_operation> (
type,
1952 std::move (field_v));
1962 std::vector<std::pair<std::string, operation_up>> field_v (args.size ());
1963 for (
int i = 0; i < args.size (); ++i)
1964 field_v[i] = { string_printf (
"__%d", i), std::move (args[i]) };
1966 return (make_operation<rust_aggregate_operation>
1980 if (
type ==
nullptr)
1981 error (_(
"Could not find type '%s'"), path.c_str ());
1990 if (
type !=
nullptr)
1993 error (_(
"Type %s is not a tuple struct"), path.c_str ());
2039 result = make_operation<string_operation> (
get_string ());
2068 result = make_operation<rust_unop_ind_operation> (
parse_atom (
true));
2072 result = make_operation<unary_plus_operation> (
parse_atom (
true));
2076 result = make_operation<unary_neg_operation> (
parse_atom (
true));
2080 result = make_operation<rust_unop_compl_operation> (
parse_atom (
true));
2092 error (_(
"unexpected token"));
2130 result =
parser.parse_entry_point ();
2132 catch (
const gdb_exception &exc)
2136 result = std::move (
parser.completion_op);
2137 if (result ==
nullptr)
2156rust_lex_test_one (
rust_parser *parser,
const char *input,
int expected)
2160 parser->reset (input);
2163 SELF_CHECK (
token == expected);
2168 SELF_CHECK (
token == 0);
2175rust_lex_int_test (
rust_parser *parser,
const char *input,
2176 ULONGEST
value,
int kind)
2178 rust_lex_test_one (parser, input, kind);
2185rust_lex_exception_test (
rust_parser *parser,
const char *input,
2194 catch (
const gdb_exception_error &except)
2196 SELF_CHECK (strcmp (
except.what (),
err) == 0);
2204rust_lex_stringish_test (
rust_parser *parser,
const char *input,
2205 const char *
value,
int kind)
2207 rust_lex_test_one (parser, input, kind);
2214rust_lex_test_sequence (
rust_parser *parser,
const char *input,
int len,
2215 const int expected[])
2219 parser->reset (input);
2221 for (i = 0; i < len; ++i)
2224 SELF_CHECK (
token == expected[i]);
2234 const int expected2[] = {
INTEGER,
'.',
IDENT,
'(',
')', 0 };
2235 const int expected3[] = {
FLOAT,
EQEQ,
'(',
')', 0 };
2238 rust_lex_test_sequence (parser,
"23.g()", ARRAY_SIZE (expected1), expected1);
2239 rust_lex_test_sequence (parser,
"23_0.g()", ARRAY_SIZE (expected2),
2241 rust_lex_test_sequence (parser,
"23.==()", ARRAY_SIZE (expected3),
2243 rust_lex_test_sequence (parser,
"23..25", ARRAY_SIZE (expected4), expected4);
2255 rust_lex_test_sequence (parser,
"something.wha", ARRAY_SIZE (expected),
2257 rust_lex_test_sequence (parser,
"something.", ARRAY_SIZE (expected),
2270 parser->reset (
">>=");
2279 SELF_CHECK (
token ==
'=');
2282 SELF_CHECK (
token == 0);
2288rust_lex_tests (
void)
2292 nullptr, 0, 0, nullptr, 0, nullptr, false);
2295 rust_lex_test_one (&parser,
"", 0);
2296 rust_lex_test_one (&parser,
" \t \n \r ", 0);
2297 rust_lex_test_one (&parser,
"thread 23", 0);
2298 rust_lex_test_one (&parser,
"task 23", 0);
2299 rust_lex_test_one (&parser,
"th 104", 0);
2300 rust_lex_test_one (&parser,
"ta 97", 0);
2302 rust_lex_int_test (&parser,
"'z'",
'z',
INTEGER);
2303 rust_lex_int_test (&parser,
"'\\xff'", 0xff,
INTEGER);
2304 rust_lex_int_test (&parser,
"'\\u{1016f}'", 0x1016f,
INTEGER);
2305 rust_lex_int_test (&parser,
"b'z'",
'z',
INTEGER);
2306 rust_lex_int_test (&parser,
"b'\\xfe'", 0xfe,
INTEGER);
2307 rust_lex_int_test (&parser,
"b'\\xFE'", 0xfe,
INTEGER);
2308 rust_lex_int_test (&parser,
"b'\\xfE'", 0xfe,
INTEGER);
2311 rust_lex_int_test (&parser,
"'\\n'",
'\n',
INTEGER);
2312 rust_lex_int_test (&parser,
"'\\r'",
'\r',
INTEGER);
2313 rust_lex_int_test (&parser,
"'\\t'",
'\t',
INTEGER);
2314 rust_lex_int_test (&parser,
"'\\\\'",
'\\',
INTEGER);
2315 rust_lex_int_test (&parser,
"'\\0'",
'\0',
INTEGER);
2316 rust_lex_int_test (&parser,
"'\\''",
'\'',
INTEGER);
2317 rust_lex_int_test (&parser,
"'\\\"'",
'"',
INTEGER);
2319 rust_lex_int_test (&parser,
"b'\\n'",
'\n',
INTEGER);
2320 rust_lex_int_test (&parser,
"b'\\r'",
'\r',
INTEGER);
2321 rust_lex_int_test (&parser,
"b'\\t'",
'\t',
INTEGER);
2322 rust_lex_int_test (&parser,
"b'\\\\'",
'\\',
INTEGER);
2323 rust_lex_int_test (&parser,
"b'\\0'",
'\0',
INTEGER);
2324 rust_lex_int_test (&parser,
"b'\\''",
'\'',
INTEGER);
2325 rust_lex_int_test (&parser,
"b'\\\"'",
'"',
INTEGER);
2327 rust_lex_exception_test (&parser,
"'z",
"Unterminated character literal");
2328 rust_lex_exception_test (&parser,
"b'\\x0'",
"Not enough hex digits seen");
2329 rust_lex_exception_test (&parser,
"b'\\u{0}'",
2330 "Unicode escape in byte literal");
2331 rust_lex_exception_test (&parser,
"'\\x0'",
"Not enough hex digits seen");
2332 rust_lex_exception_test (&parser,
"'\\u0'",
"Missing '{' in Unicode escape");
2333 rust_lex_exception_test (&parser,
"'\\u{0",
"Missing '}' in Unicode escape");
2334 rust_lex_exception_test (&parser,
"'\\u{0000007}",
"Overlong hex escape");
2335 rust_lex_exception_test (&parser,
"'\\u{}",
"Not enough hex digits seen");
2336 rust_lex_exception_test (&parser,
"'\\Q'",
"Invalid escape \\Q in literal");
2337 rust_lex_exception_test (&parser,
"b'\\Q'",
"Invalid escape \\Q in literal");
2340 rust_lex_int_test (&parser,
"2_344__29", 234429,
INTEGER);
2341 rust_lex_int_test (&parser,
"0x1f", 0x1f,
INTEGER);
2342 rust_lex_int_test (&parser,
"23usize", 23,
INTEGER);
2343 rust_lex_int_test (&parser,
"23i32", 23,
INTEGER);
2344 rust_lex_int_test (&parser,
"0x1_f", 0x1f,
INTEGER);
2345 rust_lex_int_test (&parser,
"0b1_101011__", 0x6b,
INTEGER);
2346 rust_lex_int_test (&parser,
"0o001177i64", 639,
INTEGER);
2347 rust_lex_int_test (&parser,
"0x123456789u64", 0x123456789ull,
INTEGER);
2349 rust_lex_test_trailing_dot (&parser);
2351 rust_lex_test_one (&parser,
"23.",
FLOAT);
2352 rust_lex_test_one (&parser,
"23.99f32",
FLOAT);
2353 rust_lex_test_one (&parser,
"23e7",
FLOAT);
2354 rust_lex_test_one (&parser,
"23E-7",
FLOAT);
2355 rust_lex_test_one (&parser,
"23e+7",
FLOAT);
2356 rust_lex_test_one (&parser,
"23.99e+7f64",
FLOAT);
2357 rust_lex_test_one (&parser,
"23.82f32",
FLOAT);
2359 rust_lex_stringish_test (&parser,
"hibob",
"hibob",
IDENT);
2360 rust_lex_stringish_test (&parser,
"hibob__93",
"hibob__93",
IDENT);
2361 rust_lex_stringish_test (&parser,
"thread",
"thread",
IDENT);
2362 rust_lex_stringish_test (&parser,
"r#true",
"true",
IDENT);
2365 rust_lex_test_sequence (&parser,
"r#thread 23", ARRAY_SIZE (expected1),
2367 const int expected2[] = {
IDENT,
'#', 0 };
2368 rust_lex_test_sequence (&parser,
"r#", ARRAY_SIZE (expected2), expected2);
2370 rust_lex_stringish_test (&parser,
"\"string\"",
"string",
STRING);
2371 rust_lex_stringish_test (&parser,
"\"str\\ting\"",
"str\ting",
STRING);
2372 rust_lex_stringish_test (&parser,
"\"str\\\"ing\"",
"str\"ing",
STRING);
2373 rust_lex_stringish_test (&parser,
"r\"str\\ing\"",
"str\\ing",
STRING);
2374 rust_lex_stringish_test (&parser,
"r#\"str\\ting\"#",
"str\\ting",
STRING);
2375 rust_lex_stringish_test (&parser,
"r###\"str\\\"ing\"###",
"str\\\"ing",
2378 rust_lex_stringish_test (&parser,
"b\"string\"",
"string",
BYTESTRING);
2379 rust_lex_stringish_test (&parser,
"b\"\x73tring\"",
"string",
BYTESTRING);
2380 rust_lex_stringish_test (&parser,
"b\"str\\\"ing\"",
"str\"ing",
BYTESTRING);
2381 rust_lex_stringish_test (&parser,
"br####\"\\x73tring\"####",
"\\x73tring",
2385 rust_lex_test_one (&parser, candidate.name, candidate.value);
2388 rust_lex_test_one (&parser, candidate.name, candidate.value);
2390 rust_lex_test_completion (&parser);
2391 rust_lex_test_push_back (&parser);
2405 gdb_assert (
code == 0);
2408 selftests::register_test (
"rust-lex", rust_lex_tests);
struct gdbarch * target_gdbarch(void)
const struct block * block_static_block(const struct block *block)
const char * block_scope(const struct block *block)
const char * host_charset(void)
void convert_between_encodings(const char *from, const char *to, const gdb_byte *bytes, unsigned int num_bytes, int width, struct obstack *output, enum transliterations translit)
void update(const struct block *b, innermost_block_tracker_types t)
int parser(struct parser_state *ps) const override
unsigned int cp_find_first_component(const char *name)
@ RANGE_LOW_BOUND_DEFAULT
@ RANGE_HIGH_BOUND_EXCLUSIVE
@ RANGE_HIGH_BOUND_DEFAULT
int symbol_read_needs_frame(struct symbol *sym)
struct type * lookup_pointer_type(struct type *type)
struct type * lookup_typename(const struct language_defn *language, const char *name, const struct block *block, int noerr)
struct type * lookup_array_range_type(struct type *element_type, LONGEST low_bound, LONGEST high_bound)
struct type * lookup_function_type_with_arguments(struct type *type, int nparams, struct type **param_types)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t err
const struct language_defn * language_def(enum language lang)
struct type * language_lookup_primitive_type(const struct language_defn *la, struct gdbarch *gdbarch, const char *name)
std::unique_ptr< operation > operation_up
std::array< gdb_byte, 16 > float_data
bool parse_float(const char *p, int len, const struct type *type, gdb_byte *data)
std::string rust_crate_for_block(const struct block *block)
struct type * rust_slice_type(const char *name, struct type *elt_type, struct type *usize_type)
bool rust_tuple_struct_type_p(struct type *type)
bool rust_tuple_type_p(struct type *type)
#define NUM_SUBEXPRESSIONS
static bool space_then_number(const char *string)
static bool ends_raw_string(const char *str, int n)
static const struct token_info operator_tokens[]
void _initialize_rust_exp()
static bool rust_identifier_start_p(char c)
static const struct token_info identifier_tokens[]
static regex_t number_regex
static uint32_t lex_multibyte_char(const char *text, int *len)
static int starts_raw_string(const char *str)
static void munge_name_and_block(const char **name, const struct block **block)
static const char number_regex_text[]
void set_operation(expr::operation_up &&op)
const struct language_defn * language()
struct gdbarch * gdbarch()
const struct block *const expression_context_block
void push_dollar(struct stoken str)
innermost_block_tracker * block_tracker
void mark_struct_expression(expr::structop_base_operation *op)
std::string super_name(const std::string &ident, unsigned int n_supers)
typed_val_float current_float_val
struct type * parse_array_type()
void update_innermost_block(struct block_symbol sym)
operation_up parse_array()
operation_up parse_addr()
uint32_t lex_hex(int min, int max)
struct type * parse_function_type()
struct parser_state * pstate
rust_parser(struct parser_state *state)
operation_up parse_sizeof()
operation_up parse_expr()
struct type * parse_type()
enum exp_opcode current_opcode
std::string parse_path(bool for_expr)
operation_up name_to_operation(const std::string &name)
struct type * parse_pointer_type()
struct block_symbol lookup_symbol(const char *name, const struct block *block, const domain_enum domain)
operation_up parse_atom(bool required)
struct type * parse_tuple_type()
struct type * get_type(const char *name)
operation_up parse_field(operation_up &&)
operation_up parse_binop(bool required)
struct type * parse_slice_type()
struct gdbarch * arch() const
typed_val_int current_int_val
operation_up parse_tuple()
uint32_t lex_escape(int is_byte)
operation_up parse_entry_point()
operation_up parse_tuple_struct(struct type *type)
operation_up parse_index(operation_up &&)
std::vector< operation_up > parse_paren_args()
std::string get_string() const
std::vector< struct type * > parse_type_list()
operation_up parse_struct_expr(struct type *type)
operation_up parse_path_expr()
struct type * rust_lookup_type(const char *name)
operation_up parse_range()
const struct language_defn * language() const
DISABLE_COPY_AND_ASSIGN(rust_parser)
operation_up parse_call(operation_up &&)
operation_up parse_string()
std::string crate_name(const std::string &name)
std::vector< struct type * > parse_maybe_type_list()
operation_up completion_op
rustop_item(int token_, int precedence_, enum exp_opcode opcode_, operation_up &&op_)
address_class aclass() const
struct type * type() const
struct block_symbol lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
struct block_symbol lookup_symbol(const char *, const struct block *, const domain_enum, struct field_of_this_result *)
std::string type_to_string(struct type *type)