parser

package
v0.0.0-...-020b95d Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InterfaceDecl   = "interface_declaration"
	PackageDecl     = "package_declaration"
	MethodDecl      = "method_declaration"
	ClassDecl       = "class_declaration"
	FieldDecl       = "field_declaration"
	ConstructorDecl = "constructor_declaration"
	VariableDecl    = "variable_declarator"

	Identifier       = "identifier"
	TypeIdentifier   = "type_identifier"
	ScopedIdentifier = "scoped_identifier"

	ClassBody = "class_body"

	Modifiers     = "modifiers"
	InterfaceBody = "interface_body"

	FormalParameters = "formal_parameters"
	FormalParameter  = "formal_parameter"

	IntegralType      = "integral_type"       // byte, short, int, long, char
	FloatingPointType = "floating_point_type" // float, double
	BooleanType       = "boolean_type"
	GenericType       = "generic_type" // List, Map ...
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg struct {
	Name string
	Type string
}

type JavaClass

type JavaClass struct {
	Name            string
	Fields          []*JavaField
	Methods         []*JavaMethod
	GetterMethodMap map[string]bool
}

type JavaField

type JavaField struct {
	Name string
	Type string

	Modifier string
}

type JavaInterface

type JavaInterface struct {
	Name    string
	Methods []*JavaMethod
}

type JavaMethod

type JavaMethod struct {
	Name string

	Modifier   string
	ReturnType string
	Args       []*Arg
}

type JavaParser

type JavaParser struct {
	PackageName string
	Interfaces  []*JavaInterface
	Classes     []*JavaClass
	// contains filtered or unexported fields
}

func NewParser

func NewParser(filepath string) (*JavaParser, error)

func (*JavaParser) AddPackagePrefix

func (jp *JavaParser) AddPackagePrefix(s string) string

func (*JavaParser) ParseFile

func (jp *JavaParser) ParseFile()

Jump to

Keyboard shortcuts

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