Documentation ¶
Overview ¶
Package prs implements parser based on the tree-sitter parser.
Index ¶
- Constants
- func ParsePackages(packages Packages)
- type Arg
- type BinaryExpr
- type BinaryOperator
- type BitString
- type Bool
- type Call
- type Const
- type DeclaredIdentifier
- type Expr
- type File
- type Functionality
- type Import
- type Inst
- func (i Inst) Args() []Arg
- func (s Inst) Col() int
- func (i Inst) Count() Expr
- func (s Inst) Doc() string
- func (i Inst) File() *File
- func (i *Inst) GetConst(name string) (*Const, error)
- func (i *Inst) GetInst(name string) (*Inst, error)
- func (i *Inst) GetType(name string) (*Type, error)
- func (i Inst) IsArray() bool
- func (i Inst) Kind() SymbolKind
- func (s Inst) Line() int
- func (s Inst) Name() string
- func (i Inst) Params() []Param
- func (i Inst) Props() PropContainer
- func (i Inst) ResolvedArgs() map[string]Expr
- func (s Inst) Scope() Scope
- func (i *Inst) SetResolvedArgs(ra map[string]Expr)
- func (i Inst) Symbols() []Symbol
- func (i Inst) Type() string
- type Int
- type List
- type Package
- type Packages
- type Param
- type Prop
- type PropContainer
- type Real
- type Scope
- type String
- type Symbol
- type SymbolKind
- type Time
- type Type
- func (t Type) Args() []Arg
- func (s Type) Col() int
- func (t Type) Count() Expr
- func (s Type) Doc() string
- func (s Type) File() *File
- func (t *Type) GetConst(name string) (*Const, error)
- func (t *Type) GetInst(name string) (*Inst, error)
- func (t *Type) GetType(name string) (*Type, error)
- func (t Type) IsArray() bool
- func (t Type) Kind() SymbolKind
- func (s Type) Line() int
- func (s Type) Name() string
- func (t Type) Params() []Param
- func (t Type) Props() PropContainer
- func (t Type) ResolvedArgs() map[string]Expr
- func (s Type) Scope() Scope
- func (t *Type) SetResolvedArgs(ra map[string]Expr)
- func (t Type) Symbols() []Symbol
- func (t Type) Type() string
- type UnaryExpr
- type UnaryOperator
Constants ¶
View Source
const ( UnaryPlus = iota UnaryMinus )
Variables ¶
This section is empty.
Functions ¶
func ParsePackages ¶
func ParsePackages(packages Packages)
Types ¶
type BinaryExpr ¶
type BinaryExpr struct {
// contains filtered or unexported fields
}
func MakeBinaryExpr ¶
func MakeBinaryExpr(e ast.BinaryExpr, src []byte, s Scope) (BinaryExpr, error)
type BinaryOperator ¶
type BinaryOperator uint8
const ( Add BinaryOperator = iota Subtract Multiply Divide Modulo Power LeftShift RightShift )
type Const ¶
type Const struct { Value Expr // contains filtered or unexported fields }
Const represents constant definition.
func (Const) Kind ¶
func (c Const) Kind() SymbolKind
type DeclaredIdentifier ¶
type DeclaredIdentifier struct {
// contains filtered or unexported fields
}
func MakeDeclaredIdentifier ¶
func MakeDeclaredIdentifier(e ast.Ident, src []byte, s Scope) DeclaredIdentifier
type File ¶
type Functionality ¶
type Functionality interface { Scope Symbol IsArray() bool Count() Expr Type() string Args() []Arg Params() []Param SetResolvedArgs(args map[string]Expr) ResolvedArgs() map[string]Expr Props() PropContainer Symbols() []Symbol }
Functionality is common interface for Inst and Type structs. Type is actually a functionality, but not instantiated.
type Inst ¶
type Inst struct {
// contains filtered or unexported fields
}
Inst struct represents functionality instantiation.
func (Inst) Kind ¶
func (i Inst) Kind() SymbolKind
func (Inst) Props ¶
func (i Inst) Props() PropContainer
func (Inst) ResolvedArgs ¶
func (*Inst) SetResolvedArgs ¶
type Package ¶
type Packages ¶
func DiscoverPackages ¶
func (Packages) GetMatching ¶
GetMatching returns list of pointers to packages which Path contains path suffix.
type Param ¶
Param struct represents parameter in the type definition parameter list, not the 'param' functionality.
type PropContainer ¶
type PropContainer []Prop
func (*PropContainer) Add ¶
func (pc *PropContainer) Add(prop Prop) bool
type SymbolKind ¶
type SymbolKind uint8
const ( ConstDef SymbolKind = iota // Constant Definition TypeDef // Type Definition FuncInst // Functionality Instantiation )
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
Type represents type definition.
func (Type) Kind ¶
func (t Type) Kind() SymbolKind
func (Type) Props ¶
func (t Type) Props() PropContainer
func (Type) ResolvedArgs ¶
func (*Type) SetResolvedArgs ¶
type UnaryOperator ¶
type UnaryOperator uint8
Click to show internal directories.
Click to hide internal directories.