Module stm8dce.rel_matchers
This module provides classes and function to pattern match STM8 SDCC generated .rel and .lib files. For more information on the STM8 .rel and .lib file formats, see: https://sourceforge.net/p/sdcc/code/HEAD/tree/trunk/sdcc/sdas/doc/format.txt
Functions
def match_rel_line(file_path, line_number, line)
-
Matches a line from a .rel or .lib file to a SymbolLine, HeaderLine, or ModuleLine.
Args
file_path
:str
- The path to the file containing the line.
line_number
:int
- The line number of the line.
line
:str
- The line to be matched.
Returns
SymbolLine, HeaderLine,
orModuleLine
- The matched object, or None if no match is found.
Classes
class HeaderLine
-
Class to represent a header line in a .rel or .lib file.
Initializes a HeaderLine object.
Args
file_path
:str
- The path to the file containing the header line.
line_number
:int
- The line number of the header line.
line
:str
- The line containing the header line.
Methods
def __init__(self, file_path, line_number, line)
-
Initializes a HeaderLine object.
Args
file_path
:str
- The path to the file containing the header line.
line_number
:int
- The line number of the header line.
line
:str
- The line containing the header line.
class ModuleLine
-
Class to represent a module line in a .rel or .lib file.
Initializes a ModuleLine object.
Args
file_path
:str
- The path to the file containing the module line.
line_number
:int
- The line number of the module line.
line
:str
- The line containing the module line.
Methods
def __init__(self, file_path, line_number, line)
-
Initializes a ModuleLine object.
Args
file_path
:str
- The path to the file containing the module line.
line_number
:int
- The line number of the module line.
line
:str
- The line containing the module line.
class SymbolLine
-
Class to represent a symbol line in a .rel or .lib file.
Initializes a SymbolLine object.
Args
file_path
:str
- The path to the file containing the symbol line.
line_number
:int
- The line number of the symbol line.
line
:str
- The line containing the symbol line.
Class variables
var Type
-
Enum to represent the type of a symbol line.
Methods
def __init__(self, file_path, line_number, line)
-
Initializes a SymbolLine object.
Args
file_path
:str
- The path to the file containing the symbol line.
line_number
:int
- The line number of the symbol line.
line
:str
- The line containing the symbol line.