parsers

package
v0.0.0-...-6a3e998 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Kotlin parser for parsing Kotlin code into code chunks

Rust parser for parsing Rust code into code chunks

Shell parser for parsing shell scripts into code chunks

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeChunkingService

func InitializeChunkingService() *chunking.ChunkingService

InitializeChunkingService creates and initializes a new chunking service with all supported parsers

func NewParserFactory

func NewParserFactory() map[chunking.Language]chunking.LanguageParser

NewParserFactory creates a new parser factory that registers all supported language parsers

Types

type GoParser

type GoParser struct{}

GoParser is a parser for Go code

func NewGoParser

func NewGoParser() *GoParser

NewGoParser creates a new GoParser

func (*GoParser) GetLanguage

func (p *GoParser) GetLanguage() chunking.Language

GetLanguage returns the language this parser handles

func (*GoParser) Parse

func (p *GoParser) Parse(ctx context.Context, code string, filename string) ([]*chunking.CodeChunk, error)

Parse parses Go code and returns chunks

type HCLParser

type HCLParser struct{}

HCLParser is a parser for HCL (Terraform) code

func NewHCLParser

func NewHCLParser() *HCLParser

NewHCLParser creates a new HCLParser

func (*HCLParser) GetLanguage

func (p *HCLParser) GetLanguage() chunking.Language

GetLanguage returns the language this parser handles

func (*HCLParser) Parse

func (p *HCLParser) Parse(ctx context.Context, code string, filename string) ([]*chunking.CodeChunk, error)

Parse parses HCL (Terraform) code and returns chunks

type JavaParser

type JavaParser struct{}

JavaParser is a parser for Java code

func NewJavaParser

func NewJavaParser() *JavaParser

NewJavaParser creates a new JavaParser

func (*JavaParser) GetLanguage

func (p *JavaParser) GetLanguage() chunking.Language

GetLanguage returns the language this parser handles

func (*JavaParser) Parse

func (p *JavaParser) Parse(ctx context.Context, code string, filename string) ([]*chunking.CodeChunk, error)

Parse parses Java code and returns chunks

type JavaScriptParser

type JavaScriptParser struct{}

JavaScriptParser is a parser for JavaScript code

func NewJavaScriptParser

func NewJavaScriptParser() *JavaScriptParser

NewJavaScriptParser creates a new JavaScriptParser

func (*JavaScriptParser) GetLanguage

func (p *JavaScriptParser) GetLanguage() chunking.Language

GetLanguage returns the language this parser handles

func (*JavaScriptParser) Parse

func (p *JavaScriptParser) Parse(ctx context.Context, code string, filename string) ([]*chunking.CodeChunk, error)

Parse parses JavaScript code and returns chunks

type KotlinParser

type KotlinParser struct{}

KotlinParser handles parsing Kotlin code

func NewKotlinParser

func NewKotlinParser() *KotlinParser

NewKotlinParser creates a new Kotlin parser instance

func (*KotlinParser) GetLanguage

func (p *KotlinParser) GetLanguage() chunking.Language

GetLanguage returns the language this parser supports

func (*KotlinParser) Parse

func (p *KotlinParser) Parse(ctx context.Context, code string, filename string) ([]*chunking.CodeChunk, error)

Parse parses Kotlin code and returns code chunks

type PythonParser

type PythonParser struct{}

PythonParser is a parser for Python code

func NewPythonParser

func NewPythonParser() *PythonParser

NewPythonParser creates a new PythonParser

func (*PythonParser) GetLanguage

func (p *PythonParser) GetLanguage() chunking.Language

GetLanguage returns the language this parser handles

func (*PythonParser) Parse

func (p *PythonParser) Parse(ctx context.Context, code string, filename string) ([]*chunking.CodeChunk, error)

Parse parses Python code and returns chunks

type RustParser

type RustParser struct{}

RustParser handles parsing Rust code

func NewRustParser

func NewRustParser() *RustParser

NewRustParser creates a new Rust parser instance

func (*RustParser) GetLanguage

func (p *RustParser) GetLanguage() chunking.Language

GetLanguage returns the language this parser supports

func (*RustParser) Parse

func (p *RustParser) Parse(ctx context.Context, code string, filename string) ([]*chunking.CodeChunk, error)

Parse parses Rust code and returns code chunks

type ShellParser

type ShellParser struct{}

ShellParser handles parsing shell scripts

func NewShellParser

func NewShellParser() *ShellParser

NewShellParser creates a new Shell parser instance

func (*ShellParser) GetLanguage

func (p *ShellParser) GetLanguage() chunking.Language

GetLanguage returns the language this parser supports

func (*ShellParser) Parse

func (p *ShellParser) Parse(ctx context.Context, code string, filename string) ([]*chunking.CodeChunk, error)

Parse parses shell script code and returns code chunks

type TypeScriptParser

type TypeScriptParser struct{}

TypeScriptParser handles parsing TypeScript code

func NewTypeScriptParser

func NewTypeScriptParser() *TypeScriptParser

NewTypeScriptParser creates a new TypeScript parser instance

func (*TypeScriptParser) GetLanguage

func (p *TypeScriptParser) GetLanguage() chunking.Language

GetLanguage returns the language this parser handles

func (*TypeScriptParser) Parse

func (p *TypeScriptParser) Parse(ctx context.Context, code string, filename string) ([]*chunking.CodeChunk, error)

Parse parses TypeScript code and returns chunks

Jump to

Keyboard shortcuts

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