parser

package
v0.0.0-...-b51462a Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClassInfo

type ClassInfo struct {
	Name        string
	Modifiers   []string
	Annotations []string
	Extends     string
	Implements  []string
	OuterClass  string
	Line        int
}

ClassInfo represents a parsed class declaration.

type FieldInfo

type FieldInfo struct {
	Name        string
	ClassName   string
	Type        string
	Modifiers   []string
	Annotations []string
}

FieldInfo represents a parsed field declaration.

type MethodInfo

type MethodInfo struct {
	Name          string
	ClassName     string
	Modifiers     []string
	Annotations   []string
	ReturnType    string
	Params        []ParamInfo
	IsConstructor bool
	Line          int
}

MethodInfo represents a parsed method or constructor declaration.

type ParamInfo

type ParamInfo struct {
	Name string
	Type string
}

ParamInfo represents a method parameter.

type ParsedFile

type ParsedFile struct {
	Path          string
	Package       string
	Imports       []string
	Classes       []ClassInfo
	Fields        []FieldInfo
	Methods       []MethodInfo
	HasReflection bool
	// Source is the raw source content (retained from ParseFile to avoid re-read).
	// Nil when ParsedFile was constructed manually (e.g. in tests).
	Source []byte
	// Root is the root AST node (retained from ParseFile to avoid re-parse).
	// Nil when ParsedFile was constructed manually or parse failed.
	Root *sitter.Node
}

ParsedFile holds the extracted symbols from a Java source file.

func ParseFile

func ParseFile(path string) (*ParsedFile, error)

ParseFile parses a single Java file and extracts symbols.

Jump to

Keyboard shortcuts

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