GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | List of all members
rust_parser Struct Reference

Classes

struct  current_string_val
 

Public Member Functions

 rust_parser (struct parser_state *state)
 
 DISABLE_COPY_AND_ASSIGN (rust_parser)
 
const struct language_defnlanguage () const
 
struct gdbarcharch () const
 
struct typeget_type (const char *name)
 
std::string crate_name (const std::string &name)
 
std::string super_name (const std::string &ident, unsigned int n_supers)
 
int lex_character ()
 
int lex_number ()
 
int lex_string ()
 
int lex_identifier ()
 
uint32_t lex_hex (int min, int max)
 
uint32_t lex_escape (int is_byte)
 
int lex_operator ()
 
int lex_one_token ()
 
void push_back (char c)
 
void lex ()
 
void assume (int type)
 
void require (char type)
 
operation_up parse_entry_point ()
 
operation_up parse_tuple ()
 
operation_up parse_array ()
 
operation_up name_to_operation (const std::string &name)
 
operation_up parse_struct_expr (struct type *type)
 
operation_up parse_binop (bool required)
 
operation_up parse_range ()
 
operation_up parse_expr ()
 
operation_up parse_sizeof ()
 
operation_up parse_addr ()
 
operation_up parse_field (operation_up &&)
 
operation_up parse_index (operation_up &&)
 
std::vector< operation_upparse_paren_args ()
 
operation_up parse_call (operation_up &&)
 
std::vector< struct type * > parse_type_list ()
 
std::vector< struct type * > parse_maybe_type_list ()
 
struct typeparse_array_type ()
 
struct typeparse_slice_type ()
 
struct typeparse_pointer_type ()
 
struct typeparse_function_type ()
 
struct typeparse_tuple_type ()
 
struct typeparse_type ()
 
std::string parse_path (bool for_expr)
 
operation_up parse_string ()
 
operation_up parse_tuple_struct (struct type *type)
 
operation_up parse_path_expr ()
 
operation_up parse_atom (bool required)
 
void update_innermost_block (struct block_symbol sym)
 
struct block_symbol lookup_symbol (const char *name, const struct block *block, const domain_enum domain)
 
struct typerust_lookup_type (const char *name)
 
std::string get_string () const
 

Public Attributes

auto_obstack obstack
 
struct parser_statepstate
 
int paren_depth = 0
 
int current_token = 0
 
typed_val_int current_int_val {}
 
typed_val_float current_float_val {}
 
enum exp_opcode current_opcode = OP_NULL
 
operation_up completion_op
 

Detailed Description

Definition at line 200 of file rust-parse.c.

Constructor & Destructor Documentation

◆ rust_parser()

rust_parser::rust_parser ( struct parser_state * state)
inlineexplicit

Definition at line 202 of file rust-parse.c.

Member Function Documentation

◆ arch()

struct gdbarch * rust_parser::arch ( ) const
inline

Definition at line 216 of file rust-parse.c.

References expr_builder::gdbarch(), and pstate.

Referenced by get_type(), and rust_lookup_type().

◆ assume()

void rust_parser::assume ( int type)
inline

◆ crate_name()

std::string rust_parser::crate_name ( const std::string & name)

Definition at line 360 of file rust-parse.c.

References parser_state::expression_context_block, name, pstate, and rust_crate_for_block().

Referenced by parse_path().

◆ DISABLE_COPY_AND_ASSIGN()

rust_parser::DISABLE_COPY_AND_ASSIGN ( rust_parser )

◆ get_string()

std::string rust_parser::get_string ( ) const
inline

◆ get_type()

struct type * rust_parser::get_type ( const char * name)
inline

◆ language()

const struct language_defn * rust_parser::language ( ) const
inline

Definition at line 210 of file rust-parse.c.

References expr_builder::language(), and pstate.

◆ lex()

void rust_parser::lex ( )
inline

◆ lex_character()

int rust_parser::lex_character ( )

◆ lex_escape()

uint32_t rust_parser::lex_escape ( int is_byte)

Definition at line 522 of file rust-parse.c.

References lex_hex(), parser_state::lexptr, and pstate.

Referenced by lex_character(), and lex_string().

◆ lex_hex()

uint32_t rust_parser::lex_hex ( int min,
int max )

Definition at line 484 of file rust-parse.c.

References parser_state::lexptr, and pstate.

Referenced by lex_escape().

◆ lex_identifier()

int rust_parser::lex_identifier ( )

◆ lex_number()

int rust_parser::lex_number ( )

◆ lex_one_token()

int rust_parser::lex_one_token ( )

◆ lex_operator()

int rust_parser::lex_operator ( )

Definition at line 879 of file rust-parse.c.

References current_opcode, parser_state::lexptr, operator_tokens, pstate, and token.

Referenced by lex_one_token().

◆ lex_string()

int rust_parser::lex_string ( )

◆ lookup_symbol()

struct block_symbol rust_parser::lookup_symbol ( const char * name,
const struct block * block,
const domain_enum domain )

Definition at line 432 of file rust-parse.c.

References lookup_symbol(), munge_name_and_block(), name, and block_symbol::symbol.

Referenced by name_to_operation(), and rust_lookup_type().

◆ name_to_operation()

operation_up rust_parser::name_to_operation ( const std::string & name)

◆ parse_addr()

operation_up rust_parser::parse_addr ( )

Definition at line 1528 of file rust-parse.c.

References assume(), current_token, KW_MUT, lex(), and parse_atom().

Referenced by parse_atom().

◆ parse_array()

operation_up rust_parser::parse_array ( )

Definition at line 1177 of file rust-parse.c.

References assume(), current_token, KW_MUT, lex(), parse_expr(), and require().

Referenced by parse_atom().

◆ parse_array_type()

struct type * rust_parser::parse_array_type ( )

◆ parse_atom()

operation_up rust_parser::parse_atom ( bool required)

◆ parse_binop()

operation_up rust_parser::parse_binop ( bool required)

◆ parse_call()

operation_up rust_parser::parse_call ( operation_up && lhs)

Definition at line 1624 of file rust-parse.c.

References parse_paren_args().

Referenced by parse_atom().

◆ parse_entry_point()

operation_up rust_parser::parse_entry_point ( )
inline

Definition at line 271 of file rust-parse.c.

References current_token, lex(), parse_expr(), parser_state::prev_lexptr, and pstate.

◆ parse_expr()

operation_up rust_parser::parse_expr ( )

◆ parse_field()

operation_up rust_parser::parse_field ( operation_up && lhs)

◆ parse_function_type()

struct type * rust_parser::parse_function_type ( )

◆ parse_index()

operation_up rust_parser::parse_index ( operation_up && lhs)

Definition at line 1586 of file rust-parse.c.

References assume(), parse_expr(), and require().

Referenced by parse_atom().

◆ parse_maybe_type_list()

std::vector< struct type * > rust_parser::parse_maybe_type_list ( )

Definition at line 1650 of file rust-parse.c.

References assume(), current_token, parse_type_list(), and require().

Referenced by parse_function_type(), and parse_tuple_type().

◆ parse_paren_args()

std::vector< operation_up > rust_parser::parse_paren_args ( )

Definition at line 1599 of file rust-parse.c.

References assume(), current_token, lex(), and parse_expr().

Referenced by parse_call(), and parse_tuple_struct().

◆ parse_path()

std::string rust_parser::parse_path ( bool for_expr)

◆ parse_path_expr()

operation_up rust_parser::parse_path_expr ( )

◆ parse_pointer_type()

struct type * rust_parser::parse_pointer_type ( )

Definition at line 1714 of file rust-parse.c.

References assume(), current_token, KW_CONST, KW_MUT, lex(), lookup_pointer_type(), and parse_type().

Referenced by parse_type().

◆ parse_range()

operation_up rust_parser::parse_range ( )

◆ parse_sizeof()

operation_up rust_parser::parse_sizeof ( )

Definition at line 1515 of file rust-parse.c.

References assume(), KW_SIZEOF, parse_expr(), and require().

Referenced by parse_atom().

◆ parse_slice_type()

struct type * rust_parser::parse_slice_type ( )

◆ parse_string()

operation_up rust_parser::parse_string ( )

Definition at line 1950 of file rust-parse.c.

References current_token, get_string(), get_type(), rust_lookup_type(), and STRING.

Referenced by parse_atom().

◆ parse_struct_expr()

operation_up rust_parser::parse_struct_expr ( struct type * type)

◆ parse_tuple()

operation_up rust_parser::parse_tuple ( )

Definition at line 1137 of file rust-parse.c.

References assume(), current_token, get_type(), lex(), and parse_expr().

Referenced by parse_atom().

◆ parse_tuple_struct()

operation_up rust_parser::parse_tuple_struct ( struct type * type)

Definition at line 1979 of file rust-parse.c.

References parse_paren_args().

Referenced by parse_path_expr().

◆ parse_tuple_type()

struct type * rust_parser::parse_tuple_type ( )

Definition at line 1757 of file rust-parse.c.

References name, obstack, parse_maybe_type_list(), rust_lookup_type(), and type_to_string().

Referenced by parse_type().

◆ parse_type()

struct type * rust_parser::parse_type ( )

◆ parse_type_list()

std::vector< struct type * > rust_parser::parse_type_list ( )

Definition at line 1635 of file rust-parse.c.

References current_token, lex(), and parse_type().

Referenced by parse_maybe_type_list(), and parse_path().

◆ push_back()

void rust_parser::push_back ( char c)

Definition at line 1123 of file rust-parse.c.

References parser_state::lexptr, parser_state::prev_lexptr, and pstate.

Referenced by parse_path().

◆ require()

void rust_parser::require ( char type)
inline

◆ rust_lookup_type()

struct type * rust_parser::rust_lookup_type ( const char * name)

◆ super_name()

std::string rust_parser::super_name ( const std::string & ident,
unsigned int n_supers )

◆ update_innermost_block()

void rust_parser::update_innermost_block ( struct block_symbol sym)

Member Data Documentation

◆ completion_op

operation_up rust_parser::completion_op

Definition at line 353 of file rust-parse.c.

Referenced by parse_field().

◆ current_float_val

typed_val_float rust_parser::current_float_val {}

Definition at line 347 of file rust-parse.c.

Referenced by lex_number(), and parse_atom().

◆ current_int_val

typed_val_int rust_parser::current_int_val {}

Definition at line 346 of file rust-parse.c.

Referenced by lex_character(), lex_number(), parse_array_type(), parse_atom(), and parse_field().

◆ current_opcode

enum exp_opcode rust_parser::current_opcode = OP_NULL

Definition at line 349 of file rust-parse.c.

Referenced by lex_operator(), and parse_binop().

◆ current_token

int rust_parser::current_token = 0

◆ obstack

auto_obstack rust_parser::obstack

Definition at line 335 of file rust-parse.c.

Referenced by lex_string(), and parse_tuple_type().

◆ paren_depth

int rust_parser::paren_depth = 0

Definition at line 341 of file rust-parse.c.

Referenced by lex_one_token().

◆ pstate

struct parser_state* rust_parser::pstate

The documentation for this struct was generated from the following file: