parser

package
v0.0.0-...-3ca7fae Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	FlagIsParam = 1 << iota
	FlagIsField
	FlagIsExtern
	FlagIsTypedef
	FlagGetRetType
)
View Source
const (
	KindFConst = 1 << iota
	KindFVolatile
	KindFAnonymous
	KindFVariadic
)

Variables

View Source
var (
	ErrInvalidType = errors.New("invalid type")
)

Functions

func ParseType

func ParseType(qualType string, conf *Config) (t types.Type, kind int, err error)

qualType can be:

  • unsigned int
  • struct ConstantString
  • volatile uint32_t
  • int (*)(void *, int, char **, char **)
  • int (*)(const char *, ...)
  • int (*)(void)
  • void (*(int, void (*)(int)))(int)
  • const char *restrict
  • const char [7]
  • char *
  • void
  • ...

Types

type Config

type Config struct {
	Pkg       *types.Package
	Scope     *types.Scope
	TyAnonym  types.Type
	TyInt128  types.Type
	TyUint128 types.Type
	Flags     int
}

type ParseTypeError

type ParseTypeError struct {
	QualType string
	ErrMsg   string
}

func (*ParseTypeError) Error

func (p *ParseTypeError) Error() string

type TypeNotFound

type TypeNotFound struct {
	Literal       string
	StructOrUnion bool
}

func (*TypeNotFound) Error

func (p *TypeNotFound) Error() string

Jump to

Keyboard shortcuts

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