pyrtma.parser.Parser

class Parser(debug=False, validate_alignment=True, auto_pad=True, import_coredefs=True)[source]

Bases: object

Parser class

Parser class

Parameters:
  • debug (bool, optional) – Flag for debug mode. Defaults to False.

  • validate_alignment (bool) –

  • auto_pad (bool) –

  • import_coredefs (bool) –

Methods

add_fields

check_alignment

Confirm 64 bit alignment of structures

check_duplicate_name

Check namespaces for conflicting names.

check_key_value_separation

check_name

Check that names start with a letter.

clear

expand_expression

rtype:

Tuple[str, int]

get_ctype_cls

rtype:

Type[Structure]

get_ctype_size

rtype:

int

handle_alias

Find the base type ultimately represented by the typedef alias

handle_compiler_options

handle_expression

handle_host_id

handle_import

handle_message_def

handle_metadata

handle_module_id

handle_reserve

handle_signal

handle_string

handle_struct

parse

parse_compiler_options

rtype:

Dict[str, CompilerOptions]

parse_file

parse_options

parse_options_text

parse_text

to_json

trim_root

rtype:

Path

validate_msg_def

validate_msg_id

warning

check_alignment(s)[source]

Confirm 64 bit alignment of structures

Parameters:

s (Union[SDF, MDF]) –

check_duplicate_name(section, name, namespaces)[source]

Check namespaces for conflicting names.

Parameters:
check_name(name)[source]

Check that names start with a letter.

Parameters:

name (str) –

handle_alias(alias, ftype)[source]

Find the base type ultimately represented by the typedef alias

Parameters:
  • alias (str) –

  • ftype (str) –