parser

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Def

type Def interface {
	String() string
	ShortType() string
	Type() (types.Type, error)
	Optional() bool
}

type Expression

type Expression interface {
	String() string
}

type IntegerLiteral

type IntegerLiteral struct {
	Value int32 `parser:"@Int"`
}

func (*IntegerLiteral) String

func (l *IntegerLiteral) String() string

type ParamName

type ParamName struct {
	Name string `parser:"@Identifier"`
}

func (*ParamName) String

func (p *ParamName) String() string

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func New

func New() (*Parser, error)

func (*Parser) Parse

func (p *Parser) Parse(r io.Reader) (*TypeExpression, error)

func (*Parser) ParseBytes

func (p *Parser) ParseBytes(expr []byte) (*TypeExpression, error)

func (*Parser) ParseString

func (p *Parser) ParseString(str string) (*TypeExpression, error)

type Type

type Type struct {
	TypeDef Def `parser:"@@"`
}

func (*Type) Optional

func (t *Type) Optional() bool

func (*Type) ShortType

func (t *Type) ShortType() string

func (*Type) String

func (t *Type) String() string

func (*Type) Type

func (t *Type) Type() (types.Type, error)

type TypeExpression

type TypeExpression struct {
	Expr Expression `parser:"@@"`
}

func (TypeExpression) MarshalYAML

func (t TypeExpression) MarshalYAML() (interface{}, error)

func (TypeExpression) String

func (t TypeExpression) String() string

func (*TypeExpression) UnmarshalYAML

func (t *TypeExpression) UnmarshalYAML(fn func(interface{}) error) error

Jump to

Keyboard shortcuts

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