parser

package
v0.0.0-...-8573741 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: LGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SIGNAL = "signal"
	SLOT   = "slot"
	PROP   = "prop"

	IMPURE = "impure"
	PURE   = "pure"

	PLAIN            = "plain"
	CONSTRUCTOR      = "constructor"
	COPY_CONSTRUCTOR = "copy-constructor"
	MOVE_CONSTRUCTOR = "move-constructor"
	DESTRUCTOR       = "destructor"

	CONNECT    = "Connect"
	DISCONNECT = "Disconnect"
	CALLBACK   = "callback"

	GETTER = "getter"
	SETTER = "setter"

	VOID = "void"

	TILDE = "~"

	MOC = "moc"
)

Variables

View Source
var LibDeps = map[string][]string{
	"Core":          {"Widgets", "Gui", "Svg"},
	"AndroidExtras": {"Core"},
	"Gui":           {"Widgets", "Core"},
	"Network":       {"Core"},
	"Xml":           {"XmlPatterns", "Core"},
	"DBus":          {"Core"},
	"Nfc":           {"Core"},
	"Script":        {"Core"},
	"Sensors":       {"Core"},
	"Positioning":   {"Core"},
	"Widgets":       {"Gui", "Core"},
	"Sql":           {"Widgets", "Gui", "Core"},
	"MacExtras":     {"Gui", "Core"},
	"Qml":           {"Network", "Core"},
	"WebSockets":    {"Network", "Core"},
	"XmlPatterns":   {"Network", "Core"},
	"Bluetooth":     {"Core"},
	"WebChannel":    {"Network", "Qml", "Core"},
	"Svg":           {"Widgets", "Gui", "Core"},
	"Multimedia":    {"MultimediaWidgets", "Widgets", "Network", "Gui", "Core"},
	"Quick":         {"QuickWidgets", "Widgets", "Network", "Qml", "Gui", "Core"},
	"Help":          {"Sql", "Network", "Widgets", "Gui", "Core"},
	"Location":      {"Positioning", "Quick", "Gui", "Core"},
	"ScriptTools":   {"Script", "Widgets", "Core"},
	"UiTools":       {"Widgets", "Gui", "Core"},
	"X11Extras":     {"Gui", "Core"},
	"WinExtras":     {"Widgets", "Gui", "Core"},
	"WebEngine":     {"Widgets", "WebEngineWidgets", "WebChannel", "Network", "WebEngineCore", "Quick", "PrintSupport", "Gui", "Qml", "Positioning", "Core"},
	"TestLib":       {"Widgets", "Gui", "Core"},
	"SerialPort":    {"Core"},
	"SerialBus":     {"Core"},
	"PrintSupport":  {"Widgets", "Gui", "Core"},

	"Designer": {"UiPlugin", "Widgets", "Gui", "Xml", "Core"},
	"Scxml":    {"Network", "Qml", "Core"},
	"Gamepad":  {"Gui", "Core"},

	"Purchasing":        {"Core"},
	"DataVisualization": {"Gui", "Core"},
	"Charts":            {"Widgets", "Gui", "Core"},

	"VirtualKeyboard": {"Quick", "Gui", "Qml", "Network", "Core"},

	"Speech":         {"Core"},
	"QuickControls2": {"Quick", "QuickWidgets", "Widgets", "Network", "Qml", "Gui", "Core"},

	"Sailfish": {"Core"},
	"WebView":  {"Core"},

	"NetworkAuth":   {"Network", "Gui", "Core"},
	"RemoteObjects": {"Network", "Core"},

	"WebKit": {"WebKitWidgets", "Multimedia", "Positioning", "Widgets", "Sql", "Network", "Gui", "Sensors", "Core"},

	MOC:            make([]string, 0),
	"build_static": {"Qml"},

	"Felgo": {"Qml", "Quick", "Widgets", "Network", "Multimedia", "Sql", "WebSockets"},
}
View Source
var LibDepsMutex = new(sync.Mutex)

TODO: remove global

View Source
var State = &struct {
	ClassMap   map[string]*Class
	GoClassMap map[string]*Class

	MocImports map[string]struct{}
	Minimal    bool //TODO:
	Target     string
}{
	ClassMap:   make(map[string]*Class),
	GoClassMap: make(map[string]*Class),
	MocImports: make(map[string]struct{}),
}

Functions

func CleanName

func CleanName(name, value string) string

func CleanValue

func CleanValue(v string) string

func Dump

func Dump()

func GetCustomLibs

func GetCustomLibs(_ string, env map[string]string, tags []string) map[string]string

func GetLibs

func GetLibs() []string

func IsBlackListedPureGoType

func IsBlackListedPureGoType(s string) bool

func IsBlockedDefault

func IsBlockedDefault() []string

func IsClass

func IsClass(value string) (string, bool)

func IsPackedList

func IsPackedList(v string) bool

func IsPackedMap

func IsPackedMap(v string) bool

func IsWhiteListedJsLib

func IsWhiteListedJsLib(name string) bool

TODO: whitelist everything once dependency issue is resolved

func IsWhiteListedRaspberryLib

func IsWhiteListedRaspberryLib(name string) bool

func IsWhiteListedSailfishLib

func IsWhiteListedSailfishLib(name string) bool

func LoadModules

func LoadModules(target string)

func LoadModulesM

func LoadModulesM(target string)

func ShouldBuildForTarget

func ShouldBuildForTarget(module, target string) bool

func ShouldBuildForTargetM

func ShouldBuildForTargetM(module, target string) bool

func SortedClassNamesForModule

func SortedClassNamesForModule(module string, template bool) []string

func UnpackedGoMapDirty

func UnpackedGoMapDirty(v string) []string

func UnpackedList

func UnpackedList(v string) string

func UnpackedListDirty

func UnpackedListDirty(v string) string

func UnpackedMap

func UnpackedMap(v string) (string, string)

func UnpackedMapDirty

func UnpackedMapDirty(v string) (string, string)

func UseJs

func UseJs() bool

func UseWasm

func UseWasm() bool

Types

type Class

type Class struct {
	Name       string      `xml:"name,attr"`
	Status     string      `xml:"status,attr"`
	Access     string      `xml:"access,attr"`
	Abstract   bool        `xml:"abstract,attr"`
	Bases      string      `xml:"bases,attr"`
	Module     string      `xml:"module,attr"`
	Brief      string      `xml:"brief,attr"`
	Functions  []*Function `xml:"function"`
	Enums      []*Enum     `xml:"enum"`
	Variables  []*Variable `xml:"variable"`
	Properties []*Variable `xml:"property"`
	Classes    []*Class    `xml:"class"`
	Since      string      `xml:"since,attr"`
	Filepath   string      `xml:"filepath,attr"`

	DocModule    string
	Stub         bool
	WeakLink     map[string]struct{}
	Export       bool
	Fullname     string
	Pkg          string
	Path         string
	HasFinalizer bool

	Constructors []string
	Derivations  []string

	ToBeCleanedUp bool

	sync.Mutex
}

func SortedClassesForModule

func SortedClassesForModule(module string, template bool) []*Class

func (*Class) FixGenericHelper

func (c *Class) FixGenericHelper()

func (*Class) GetAllBases

func (c *Class) GetAllBases() []string

func (*Class) GetAllBasesRecursiveCheckFailed

func (c *Class) GetAllBasesRecursiveCheckFailed(i int) ([]string, bool)

func (*Class) GetAllDerivations

func (c *Class) GetAllDerivations() []string

func (*Class) GetAllDerivationsInSameModule

func (c *Class) GetAllDerivationsInSameModule() []string

func (*Class) GetBases

func (c *Class) GetBases() []string

func (*Class) GetBasesSorted

func (c *Class) GetBasesSorted() []string

func (*Class) GetFunction

func (c *Class) GetFunction(fname string) *Function

func (*Class) GetFunctionWithOverloadNumber

func (c *Class) GetFunctionWithOverloadNumber(fname string, num string) *Function

func (*Class) GetTitledFunction

func (c *Class) GetTitledFunction(fname string) *Function

func (*Class) HasCallbackFunctions

func (c *Class) HasCallbackFunctions() bool

func (*Class) HasCallbackFunctionsBesideTheDestructor

func (c *Class) HasCallbackFunctionsBesideTheDestructor() bool

func (*Class) HasConstructor

func (c *Class) HasConstructor() bool

func (*Class) HasDestructor

func (c *Class) HasDestructor() bool

func (*Class) HasFunction

func (c *Class) HasFunction(f *Function) bool

func (*Class) HasFunctionWithName

func (c *Class) HasFunctionWithName(n string) bool

func (*Class) HasFunctionWithNameAndOverloadNumber

func (c *Class) HasFunctionWithNameAndOverloadNumber(n string, num string) bool

func (*Class) Hash

func (c *Class) Hash() string

func (*Class) IsPolymorphic

func (c *Class) IsPolymorphic() bool

func (*Class) IsSubClassOf

func (c *Class) IsSubClassOf(class string) bool

func (*Class) IsSubClassOfQObject

func (c *Class) IsSubClassOfQObject() bool

func (*Class) IsSupported

func (c *Class) IsSupported() bool

type Enum

type Enum struct {
	Name     string   `xml:"name,attr"`
	Fullname string   `xml:"fullname,attr"`
	Status   string   `xml:"status,attr"`
	Access   string   `xml:"access,attr"`
	Typedef  string   `xml:"typedef,attr"`
	Values   []*Value `xml:"value"`
	NoConst  bool
}

func (*Enum) Class

func (e *Enum) Class() (*Class, bool)

func (*Enum) ClassName

func (e *Enum) ClassName() string

type Function

type Function struct {
	Name              string       `xml:"name,attr"`
	Fullname          string       `xml:"fullname,attr"`
	Href              string       `xml:"href,attr"`
	Status            string       `xml:"status,attr"`
	Access            string       `xml:"access,attr"`
	Filepath          string       `xml:"filepath,attr"`
	Virtual           string       `xml:"virtual,attr"`
	Meta              string       `xml:"meta,attr"`
	Static            bool         `xml:"static,attr"`
	Overload          bool         `xml:"overload,attr"`
	OverloadNumber    string       `xml:"overload-number,attr"`
	Output            string       `xml:"type,attr"`
	Signature         string       `xml:"signature,attr"`
	Parameters        []*Parameter `xml:"parameter"`
	Brief             string       `xml:"brief,attr"`
	Since             string       `xml:"since,attr"`
	Related           string       `xml:"related,attr"`
	SignalMode        string
	TemplateModeJNI   string
	Default           bool
	TmpName           string
	Export            bool
	NeedsFinalizer    bool
	NeedsFinalizerFor []string
	Container         string
	TemplateModeGo    string
	NonMember         bool
	NoMocDeduce       bool
	Synthetic         bool
	Checked           bool
	Exception         bool
	IsMap             bool
	OgParameters      []Parameter
	OgOutput          string
	IsMocFunction     bool
	IsMocProperty     bool
	PureGoOutput      string
	Connect           int
	Target            string
	Inbound           bool
	BoundByEmscripten bool //TODO: needed at all ?
	FakeForJSCallback bool
}

func (*Function) Class

func (f *Function) Class() (*Class, bool)

func (*Function) ClassName

func (f *Function) ClassName() string

func (*Function) FindDeepestImplementation

func (f *Function) FindDeepestImplementation() string

func (*Function) Implements

func (f *Function) Implements() bool

func (*Function) IsDerivedFromImpure

func (f *Function) IsDerivedFromImpure() bool

TODO: combine

func (*Function) IsDerivedFromPure

func (f *Function) IsDerivedFromPure() bool

func (*Function) IsDerivedFromVirtual

func (f *Function) IsDerivedFromVirtual() bool

TODO: combine

func (*Function) IsJNIGeneric

func (f *Function) IsJNIGeneric() bool

func (*Function) IsSupported

func (f *Function) IsSupported() bool

TODO:

func (*Function) PossibleDerivationsInAllModules

func (f *Function) PossibleDerivationsInAllModules(self bool) ([]string, string)

func (*Function) PossibleDerivationsReversedAndRemovedPure

func (f *Function) PossibleDerivationsReversedAndRemovedPure(self bool) ([]string, string)

func (*Function) PossiblePolymorphicDerivations

func (f *Function) PossiblePolymorphicDerivations(self bool) ([]string, string)

TODO: multipoly [][]string TODO: connect/disconnect slot functions + add necessary SIGNAL_* functions (check first if really needed)

func (*Function) Root

func (f *Function) Root() *Function

type Module

type Module struct {
	Namespace *Namespace `xml:"namespace"`
	Project   string     `xml:"project,attr"`
	Pkg       string
}

func LoadModule

func LoadModule(m string) *Module

func (*Module) Prepare

func (m *Module) Prepare() error

type Namespace

type Namespace struct {
	Classes   []*Class    `xml:"class"`
	Structs   []*Class    `xml:"struct"`
	Functions []*Function `xml:"function"`
	//Enums         []*Enum         `xml:"enum"`     //TODO: uncomment
	SubNamespaces []*SubNamespace `xml:"namespace"`
}

type Parameter

type Parameter struct {
	Name       string `xml:"name,attr"`
	Value      string `xml:"left,attr"`
	ValueNew   string `xml:"type,attr"`
	Right      string `xml:"right,attr"`
	Default    string `xml:"default,attr"`
	PureGoType string
}

type SubNamespace

type SubNamespace struct {
	//Classes   []*Class    `xml:"class"`    //TODO: uncomment
	Functions []*Function `xml:"function"`
	Enums     []*Enum     `xml:"enum"`
	Status    string      `xml:"status,attr"`
	Access    string      `xml:"access,attr"`
}

type Value

type Value struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

type Variable

type Variable struct {
	Name     string     `xml:"name,attr"`
	Fullname string     `xml:"fullname,attr"`
	Href     string     `xml:"href,attr"`
	Status   string     `xml:"status,attr"`
	Access   string     `xml:"access,attr"`
	Filepath string     `xml:"filepath,attr"`
	Static   bool       `xml:"static,attr"`
	Output   string     `xml:"type,attr"`
	Brief    string     `xml:"brief,attr"`
	Getter   []struct{} `xml:"getter"`
	Setter   []struct{} `xml:"setter"`

	IsMocSynthetic bool
	PureGoType     string
	Connect        int
	ConnectGet     bool
	ConnectSet     bool
	ConnectChanged bool
	Target         string
	Inbound        bool
}

func (*Variable) Class

func (v *Variable) Class() (*Class, bool)

func (*Variable) ClassName

func (v *Variable) ClassName() string

Jump to

Keyboard shortcuts

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