parser

package
v0.0.0-...-a4d875f Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Comment    string
	Package    string
	Imports    []NamedTypeValue
	Constants  []NamedTypeValue
	Vars       []NamedTypeValue
	Interfaces []Interface
	Structs    []Struct
	Methods    []Method
}

func NewFile

func NewFile() File

func (*File) String

func (f *File) String() string

type FileParser

type FileParser struct{}

func NewFileParser

func NewFileParser() *FileParser

func (*FileParser) Parse

func (fp *FileParser) Parse(src []byte) (*File, error)

type Interface

type Interface struct {
	Name    string
	Comment string
	Methods []Method
}

func NewInterface

func NewInterface(name string, methods []Method) Interface

func NewInterfaceWithComment

func NewInterfaceWithComment(name string, comment string, methods []Method) Interface

func (*Interface) String

func (i *Interface) String() string

type Method

type Method struct {
	Comment    string
	Name       string
	Struct     NamedTypeValue
	Body       string
	Parameters []NamedTypeValue
	Results    []NamedTypeValue
}

func NewMethod

func NewMethod(name string, str NamedTypeValue, body string, parameters, results []NamedTypeValue) Method

func NewMethodWithComment

func NewMethodWithComment(name string, comment string, str NamedTypeValue, body string, parameters, results []NamedTypeValue) Method

func (*Method) String

func (m *Method) String() string

type NamedTypeValue

type NamedTypeValue struct {
	Name     string
	Type     string
	Value    string
	HasValue bool
}

func NewNameType

func NewNameType(name string, tp string) NamedTypeValue

func NewNameTypeValue

func NewNameTypeValue(name string, tp string, vl string) NamedTypeValue

type ParsedSrc

type ParsedSrc interface {
	String() string
}

type Parser

type Parser interface {
	Parse(src []byte) (ParsedSrc, error)
}

type Struct

type Struct struct {
	Name    string
	Comment string
	Vars    []NamedTypeValue
}

func NewStruct

func NewStruct(name string, vars []NamedTypeValue) Struct

func NewStructWithComment

func NewStructWithComment(name string, comment string, vars []NamedTypeValue) Struct

func (*Struct) String

func (s *Struct) String() string

Jump to

Keyboard shortcuts

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