Documentation ¶
Index ¶
- func NewBitmaskTypeFromXML(node *xmlquery.Node) *bitmaskType
- func NewBitmaskValueFromXML(forBitmask TypeDefiner, elt *xmlquery.Node) *bitmaskValue
- func NewCommandFromJSON(key, json gjson.Result) *commandType
- func NewCommandFromXML(elt *xmlquery.Node) *commandType
- func NewCommandParamFromXML(elt *xmlquery.Node, forCommand *commandType) *commandParam
- func NewDefineTypeFromXML(node *xmlquery.Node) *defineType
- func NewEnumValueFromXML(td TypeDefiner, elt *xmlquery.Node) *enumValue
- func NewExternalTypeFromXML(node *xmlquery.Node) *externalType
- func NewIncludeTypeFromXML(node *xmlquery.Node) *includeType
- func NewOrUpdateExternalValueFromJSON(key, value string, td TypeDefiner, tr TypeRegistry, vr ValueRegistry)
- func NewUntypedEnumValueFromXML(elt *xmlquery.Node) *extenValue
- func ReadAllExtensionsFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegistry) []*extensionSet
- func ReadApiConstantsFromXML(doc *xmlquery.Node, externalType TypeDefiner, tr TypeRegistry, ...)
- func ReadBaseTypeExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
- func ReadBaseTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, _ ValueRegistry)
- func ReadBitmaskTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegistry)
- func ReadCommandExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
- func ReadCommandTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegistry)
- func ReadDefineExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
- func ReadDefineTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, _ ValueRegistry)
- func ReadEnumTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegistry)
- func ReadEnumValuesFromXML(doc *xmlquery.Node, td TypeDefiner, tr TypeRegistry, vr ValueRegistry)
- func ReadExternalExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
- func ReadExternalTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegistry)
- func ReadFeatureFromXML(featureNode *xmlquery.Node, tr TypeRegistry, vr ValueRegistry) *featureSet
- func ReadHandleExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
- func ReadHandleTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, _ ValueRegistry)
- func ReadIncludeExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
- func ReadIncludeTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, _ ValueRegistry)
- func ReadPlatformExceptionsFromJSON(exceptions gjson.Result, fm FeatureMap)
- func ReadStructExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
- func ReadStructTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegistry)
- func ReadUnionExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
- func ReadUnionTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegistry)
- func RenameIdentifier(s string) string
- func SegmentExtensionsByPlatform(allExts []*extensionSet) map[string][]*extensionSet
- func UpdateUnionTypeFromJSON(key, json gjson.Result, td *unionType)
- func WriteStringerCommands(w io.Writer, defs []TypeDefiner, cat TypeCategory, filenameBase string)
- type Aliaser
- type ByName
- type ByValue
- type ByValuePublicName
- type FeatureCollection
- type FeatureMap
- type ImportMap
- type IncludeSet
- type Namer
- type Printer
- type Resolver
- type TypeCategory
- type TypeDefiner
- func NewBaseTypeFromXML(node *xmlquery.Node) TypeDefiner
- func NewDefineTypeFromJSON(key, json gjson.Result) TypeDefiner
- func NewEnumTypeFromXML(node *xmlquery.Node) TypeDefiner
- func NewHandleTypeFromJSON(key, json gjson.Result) TypeDefiner
- func NewHandleTypeFromXML(node *xmlquery.Node) TypeDefiner
- func NewOrUpdateBaseTypeFromJSON(key string, exception gjson.Result, tr TypeRegistry, vr ValueRegistry) TypeDefiner
- func NewOrUpdateExternalTypeFromJSON(key string, exception gjson.Result, tr TypeRegistry, vr ValueRegistry) TypeDefiner
- func NewOrUpdateIncludeTypeFromJSON(key string, exception gjson.Result, tr TypeRegistry, vr ValueRegistry) TypeDefiner
- func NewOrUpdateStructTypeFromJSON(key, json gjson.Result, existing *structType) TypeDefiner
- type TypeRegistry
- type ValueDefiner
- type ValueRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBitmaskTypeFromXML ¶
func NewBitmaskValueFromXML ¶
func NewBitmaskValueFromXML(forBitmask TypeDefiner, elt *xmlquery.Node) *bitmaskValue
func NewCommandFromJSON ¶
func NewCommandFromXML ¶
func NewCommandParamFromXML ¶
func NewDefineTypeFromXML ¶
NewDefineTypeFromXML has a few processing paths. First, the name is typically a child node, but is an XML attribute for a few entries. Next, some defines such as VK_API_VERSION_1_0 are actually macro calls, which is named in a child node for type. Defines may also have a requires attr, which also indicates the name of the macro call, except when it doesn't (e.g., VK_HEADER_VERSION_COMPLETE). Then, parameters of the macro may be present in plain text between parenthesis. Or the define might be a singular value, in the case of VK_HEADER_VERSION.
func NewEnumValueFromXML ¶
func NewEnumValueFromXML(td TypeDefiner, elt *xmlquery.Node) *enumValue
func NewExternalTypeFromXML ¶
func NewIncludeTypeFromXML ¶
func NewOrUpdateExternalValueFromJSON ¶
func NewOrUpdateExternalValueFromJSON(key, value string, td TypeDefiner, tr TypeRegistry, vr ValueRegistry)
func ReadAllExtensionsFromXML ¶
func ReadAllExtensionsFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegistry) []*extensionSet
func ReadApiConstantsFromXML ¶
func ReadApiConstantsFromXML(doc *xmlquery.Node, externalType TypeDefiner, tr TypeRegistry, vr ValueRegistry)
func ReadBaseTypeExceptionsFromJSON ¶
func ReadBaseTypeExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
func ReadBaseTypesFromXML ¶
func ReadBaseTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, _ ValueRegistry)
func ReadBitmaskTypesFromXML ¶
func ReadBitmaskTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegistry)
func ReadCommandExceptionsFromJSON ¶
func ReadCommandExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
func ReadCommandTypesFromXML ¶
func ReadCommandTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegistry)
func ReadDefineExceptionsFromJSON ¶
func ReadDefineExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
func ReadDefineTypesFromXML ¶
func ReadDefineTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, _ ValueRegistry)
func ReadEnumTypesFromXML ¶
func ReadEnumTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegistry)
func ReadEnumValuesFromXML ¶
func ReadEnumValuesFromXML(doc *xmlquery.Node, td TypeDefiner, tr TypeRegistry, vr ValueRegistry)
func ReadExternalExceptionsFromJSON ¶
func ReadExternalExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
func ReadExternalTypesFromXML ¶
func ReadExternalTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegistry)
func ReadFeatureFromXML ¶
func ReadFeatureFromXML(featureNode *xmlquery.Node, tr TypeRegistry, vr ValueRegistry) *featureSet
func ReadHandleExceptionsFromJSON ¶
func ReadHandleExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
func ReadHandleTypesFromXML ¶
func ReadHandleTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, _ ValueRegistry)
func ReadIncludeExceptionsFromJSON ¶
func ReadIncludeExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
func ReadIncludeTypesFromXML ¶
func ReadIncludeTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, _ ValueRegistry)
func ReadPlatformExceptionsFromJSON ¶
func ReadPlatformExceptionsFromJSON(exceptions gjson.Result, fm FeatureMap)
func ReadStructExceptionsFromJSON ¶
func ReadStructExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
func ReadStructTypesFromXML ¶
func ReadStructTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegistry)
func ReadUnionExceptionsFromJSON ¶
func ReadUnionExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry)
func ReadUnionTypesFromXML ¶
func ReadUnionTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegistry)
func RenameIdentifier ¶
RenameIdentifier trims the leading Vk (or variants) and then renames any keywords or typenames reserved in Go. Every type and value definer needs to call this on every registry name.
func SegmentExtensionsByPlatform ¶
func SegmentExtensionsByPlatform(allExts []*extensionSet) map[string][]*extensionSet
func UpdateUnionTypeFromJSON ¶
func WriteStringerCommands ¶
func WriteStringerCommands(w io.Writer, defs []TypeDefiner, cat TypeCategory, filenameBase string)
Types ¶
type Aliaser ¶
type Aliaser interface { SetAliasType(TypeDefiner) IsAlias() bool }
type ByName ¶
type ByName []TypeDefiner
type ByValue ¶
type ByValue []ValueDefiner
type ByValuePublicName ¶
type ByValuePublicName []ValueDefiner // add for cleanup/issue-3
func (ByValuePublicName) Len ¶
func (a ByValuePublicName) Len() int
func (ByValuePublicName) Less ¶
func (a ByValuePublicName) Less(i, j int) bool
func (ByValuePublicName) Swap ¶
func (a ByValuePublicName) Swap(i, j int)
type FeatureCollection ¶
type FeatureCollection interface { Resolver ResolvedTypes() TypeRegistry FilterTypesByCategory() map[TypeCategory]FeatureCollection Platform() string FilenameFragment() string WriteBuildTags(io.Writer) MergeWith(FeatureCollection) // contains filtered or unexported methods }
type FeatureMap ¶
type FeatureMap map[string]FeatureCollection
func ReadPlatformsFromXML ¶
func ReadPlatformsFromXML(doc *xmlquery.Node) FeatureMap
type ImportMap ¶
func (ImportMap) SortedKeys ¶
type IncludeSet ¶
type IncludeSet struct {
IncludeTypes, IncludeValues map[string]bool
ResolvedTypes TypeRegistry
ResolvedValues ValueRegistry
}
func NewIncludeSet ¶
func NewIncludeSet() *IncludeSet
func (*IncludeSet) MergeWith ¶
func (is *IncludeSet) MergeWith(js *IncludeSet)
type Printer ¶
type Printer interface { RegisterImports(reg map[string]bool) PrintGlobalDeclarations(io.Writer, int, bool) PrintFileInitContent(io.Writer) PrintPublicDeclaration(io.Writer) PrintInternalDeclaration(io.Writer) PrintPublicToInternalTranslation(w io.Writer, inputVar, outputVar, lenSpec string) // PrintTranslateToPublic(w io.Writer, inputVar, outputVar string) PrintTranslateToInternal(w io.Writer, inputVar, outputVar string) TranslateToPublic(inputVar string) string TranslateToInternal(inputVar string) string }
type Resolver ¶
type Resolver interface { Resolve(TypeRegistry, ValueRegistry) *IncludeSet IsIdenticalPublicAndInternal() bool }
type TypeCategory ¶
type TypeCategory int
const ( CatNone TypeCategory = iota CatExten // meta-category for printing extension names/version constants CatDefine CatInclude CatExternal CatHandle CatBasetype CatEnum CatBitmask CatStruct CatUnion CatPointer CatArray CatCommand CatMaximum )
func (TypeCategory) ReadFns ¶
func (c TypeCategory) ReadFns() (fnReadFromXML, fnReadFromJSON)
func (TypeCategory) String ¶
func (i TypeCategory) String() string
type TypeDefiner ¶
type TypeDefiner interface { Category() TypeCategory Namer Resolver Printer AllValues() []ValueDefiner PushValue(ValueDefiner) AppendValues(vals ValueRegistry) }
func NewBaseTypeFromXML ¶
func NewBaseTypeFromXML(node *xmlquery.Node) TypeDefiner
func NewDefineTypeFromJSON ¶
func NewDefineTypeFromJSON(key, json gjson.Result) TypeDefiner
func NewEnumTypeFromXML ¶
func NewEnumTypeFromXML(node *xmlquery.Node) TypeDefiner
func NewHandleTypeFromJSON ¶
func NewHandleTypeFromJSON(key, json gjson.Result) TypeDefiner
func NewHandleTypeFromXML ¶
func NewHandleTypeFromXML(node *xmlquery.Node) TypeDefiner
func NewOrUpdateBaseTypeFromJSON ¶
func NewOrUpdateBaseTypeFromJSON(key string, exception gjson.Result, tr TypeRegistry, vr ValueRegistry) TypeDefiner
func NewOrUpdateExternalTypeFromJSON ¶
func NewOrUpdateExternalTypeFromJSON(key string, exception gjson.Result, tr TypeRegistry, vr ValueRegistry) TypeDefiner
func NewOrUpdateIncludeTypeFromJSON ¶
func NewOrUpdateIncludeTypeFromJSON(key string, exception gjson.Result, tr TypeRegistry, vr ValueRegistry) TypeDefiner
func NewOrUpdateStructTypeFromJSON ¶
func NewOrUpdateStructTypeFromJSON(key, json gjson.Result, existing *structType) TypeDefiner
type TypeRegistry ¶
type TypeRegistry map[string]TypeDefiner
func (TypeRegistry) SelectCategory ¶
func (tr TypeRegistry) SelectCategory(cat TypeCategory) *IncludeSet
type ValueDefiner ¶
type ValueDefiner interface { RegistryName() string PublicName() string ValueString() string UnderlyingTypeName() string ResolvedType() TypeDefiner Resolve(TypeRegistry, ValueRegistry) *IncludeSet PrintPublicDeclaration(w io.Writer) SetExtensionNumber(int) IsAlias() bool IsCore() bool }
type ValueRegistry ¶
type ValueRegistry map[string]ValueDefiner
Source Files ¶
- array_type.go
- base_type.go
- bitmask_type.go
- bitmask_value.go
- command_type.go
- define_type.go
- enum_type.go
- enum_value.go
- external_type.go
- generic_type.go
- generic_value.go
- handle_type.go
- include_type.go
- internal_type.go
- name_conversion.go
- pointer_type.go
- registry_base.go
- registry_extensions.go
- registry_feat.go
- registry_platform.go
- simple_type.go
- struct_type.go
- typecategory_string.go
- union_type.go