Documentation
¶
Index ¶
- Constants
- Variables
- func CanEval(es ...Expr) bool
- func FileStore(p string, f *File)
- func FindFile(f string) (string, string, error)
- func FindPath() []string
- func Hash(s string) int
- func IsBoolOp(op int) bool
- func IsIntegerType(kind Kind) bool
- func MD5(text string) string
- func PrimitiveTypeSize(kind Kind) int
- func RPCErrorMessage(state, lookAhead int) string
- func RPCParse(RPClex RPCLexer) int
- func RPCStatname(s int) string
- func RPCTokname(c int) string
- func RPClex1(lex RPCLexer, lval *RPCSymType) (char, token int)
- func SetSwitchType(fields []*Field)
- func TagName(kind Kind, tag string) string
- func TypeSize(s TypeStore, t *Type) int
- type Args
- type Array
- type ArrayBound
- type Charset
- type ComClass
- type ComClassAttr
- type ComInterface
- type ComInterfaceAttr
- type Const
- type Dim
- type Direction
- type DispatchInterface
- type DispatchInterfaceAttr
- type DispatchInterfaceBody
- type Element
- type Enum
- type Export
- type Expr
- func (lval Expr) Add(rval Expr) (Expr, bool)
- func (lval Expr) And(rval Expr) (Expr, bool)
- func (e Expr) BigInt() (*big.Int, bool)
- func (e Expr) Bool() bool
- func (e Expr) CanEval() bool
- func (e Expr) Char() (rune, bool)
- func (e Expr) Coerce(kind Kind) (Expr, error)
- func (lval Expr) Div(rval Expr) (Expr, bool)
- func (val Expr) Empty() bool
- func (lval Expr) Eq(rval Expr) (Expr, bool)
- func (e Expr) Eval(l ExprStore) (Expr, bool)
- func (e Expr) Expression(opts ...any) string
- func (lval Expr) Ge(rval Expr) (Expr, bool)
- func (lval Expr) Gt(rval Expr) (Expr, bool)
- func (val Expr) Ident() Expr
- func (e Expr) Int64() (int64, bool)
- func (e Expr) IsIdent() bool
- func (e Expr) IsZero() bool
- func (lval Expr) Le(rval Expr) (Expr, bool)
- func (lval Expr) LogicalAnd(rval Expr) (Expr, bool)
- func (lval Expr) LogicalOr(rval Expr) (Expr, bool)
- func (lval Expr) Lsh(rval Expr) (Expr, bool)
- func (lval Expr) Lt(rval Expr) (Expr, bool)
- func (e Expr) MarshalJSON() ([]byte, error)
- func (lval Expr) Mul(rval Expr) (Expr, bool)
- func (lval Expr) Ne(rval Expr) (Expr, bool)
- func (val Expr) Neg() (Expr, bool)
- func (val Expr) Negative() (Expr, bool)
- func (val Expr) Not() (Expr, bool)
- func (e Expr) Null() bool
- func (lval Expr) Or(rval Expr) (Expr, bool)
- func (val Expr) Positive() (Expr, bool)
- func (val Expr) Ptr() (Expr, bool)
- func (lval Expr) Rem(rval Expr) (Expr, bool)
- func (e Expr) Resolve(in Expr) (Expr, bool)
- func (val Expr) ResolveTo(to Expr) (Expr, bool)
- func (lval Expr) Rsh(rval Expr) (Expr, bool)
- func (e Expr) Str() (string, bool)
- func (e Expr) String() string
- func (lval Expr) Sub(rval Expr) (Expr, bool)
- func (cond Expr) Ter(lval, rval Expr) (Expr, bool)
- func (e Expr) Uint64() (uint64, bool)
- func (lval Expr) Xor(rval Expr) (Expr, bool)
- type ExprStore
- type ExprTree
- type Exprs
- type Field
- type FieldAttr
- type File
- func (f *File) Exports() []*Export
- func (f *File) GoPackage(tn string) (string, bool)
- func (f *File) IsDCOM() bool
- func (f *File) IsLocal(tn string) bool
- func (f *File) Load() (*File, error)
- func (f *File) LookupAlias(n string) []string
- func (f *File) LookupType(n string) (*Type, bool)
- func (f *File) PkgIs(pkg string) bool
- type Format
- type Func
- type Interface
- type InterfaceAttr
- type InterfaceBody
- type Kind
- type Lexer
- type Library
- type LibraryAttr
- type LibraryBody
- type Operation
- type OperationAttr
- type Param
- type ParamAttr
- type Parser
- type PointerType
- type RPCLexer
- type RPCParser
- type RPCParserImpl
- type RPCSymType
- type Range
- type Scope
- type ScopedType
- type Size
- type SizeAttr
- type Struct
- type Type
- func (t *Type) Append(tt *Type) *Type
- func (t *Type) AppendAfterPointer(tt *Type) *Type
- func (t *Type) Base() *Type
- func (t *Type) Is(kind Kind) bool
- func (t *Type) IsPrimitiveType() bool
- func (t *Type) IsString() bool
- func (a *Type) MarshalJSON() ([]byte, error)
- func (t *Type) Scopes() []*Scope
- func (t *Type) TypeName() string
- type TypeAttr
- type TypeStore
- type Union
- type UnionCase
- type UnionSwitch
- type Usage
- type Version
Constants ¶
const ACS_BYTE_COUNT = 57461
const AND = 57479
const ANNOTATION = 57452
const APPOBJECT = 57445
const BOOLEAN = 57356
const BROADCAST = 57405
const BYTE = 57357
const CALLBACK = 57431
const CALL_AS = 57451
const CASE = 57395
const CAST = 57485
const CHAR = 57355
const CHARACTER_LITERAL = 57463
const COCLASS = 57459
const CONST = 57385
const DEFAULT = 57396
const DEFAULT_VALUE = 57441
const DISABLE_CONSISTENCY_CHECK = 57427
const DISPINTERFACE = 57456
const DOUBLE = 57347
const DUAL = 57433
const ENDPOINT = 57409
const ENUM = 57391
const EQ = 57475
const ERROR_STATUS_T = 57360
const EXCEPTIONS = 57410
const FALSE = 57388
const FIRST_IS = 57365
const FLOAT = 57346
const FORMAT = 57374
const FORMAT_HEX = 57379
const FORMAT_MULTI_SIZE = 57376
const FORMAT_NULL_TERMINATED = 57375
const FORMAT_RUNE = 57378
const FORMAT_UTF8 = 57377
const GE = 57472
const GOEXT_DEFAULT_NULL = 57449
const GOEXT_LAYOUT = 57448
const GOEXT_NO_SIZE_LIMIT = 57450
const GT = 57474
const HANDLE = 57399
const HANDLE_T = 57359
const HELP_STRING = 57432
const HIDDEN = 57438
const HYPER = 57348
const ID = 57437
const IDEMPOTENT = 57404
const IDENT = 57466
const IGNORE = 57380
const IID_IS = 57414
const IMPORT = 57400
const IN = 57389
const INT = 57354
const INT16 = 57418
const INT32 = 57419
const INT3264 = 57416
const INT64 = 57420
const INT8 = 57417
const INTERFACE = 57403
const INT_LITERAL = 57465
const ISO_LATIN_1 = 57361
const ISO_MULTILINGUAL = 57362
const ISO_UCS = 57363
const LAST_IS = 57366
const LE = 57471
const LENGTH_IS = 57367
const LIBRARY = 57460
const LOCAL = 57411
const LOGICAL_AND = 57470
const LOGICAL_OR = 57469
const LONG = 57351
const LSH = 57480
const LT = 57473
const MAX_IS = 57368
const MAYBE = 57406
const METHODS = 57457
const MIN_IS = 57369
const MS_UNION = 57422
const NE = 57476
const NONEXTENSIBLE = 57439
const NULL = 57386
const OBJECT = 57423
const ODL = 57442
const OLEAUTOMATION = 57443
const OPTIONAL = 57444
const OR = 57477
const OUT = 57390
const PAD = 57447
const PIPE = 57392
const POINTER = 57381
const POINTER_DEFAULT = 57412
const POINTER_PTR = 57384
const POINTER_REF = 57382
const POINTER_UNIQUE = 57383
const PRAGMA_CPP_QUOTE = 57430
const PRAGMA_DEFINE = 57429
const PROPERTIES = 57458
const PROPGET = 57434
const PROPPUT = 57435
const PROPPUTREF = 57436
const PUBLIC = 57454
const RANGE = 57421
const REFLECT_DELETIONS = 57407
const RESTRICTED = 57440
const RETVAL = 57413
const RNG = 57468
const RPCEofCode = 1
const RPCErrCode = 2
const RPCFlag = -1000
const RPCInitialStackSize = 16
const RPCLast = 1103
const RPCPrivate = 57344
const RSH = 57481
const SAFEARRAY = 57446
const SHORT = 57352
const SIGNED = 57350
const SIZEOF = 57428
const SIZE_IS = 57370
const SMALL = 57353
const SOURCE = 57455
const STRICT_CONTEXT_HANDLE = 57425
const STRING = 57462
const STRING_LITERAL = 57464
const STRUCT = 57364
const SWITCH = 57394
const SWITCH_IS = 57371
const SWITCH_TYPE = 57397
const TERNARY = 57467
const TRANSMIT_AS = 57398
const TRUE = 57387
const TYPEDEF = 57401
const TYPE_STRICT_CONTEXT_HANDLE = 57426
const UMINUS = 57486
const UMUL = 57487
const UNEG = 57483
const UNION = 57393
const UNOT = 57484
const UNSIGNED = 57349
const UPLUS = 57482
const USAGE_CONTEXT_HANDLE = 57373
const USAGE_STRING = 57372
const UUID = 57402
const V1_ENUM = 57424
const VERSION = 57408
const VOID = 57358
const WCHAR_T = 57415
const WIRE_MARSHAL = 57453
const XOR = 57478
Variables ¶
var ( NameTok = map[string]int{} TokName = map[int]string{}/* 113 elements not displayed */ SQBReservedTok = map[int]struct{}{ ANNOTATION: {}, APPOBJECT: {}, BROADCAST: {}, CALL_AS: {}, CALLBACK: {}, DEFAULT_VALUE: {}, DISABLE_CONSISTENCY_CHECK: {}, ENDPOINT: {}, FIRST_IS: {}, HANDLE: {}, HELP_STRING: {}, HIDDEN: {}, ID: {}, IGNORE: {}, IDEMPOTENT: {}, IID_IS: {}, IN: {}, LAST_IS: {}, LENGTH_IS: {}, LOCAL: {}, MAX_IS: {}, MAYBE: {}, MIN_IS: {}, MS_UNION: {}, OBJECT: {}, ODL: {}, OLEAUTOMATION: {}, OPTIONAL: {}, OUT: {}, POINTER_DEFAULT: {}, PROPGET: {}, PROPPUT: {}, PROPPUTREF: {}, POINTER_PTR: {}, PUBLIC: {}, RANGE: {}, POINTER_REF: {}, RETVAL: {}, SIZE_IS: {}, SOURCE: {}, STRICT_CONTEXT_HANDLE: {}, USAGE_STRING: {}, USAGE_CONTEXT_HANDLE: {}, FORMAT: {}, FORMAT_UTF8: {}, FORMAT_NULL_TERMINATED: {}, FORMAT_MULTI_SIZE: {}, FORMAT_RUNE: {}, FORMAT_HEX: {}, SWITCH_IS: {}, SWITCH_TYPE: {}, TRANSMIT_AS: {}, TYPE_STRICT_CONTEXT_HANDLE: {}, POINTER_UNIQUE: {}, UUID: {}, VERSION: {}, WIRE_MARSHAL: {}, PAD: {}, GOEXT_LAYOUT: {}, GOEXT_DEFAULT_NULL: {}, SAFEARRAY: {}, } ReservedTok = map[int]struct{}{ SIZEOF: {}, PRAGMA_CPP_QUOTE: {}, FLOAT: {}, DOUBLE: {}, HYPER: {}, UNSIGNED: {}, SIGNED: {}, LONG: {}, SHORT: {}, SMALL: {}, INT: {}, INT8: {}, INT16: {}, INT32: {}, INT64: {}, INT3264: {}, CHAR: {}, WCHAR_T: {}, BOOLEAN: {}, BYTE: {}, VOID: {}, HANDLE_T: {}, ERROR_STATUS_T: {}, ISO_LATIN_1: {}, ISO_MULTILINGUAL: {}, ISO_UCS: {}, STRUCT: {}, CONST: {}, NULL: {}, TRUE: {}, FALSE: {}, ENUM: {}, PIPE: {}, UNION: {}, SWITCH: {}, CASE: {}, DEFAULT: {}, IMPORT: {}, TYPEDEF: {}, INTERFACE: {}, COCLASS: {}, DISPINTERFACE: {}, } )
var ( RPCDebug = 0 RPCErrorVerbose = false )
var ( // ErrEOF ... ErrEOF = errors.New("unexpected EOF") )
var RPCAct = [...]int16{}/* 1103 elements not displayed */
var RPCChk = [...]int16{}/* 618 elements not displayed */
var RPCDef = [...]int16{}/* 618 elements not displayed */
var RPCErrorMessages = [...]struct { state int token int msg string }{}
var RPCExca = [...]int16{
-1, 0,
1, 1,
-2, 46,
-1, 1,
1, -1,
-2, 0,
-1, 2,
1, 2,
-2, 46,
-1, 249,
153, 116,
-2, 46,
-1, 265,
115, 36,
116, 36,
153, 36,
-2, 46,
-1, 272,
151, 199,
156, 199,
-2, 340,
-1, 419,
115, 37,
116, 37,
153, 37,
-2, 46,
-1, 420,
115, 35,
116, 35,
153, 35,
-2, 46,
-1, 467,
2, 340,
124, 340,
158, 340,
-2, 199,
-1, 557,
159, 250,
-2, 247,
-1, 561,
159, 250,
-2, 247,
-1, 585,
159, 251,
-2, 243,
}
var RPCPact = [...]int16{}/* 618 elements not displayed */
var RPCPgo = [...]int16{}/* 144 elements not displayed */
var RPCR1 = [...]uint8{}/* 362 elements not displayed */
var RPCR2 = [...]int8{}/* 362 elements not displayed */
var RPCStatenames = [...]string{}
var RPCTok1 = [...]uint8{}/* 127 elements not displayed */
var RPCTok2 = [...]uint8{}/* 144 elements not displayed */
var RPCTok3 = [...]int8{
0,
}
var RPCToknames = [...]string{}/* 164 elements not displayed */
Functions ¶
func IsIntegerType ¶
func PrimitiveTypeSize ¶
func RPCErrorMessage ¶
func RPCStatname ¶
func RPCTokname ¶
func RPClex1 ¶
func RPClex1(lex RPCLexer, lval *RPCSymType) (char, token int)
func SetSwitchType ¶
func SetSwitchType(fields []*Field)
Types ¶
type Array ¶
type Array struct {
// The array bounds.
Bound ArrayBound
}
Array structure represents the array type.
func (*Array) MarshalJSON ¶
type ArrayBound ¶
type ArrayBound struct {
// The upper and lower bounds for the array declaration.
Upper, Lower int64
}
ArrayBound structure represents the array bounds declaration.
type ComClass ¶
type ComClass struct {
Name string `json:"name,omitempty"`
Attrs *ComClassAttr `json:"attrs,omitempty"`
Interfaces []*ComInterface `json:"interfaces,omitempty"`
}
ComClass structure ...
type ComClassAttr ¶
type ComClassAttr struct {
*InterfaceAttr
AppObject bool
}
ComClassAttr ...
func (*ComClassAttr) MarshalJSON ¶
func (a *ComClassAttr) MarshalJSON() ([]byte, error)
func (*ComClassAttr) String ¶
func (a *ComClassAttr) String() string
type ComInterface ¶
type ComInterface struct {
Name string `json:"name,omitempty"`
Type *Type `json:"type,omitempty"`
Attrs *ComInterfaceAttr `json:"attrs,omitempty"`
}
ComInterface structure ...
type ComInterfaceAttr ¶
ComInterfaceAttr ...
func (*ComInterfaceAttr) MarshalJSON ¶
func (a *ComInterfaceAttr) MarshalJSON() ([]byte, error)
func (*ComInterfaceAttr) String ¶
func (a *ComInterfaceAttr) String() string
type Const ¶
type Const struct {
// The constant name.
Name string `json:"name"`
// The constant type.
Type Kind `json:"kind"`
// The constant value.
Value Expr `json:"value"`
}
Const structure represents the constant declaration. This declaration is obtained either via `const` expression or via #define statement.
type Dim ¶
type Direction ¶
type Direction struct {
// Determines the operation/function parameter direction.
In, Out bool
}
type DispatchInterface ¶
type DispatchInterface struct {
// The dispatch interface name.
Name string `json:"name"`
// The dispatch interface attributes.
Attrs *DispatchInterfaceAttr `json:"attr,omitempty"`
// The dispatch interface body.
Body DispatchInterfaceBody `json:"body,omitempty"`
}
DispatchInterface ...
type DispatchInterfaceAttr ¶
type DispatchInterfaceAttr struct {
*InterfaceAttr
}
DispatchInterfaceAttr ...
func (*DispatchInterfaceAttr) MarshalJSON ¶
func (a *DispatchInterfaceAttr) MarshalJSON() ([]byte, error)
func (*DispatchInterfaceAttr) String ¶
func (a *DispatchInterfaceAttr) String() string
type DispatchInterfaceBody ¶
type DispatchInterfaceBody struct {
// The dispatch interface properties.
Properties []*Field `json:"properties,omitempty"`
// The dispatch interfaces methods.
Methods []*Operation `json:"methods,omitempty"`
}
DispatchInterfaceBody ...
type Element ¶
type Element struct {
// The enumeration element label.
Value string `json:"value"`
// The enumeration element identifier.
ID int `json:"id"`
}
Element structure represents the enumeration element.
type Enum ¶
type Enum struct {
// Requires 32-bit uint type.
Is32 bool
// The enumeration elements.
Elems []*Element `json:"elements"`
}
Enum structure represents the enumeration type.
type Export ¶
type Export struct {
// The positional number.
Position int
// The export symbol name.
Name string
// The constant value, or nil.
Const *Const `json:"const,omitempty"`
// The type value, or nil.
Type *Type `json:"type,omitempty"`
// The list of aliases of the tagged declarator.
Aliases []string `json:"aliases,omitempty"`
}
Export structure represents the exported symbol.
type Expr ¶
type Expr struct {
// Value is an expression value.
Value interface{}
// Expr is a parsed expression tree.
Expr *ExprTree
// contains filtered or unexported fields
}
Expr is an expression.
func NewValue ¶
func NewValue(v interface{}) Expr
NewValue function creates a new expression node value.
func (Expr) Coerce ¶
Coerce function tries to cast the given Expr to the kind provided and returns the same expression.
func (Expr) Div ¶
Div function performs integer division (`lval` / `rval`). Note that `rval` must evaluate to the non-zero value.
func (Expr) Expression ¶
func (Expr) LogicalAnd ¶
LogicalAnd function performs logical-and (&&) operation on expression.
func (Expr) Lsh ¶
Lsh function performs the left-shift of the `lval` on `rval` amount. `rval` must be a valid unsigned integer.
func (Expr) MarshalJSON ¶
func (Expr) Ptr ¶
Ptr function doesn't do anything special, needed to resemble correct tree with pointer value.
func (Expr) Rem ¶
Rem function performs C-like integer reminder operation (`lval` % `rval`). Note that `rval` must evaluate to the non-zero value.
func (Expr) Rsh ¶
Rsh function performs the right-shift of the `lval` on `rval` amount. `rval` must be a valid unsigned integer.
type ExprTree ¶
type ExprTree struct {
// Op is an expression tree operation.
Op int
// Value is a terminal value of the expression tree.
Value interface{}
// Cond, Lval, Rval are the expression tree children.
// (Cond used for ternary only, Lval is a value for unary operation).
Cond, Lval, Rval *ExprTree
}
ExprTree is an expression tree build when expression cannot be evaluated immediately.
func (*ExprTree) Expression ¶
type Field ¶
type Field struct {
// The field position.
Position int `json:"-"`
// The field name.
Name string `json:"name,omitempty"`
// The field attributes.
Attrs *FieldAttr `json:"attrs,omitempty"`
// The field type.
Type *Type `json:"type,omitempty"`
// Default Value.
DefaultValue Expr `json:"default_value,omitempty"`
}
Field structure represents the union/structure field declaration.
type FieldAttr ¶
type FieldAttr struct {
FirstIs []Expr
LastIs []Expr
LengthIs []Expr
MinIs []Expr
MaxIs []Expr
SizeIs []Expr
Usage Usage
Format Format
SwitchIs Expr
Ignore bool
Pointer PointerType
Range *Range
SwitchType *Type
Safearray *Type
Layout []*Field
NoSizeLimit bool
IsLayout bool
DefaultNull []Expr
}
FieldAttr ...
func (*FieldAttr) MarshalJSON ¶
type File ¶
type File struct {
FullPath string `json:"full_path"`
// Path is a path to file.
Path string `json:"path"`
// GoPkg ...
GoPkg string `json:"go_pkg"`
// The list of imports.
Imports []string `json:"imports,omitempty"`
// Export is a map of exported symbols on file level.
Export map[string]*Export `json:"exports,omitempty"`
// Interfaces is a list of interfaces.
Interfaces []*Interface `json:"interfaces,omitempty"`
// ComClasses is a list of COM classes.
ComClasses []*ComClass `json:"com_classes,omitempty"`
// DispatchInterfaces ...
DispatchInterfaces []*DispatchInterface `json:"dispatch_interfaces,omitempty"`
// Libraries ...
Libraries []*Library `json:"libraries,omitempty"`
// contains filtered or unexported fields
}
File structure represents the parsed file contents.
func (*File) LookupAlias ¶
func (*File) LookupType ¶
LookupType function lookups the type inside the file.
type Func ¶
type Func struct {
// The function parameters list.
Params []*Param
}
Func structure represents the function type.
type Interface ¶
type Interface struct {
// The interface name.
Name string `json:"name,omitempty"`
// The interface base.
BaseName string `json:"base_name,omitempty"`
// The interface base.
Base *Interface `json:"-"`
// The interface attributes.
Attrs *InterfaceAttr `json:"attrs,omitempty"`
// Body is an interface body (including export symbols and function calls).
Body InterfaceBody `json:"body,omitempty"`
}
Interface structure represents the interface definition.
type InterfaceAttr ¶
type InterfaceAttr struct {
UUID *uuid.UUID
Version *Version
Endpoints []string
Exceptions []string
Local bool
PointerDefault PointerType
MSUnion bool
Object bool
HelpString string
Dual bool
Hidden bool
Nonextensible bool
ODL bool
OLEAutomation bool
}
InterfaceAttr ...
func (*InterfaceAttr) MarshalJSON ¶
func (a *InterfaceAttr) MarshalJSON() ([]byte, error)
func (*InterfaceAttr) String ¶
func (a *InterfaceAttr) String() string
type InterfaceBody ¶
type InterfaceBody struct {
// Imports is a list of file paths for the imported symbols.
Imports []string `json:"imports"`
// Export is a map for the exported symbols.
Export map[string]*Export `json:"exports"`
// Operations is a list of the interface operations.
Operations []*Operation `json:"operations"`
}
InterfaceBody structure represents the interface body definitions.
type Kind ¶
type Kind int
Kind is the type selector.
const ( TypeInvalid Kind = iota TypeInt8 TypeUint8 TypeInt16 TypeUint16 TypeInt32 TypeInt64 TypeUint32 TypeUint64 TypeInt32_64 // 32 for NDR, 64 for NDR64 representation. TypeUint32_64 // 32 for NDR, 64 for NDR64 representation. TypeFloat32 TypeFloat64 TypeCharset TypeUChar TypeChar TypeWChar TypeEnum TypeString TypeStruct TypeUnion TypeCUnion TypeFunc TypeArray TypePointer TypePipe TypeBoolean TypeVoid // constant declaration only. TypeHandle TypeError TypeInterface TypeDispInterface TypeRef // type reference, resolved via lookup. TypeAttribute // TypeTag )
func (Kind) MarshalJSON ¶
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
Lexer ...
type Library ¶
type Library struct {
Name string `json:"name"`
Attrs *LibraryAttr `json:"attr,omitempty"`
Body LibraryBody `json:"body,omitempty"`
}
type LibraryAttr ¶
type LibraryAttr struct {
*InterfaceAttr
}
LibraryAttr ...
func (*LibraryAttr) MarshalJSON ¶
func (a *LibraryAttr) MarshalJSON() ([]byte, error)
func (*LibraryAttr) String ¶
func (a *LibraryAttr) String() string
type LibraryBody ¶
type LibraryBody struct {
ComClasses []*ComClass `json:"com_classes,omitempty"`
}
LibraryBody ...
type Operation ¶
type Operation struct {
// The operation name.
Name string `json:"name"`
// The operation number.
OpNum int `json:"op_num"`
// The operation return type.
Type *Type `json:"type"`
// The operation parameter list.
Params []*Param `json:"params"`
// The operation attributes.
Attrs *OperationAttr `json:"attrs,omitempty"`
}
Operation structure represents the RPC call.
type OperationAttr ¶
type OperationAttr struct {
Idempotent bool
Broadcast bool
Maybe bool
ReflectDeletions bool
Usage Usage
Format Format
Pointer PointerType
Callback bool
PropGet bool
PropPut bool
PropPutRef bool
ID Expr
Restricted bool
CallAs string
}
OperationAttr ...
func (*OperationAttr) MarshalJSON ¶
func (a *OperationAttr) MarshalJSON() ([]byte, error)
func (*OperationAttr) String ¶
func (a *OperationAttr) String() string
type Param ¶
type Param struct {
// The parameter name.
Name string `json:"name,omitempty"`
// The parameter type.
Type *Type `json:"type,omitempty"`
// The parameter attributes.
Attrs *ParamAttr `json:"attrs,omitempty"`
}
Param structure represents the operation/function parameter declaration.
type ParamAttr ¶
type ParamAttr struct {
*FieldAttr
Direction Direction
DisableConsistencyCheck bool
IIDIs Expr
Retval bool
DefaultValue Expr
Optional bool
Annotation string
}
ParamAttr ...
func (*ParamAttr) MarshalJSON ¶
type Parser ¶
type Parser struct {
// The lexer entity.
*Lexer
// contains filtered or unexported fields
}
type PointerType ¶
type PointerType int
const ( PointerTypeNone PointerType = iota PointerTypeRef PointerTypePtr PointerTypeUnique PointerTypeRefWeak )
func (PointerType) String ¶
func (p PointerType) String() string
type RPCLexer ¶
type RPCLexer interface {
Lex(lval *RPCSymType) int
Error(s string)
}
type RPCParser ¶
func RPCNewParser ¶
func RPCNewParser() RPCParser
type RPCParserImpl ¶
type RPCParserImpl struct {
// contains filtered or unexported fields
}
func (*RPCParserImpl) Lookahead ¶
func (p *RPCParserImpl) Lookahead() int
func (*RPCParserImpl) Parse ¶
func (RPCrcvr *RPCParserImpl) Parse(RPClex RPCLexer) int
type RPCSymType ¶
type RPCSymType struct {
File File
Interface Interface
InterfaceBody InterfaceBody
Version *Version
Export []*Export
Type *Type
Kind Kind
Const *Const
Operation *Operation
Operations []*Operation
Param *Param
Params []*Param
Fields []*Field
Field *Field
Declarators []*pDeclarator
Declarator *pDeclarator
ArrayBound ArrayBound
Int64 int64
UnionSwitch *UnionSwitch
UnionCases []*UnionCase
UnionCase *UnionCase
Expr Expr
Exprs Exprs
Ident string
Char rune
String string
Int *big.Int
UUID *uuid.UUID
Range *Range
Strings []string
Token int
Typedef *pTypedef
Attr pAttr
AttrType pAttrType
TagID pTagID
TagIDs []pTagID
ComClass ComClass
Library Library
ComInterfaces []*ComInterface
ComInterface *ComInterface
DispatchInterface DispatchInterface
DispatchInterfaceBody DispatchInterfaceBody
// contains filtered or unexported fields
}
type Scope ¶
type Scope struct {
Attr *TypeAttr
Types []*ScopedType
}
type ScopedType ¶
type Struct ¶
type Struct struct {
// The structure fields.
Fields []*Field `json:"fields,omitempty"`
}
Struct structure represents the structure type.
type Type ¶
type Type struct {
Kind Kind `json:"kind,omitempty"`
Charset Charset `json:"charset,omitempty"`
Name string `json:"name,omitempty"`
Tag string `json:"tag,omitempty"`
Func *Func `json:"func,omitempty"`
Array *Array `json:"array,omitempty"`
Enum *Enum `json:"enum,omitempty"`
Struct *Struct `json:"struct,omitempty"`
Union *Union `json:"union,omitempty"`
Interface *Interface `json:"-"`
Attrs *TypeAttr `json:"attrs,omitempty"`
Alias string `json:"alias,omitempty"`
Elem *Type `json:"elem,omitempty"`
}
Type structure represents the type declaration.
func InterfaceToExport ¶
func LookupType ¶
func (*Type) AppendAfterPointer ¶
func (*Type) Is ¶
Is function returns true if type is of a given kind. Note, that synthetic type `TypeTag` is used to determine if type can be a tagged type.
func (*Type) IsPrimitiveType ¶
func (*Type) MarshalJSON ¶
type TypeAttr ¶
type TypeAttr struct {
TransmitAs *Type
Handle bool
SwitchType *Type
Usage Usage
Format Format
Pointer PointerType
V1Enum bool
Range *Range
DisableConsistencyCheck bool
WireMarshal string
Public bool
Alias string
// names, pointers to keep track of lost data merged.
Names []string
Pointers []PointerType
Parent string
Pad uint64
IsLayout bool
}
TypeAttr ...
func (*TypeAttr) MarshalJSON ¶
type TypeStore ¶
type TypeStore interface {
// LookupType function must resolve the type reference
// and return type or 'false'
LookupType(n string) (*Type, bool)
}
TypeStore interface represents the type storage to resolve kind of TypeRef.
type Union ¶
type Union struct {
// The list of union switch/case statements.
Body []*UnionCase `json:"body,omitempty"`
Switch *UnionSwitch `json:"switch,omitempty"`
}
Union structure represents the union type.
func (*Union) IsEncapsulated ¶
type UnionCase ¶
type UnionCase struct {
Position int `json:"position,omitempty"`
Labels []interface{} `json:"labels,omitempty"`
Arms []*Field `json:"arms,omitempty"`
IsDefault bool `json:"is_default,omitempty"`
}
UnionCase structure is a union case statement, if Label is nil, this is default case.
type UnionSwitch ¶
UnionSwitch structure represents the union switch (switch_is declaration).