Improve documentation of check_names.py

This commit improves the documentation of check_names.py specifically
for the new class MBEDTLSCodeParser and TFPSACryptoCodeParser.

Signed-off-by: Harry Ramsey <[email protected]>
This commit is contained in:
Harry Ramsey
2025-01-30 14:51:28 +00:00
parent a58d44adbe
commit b54f3279b7
+9 -9
View File
@@ -8,12 +8,14 @@ This script confirms that the naming of all symbols and identifiers in Mbed TLS
are consistent with the house style and are also self-consistent. It only runs are consistent with the house style and are also self-consistent. It only runs
on Linux and macOS since it depends on nm. on Linux and macOS since it depends on nm.
It contains two major Python classes, CodeParser and NameChecker. They both have It contains three major Python classes, TFPSACryptoCodeParser,
a comprehensive "run-all" function (comprehensive_parse() and perform_checks()) MBEDTLSCodeParser and NameChecker. They all have a comprehensive "run-all"
but the individual functions can also be used for specific needs. function (comprehensive_parse() and perform_checks()) but the individual
functions can also be used for specific needs.
CodeParser makes heavy use of regular expressions to parse the code, and is CodeParser(a inherent base class for TFPSACryptoCodeParser and MBEDTLSCodeParser)
dependent on the current code formatting. Many Python C parser libraries require makes heavy use of regular expressions to parse the code, and is dependent on
the current code formatting. Many Python C parser libraries require
preprocessed C code, which means no macro parsing. Compiler tools are also not preprocessed C code, which means no macro parsing. Compiler tools are also not
very helpful when we want the exact location in the original source (which very helpful when we want the exact location in the original source (which
becomes impossible when e.g. comments are stripped). becomes impossible when e.g. comments are stripped).
@@ -679,8 +681,7 @@ class CodeParser():
class TFPSACryptoCodeParser(CodeParser): class TFPSACryptoCodeParser(CodeParser):
""" """
Class for retrieving files and parsing TF-PSA-Crypto code. This can be used Class for retrieving files and parsing TF-PSA-Crypto code. This can be used
independently of the checks that NameChecker performs, for example for independently of the checks that NameChecker performs.
list_internal_identifiers.py.
""" """
def __init__(self, log): def __init__(self, log):
@@ -827,8 +828,7 @@ class TFPSACryptoCodeParser(CodeParser):
class MBEDTLSCodeParser(CodeParser): class MBEDTLSCodeParser(CodeParser):
""" """
Class for retrieving files and parsing Mbed TLS code. This can be used Class for retrieving files and parsing Mbed TLS code. This can be used
independently of the checks that NameChecker performs, for example for independently of the checks that NameChecker performs.
list_internal_identifiers.py.
""" """
def comprehensive_parse(self): def comprehensive_parse(self):