diff --git a/uppaal2jetracer/parser/declarationparser/declaration_lexer.py b/uppaal2jetracer/parser/declarationparser/declaration_lexer.py index 3a0743e777a97a72c69eb131df9d2ab3959276a1..06f2444d0933dbbb62f64a4339f27a80886a23e6 100644 --- a/uppaal2jetracer/parser/declarationparser/declaration_lexer.py +++ b/uppaal2jetracer/parser/declarationparser/declaration_lexer.py @@ -10,12 +10,10 @@ Based on the c_lexer.py from the pycparser project by Eli Bendersky (https://eli under the BSD license. Classes: - * DeclarationLexer: Implements a custom lexer for UPPAAL declarations with - methods for input handling, token generation, and error handling. + * DeclarationLexer: Implements a custom lexer for UPPAAL declarations with methods for input handling, token generation, and error handling. Key Features: - * Recognizes reserved keywords, custom identifiers, constants, and various - operators. + * Recognizes reserved keywords, custom identifiers, constants, and various operators. * Provides hooks for handling specific events like opening and closing braces. * Offers mechanisms to handle typographical lookups for typedef names. diff --git a/uppaal2jetracer/parser/declarationparser/declaration_parser.py b/uppaal2jetracer/parser/declarationparser/declaration_parser.py index e0dfd55080d5cce30035d7a731ce69c811ea25f8..34485a030f88b27af12d517f2728866ec8d6465f 100644 --- a/uppaal2jetracer/parser/declarationparser/declaration_parser.py +++ b/uppaal2jetracer/parser/declarationparser/declaration_parser.py @@ -12,12 +12,10 @@ Classes: * `SingleStatementParser`: Parser for single statements with relaxed rules on typing. Key Features: - * Manages scope information with a stack-based system for accurate type - and identifier resolution. + * Manages scope information with a stack-based system for accurate type and identifier resolution. * Supports lexer and parser customization, as well as optimization for performance. * Includes utility methods for handling specific parsing scenarios, such as typedef management. - * Provides detailed debugging capabilities, such as generating lexer and parser tables - and debug outputs. + * Provides detailed debugging capabilities, such as generating lexer and parser tables and debug outputs. """ from uppaal2jetracer.declarations import declarations_ast from uppaal2jetracer.parser.declarationparser.ply import yacc diff --git a/uppaal2jetracer/parser/declarationparser/plyparser.py b/uppaal2jetracer/parser/declarationparser/plyparser.py index 35f68228e262bf9067c98a96e32228272f46697a..c6808447e9d59cae3ff7357c998547ac871f6dd3 100644 --- a/uppaal2jetracer/parser/declarationparser/plyparser.py +++ b/uppaal2jetracer/parser/declarationparser/plyparser.py @@ -111,14 +111,13 @@ class PLYParser: def parameterized(*params): """ Decorator to create parameterized rules. - - Parameterized rule methods must be named starting with "p_" and contain - "xxx", and their docstrings may contain "xxx" and "yyy". These will be - replaced by the given parameter tuples. For example, "p_xxx_rule()" with - docstring "xxx_rule : yyy" when decorated with - "@parameterized(("id", "ID"))" produces "p_id_rule()" with the docstring - "id_rule : ID". Using multiple tuples produces multiple rules. """ + # Parameterized rule methods must be named starting with "p_" and contain + # "xxx", and their docstrings may contain "xxx" and "yyy". These will be + # replaced by the given parameter tuples. For example, "p_xxx_rule()" with + # docstring "xxx_rule : yyy" when decorated with + # "@parameterized(("id", "ID"))" produces "p_id_rule()" with the docstring + # "id_rule : ID". Using multiple tuples produces multiple rules. def decorate(rule_func): """