xoofx / xoofx/CppAst.NET

Provide option for parsing function bodies

Open
#95 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
C#
Stars
620
Forks
79
Avg merge
14h 27m
Merged PRs (30d)
1

Description

Hi there, I'm trying to use CppAst.NET to parse metal-cpp header files, which are a wrapper of the Objective-C API. The underlying Objective-C functions being called are contained within a macro within the function body.

Screenshot 2024-03-30 at 21 21 35

To generate valid C# code, I need to be able to access the string used to generate the selector inside the function bodies, however currently, function body parsing is disabled.

Could an option be added to enable function body parsing? I'm happy to PR it myself, however, I don't know what other modifications would be required.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/CppAst/CppParser.cs at the function-body parsing setting around line 113, then trace how parsed function bodies and macros are represented. Add an option that lets callers enable body parsing and expose the selector string needed by metal-cpp consumers; done means the option works without changing the default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp, objective-c
Domain
compilers, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.