Documentation
¶
Index ¶
- Constants
- Variables
- type ID
- type Info
- func (i Info) CanAssignConst(o Info) bool
- func (i Info) Concrete() bool
- func (i Info) Equal(o Info) bool
- func (i *Info) Instantiate(o Info) bool
- func (i *Info) InstantiateWithSizes(sizes []int) error
- func (i *Info) SetConcrete(c bool)
- func (i Info) ShortString() string
- func (i Info) Specializable(o Info) bool
- func (i Info) String() string
- func (i Info) Undefined() bool
- type Size
- type StructField
- type Type
Constants ¶
const ByteBits = 8
ByteBits defines the byte size in bits.
Variables ¶
var Bool = Info{ Type: TBool, IsConcrete: true, Bits: 1, MinBits: 1, }
Bool defines type info for boolean values.
var Byte = Info{ Type: TUint, IsConcrete: true, Bits: 8, MinBits: 8, }
Byte defines type info for byte values.
var Int32 = Info{ Type: TInt, IsConcrete: true, Bits: 32, MinBits: 32, }
Int32 defines type info for signed 32bit integers.
var Nil = Info{ Type: TNil, IsConcrete: true, }
Nil defines type info for the nil value.
var Rune = Info{ Type: TInt, IsConcrete: true, Bits: 32, MinBits: 32, }
Rune defines type info for rune values.
var Types = map[string]Type{ "<Undefined>": TUndefined, "bool": TBool, "int": TInt, "uint": TUint, "float": TFloat, "string": TString, "struct": TStruct, "array": TArray, "slice": TSlice, "ptr": TPtr, "nil": TNil, }
Types define MPCL types and their names.
var Uint32 = Info{ Type: TUint, IsConcrete: true, Bits: 32, MinBits: 32, }
Uint32 defines type info for unsigned 32bit integers.
var Uint64 = Info{ Type: TUint, IsConcrete: true, Bits: 64, MinBits: 64, }
Uint64 defines type info for unsigned 64bit integers.
var Undefined = Info{ Type: TUndefined, IsConcrete: true, }
Undefined defines type info for undefined types.
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct { ID ID Type Type IsConcrete bool Bits Size MinBits Size Struct []StructField ElementType *Info ArraySize Size Offset Size }
Info specifies information about a type.
func (Info) CanAssignConst ¶
CanAssignConst tests if the argument const type can be assigned to this type.
func (*Info) Instantiate ¶
Instantiate instantiates template type to match parameter type.
func (*Info) InstantiateWithSizes ¶
InstantiateWithSizes creates a concrete type of the unspecified type with given element sizes.
func (*Info) SetConcrete ¶
SetConcrete sets the type concrete status.
func (Info) ShortString ¶
ShortString returns a short string name for the type info.
func (Info) Specializable ¶
Specializable tests if this type can be specialized with the argument type.
type StructField ¶
StructField defines a structure field name and type.
func (StructField) String ¶
func (f StructField) String() string
type Type ¶
type Type int8
Type specifies an MPCL type.
MPCL types.
func (Type) ShortString ¶
ShortString returns a short string name for the type.