parser

package
v0.0.0-...-0f99eb6 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2017 License: LGPL-3.0 Imports: 11 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", "Gui", "Qml", "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"},

	"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_ios": {"Core", "Gui", "Network", "Sql", "Xml", "Nfc", "Script", "Sensors", "Positioning", "Widgets", "Qml", "WebSockets", "XmlPatterns", "Bluetooth", "WebChannel", "Svg", "Multimedia", "Quick", "Help", "Location", "ScriptTools", "MultimediaWidgets", "UiTools", "PrintSupport", "WebView"},
}

TODO: remove global

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

	MocImports map[string]struct{}
	Minimal    bool //TODO:
	Target     string
}{
	ClassMap:   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(target, tags string) map[string]string

func GetLibs

func GetLibs() []string

func IsBlockedDefault

func IsBlockedDefault() []string

func IsPackedList

func IsPackedList(v string) bool

func IsPackedMap

func IsPackedMap(v string) bool

func IsWhiteListedSailfishLib

func IsWhiteListedSailfishLib(name string) bool

func LoadModule

func LoadModule(m string) error

func LoadModules

func LoadModules()

func ShouldBuildForTarget

func ShouldBuildForTarget(module, target string) bool

func SortedClassNamesForModule

func SortedClassNamesForModule(module string, template bool) []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)

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"`

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

	Constructors []string
	Derivations  []string
}

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

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

func (*Class) HasCallbackFunctions

func (c *Class) HasCallbackFunctions() 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) 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"`
	SignalMode      string
	TemplateModeJNI string
	Default         bool
	TmpName         string
	Export          bool
	NeedsFinalizer  bool
	Container       string
	TemplateModeGo  string
	NonMember       bool
	NoMocDeduce     bool
	AsError         bool
	Synthetic       bool
	Checked         bool
	Exception       bool
	IsMap           bool
	OgParameters    []Parameter
	IsMocFunction   bool
	IsMocProperty   bool
	PureGoOutput    string
}

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

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 (*Module) Prepare

func (m *Module) Prepare() error

type Namespace

type Namespace struct {
	Classes []*Class `xml:"class"`
	//Functions     []*Function     `xml:"function"` //TODO: uncomment
	//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"`
	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
}

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