cpp

package
v0.0.3-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cpp implements a tree-sitter-based parser for C++ source files. It reuses helper functions from the C parser for shared constructs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CppParser

type CppParser struct{}

CppParser is the entry point for C++ source files.

func (*CppParser) Parse

func (p *CppParser) Parse(filePath string, content string) (*ParseResult, error)

Parse parses a C++ source file using tree-sitter.

type Dependency

type Dependency struct {
	Path       string
	Type       string // "include" | "using"
	LineNumber int
	IsLocal    bool
}

Dependency represents an #include or using directive.

type Entity

type Entity struct {
	Name      string
	Type      string // "function" | "method" | "class" | "struct" | "enum" | "namespace" | "type"
	Kind      string
	Signature string
	StartLine int
	EndLine   int
	Docs      string
	Parent    string
}

Entity represents a named code element.

type ParseResult

type ParseResult struct {
	FilePath     string
	Entities     []*Entity
	Dependencies []*Dependency
}

ParseResult is the output of Parse.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL