profile

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2015 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TransformTypes

func TransformTypes(ptypes []*PType) (map[string]*Type, error)

Types

type Component added in v0.2.0

type Component struct {
	Name       string
	Bits       string
	BitsInt    int
	Scale      string
	Offset     string
	Accumulate bool
}

type Field

type Field struct {
	DefNum string
	Name   string
	CCName string
	Type   string
	Array  string // 255=N
	Scale  string
	Offset string
	Units  string

	Components []Component

	Subfields     []*Field // Not set for subfields
	RefFieldName  []string // Only set for subfields
	RefFieldValue []string // Only set for subfields

	Comment string
	Example string

	BaseType  string
	BTInvalid string
	GoType    string
	GoInvalid string
	// contains filtered or unexported fields
}

type Generator

type Generator struct {
	*bytes.Buffer
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(sdkVersion string) *Generator

func (*Generator) GenerateMsgs

func (g *Generator) GenerateMsgs(msgs []*Msg) ([]byte, error)

func (*Generator) GenerateProfile

func (g *Generator) GenerateProfile(types map[string]*Type, msgs []*Msg, jmptable bool) ([]byte, error)

func (*Generator) GenerateTypes

func (g *Generator) GenerateTypes(types map[string]*Type) ([]byte, error)

type Msg

type Msg struct {
	Name        string
	CCName      string
	Fields      []*Field
	FieldByName map[string]*Field
}

func TransformMsgs

func TransformMsgs(pmsgs []*PMsg, types map[string]*Type) ([]*Msg, error)

type PField added in v0.2.0

type PField struct {
	Field     []string
	Subfields [][]string
}

type PMsg added in v0.2.0

type PMsg struct {
	Header []string
	Fields []*PField
}

type PType added in v0.2.0

type PType struct {
	Header []string
	Fields [][]string
}

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewMsgParser

func NewMsgParser(r io.Reader) (*Parser, error)

func NewTypeParser

func NewTypeParser(r io.Reader) (*Parser, error)

func (*Parser) ParseMsg

func (p *Parser) ParseMsg() (*PMsg, error)

func (*Parser) ParseType

func (p *Parser) ParseType() (*PType, error)

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

func NewMsgScanner

func NewMsgScanner(r io.Reader) (*Scanner, error)

func NewTypeScanner

func NewTypeScanner(r io.Reader) (*Scanner, error)

func (*Scanner) Scan

func (s *Scanner) Scan() (tok Token, lit []string)

type Token

type Token int
const (
	// Common
	ILLEGAL Token = iota
	EOF
	EMPTY
	CSVHDR

	// Types
	THDR
	TFIELD

	// Messages
	FMSGSHDR
	MSGHDR
	MSGFIELD
	DYNMSGFIELD
)

func (Token) String

func (t Token) String() string

type Type

type Type struct {
	Name         string
	CCName       string
	OrigName     string
	PkgName      string
	BaseType     string
	GoBaseType   string
	InvalidValue string
	Values       []ValueTriple
	// contains filtered or unexported fields
}

type ValueTriple

type ValueTriple struct {
	Name, Value, Comment string
}

Jump to

Keyboard shortcuts

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