clang

package
v0.0.0-...-1f315ce Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: MIT Imports: 3 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:" @@     "`
	Name string `parser:" @Ident? "`
}

type CHeaderFileAST

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

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) CollectStructs

func (a CHeaderFileAST) CollectStructs() []TypedefStruct

type EnumValue

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

type Expr

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

type StructField

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

type StructFunction

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

type StructVariable

type StructVariable struct {
	Type Type   `parser:" @@     "`
	Name string `parser:" @Ident "`
}

type Type

type Type struct {
	IsConst   bool   `parser:" @'const'? "`
	Name      string `parser:" @Ident    "`
	IsPointer bool   `parser:" @'*'?     "`
}

func (Type) String

func (t Type) String() string

type TypedefAlias

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

type TypedefEnum

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

type TypedefFunction

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

type TypedefStruct

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

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