clang

package
v0.3.18 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument struct {
	Type Type   `parser:" @@                               " json:",omitempty"`
	Name string `parser:" ( @Ident | '(' '*' @Ident ')' )? " json:",omitempty"`
}

void (*p_func)(void *, uint32_t)

func (Argument) CStyleString

func (a Argument) CStyleString(i int) string

func (Argument) IsPinnable

func (a Argument) IsPinnable() bool

func (Argument) ResolvedName

func (a Argument) ResolvedName(i int) string

type CHeaderFileAST

type CHeaderFileAST struct {
	Expr []Expr `parser:" @@* " json:",omitempty"`
}

func ParseCString

func ParseCString(s string) (CHeaderFileAST, error)

func (CHeaderFileAST) CollectAliases

func (a CHeaderFileAST) CollectAliases() []TypedefAlias

func (CHeaderFileAST) CollectEnums

func (a CHeaderFileAST) CollectEnums() []TypedefEnum

func (CHeaderFileAST) CollectFunctions

func (a CHeaderFileAST) CollectFunctions() []TypedefFunction

func (CHeaderFileAST) CollectGDExtensionInterfaceFunctions

func (a CHeaderFileAST) CollectGDExtensionInterfaceFunctions() []TypedefFunction

func (CHeaderFileAST) CollectNonGDExtensionInterfaceFunctions

func (a CHeaderFileAST) CollectNonGDExtensionInterfaceFunctions() []TypedefFunction

func (CHeaderFileAST) CollectStructs

func (a CHeaderFileAST) CollectStructs() []TypedefStruct

func (CHeaderFileAST) FindVariantEnumType added in v0.3.13

func (a CHeaderFileAST) FindVariantEnumType() *TypedefEnum

type EnumValue

type EnumValue struct {
	Name          string  `parser:" @Ident                     " json:",omitempty"`
	IntValue      *int    `parser:" ( '=' ( @Int               " json:",omitempty"`
	ConstRefValue *string `parser:"              | @Ident ) )? " json:",omitempty"`
}

type Expr

type Expr struct {
	Comment  string           `parser:"   @Comment " json:",omitempty"`
	Enum     *TypedefEnum     `parser:" | @@ ';'   " json:",omitempty"`
	Alias    *TypedefAlias    `parser:" | @@ ';'   " json:",omitempty"`
	Function *TypedefFunction `parser:" | @@ ';'   " json:",omitempty"`
	Struct   *TypedefStruct   `parser:" | @@ ';'   " json:",omitempty"`
}

type FunctionType

type FunctionType struct {
	ReturnType PrimativeType `parser:" @@                          " json:",omitempty"`
	Name       string        `parser:" '(' '*' @Ident ')'          " json:",omitempty"`
	Arguments  []Argument    `parser:" '(' ( @@ ( ',' @@ )* )? ')' " json:",omitempty"`
}

func (FunctionType) CStyleString

func (t FunctionType) CStyleString() string

type PrimativeType

type PrimativeType struct {
	IsConst   bool   `parser:" @'const'? " json:",omitempty"`
	Name      string `parser:" @Ident    " json:",omitempty"`
	IsPointer bool   `parser:" @'*'?     " json:",omitempty"`
}

func (PrimativeType) CStyleString

func (t PrimativeType) CStyleString() string

type StructField

type StructField struct {
	Variable *StructVariable `parser:" ( @@       " json:",omitempty"`
	Function *StructFunction `parser:" | @@ ) ';' " json:",omitempty"`
}

type StructFunction

type StructFunction struct {
	ReturnType PrimativeType `parser:" @@                     " json:",omitempty"`
	Name       string        `parser:" '(' '*' @Ident ')'     " json:",omitempty"`
	Arguments  []Argument    `parser:" '(' @@ ( ',' @@ )* ')' " json:",omitempty"`
	Comment    string        `parser:" @Comment?              " json:",omitempty"`
}

type StructVariable

type StructVariable struct {
	Type PrimativeType `parser:" @@     " json:",omitempty"`
	Name string        `parser:" @Ident " json:",omitempty"`
}

type Type

type Type struct {
	Function  *FunctionType  `parser:" ( @@   " json:",omitempty"`
	Primative *PrimativeType `parser:" | @@ ) " json:",omitempty"`
}

func (Type) CStyleString

func (t Type) CStyleString() string

type TypedefAlias

type TypedefAlias struct {
	Type PrimativeType `parser:" 'typedef' @@ " json:",omitempty"`
	Name string        `parser:" @Ident       " json:",omitempty"`
}

type TypedefEnum

type TypedefEnum struct {
	Values []EnumValue `parser:" 'typedef' 'enum' '{' ( @@ ( ',' Comment? @@ Comment? )* ','? Comment? )? '}' " json:",omitempty"`
	Name   *string     `parser:" @Ident                                                                       " json:",omitempty"`
}

type TypedefFunction

type TypedefFunction struct {
	ReturnType PrimativeType `parser:" 'typedef' @@                " json:",omitempty"`
	Name       string        `parser:" '(' '*' @Ident ')'          " json:",omitempty"`
	Arguments  []Argument    `parser:" '(' ( @@ ( ',' @@ )* )? ')' " json:",omitempty"`
}

type TypedefStruct

type TypedefStruct struct {
	Fields []StructField `parser:" 'typedef' 'struct' '{' @@* '}' " json:",omitempty"`
	Name   string        `parser:" @Ident                         " json:",omitempty"`
}

func (TypedefStruct) CollectFunctions

func (t TypedefStruct) CollectFunctions() []StructFunction

Jump to

Keyboard shortcuts

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