Skip to content

Make a direct command-line interface to the macro expander #635

Open
@mattmccutchen-cci

Description

@mattmccutchen-cci

It would be nice to have a direct command-line interface to the macro expander. expand_macros.py ARGS would be roughly equivalent to convert_project.py --expand_macros_before_conversion --dr ARGS but cleaner (e.g., not creating the convert_* scripts). I was hoping to eventually publicize the macro expander for possible reuse by projects unrelated to 3C, and a direct CLI would make that a much easier sell. We may also use the new CLI in analyse-conv and for the textual merge workflow described in #400, possibly in combination with 3c-commits / 3c-wrap. For that matter, should we even remove the convert_project --expand_macros_before_conversion option and have callers that want to perform both steps (macro expansion and 3C) call expand_macros and convert_project separately?

It looks like it would be reasonably straightforward to factor out the first part of run3C in generate_ccommands.py (which builds the list of translation units) into a new function in common.py that could be called by both run3C and expand_macros.py. The necessary command-line option parsing code could probably be factored out as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions