Module stm8dce.asm_parser

This module provides a class to parse STM8 SDCC generated assembly files.

Classes

class ASMParser

Class to parse STM8 SDCC generated assembly files.

Attributes

globals : list
A list of global definitions.
interrupts : list
A list of interrupt definitions.
functions : list
A list of functions.
constants : list
A list of constants.

Initializes the ASMParser with a file path and parses the file.

Args

file_path : str
The path to the assembly file to be parsed.

Methods

def __init__(self, file_path)

Initializes the ASMParser with a file path and parses the file.

Args

file_path : str
The path to the assembly file to be parsed.
def _parse(self)

Parses the relevant lines of the assembly file and extracts globals, interrupts, functions, and constants.

def _parse_code_section(self, area)

Parses the code section of the file and extracts functions.

Args

area : Directive
The directive indicating the start of the code section.
def _parse_const_section(self, area)

Parses the constants section of the file and extracts constants.

Args

area : Directive
The directive indicating the start of the constants section.
def _parse_constant(self, label)

Parses a constant and extracts relevant information.

Args

label : Label
The label indicating the start of the constant.
def _parse_function(self, label)

Parses a function and extracts relevant information.

Args

label : Label
The label indicating the start of the function.