parser

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: BSD-3-Clause, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Defs = map[string]Decl{}
View Source
var FileDefs = map[string][]Decl{}
View Source
var TargetFileList = map[string]void{
	"cef_types.h":                         setElement,
	"cef_types_win.h":                     setElement,
	"cef_accessibility_handler_capi.h":    setElement,
	"cef_app_capi.h":                      setElement,
	"cef_auth_callback_capi.h":            setElement,
	"cef_browser_capi.h":                  setElement,
	"cef_browser_process_handler_capi.h":  setElement,
	"cef_callback_capi.h":                 setElement,
	"cef_cookie_capi.h":                   setElement,
	"cef_client_capi.h":                   setElement,
	"cef_command_line_capi.h":             setElement,
	"cef_context_menu_handler_capi.h":     setElement,
	"cef_dialog_handler_capi.h":           setElement,
	"cef_display_handler_capi.h":          setElement,
	"cef_download_handler_capi.h":         setElement,
	"cef_download_item_capi.h":            setElement,
	"cef_dom_capi.h":                      setElement,
	"cef_drag_data_capi.h":                setElement,
	"cef_drag_handler_capi.h":             setElement,
	"cef_extension_capi.h":                setElement,
	"cef_extension_handler_capi.h":        setElement,
	"cef_frame_capi.h":                    setElement,
	"cef_find_handler_capi.h":             setElement,
	"cef_focus_handler_capi.h":            setElement,
	"cef_image_capi.h":                    setElement,
	"cef_jsdialog_handler_capi.h":         setElement,
	"cef_keyboard_handler_capi.h":         setElement,
	"cef_life_span_handler_capi.h":        setElement,
	"cef_load_handler_capi.h":             setElement,
	"cef_menu_model_capi.h":               setElement,
	"cef_menu_model_delegate_capi.h":      setElement,
	"cef_process_message_capi.h":          setElement,
	"cef_navigation_entry_capi.h":         setElement,
	"cef_print_handler_capi.h":            setElement,
	"cef_print_settings_capi.h":           setElement,
	"cef_render_handler_capi.h":           setElement,
	"cef_render_process_handler_capi.h":   setElement,
	"cef_request_capi.h":                  setElement,
	"cef_request_callback_capi.h":         setElement,
	"cef_request_context_capi.h":          setElement,
	"cef_request_context_handler_capi.h":  setElement,
	"cef_request_handler_capi.h":          setElement,
	"cef_resource_handler_capi.h":         setElement,
	"cef_resource_bundle_handler_capi.h":  setElement,
	"cef_resource_request_handler_capi.h": setElement,
	"cef_response_filter_capi.h":          setElement,
	"cef_ssl_info_capi.h":                 setElement,
	"cef_ssl_status_capi.h":               setElement,
	"cef_string_visitor_capi.h":           setElement,
	"cef_stream_capi.h":                   setElement,
	"cef_response_capi.h":                 setElement,
	"cef_scheme_capi.h":                   setElement,
	"cef_task_capi.h":                     setElement,
	"cef_urlrequest_capi.h":               setElement,
	"cef_v8_capi.h":                       setElement,
	"cef_values_capi.h":                   setElement,
	"cef_x509_certificate_capi.h":         setElement,
	"cef_web_plugin_capi.h":               setElement,

	"cef_string_list.h":     setElement,
	"cef_string_map.h":      setElement,
	"cef_string_multimap.h": setElement,
	"cef_time.h":            setElement,

	"cef_box_layout_capi.h":            setElement,
	"cef_browser_view_delegate_capi.h": setElement,
	"cef_browser_view_capi.h":          setElement,
	"cef_button_capi.h":                setElement,
	"cef_button_delegate_capi.h":       setElement,
	"cef_display_capi.h":               setElement,
	"cef_fill_layout_capi.h":           setElement,
	"cef_label_button_capi.h":          setElement,
	"cef_layout_capi.h":                setElement,
	"cef_menu_button_capi.h":           setElement,
	"cef_menu_button_delegate_capi.h":  setElement,
	"cef_panel_capi.h":                 setElement,
	"cef_panel_delegate_capi.h":        setElement,
	"cef_scroll_view_capi.h":           setElement,
	"cef_textfield_capi.h":             setElement,
	"cef_textfield_delegate_capi.h":    setElement,
	"cef_view_capi.h":                  setElement,
	"cef_view_delegate_capi.h":         setElement,
	"cef_window_capi.h":                setElement,
	"cef_window_delegate_capi.h":       setElement,
}

Functions

func ExternalDeclaration

func ExternalDeclaration(i int, ed *cc.ExternalDeclaration)

ExternalDeclaration:

FunctionDefinition

| Declaration // Case 1 | BasicAssemblerStatement ';' // Case 2 | ';' // Case 3

func GetCurrentDir

func GetCurrentDir() string

__DIR__

func HasHandlerClass

func HasHandlerClass(fname string) bool

func InCefHeader

func InCefHeader(t Token) bool

func InTargetFile

func InTargetFile(t Token) (f bool, fname string)

func IsHandlerClass

func IsHandlerClass(t Token) (c bool)

func Parse

func Parse() []*cc.TranslationUnit

Types

type Callable added in v0.2.0

type Callable interface {
	Params() []Param
	HasReturnValue() bool
	HasOutParam() bool
	IsBoolValueMethod() bool
	ReturnGoType() string
	ReturnType() Type
}

type Callee

type Callee interface {
	CalleeName() string
}

type CefClassDecl added in v0.2.0

type CefClassDecl struct {
	DeclCommon
	St       StructType
	BaseType string
	Methods  []*MethodDecl
}

func (*CefClassDecl) GetBase added in v0.2.5

func (s *CefClassDecl) GetBase() (base *CefClassDecl)

func (*CefClassDecl) SetComment added in v0.2.0

func (s *CefClassDecl) SetComment(comments map[int][]string)

type Decl

type Decl interface {
	SetComment(comments map[int][]string)
	Common() *DeclCommon
}

type DeclCommon

type DeclCommon struct {
	Dk DefKind

	Comment []string
	// contains filtered or unexported fields
}

func (DeclCommon) BaseName

func (decl DeclCommon) BaseName() string

func (DeclCommon) Call

func (decl DeclCommon) Call() (call string)

func (DeclCommon) CefName

func (decl DeclCommon) CefName() string

func (*DeclCommon) Common

func (d *DeclCommon) Common() *DeclCommon

func (DeclCommon) FilePos

func (decl DeclCommon) FilePos() string

func (DeclCommon) GoName

func (decl DeclCommon) GoName() string

func (DeclCommon) Line

func (decl DeclCommon) Line() int

func (DeclCommon) LineOfTypedef

func (decl DeclCommon) LineOfTypedef() (lineno int)

func (DeclCommon) RetStr

func (decl DeclCommon) RetStr() (str string)

func (*DeclCommon) SetComment

func (s *DeclCommon) SetComment(comments map[int][]string)

func (DeclCommon) Token

func (decl DeclCommon) Token() Token

type DefKind

type DefKind int
const (
	DkUnknown DefKind = iota
	DkUnhandled
	DkSimple
	DkEnum
	DkCefClass
	DkFunc
	DkStruct
)

func (DefKind) String

func (i DefKind) String() string

type EnumDecl

type EnumDecl struct {
	DeclCommon
	Enums []Token
}

type FuncDecl

type FuncDecl struct {
	DeclCommon
	Funcname Token
	// contains filtered or unexported fields
}

func (*FuncDecl) CalleeName

func (f *FuncDecl) CalleeName() string

func (FuncDecl) HasOutParam added in v0.2.0

func (f FuncDecl) HasOutParam() (has bool)

func (FuncDecl) HasReturnValue added in v0.2.0

func (f FuncDecl) HasReturnValue() (has bool)

func (FuncDecl) IsBoolValueMethod

func (f FuncDecl) IsBoolValueMethod() (boolMethod bool)

func (FuncDecl) Params

func (f FuncDecl) Params() []Param

func (FuncDecl) ReturnGoType

func (f FuncDecl) ReturnGoType() string

func (*FuncDecl) ReturnType

func (f *FuncDecl) ReturnType() (retType Type)

type IdentKind

type IdentKind int
const (
	IkNone IdentKind = iota
	IkName
	IkFunc
	IkArray
	IkStructTag
)

func (IdentKind) String

func (i IdentKind) String() string

type Member added in v0.2.0

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

func (Member) GoName added in v0.2.0

func (m Member) GoName() string

func (Member) GoType added in v0.2.0

func (m Member) GoType() string

func (Member) Name added in v0.2.0

func (m Member) Name() string

func (Member) Type added in v0.2.0

func (m Member) Type() Type

type MethodDecl

type MethodDecl struct {
	Funcname Token

	Comment []string
	// contains filtered or unexported fields
}

func (*MethodDecl) CalleeName

func (mp *MethodDecl) CalleeName() string

func (*MethodDecl) ClassBaseName

func (mp *MethodDecl) ClassBaseName() string

func (MethodDecl) FirstLine

func (m MethodDecl) FirstLine() (line int)

func (MethodDecl) HasConstParams

func (m MethodDecl) HasConstParams() (has bool)

func (MethodDecl) HasOutParam added in v0.2.0

func (m MethodDecl) HasOutParam() (has bool)

func (MethodDecl) HasReturnValue added in v0.2.0

func (m MethodDecl) HasReturnValue() (has bool)

func (MethodDecl) IfName

func (m MethodDecl) IfName() (ifname string)

func (MethodDecl) IsBoolValueMethod

func (m MethodDecl) IsBoolValueMethod() (boolMethod bool)

func (MethodDecl) IsGetFunc

func (m MethodDecl) IsGetFunc() bool

func (MethodDecl) Params

func (m MethodDecl) Params() []Param

func (MethodDecl) ReturnGoType

func (m MethodDecl) ReturnGoType() string

func (MethodDecl) ReturnType

func (m MethodDecl) ReturnType() (retType Type)

func (MethodDecl) Type

func (m MethodDecl) Type() string

type Param

type Param struct {
	Callee
	Variadic bool
	// contains filtered or unexported fields
}

func (Param) CType

func (p Param) CType() (t string)

func (Param) GoCType

func (p Param) GoCType() (t string)

func (Param) GoType

func (p Param) GoType() (t string)

func (Param) GoTypeIn added in v0.2.0

func (p Param) GoTypeIn() (t string)

func (Param) IsBoolParam

func (p Param) IsBoolParam() (isBool bool)

func (Param) IsByteSliceLengthParam

func (p Param) IsByteSliceLengthParam() (isByteSliceLength bool)

func (Param) IsByteSliceParam

func (p Param) IsByteSliceParam() (isByteSlice bool, maxLengthArg string)

func (Param) IsHandlerClass

func (p Param) IsHandlerClass() bool

func (Param) IsInOutParam

func (p Param) IsInOutParam() (isOut bool)

func (Param) IsOutParam

func (p Param) IsOutParam() (isOut bool)

func (Param) IsRefCountedClass

func (p Param) IsRefCountedClass() bool

func (Param) IsScopedClass

func (p Param) IsScopedClass() bool

func (Param) IsSliceLengthParam

func (p Param) IsSliceLengthParam() (isSliceLength bool)

func (Param) IsSliceParam

func (p Param) IsSliceParam() (isSlice bool, maxLengthArg string)

func (Param) Name

func (p Param) Name() string

func (Param) String

func (p Param) String() string

func (Param) Type

func (p Param) Type() (ty Type)

type SimpleDecl

type SimpleDecl struct {
	DeclCommon
}

type StructDecl

type StructDecl struct {
	DeclCommon
	Members []Member
}

type StructType

type StructType int
const (
	StUnknown StructType = iota
	StRefCounted
	StScoped
	StYetNotDefined
)

func (StructType) String

func (i StructType) String() string

type Token

type Token xc.Token

func (Token) AbsFilename

func (t Token) AbsFilename() string

func (Token) BaseName

func (t Token) BaseName() string

func (Token) FilePos

func (t Token) FilePos() string

func (Token) Filename

func (t Token) Filename() string

func (Token) GoName

func (t Token) GoName() string

func (Token) Line

func (t Token) Line() int

func (Token) Name

func (t Token) Name() string

func (Token) String

func (t Token) String() string

func (Token) TitleCase

func (t Token) TitleCase() string

type Ty

type Ty int
const (
	TyUnknown Ty = iota
	TyVoid
	TyChar
	TyUnsigned
	TyInt
	TyLong
	TyLongLong
	TyULong
	TyULongLong
	TyFloat
	TyDouble
	TySizeT
	TyHWND
	TyStructUnhandled
	TyStructSimple
	TyStructRefCounted
	TyStructScoped
	TyStructNotDefined
	TyInt16
	TyInt32
	TyInt64
	TyUint16
	TyUint32
	TyUint64
	TyTimeT
	TyStringT
	TyStringUserfreeT
	TyOther
	TyEnum
	TySimple
	TyMSG
	TyHCURSOR
	TyHINSTANCE
	TyDWORD
	TyHMENU
)

func (Ty) String

func (i Ty) String() string

type Type

type Type struct {
	Ty
	Pointer int
	Const   bool
	Token   Token
	Typedef bool
	Tq      []TypeQualifier
}

func (Type) BaseName

func (t Type) BaseName() (ret string)

func (Type) CType

func (t Type) CType() (ret string)

func (Type) Deref added in v0.2.0

func (t Type) Deref() (t0 Type)

func (Type) GoCType

func (t Type) GoCType() (ct string)

func (Type) GoType

func (t Type) GoType() (ret string)

func (Type) IsHandlerClass

func (t Type) IsHandlerClass() bool

func (Type) IsRefCountedClass

func (t Type) IsRefCountedClass() bool

func (Type) IsScopedClass

func (t Type) IsScopedClass() bool

func (Type) IsSimpleDefName

func (t Type) IsSimpleDefName() bool

func (Type) Name

func (t Type) Name() string

func (Type) String

func (t Type) String() string

func (Type) TitleCase

func (t Type) TitleCase() (ret string)

type TypeQualifier

type TypeQualifier int
const (
	TqUnknown TypeQualifier = iota
	TqConst
	TqPointer
)

func (TypeQualifier) String

func (i TypeQualifier) String() string

type UnhandledDecl

type UnhandledDecl struct {
	DeclCommon
}

Jump to

Keyboard shortcuts

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