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|128))?"
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;
376 const char *scope =
"";
381 if (scope[0] ==
'\0')
382 error (_(
"Couldn't find namespace scope for self::"));
387 std::vector<int> offsets;
388 unsigned int current_len;
391 while (scope[current_len] !=
'\0')
393 offsets.push_back (current_len);
394 gdb_assert (scope[current_len] ==
':');
401 len = offsets.size ();
403 error (_(
"Too many super:: uses from '%s'"), scope);
405 offset = offsets[len - n_supers];
408 offset = strlen (scope);
410 return "::" + std::string (scope, offset) +
"::" + ident;
421 if (startswith (*
name,
"::"))
433 const domain_enum domain)
440 if (result.
symbol != NULL)
441 update_innermost_block (result);
457 if (result.
symbol != NULL)
489 int check_max = min == max;
491 while ((check_max ? len <= max : 1)
508 error (_(
"Not enough hex digits seen"));
511 gdb_assert (min != max);
512 error (_(
"Overlong hex escape"));
537 error (_(
"Unicode escape in byte literal"));
540 error (_(
"Missing '{' in Unicode escape"));
545 error (_(
"Missing '}' in Unicode escape"));
579 error (_(
"Invalid escape \\%c in literal"),
pstate->
lexptr[0]);
594 gdb_assert (text[0] !=
'\'');
595 for (quote = 1; text[quote] !=
'\0' && text[quote] !=
'\''; ++quote)
599 if (text[quote] ==
'\0')
604 (
const gdb_byte *) text,
607 int size = obstack_object_size (&result);
609 error (_(
"overlong character literal"));
611 memcpy (&
value, obstack_finish (&result),
size);
631 error (_(
"empty character literal"));
642 error (_(
"Unterminated character literal"));
657 const char *save = str;
662 while (str[0] ==
'#')
677 gdb_assert (str[0] ==
'"');
678 for (i = 0; i < n; ++i)
679 if (str[i + 1] !=
'#')
713 error (_(
"Unexpected EOF in string"));
716 if (is_byte &&
value > 127)
717 error (_(
"Non-ASCII value in raw byte string"));
741 error (_(
"Unexpected EOF in string"));
745 if (is_byte &&
value > 127)
746 error (_(
"Non-ASCII value in byte string"));
762 const char *p = string;
764 while (p[0] ==
' ' || p[0] ==
'\t')
769 return *p >=
'0' && *p <=
'9';
777 return ((c >=
'a' && c <=
'z')
778 || (c >=
'A' && c <=
'Z')
826 if (length == strlen (candidate.name)
827 && strncmp (candidate.name, start, length) == 0)
837 if (
token->value == 0)
844 else if (
token == NULL
846 && (strncmp (start,
"thread", length) == 0
847 || strncmp (start,
"task", length) == 0)
886 strlen (candidate.name)) == 0)
911 int could_be_decimal = 1;
912 int implicit_i32 = 0;
913 const char *type_name = NULL;
922 gdb_assert (match == 0);
928 end_index = subexps[
INT_TEXT].rm_eo;
937 could_be_decimal = 0;
955 end_index = subexps[0].rm_eo;
963 gdb_assert (subexps[0].rm_eo > 0);
966 const char *next = skip_spaces (&
pstate->
lexptr[subexps[0].rm_eo]);
972 end_index = subexps[0].rm_eo;
974 could_be_decimal = 1;
980 std::string type_name_holder;
981 if (type_name == NULL)
983 gdb_assert (type_index != -1);
985 + subexps[type_index].rm_so),
986 (subexps[type_index].rm_eo
987 - subexps[type_index].rm_so));
988 type_name = type_name_holder.c_str ();
999 could_be_decimal = 0;
1013 if (number[0] ==
'0')
1015 if (number[1] ==
'x')
1017 else if (number[1] ==
'o')
1019 else if (number[1] ==
'b')
1024 could_be_decimal = 0;
1031 error (_(
"Invalid integer"));
1049 bool parsed =
parse_float (number.c_str (), number.length (),
1052 gdb_assert (parsed);
1145 return make_operation<long_const_operation> (unit, 0);
1153 return make_operation<rust_parenthesized_operation> (std::move (
expr));
1156 std::vector<operation_up> ops;
1157 ops.push_back (std::move (
expr));
1161 error (_(
"',' or ')' expected"));
1171 error (_(
"Tuple expressions not supported yet"));
1190 result = make_operation<rust_array_operation> (std::move (
expr),
1195 std::vector<operation_up> ops;
1196 ops.push_back (std::move (
expr));
1200 error (_(
"',' or ']' expected"));
1204 ops.shrink_to_fit ();
1205 int len = ops.size () - 1;
1206 result = make_operation<array_operation> (0, len, std::move (ops));
1209 error (_(
"',', ';', or ']' expected"));
1225 return make_operation<var_value_operation> (sym);
1229 if (sym.
symbol !=
nullptr)
1234 if (
type ==
nullptr)
1236 if (
type ==
nullptr)
1237 error (_(
"No symbol '%s' in current context"),
name.c_str ());
1246 return make_operation<type_operation> (
type);
1256 if (
type->
code () != TYPE_CODE_STRUCT
1259 error (_(
"Struct expression applied to non-struct type"));
1261 std::vector<std::pair<std::string, operation_up>> field_v;
1265 error (_(
"'}', '..', or identifier expected"));
1279 field_v.emplace_back (std::move (
name), std::move (
expr));
1295 return make_operation<rust_aggregate_operation> (
type,
1297 std::move (field_v));
1308 op (
std::move (op_))
1336 OPERATION ('*', 10, mul_operation) \
1337 OPERATION ('/', 10, div_operation) \
1338 OPERATION ('%', 10, rem_operation) \
1339 OPERATION ('@', 9, repeat_operation) \
1340 OPERATION ('+', 8, add_operation) \
1341 OPERATION ('-', 8, sub_operation) \
1342 OPERATION (LSH, 7, lsh_operation) \
1343 OPERATION (RSH, 7, rsh_operation) \
1344 OPERATION ('&', 6, bitwise_and_operation) \
1345 OPERATION ('^', 5, bitwise_xor_operation) \
1346 OPERATION ('|', 4, bitwise_ior_operation) \
1347 OPERATION (EQEQ, 3, equal_operation) \
1348 OPERATION (NOTEQ, 3, notequal_operation) \
1349 OPERATION ('<', 3, less_operation) \
1350 OPERATION (LTEQ, 3, leq_operation) \
1351 OPERATION ('>', 3, gtr_operation) \
1352 OPERATION (GTEQ, 3, geq_operation) \
1353 OPERATION (ANDAND, 2, logical_and_operation) \
1354 OPERATION (OROR, 1, logical_or_operation)
1356#define ASSIGN_PREC 0
1359 if (start ==
nullptr)
1361 gdb_assert (!required);
1365 std::vector<rustop_item> operator_stack;
1366 operator_stack.emplace_back (0, -1, OP_NULL, std::move (start));
1371 enum exp_opcode compound_assign_op = OP_NULL;
1372 int precedence = -2;
1376#define OPERATION(TOKEN, PRECEDENCE, TYPE) \
1378 precedence = PRECEDENCE; \
1400 lhs.
op = make_operation<unop_cast_operation> (std::move (lhs.
op),
1415 ? precedence < operator_stack.back ().precedence
1416 : precedence <= operator_stack.back ().precedence)
1417 && operator_stack.size () > 1)
1419 rustop_item rhs = std::move (operator_stack.back ());
1420 operator_stack.pop_back ();
1426#define OPERATION(TOKEN, PRECEDENCE, TYPE) \
1428 lhs.op = make_operation<TYPE> (std::move (lhs.op), \
1429 std::move (rhs.op)); \
1439 if (rhs.
token ==
'=')
1440 lhs.
op = (make_operation<assign_operation>
1441 (std::move (lhs.
op), std::move (rhs.
op)));
1443 lhs.
op = (make_operation<assign_modify_operation>
1445 std::move (rhs.
op)));
1450 lhs.
op = (make_operation<comma_operation>
1451 (std::move (lhs.
op), std::move (nil)));
1456 gdb_assert_not_reached (
"bad binary operator");
1460 if (precedence == -2)
1463 operator_stack.emplace_back (this_token, precedence, compound_assign_op,
1467 gdb_assert (operator_stack.size () == 1);
1468 return std::move (operator_stack[0].op);
1484 kind &= ~RANGE_LOW_BOUND_DEFAULT;
1497 kind &= ~RANGE_HIGH_BOUND_DEFAULT;
1499 return make_operation<rust_range_operation> (kind,
1535 return make_operation<rust_unop_addr_operation> (
parse_atom (
true));
1559 error (_(
"not really an error"));
1561 result.reset (struct_op);
1568 result = make_operation<rust_struct_anon> (idx, std::move (lhs));
1574 error (_(
"'_' not allowed in integers in anonymous field references"));
1577 error (_(
"field name expected"));
1592 return make_operation<rust_subscript_operation> (std::move (lhs),
1598std::vector<operation_up>
1603 std::vector<operation_up> args;
1609 error (_(
"',' or ')' expected"));
1628 return make_operation<funcall_operation> (std::move (lhs),
1634std::vector<struct type *>
1637 std::vector<struct type *> result;
1649std::vector<struct type *>
1653 std::vector<struct type *> types;
1670 error (_(
"integer expected"));
1734 error (_(
"'(' expected"));
1739 error (_(
"'->' expected"));
1744 struct type **argtypes =
nullptr;
1745 if (!types.empty ())
1746 argtypes = types.data ();
1762 obstack_1grow (&
obstack,
'(');
1763 for (
int i = 0; i < types.size (); ++i)
1768 obstack_1grow (&
obstack,
',');
1769 obstack_grow_str (&
obstack, type_name.c_str ());
1772 obstack_grow_str0 (&
obstack,
")");
1773 const char *
name = (
const char *) obstack_finish (&
obstack);
1778 if (result ==
nullptr)
1779 error (_(
"could not find tuple type '%s'"),
name);
1809 if (result ==
nullptr)
1810 error (_(
"No type name '%s' in current context"), path.c_str ());
1814 error (_(
"type expected"));
1823 unsigned n_supers = 0;
1840 error (_(
"'::' expected"));
1858 error (_(
"identifier expected"));
1860 bool saw_ident =
true;
1881 error (_(
"unexpected '::'"));
1914 error (_(
"'>' expected"));
1917 for (
int i = 0; i < types.size (); ++i)
1927 switch (first_token)
1943 gdb_assert_not_reached (
"missing case in path parsing");
1956 if (
type ==
nullptr)
1957 error (_(
"Could not find type '&str'"));
1959 std::vector<std::pair<std::string, operation_up>> field_v;
1964 = make_operation<rust_unop_addr_operation> (std::move (str));
1965 field_v.emplace_back (
"data_ptr", std::move (addr));
1968 operation_up lenop = make_operation<long_const_operation> (valtype, len);
1969 field_v.emplace_back (
"length", std::move (lenop));
1971 return make_operation<rust_aggregate_operation> (
type,
1973 std::move (field_v));
1983 std::vector<std::pair<std::string, operation_up>> field_v (args.size ());
1984 for (
int i = 0; i < args.size (); ++i)
1985 field_v[i] = { string_printf (
"__%d", i), std::move (args[i]) };
1987 return (make_operation<rust_aggregate_operation>
2001 if (
type ==
nullptr)
2002 error (_(
"Could not find type '%s'"), path.c_str ());
2011 if (
type !=
nullptr)
2014 error (_(
"Type %s is not a tuple struct"), path.c_str ());
2060 result = make_operation<string_operation> (
get_string ());
2089 result = make_operation<rust_unop_ind_operation> (
parse_atom (
true));
2093 result = make_operation<unary_plus_operation> (
parse_atom (
true));
2097 result = make_operation<unary_neg_operation> (
parse_atom (
true));
2101 result = make_operation<rust_unop_compl_operation> (
parse_atom (
true));
2113 error (_(
"unexpected token"));
2151 result =
parser.parse_entry_point ();
2153 catch (
const gdb_exception &exc)
2157 result = std::move (
parser.completion_op);
2158 if (result ==
nullptr)
2177rust_lex_test_one (
rust_parser *parser,
const char *input,
int expected)
2181 parser->reset (input);
2184 SELF_CHECK (
token == expected);
2189 SELF_CHECK (
token == 0);
2196rust_lex_int_test (
rust_parser *parser,
const char *input,
2197 ULONGEST
value,
int kind)
2199 rust_lex_test_one (parser, input, kind);
2206rust_lex_exception_test (
rust_parser *parser,
const char *input,
2215 catch (
const gdb_exception_error &except)
2217 SELF_CHECK (strcmp (except.what (),
err) == 0);
2225rust_lex_stringish_test (
rust_parser *parser,
const char *input,
2226 const char *
value,
int kind)
2228 rust_lex_test_one (parser, input, kind);
2235rust_lex_test_sequence (
rust_parser *parser,
const char *input,
int len,
2236 const int expected[])
2240 parser->reset (input);
2242 for (i = 0; i < len; ++i)
2245 SELF_CHECK (
token == expected[i]);
2255 const int expected2[] = {
INTEGER,
'.',
IDENT,
'(',
')', 0 };
2256 const int expected3[] = {
FLOAT,
EQEQ,
'(',
')', 0 };
2259 rust_lex_test_sequence (parser,
"23.g()", ARRAY_SIZE (expected1), expected1);
2260 rust_lex_test_sequence (parser,
"23_0.g()", ARRAY_SIZE (expected2),
2262 rust_lex_test_sequence (parser,
"23.==()", ARRAY_SIZE (expected3),
2264 rust_lex_test_sequence (parser,
"23..25", ARRAY_SIZE (expected4), expected4);
2276 rust_lex_test_sequence (parser,
"something.wha", ARRAY_SIZE (expected),
2278 rust_lex_test_sequence (parser,
"something.", ARRAY_SIZE (expected),
2291 parser->reset (
">>=");
2300 SELF_CHECK (
token ==
'=');
2303 SELF_CHECK (
token == 0);
2309rust_lex_tests (
void)
2316 rust_lex_test_one (&parser,
"", 0);
2317 rust_lex_test_one (&parser,
" \t \n \r ", 0);
2318 rust_lex_test_one (&parser,
"thread 23", 0);
2319 rust_lex_test_one (&parser,
"task 23", 0);
2320 rust_lex_test_one (&parser,
"th 104", 0);
2321 rust_lex_test_one (&parser,
"ta 97", 0);
2323 rust_lex_int_test (&parser,
"'z'",
'z',
INTEGER);
2324 rust_lex_int_test (&parser,
"'\\xff'", 0xff,
INTEGER);
2325 rust_lex_int_test (&parser,
"'\\u{1016f}'", 0x1016f,
INTEGER);
2326 rust_lex_int_test (&parser,
"b'z'",
'z',
INTEGER);
2327 rust_lex_int_test (&parser,
"b'\\xfe'", 0xfe,
INTEGER);
2328 rust_lex_int_test (&parser,
"b'\\xFE'", 0xfe,
INTEGER);
2329 rust_lex_int_test (&parser,
"b'\\xfE'", 0xfe,
INTEGER);
2332 rust_lex_int_test (&parser,
"'\\n'",
'\n',
INTEGER);
2333 rust_lex_int_test (&parser,
"'\\r'",
'\r',
INTEGER);
2334 rust_lex_int_test (&parser,
"'\\t'",
'\t',
INTEGER);
2335 rust_lex_int_test (&parser,
"'\\\\'",
'\\',
INTEGER);
2336 rust_lex_int_test (&parser,
"'\\0'",
'\0',
INTEGER);
2337 rust_lex_int_test (&parser,
"'\\''",
'\'',
INTEGER);
2338 rust_lex_int_test (&parser,
"'\\\"'",
'"',
INTEGER);
2340 rust_lex_int_test (&parser,
"b'\\n'",
'\n',
INTEGER);
2341 rust_lex_int_test (&parser,
"b'\\r'",
'\r',
INTEGER);
2342 rust_lex_int_test (&parser,
"b'\\t'",
'\t',
INTEGER);
2343 rust_lex_int_test (&parser,
"b'\\\\'",
'\\',
INTEGER);
2344 rust_lex_int_test (&parser,
"b'\\0'",
'\0',
INTEGER);
2345 rust_lex_int_test (&parser,
"b'\\''",
'\'',
INTEGER);
2346 rust_lex_int_test (&parser,
"b'\\\"'",
'"',
INTEGER);
2348 rust_lex_exception_test (&parser,
"'z",
"Unterminated character literal");
2349 rust_lex_exception_test (&parser,
"b'\\x0'",
"Not enough hex digits seen");
2350 rust_lex_exception_test (&parser,
"b'\\u{0}'",
2351 "Unicode escape in byte literal");
2352 rust_lex_exception_test (&parser,
"'\\x0'",
"Not enough hex digits seen");
2353 rust_lex_exception_test (&parser,
"'\\u0'",
"Missing '{' in Unicode escape");
2354 rust_lex_exception_test (&parser,
"'\\u{0",
"Missing '}' in Unicode escape");
2355 rust_lex_exception_test (&parser,
"'\\u{0000007}",
"Overlong hex escape");
2356 rust_lex_exception_test (&parser,
"'\\u{}",
"Not enough hex digits seen");
2357 rust_lex_exception_test (&parser,
"'\\Q'",
"Invalid escape \\Q in literal");
2358 rust_lex_exception_test (&parser,
"b'\\Q'",
"Invalid escape \\Q in literal");
2361 rust_lex_int_test (&parser,
"2_344__29", 234429,
INTEGER);
2362 rust_lex_int_test (&parser,
"0x1f", 0x1f,
INTEGER);
2363 rust_lex_int_test (&parser,
"23usize", 23,
INTEGER);
2364 rust_lex_int_test (&parser,
"23i32", 23,
INTEGER);
2365 rust_lex_int_test (&parser,
"0x1_f", 0x1f,
INTEGER);
2366 rust_lex_int_test (&parser,
"0b1_101011__", 0x6b,
INTEGER);
2367 rust_lex_int_test (&parser,
"0o001177i64", 639,
INTEGER);
2368 rust_lex_int_test (&parser,
"0x123456789u64", 0x123456789ull,
INTEGER);
2370 rust_lex_test_trailing_dot (&parser);
2372 rust_lex_test_one (&parser,
"23.",
FLOAT);
2373 rust_lex_test_one (&parser,
"23.99f32",
FLOAT);
2374 rust_lex_test_one (&parser,
"23e7",
FLOAT);
2375 rust_lex_test_one (&parser,
"23E-7",
FLOAT);
2376 rust_lex_test_one (&parser,
"23e+7",
FLOAT);
2377 rust_lex_test_one (&parser,
"23.99e+7f64",
FLOAT);
2378 rust_lex_test_one (&parser,
"23.82f32",
FLOAT);
2380 rust_lex_stringish_test (&parser,
"hibob",
"hibob",
IDENT);
2381 rust_lex_stringish_test (&parser,
"hibob__93",
"hibob__93",
IDENT);
2382 rust_lex_stringish_test (&parser,
"thread",
"thread",
IDENT);
2383 rust_lex_stringish_test (&parser,
"r#true",
"true",
IDENT);
2386 rust_lex_test_sequence (&parser,
"r#thread 23", ARRAY_SIZE (expected1),
2388 const int expected2[] = {
IDENT,
'#', 0 };
2389 rust_lex_test_sequence (&parser,
"r#", ARRAY_SIZE (expected2), expected2);
2391 rust_lex_stringish_test (&parser,
"\"string\"",
"string",
STRING);
2392 rust_lex_stringish_test (&parser,
"\"str\\ting\"",
"str\ting",
STRING);
2393 rust_lex_stringish_test (&parser,
"\"str\\\"ing\"",
"str\"ing",
STRING);
2394 rust_lex_stringish_test (&parser,
"r\"str\\ing\"",
"str\\ing",
STRING);
2395 rust_lex_stringish_test (&parser,
"r#\"str\\ting\"#",
"str\\ting",
STRING);
2396 rust_lex_stringish_test (&parser,
"r###\"str\\\"ing\"###",
"str\\\"ing",
2399 rust_lex_stringish_test (&parser,
"b\"string\"",
"string",
BYTESTRING);
2400 rust_lex_stringish_test (&parser,
"b\"\x73tring\"",
"string",
BYTESTRING);
2401 rust_lex_stringish_test (&parser,
"b\"str\\\"ing\"",
"str\"ing",
BYTESTRING);
2402 rust_lex_stringish_test (&parser,
"br####\"\\x73tring\"####",
"\\x73tring",
2406 rust_lex_test_one (&parser, candidate.
name, candidate.
value);
2409 rust_lex_test_one (&parser, candidate.
name, candidate.
value);
2411 rust_lex_test_completion (&parser);
2412 rust_lex_test_push_back (&parser);
2426 gdb_assert (
code == 0);
2429 selftests::register_test (
"rust-lex", rust_lex_tests);
struct gdbarch * target_gdbarch(void)
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[]
const struct block * static_block() const
const char * scope() const
void set_operation(expr::operation_up &&op)
const struct language_defn * language()
struct gdbarch * gdbarch()
static gdb_mpz pow(unsigned long base, unsigned long exp)
bool set(const char *str, int base)
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
unsigned int num_fields() 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)