Skip to content

Issue 79 support C #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 5, 2025
Merged

Issue 79 support C #81

merged 7 commits into from
Feb 5, 2025

Conversation

rahlk
Copy link
Collaborator

@rahlk rahlk commented Jan 29, 2025

Added richer support for analyzing C projects with Clang parser as requested in Issue #79

This initial version is able to create a symbol table for C projects with the following attributes:

  1. CApplication

    class CApplication(BaseModel):
     """Represents a complete C application.
    
     Attributes:
         translation_units (Dict[str, CTranslationUnit]): All source files
         call_graph (List[CCallGraphEdge]): Function call relationships
     """
    
     translation_units: Dict[str, CTranslationUnit]
     call_graph: List[CCallGraphEdge] = []
    class CTranslationUnit(BaseModel):
     """Represents a C source file.
    
     Attributes:
         file_path (str): Path to the source file
         includes (List[str]): Header files included
         macros (List[CMacro]): Macro definitions
         typedefs (List[CTypedef]): Typedef declarations
         structs (List[CStruct]): Struct/union declarations
         enums (List[CEnum]): Enum declarations
         globals (List[CVariable]): Global variable declarations
         functions (Dict[str, CFunction]): Function declarations/definitions
         is_header (bool): Whether this is a header file
     """
    
     file_path: str
     includes: List[CInclude] = []
     macros: List[CMacro] = []
     typedefs: List[CTypedef] = []
     structs: List[CStruct] = []
     enums: List[CEnum] = []
     globals: List[CVariable] = []
     functions: Dict[str, CFunction] = {} # <-----[ Initial version has been implemented ]-----
     is_header: bool = False
     is_modified: bool = False

@rahlk rahlk merged commit d9a81d9 into main Feb 5, 2025
@rahlk rahlk added the kind/feature New feature(s) label Feb 21, 2025
@rahlk rahlk deleted the issue-79-support-c branch February 21, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant