parser

package
v0.0.4-beta.4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	Path       string
	Type       string // import, require, from, include
	LineNumber int
	Resolved   string // Resolved path if determined
	IsLocal    bool   // True if local import
}

type Entity

type Entity struct {
	Name        string
	Type        string // function, class, type, interface, method, etc.
	Kind        string // specific: async_function, arrow_function, etc.
	Signature   string
	StartLine   int
	EndLine     int
	ColumnStart int
	ColumnEnd   int
	Docs        string                 // Documentation/comments
	Parent      string                 // Parent entity name for nested entities
	Visibility  string                 // public, private, protected, internal
	Scope       string                 // global, class, file, module, local
	Language    Language               // go, python, javascript, java
	Attributes  map[string]interface{} // Language-specific metadata
}

type Language

type Language string

Language represents supported programming languages

const (
	Go         Language = "go"
	Python     Language = "python"
	JavaScript Language = "javascript"
	TypeScript Language = "typescript"
	Java       Language = "java"
)

type LanguageParser

type LanguageParser interface {
	Language() Language
	Parse(filePath string, content string) (*ParseResult, error)
}

LanguageParser defines the interface for language-specific parsers

type ParseResult

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

func Parse

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

Parse routes to the appropriate language parser

Directories

Path Synopsis
Package java implements a tree-sitter-based parser for Java source files.
Package java implements a tree-sitter-based parser for Java source files.
Package javascript implements a tree-sitter-based parser for JavaScript and TypeScript source files.
Package javascript implements a tree-sitter-based parser for JavaScript and TypeScript source files.
Package python implements a tree-sitter-based parser for Python source files.
Package python implements a tree-sitter-based parser for Python source files.

Jump to

Keyboard shortcuts

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