Documentation ¶
Index ¶
- Constants
- func AnyToInt64(d any) int64
- func AnyToUint64(d any) uint64
- func CalcNodeResultLength(node *base.Node) uint64
- func ConvertToBytes(v any, length uint64, endian string) ([]byte, error)
- func ConvertToVar(v []byte, length uint64, endian, typeName string) any
- func ExecInput(node *base.Node) (res any, err error)
- func ExecOperator(node *base.Node, code string, ...) error
- func ExecOut(node *base.Node) (res *base.NodeValue, err error)
- func ExecParser(node *base.Node) (res any, err error)
- func GetBytesByNode(node *base.Node) []byte
- func GetNodePath(node *base.Node) string
- func GetNodeResult(node *base.Node) any
- func GetNodeResultPos(node *base.Node) [2]uint64
- func GetParentLengthCache(parentNode *base.Node, childName string) (uint64, bool)
- func GetParentNode(node *base.Node) *base.Node
- func GetResultByNode(node *base.Node) any
- func GetSubNodes(node *base.Node) []*base.Node
- func InitNode(node *base.Node) error
- func IsNumber(d any) bool
- func ListNodeNewElement(node *base.Node) (*base.Node, error)
- func NewNodeByType(node *base.Node, typeName string) (*base.Node, error)
- func NodeHasResult(node *base.Node) bool
- func NodeIsDelimiter(node *base.Node) bool
- func NodeIsTerminal(node *base.Node) bool
- func ParseRefNode(node *base.Node) (*base.Node, error)
- func SetParentLengthCache(parentNode *base.Node, childName string, l uint64)
- func ToMap(node *base.Node) (*base.NodeValue, error)
- type DefParser
- func (d *DefParser) Generate(data any, node *base.Node) error
- func (d *DefParser) OnRoot(node *base.Node) error
- func (d *DefParser) Operate(operator *Operator, node *base.Node) error
- func (d *DefParser) Parse(data *base.BitReader, node *base.Node) error
- func (d *DefParser) Result(node *base.Node) (*base.NodeValue, error)
- type Operator
- type YakNode
Constants ¶
View Source
const ( CfgIsTerminal = "isTerminal" CfgIsList = "list" CfgIsTempRoot = "temp root" CfgLength = "length" CfgUnit = "unit" CfgType = "type" CfgGetResult = "get result" CfgRawResult = "raw result" CfgRootMap = "rootNodeMap" CfgEndian = "endian" CfgOperator = "operator" CfgInList = "inList" CfgParent = "parent" CfgDel = "del" CfgDelimiter = "delimiter" CfgImport = "import" CfgNodeResult = "node result" CfgLastNode = "last node" CfgElementIndex = "element index" CfgExceptionPlan = "exception-plan" CtxGenReaders = "readers in generator" CfgIsRefType = "is ref type" CfgRefType = "ref-type" CfgLengthFromField = "length-from-field" CfgLengthForStartField = "length-for-start-field" CfgLengthForField = "length-for-field" CfgStopValue = "stop-value" CfgLengthCacheMap = "length-cache-map" )
View Source
const ( ParserMode = "parser" GeneratorMode = "geneartor" )
Variables ¶
This section is empty.
Functions ¶
func AnyToInt64 ¶
func AnyToUint64 ¶
func CalcNodeResultLength ¶
func ExecOperator ¶
func GetBytesByNode ¶
func GetNodePath ¶
func GetNodeResult ¶
func GetNodeResultPos ¶
func GetParentLengthCache ¶ added in v1.3.2
func GetResultByNode ¶
func NodeHasResult ¶
func NodeIsDelimiter ¶
func NodeIsTerminal ¶
func SetParentLengthCache ¶ added in v1.3.2
Types ¶
type DefParser ¶
type DefParser struct { base.BaseParser // contains filtered or unexported fields }
type YakNode ¶
type YakNode struct { Process func() any Result func() any Name string SetCfg func(k string, v any) GetCfg func(k string) any AppendNode func(d *YakNode) ForEachChild func(f func(child *YakNode)) GetParent func() *YakNode GetSubNode func(name string) *YakNode GetRemainingSpace func() uint64 CalcNodeResultLength func() uint64 NewElement func() *YakNode SetChildren func([]*YakNode) GetChildren func() []*YakNode Length func(uint ...string) uint64 SetMaxLength func(l uint64, uint ...string) GetMaxLength func(uint ...string) uint64 NewSubNode func(datas ...any) *YakNode NewUnknownNode func(name ...string) *YakNode NewEmptyNode func(name ...string) *YakNode ProcessSubNode func(name string) any TryProcessSubNode func(name string) (any, map[string]any) ProcessByType func(datas ...any) any TryProcessByType func(datas ...string) (any, map[string]any) AddInfo func(key string, v any) GetInfo func(key string) any // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.