Documentation
¶
Index ¶
- func DetectLanguage(filename string) string
- func SupportedExtensions() []string
- func SupportedLanguages() []string
- type AdaParser
- type BashParser
- type CParser
- type CSharpParser
- type ClojureParser
- type CobolParser
- type CppParser
- type CrystalParser
- type DartParser
- type DlangParser
- type ElixirParser
- type ErlangParser
- type Export
- type FortranParser
- type FsharpParser
- type GoParser
- type GroovyParser
- type HaskellParser
- type Import
- type JavaParser
- type JuliaParser
- type KotlinParser
- type LuaParser
- type NimParser
- type ObjCParser
- type OcamlParser
- type PHPParser
- type ParsedFile
- type Parser
- type PascalParser
- type PerlParser
- type PowershellParser
- type ProtobufParser
- type PythonParser
- type RParser
- type Registry
- type RubyParser
- type RustParser
- type SQLParser
- type ScalaParser
- type SolidityParser
- type SwiftParser
- type Symbol
- type TerraformParser
- type TypeScriptParser
- type VisualBasicParser
- type VlangParser
- type ZigParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectLanguage ¶
DetectLanguage returns the language for a file based on its extension. Returns empty string if the language is not supported.
func SupportedExtensions ¶
func SupportedExtensions() []string
SupportedExtensions returns all supported file extensions.
func SupportedLanguages ¶
func SupportedLanguages() []string
SupportedLanguages returns all unique supported language names.
Types ¶
type BashParser ¶
type BashParser struct{}
BashParser extracts structural information from Bash/shell script files via regex.
func (*BashParser) Parse ¶
func (p *BashParser) Parse(filename string, content []byte) (*ParsedFile, error)
Parse extracts structural info from Bash content.
type CParser ¶
type CParser struct{}
CParser extracts structural information from C files via regex.
type CSharpParser ¶
type CSharpParser struct{}
CSharpParser extracts structural information from C# files via regex.
func NewCSharpParser ¶
func NewCSharpParser() *CSharpParser
NewCSharpParser creates a new C# parser.
func (*CSharpParser) Parse ¶
func (p *CSharpParser) Parse(filename string, content []byte) (*ParsedFile, error)
Parse extracts structural info from C# content.
type ClojureParser ¶
type ClojureParser struct{}
func NewClojureParser ¶
func NewClojureParser() *ClojureParser
func (*ClojureParser) Language ¶
func (p *ClojureParser) Language() string
func (*ClojureParser) Parse ¶
func (p *ClojureParser) Parse(filename string, content []byte) (*ParsedFile, error)
type CobolParser ¶
type CobolParser struct{}
func NewCobolParser ¶
func NewCobolParser() *CobolParser
func (*CobolParser) Language ¶
func (p *CobolParser) Language() string
func (*CobolParser) Parse ¶
func (p *CobolParser) Parse(filename string, content []byte) (*ParsedFile, error)
type CppParser ¶
type CppParser struct{}
CppParser extracts structural information from C++ files via regex.
type CrystalParser ¶
type CrystalParser struct{}
CrystalParser extracts structural information from Crystal files via regex.
func NewCrystalParser ¶
func NewCrystalParser() *CrystalParser
func (*CrystalParser) Language ¶
func (p *CrystalParser) Language() string
func (*CrystalParser) Parse ¶
func (p *CrystalParser) Parse(filename string, content []byte) (*ParsedFile, error)
type DartParser ¶
type DartParser struct{}
DartParser extracts structural information from Dart files via regex.
func (*DartParser) Parse ¶
func (p *DartParser) Parse(filename string, content []byte) (*ParsedFile, error)
Parse extracts structural info from Dart content.
type DlangParser ¶
type DlangParser struct{}
DlangParser extracts structural information from D language files via regex.
func NewDlangParser ¶
func NewDlangParser() *DlangParser
func (*DlangParser) Language ¶
func (p *DlangParser) Language() string
func (*DlangParser) Parse ¶
func (p *DlangParser) Parse(filename string, content []byte) (*ParsedFile, error)
type ElixirParser ¶
type ElixirParser struct{}
ElixirParser extracts structural information from Elixir files via regex.
func NewElixirParser ¶
func NewElixirParser() *ElixirParser
NewElixirParser creates a new Elixir parser.
func (*ElixirParser) Parse ¶
func (p *ElixirParser) Parse(filename string, content []byte) (*ParsedFile, error)
Parse extracts structural info from Elixir content.
type ErlangParser ¶
type ErlangParser struct{}
func NewErlangParser ¶
func NewErlangParser() *ErlangParser
func (*ErlangParser) Language ¶
func (p *ErlangParser) Language() string
func (*ErlangParser) Parse ¶
func (p *ErlangParser) Parse(filename string, content []byte) (*ParsedFile, error)
type Export ¶
type Export struct {
Name string `json:"name"`
Kind string `json:"kind"` // function, type, variable, class
Line int `json:"line"`
}
Export represents an exported declaration.
type FortranParser ¶
type FortranParser struct{}
func NewFortranParser ¶
func NewFortranParser() *FortranParser
func (*FortranParser) Language ¶
func (p *FortranParser) Language() string
func (*FortranParser) Parse ¶
func (p *FortranParser) Parse(filename string, content []byte) (*ParsedFile, error)
type FsharpParser ¶
type FsharpParser struct{}
func NewFsharpParser ¶
func NewFsharpParser() *FsharpParser
func (*FsharpParser) Language ¶
func (p *FsharpParser) Language() string
func (*FsharpParser) Parse ¶
func (p *FsharpParser) Parse(filename string, content []byte) (*ParsedFile, error)
type GoParser ¶
type GoParser struct{}
GoParser extracts structural information from Go source files.
type GroovyParser ¶
type GroovyParser struct{}
func NewGroovyParser ¶
func NewGroovyParser() *GroovyParser
func (*GroovyParser) Language ¶
func (p *GroovyParser) Language() string
func (*GroovyParser) Parse ¶
func (p *GroovyParser) Parse(filename string, content []byte) (*ParsedFile, error)
type HaskellParser ¶
type HaskellParser struct{}
HaskellParser extracts structural information from Haskell files via regex.
func NewHaskellParser ¶
func NewHaskellParser() *HaskellParser
func (*HaskellParser) Language ¶
func (p *HaskellParser) Language() string
func (*HaskellParser) Parse ¶
func (p *HaskellParser) Parse(filename string, content []byte) (*ParsedFile, error)
type Import ¶
type Import struct {
Path string `json:"path"`
Names []string `json:"names,omitempty"`
IsType bool `json:"is_type,omitempty"`
Line int `json:"line"`
}
Import represents a single import statement.
type JavaParser ¶
type JavaParser struct{}
JavaParser extracts structural information from Java files via regex.
func (*JavaParser) Parse ¶
func (p *JavaParser) Parse(filename string, content []byte) (*ParsedFile, error)
Parse extracts structural info from Java content.
type JuliaParser ¶
type JuliaParser struct{}
func NewJuliaParser ¶
func NewJuliaParser() *JuliaParser
func (*JuliaParser) Language ¶
func (p *JuliaParser) Language() string
func (*JuliaParser) Parse ¶
func (p *JuliaParser) Parse(filename string, content []byte) (*ParsedFile, error)
type KotlinParser ¶
type KotlinParser struct{}
KotlinParser extracts structural information from Kotlin files via regex.
func NewKotlinParser ¶
func NewKotlinParser() *KotlinParser
NewKotlinParser creates a new Kotlin parser.
func (*KotlinParser) Parse ¶
func (p *KotlinParser) Parse(filename string, content []byte) (*ParsedFile, error)
Parse extracts structural info from Kotlin content.
type LuaParser ¶
type LuaParser struct{}
LuaParser extracts structural information from Lua files via regex.
type NimParser ¶
type NimParser struct{}
NimParser extracts structural information from Nim files via regex.
func NewNimParser ¶
func NewNimParser() *NimParser
type ObjCParser ¶
type ObjCParser struct{}
ObjCParser extracts structural information from Objective-C files via regex.
func NewObjCParser ¶
func NewObjCParser() *ObjCParser
NewObjCParser creates a new Objective-C parser.
func (*ObjCParser) Parse ¶
func (p *ObjCParser) Parse(filename string, content []byte) (*ParsedFile, error)
Parse extracts structural info from Objective-C content.
type OcamlParser ¶
type OcamlParser struct{}
func NewOcamlParser ¶
func NewOcamlParser() *OcamlParser
func (*OcamlParser) Language ¶
func (p *OcamlParser) Language() string
func (*OcamlParser) Parse ¶
func (p *OcamlParser) Parse(filename string, content []byte) (*ParsedFile, error)
type PHPParser ¶
type PHPParser struct{}
PHPParser extracts structural information from PHP files via regex.
type ParsedFile ¶
type ParsedFile struct {
Path string `json:"path"`
Language string `json:"language"`
Imports []Import `json:"imports"`
Exports []Export `json:"exports"`
Symbols []Symbol `json:"symbols"`
}
ParsedFile holds the structural analysis of a single source file.
type Parser ¶
type Parser interface {
// Language returns the language this parser handles.
Language() string
// Parse extracts structural info from a file's content.
Parse(filename string, content []byte) (*ParsedFile, error)
}
Parser extracts structural information from source files.
type PascalParser ¶
type PascalParser struct{}
func NewPascalParser ¶
func NewPascalParser() *PascalParser
func (*PascalParser) Language ¶
func (p *PascalParser) Language() string
func (*PascalParser) Parse ¶
func (p *PascalParser) Parse(filename string, content []byte) (*ParsedFile, error)
type PerlParser ¶
type PerlParser struct{}
func NewPerlParser ¶
func NewPerlParser() *PerlParser
func (*PerlParser) Language ¶
func (p *PerlParser) Language() string
func (*PerlParser) Parse ¶
func (p *PerlParser) Parse(filename string, content []byte) (*ParsedFile, error)
type PowershellParser ¶
type PowershellParser struct{}
func NewPowershellParser ¶
func NewPowershellParser() *PowershellParser
func (*PowershellParser) Language ¶
func (p *PowershellParser) Language() string
func (*PowershellParser) Parse ¶
func (p *PowershellParser) Parse(filename string, content []byte) (*ParsedFile, error)
type ProtobufParser ¶
type ProtobufParser struct{}
func NewProtobufParser ¶
func NewProtobufParser() *ProtobufParser
func (*ProtobufParser) Language ¶
func (p *ProtobufParser) Language() string
func (*ProtobufParser) Parse ¶
func (p *ProtobufParser) Parse(filename string, content []byte) (*ParsedFile, error)
type PythonParser ¶
type PythonParser struct{}
PythonParser extracts structural information from Python files via regex.
func NewPythonParser ¶
func NewPythonParser() *PythonParser
NewPythonParser creates a new Python parser.
func (*PythonParser) Parse ¶
func (p *PythonParser) Parse(filename string, content []byte) (*ParsedFile, error)
Parse extracts structural info from Python content.
type RParser ¶
type RParser struct{}
RParser extracts structural information from R files via regex.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages parsers for different languages.
type RubyParser ¶
type RubyParser struct{}
RubyParser extracts structural information from Ruby files via regex.
func (*RubyParser) Parse ¶
func (p *RubyParser) Parse(filename string, content []byte) (*ParsedFile, error)
Parse extracts structural info from Ruby content.
type RustParser ¶
type RustParser struct{}
RustParser extracts structural information from Rust files via regex.
func (*RustParser) Parse ¶
func (p *RustParser) Parse(filename string, content []byte) (*ParsedFile, error)
Parse extracts structural info from Rust content.
type SQLParser ¶
type SQLParser struct{}
SQLParser extracts structural information from SQL files via regex.
type ScalaParser ¶
type ScalaParser struct{}
ScalaParser extracts structural information from Scala files via regex.
func (*ScalaParser) Parse ¶
func (p *ScalaParser) Parse(filename string, content []byte) (*ParsedFile, error)
Parse extracts structural info from Scala content.
type SolidityParser ¶
type SolidityParser struct{}
func NewSolidityParser ¶
func NewSolidityParser() *SolidityParser
func (*SolidityParser) Language ¶
func (p *SolidityParser) Language() string
func (*SolidityParser) Parse ¶
func (p *SolidityParser) Parse(filename string, content []byte) (*ParsedFile, error)
type SwiftParser ¶
type SwiftParser struct{}
SwiftParser extracts structural information from Swift files via regex.
func (*SwiftParser) Parse ¶
func (p *SwiftParser) Parse(filename string, content []byte) (*ParsedFile, error)
Parse extracts structural info from Swift content.
type Symbol ¶
type Symbol struct {
Name string `json:"name"`
Kind string `json:"kind"` // function, type, variable, method, class
Exported bool `json:"exported"`
Line int `json:"line"`
EndLine int `json:"end_line,omitempty"`
Signature string `json:"signature,omitempty"`
}
Symbol represents a named declaration in the file.
type TerraformParser ¶
type TerraformParser struct{}
func NewTerraformParser ¶
func NewTerraformParser() *TerraformParser
func (*TerraformParser) Language ¶
func (p *TerraformParser) Language() string
func (*TerraformParser) Parse ¶
func (p *TerraformParser) Parse(filename string, content []byte) (*ParsedFile, error)
type TypeScriptParser ¶
type TypeScriptParser struct{}
TypeScriptParser extracts structural information from TS/JS files via regex.
func NewTypeScriptParser ¶
func NewTypeScriptParser() *TypeScriptParser
NewTypeScriptParser creates a new TypeScript/JavaScript parser.
func (*TypeScriptParser) Language ¶
func (p *TypeScriptParser) Language() string
Language returns "typescript".
func (*TypeScriptParser) Parse ¶
func (p *TypeScriptParser) Parse(filename string, content []byte) (*ParsedFile, error)
Parse extracts structural info from TypeScript/JavaScript content.
type VisualBasicParser ¶
type VisualBasicParser struct{}
func NewVisualBasicParser ¶
func NewVisualBasicParser() *VisualBasicParser
func (*VisualBasicParser) Language ¶
func (p *VisualBasicParser) Language() string
func (*VisualBasicParser) Parse ¶
func (p *VisualBasicParser) Parse(filename string, content []byte) (*ParsedFile, error)
type VlangParser ¶
type VlangParser struct{}
VlangParser extracts structural information from V language files via regex.
func NewVlangParser ¶
func NewVlangParser() *VlangParser
func (*VlangParser) Language ¶
func (p *VlangParser) Language() string
func (*VlangParser) Parse ¶
func (p *VlangParser) Parse(filename string, content []byte) (*ParsedFile, error)
Source Files
¶
- ada.go
- bash.go
- c.go
- clojure.go
- cobol.go
- cpp.go
- crystal.go
- csharp.go
- dart.go
- dlang.go
- elixir.go
- erlang.go
- fortran.go
- fsharp.go
- golang.go
- groovy.go
- haskell.go
- java.go
- julia.go
- kotlin.go
- lua.go
- nim.go
- objc.go
- ocaml.go
- parser.go
- pascal.go
- perl.go
- php.go
- powershell.go
- protobuf.go
- python.go
- r.go
- registry.go
- ruby.go
- rust.go
- scala.go
- solidity.go
- sql.go
- swift.go
- terraform.go
- typescript.go
- visualbasic.go
- vlang.go
- zig.go