Documentation ¶
Index ¶
- Constants
- Variables
- func Decode(dest string, decoding Call, fail Source) (res hardToAccessDecodingStuff)
- func Go2ResultType(extTypes map[string]types.TypeRegistration, useString bool, goType string) (hardToAccessResultType, error)
- func LookupByteLong(useString bool, v string, src Source, needle Source) lookupByteLong
- func LookupStringLong(useString bool, v string, src Source, needle Source) lookupStringLong
- func LookupStringShort(useString bool, v string, src, needle Source) lookupStringShort
- func PrefixString(useString bool, src, needle Source) prefixString
- func RightPkg(useString bool) string
- func RightType(useString bool) string
- func String(s Source) string
- type Body
- type Call
- type Define
- type DrawChar
- type ExtractorResult
- type FieldDef
- type FieldType
- type File
- func (f *File) AddAccessor(typeName, name string, resultType hardToAccessResultType) *Method
- func (f *File) AddConst(name, value string) string
- func (f *File) AddExtract(typeName string) *Method
- func (f *File) AddExtractor(comment []string, typeName string, g generator.Generator) *Strct
- func (f *File) AddNamedImport(access, path string) error
- func (f *File) Append(src Source)
- func (f *File) Dump(w io.Writer) error
- func (f *File) PkgName(name string)
- type For
- type If
- type Index
- type LineAssign
- type LookupByteShort
- type Method
- type PrefixByte
- type Raw
- type ResultType
- type Source
- func Assign(receiver string, src Source) Source
- func Comment(comment string) Source
- func Deref(operand Source) Source
- func Error(format string, params ...Source) Source
- func Goto(label string) Source
- func HexU64(data uint64) Source
- func Literal(data interface{}) Source
- func OperatorAdd(op1, op2 Source) Source
- func OperatorAnd(op1, op2 Source) Source
- func OperatorAssign(op1, op2 Source) Source
- func OperatorBitAnd(op1, op2 Source) Source
- func OperatorColon(op1, op2 Source) Source
- func OperatorComma(op1, op2 Source) Source
- func OperatorDot(op1, op2 Source) Source
- func OperatorEq(op1, op2 Source) Source
- func OperatorGE(op1, op2 Source) Source
- func OperatorGT(op1, op2 Source) Source
- func OperatorInc(op1, op2 Source) Source
- func OperatorLE(op1, op2 Source) Source
- func OperatorLT(op1, op2 Source) Source
- func OperatorNEq(op1, op2 Source) Source
- func OperatorNot(operand Source) Source
- func OperatorOr(op1, op2 Source) Source
- func OperatorSemicolon(op1, op2 Source) Source
- func OperatorSub(op1, op2 Source) Source
- func Ref(operand Source) Source
- func ReturnError(format string, params ...Source) Source
- func Slice(expr, from, to Source) Source
- func SliceFrom(expr, from Source) Source
- func SliceTo(expr, to Source) Source
- func Stringify(src Source) Source
- func Trim(s Source) Source
- type Strct
- func (s *Strct) AddBool(comment []string, name string)
- func (s *Strct) AddCustomType(comment []string, name string, fieldType types.TypeRegistration)
- func (s *Strct) AddDec128(comment []string, name string)
- func (s *Strct) AddFloat32(comment []string, name string)
- func (s *Strct) AddFloat64(comment []string, name string)
- func (s *Strct) AddInt(comment []string, name string)
- func (s *Strct) AddInt16(comment []string, name string)
- func (s *Strct) AddInt32(comment []string, name string)
- func (s *Strct) AddInt64(comment []string, name string)
- func (s *Strct) AddInt8(comment []string, name string)
- func (s *Strct) AddStr(comment []string, name string)
- func (s *Strct) AddString(comment []string, name string)
- func (s *Strct) AddSubstruct(comment []string, name string) *Strct
- func (s *Strct) AddUint(comment []string, name string)
- func (s *Strct) AddUint16(comment []string, name string)
- func (s *Strct) AddUint32(comment []string, name string)
- func (s *Strct) AddUint64(comment []string, name string)
- func (s *Strct) AddUint8(comment []string, name string)
- func (s *Strct) TypeString() string
- type Vars
Constants ¶
const ( ReturnOK = Raw("return true, nil") ReturnFail = Raw("return false, nil") )
const Break = Raw("break")
Break represents break operator
const False = Raw("false")
False ...
const Semicolon = Raw(";")
Semicolon ...
Variables ¶
var Found = OperatorGE(Raw("pos"), Raw("0"))
Found is `pos >= 0`
var OK = Raw("ok")
Functions ¶
func Go2ResultType ¶
func LookupByteLong ¶
LookupByteLong creates new lookup
func LookupStringLong ¶
LookupStringLong creates new lookup
func LookupStringShort ¶
LookupStringShort creates private lookupStringShort for external consumption
func PrefixString ¶
PrefixString creates private prefixString for external consumption
Types ¶
type Body ¶
type Body struct {
// contains filtered or unexported fields
}
Body describes LDE generated listing of program elements
type ExtractorResult ¶
type ExtractorResult struct{}
ExtractorResult
func (ExtractorResult) ResultType ¶
func (e ExtractorResult) ResultType() string
type FieldType ¶
type FieldType interface {
TypeString() string
}
FieldType represents LDE generated struct's field
type File ¶
type File struct {
// contains filtered or unexported fields
}
File represents LDE generated Go source file
func (*File) AddAccessor ¶
AddAccessor adds accessor method for an extractor
func (*File) AddExtract ¶
AddExtract adds extraction method for an extractor
func (*File) AddExtractor ¶
AddExtractor adds new extractor struct type definition and returns struct body
func (*File) AddNamedImport ¶
AddNamedImport adds new import item with specific access name
type LineAssign ¶
LineAssign represents assignment operation
type LookupByteShort ¶
LookupByteShort represents short byte lookups
type Method ¶
type Method struct {
// contains filtered or unexported fields
}
Method describes LDE generated method of extractor
func NewAccessor ¶
NewAccessor creates accessor definition
func NewExtractor ¶
NewExtractor creates extractor definition
type PrefixByte ¶
PrefixByte for prefix byte check code generation
type ResultType ¶
type ResultType interface {
ResultType() string
}
type Source ¶
Source is an abstraction over
func Literal ¶
func Literal(data interface{}) Source
Literal generates literal representation of object fed
func OperatorAdd ¶
func OperatorAnd ¶
func OperatorAssign ¶
OperatorAssign generate assignment
func OperatorBitAnd ¶
func OperatorColon ¶
func OperatorComma ¶
func OperatorDot ¶
func OperatorGE ¶
OperatorGE generate Greater or Equal comparison
func OperatorGT ¶
OperatorGT generate Greater or Equal comparison
func OperatorInc ¶
func OperatorLE ¶
OperatorLE generate Greater or Equal comparison
func OperatorLT ¶
OperatorLT generate Greater or Equal comparison
func OperatorNot ¶
func OperatorOr ¶
func OperatorSemicolon ¶
func OperatorSub ¶
type Strct ¶
type Strct struct {
// contains filtered or unexported fields
}
Strct represents LDE generated struct
func (*Strct) AddCustomType ¶ added in v0.1.0
func (s *Strct) AddCustomType(comment []string, name string, fieldType types.TypeRegistration)
AddCustomType add custom type
func (*Strct) AddDec128 ¶
AddDec128 adds a couple of two elements in a structure emulating uint128 type
func (*Strct) AddFloat32 ¶
AddFloat32 adds float32 field
func (*Strct) AddFloat64 ¶
AddFloat64 adds float64 field
func (*Strct) AddSubstruct ¶
AddSubstruct add substruct and returns it
func (*Strct) TypeString ¶
TypeString implementation to satisfy FieldType