docparser

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package docparser implements a parser for Doxygen xml.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

type Attr struct {
	CreateFields []*AttrTypeName
	SetFields    []*AttrTypeName
	ReadFields   []*AttrTypeName
}

attrInfo holds values and types for an attribute enum.

type AttrTypeName

type AttrTypeName struct {
	MemberName string
	SaiType    string
	EnumName   string
	Comment    string
	Value      int
}

attrTypeName contains the type and name of the attribute.

type CompoundDef

type CompoundDef struct {
	Title      string       `xml:"title"`
	SectionDef []SectionDef `xml:"sectiondef"`
}

CompoundDef contains a list sections in the xml.

type Description

type Description struct {
	Paragraph Paragraph `xml:"para"`
}

Description contains extra information about an enum value.

type Doxygen

type Doxygen struct {
	CompoundDef CompoundDef `xml:"compounddef"`
}

Doxygen is the root of the generated xml struct.

type Enum

type Enum struct {
	Name  string
	Value int
}

type EnumValue

type EnumValue struct {
	Name                string      `xml:"name"`
	Initializer         string      `xml:"initializer"`
	DetailedDescription Description `xml:"detaileddescription"`
	BriefDescription    Description `xml:"briefdescription"`
}

EnumValue is a single values in a enum.

type MemberDef

type MemberDef struct {
	Name       string      `xml:"name"`
	EnumValues []EnumValue `xml:"enumvalue"`
	Kind       string      `xml:"kind,attr"`
}

MemberDef is the definition of a single type.

type Paragraph

type Paragraph struct {
	InlineText string       `xml:",chardata"` // For BriefDescription, the paragraph contains raw text.
	SimpleSect []SimpleSect `xml:"simplesect"`
}

Paragraph is a generic paragraph.

type SAIInfo

type SAIInfo struct {
	// Attrs is a map from sai type (sai_port_t) to its attributes.
	Attrs map[string]*Attr
	// Enums is a map from enum name (sai_port_media_type_t) to the values of the enum.
	Enums map[string][]*Enum
}

SAIInfo contains all the info parsed from the doxygen.

func ParseSAIXMLDir

func ParseSAIXMLDir(xmlPath string) (*SAIInfo, error)

ParseSAIXMLDir parses all the SAI Doxygen XML files in a directory.

type SectionDef

type SectionDef struct {
	MemberDef []MemberDef `xml:"memberdef"`
}

SectionDef contains a list of members.

type SimpleSect

type SimpleSect struct {
	Para string `xml:"para"`
}

SimpleSect contains a description of an element.

Jump to

Keyboard shortcuts

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