definition

package
v0.1.0-c405994-dev Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Bool    = BasicType{TypeTypeID: TypeID_Bool, TypeName: "bool", TypeBitSize: 8}
	Uint8   = BasicType{TypeTypeID: TypeID_Uint8, TypeName: "uint8", TypeBitSize: 8}
	Uint16  = BasicType{TypeTypeID: TypeID_Uint16, TypeName: "uint16", TypeBitSize: 16}
	Uint32  = BasicType{TypeTypeID: TypeID_Uint32, TypeName: "uint32", TypeBitSize: 32}
	Uint64  = BasicType{TypeTypeID: TypeID_Uint64, TypeName: "uint64", TypeBitSize: 64}
	Int8    = BasicType{TypeTypeID: TypeID_Int8, TypeName: "int8", TypeBitSize: 8}
	Int16   = BasicType{TypeTypeID: TypeID_Int16, TypeName: "int16", TypeBitSize: 16}
	Int32   = BasicType{TypeTypeID: TypeID_Int32, TypeName: "int32", TypeBitSize: 32}
	Int64   = BasicType{TypeTypeID: TypeID_Int64, TypeName: "int64", TypeBitSize: 64}
	Float32 = BasicType{TypeTypeID: TypeID_Float32, TypeName: "float32", TypeBitSize: 32}
	Float64 = BasicType{TypeTypeID: TypeID_Float64, TypeName: "float64", TypeBitSize: 64}
)

Functions

This section is empty.

Types

type ArithOverflowWarning

type ArithOverflowWarning struct {
	Expr string
	From string
	To   string
}

func (ArithOverflowWarning) Error

func (w ArithOverflowWarning) Error() string

func (ArithOverflowWarning) String

func (w ArithOverflowWarning) String() string

type ArithSignToUnsignWarning

type ArithSignToUnsignWarning struct {
	Expr string
	From string
	To   string
}

func (ArithSignToUnsignWarning) Error

func (w ArithSignToUnsignWarning) Error() string

func (ArithSignToUnsignWarning) String

func (w ArithSignToUnsignWarning) String() string

type ArithTruncationWarning

type ArithTruncationWarning struct {
	Expr string
	From string
	To   string
}

func (ArithTruncationWarning) Error

func (w ArithTruncationWarning) Error() string

func (ArithTruncationWarning) String

func (w ArithTruncationWarning) String() string

type Array

type Array struct {
	ElementType Type
	Length      int64
}

func (Array) GetTypeBitSize

func (t Array) GetTypeBitSize() int64

func (Array) GetTypeID

func (t Array) GetTypeID() TypeID

func (Array) GetTypeName

func (t Array) GetTypeName() string

func (Array) String

func (t Array) String() string

type BasePosition

type BasePosition struct {
	File   string
	Line   int
	Column int
}

func (BasePosition) GetColumn

func (p BasePosition) GetColumn() int

func (BasePosition) GetFile

func (p BasePosition) GetFile() string

func (BasePosition) GetLine

func (p BasePosition) GetLine() int

func (BasePosition) GetPositionString

func (p BasePosition) GetPositionString() string

func (BasePosition) String

func (p BasePosition) String() string

type BasicType

type BasicType struct {
	TypeTypeID  TypeID
	TypeName    string
	TypeBitSize int64
}

func (BasicType) GetTypeBitSize

func (t BasicType) GetTypeBitSize() int64

func (BasicType) GetTypeID

func (t BasicType) GetTypeID() TypeID

func (BasicType) GetTypeName

func (t BasicType) GetTypeName() string

func (BasicType) String

func (t BasicType) String() string

type BinopExpr

type BinopExpr struct {
	BasePosition
	ExprType *BasicType
	Op       ExprOp
	Expr1    Expr
	Expr2    Expr
}

func (BinopExpr) GetExprKind

func (b BinopExpr) GetExprKind() ExprKindID

func (BinopExpr) GetExprType

func (b BinopExpr) GetExprType() *BasicType

func (BinopExpr) String

func (b BinopExpr) String() string

type BoolLiteral

type BoolLiteral struct {
	BasePosition
	BoolValue bool
}

func (BoolLiteral) GetLiteralKind

func (l BoolLiteral) GetLiteralKind() LiteralKindID

func (BoolLiteral) GetLiteralValue

func (l BoolLiteral) GetLiteralValue() interface{}

func (BoolLiteral) GetLiteralValueIn

func (l BoolLiteral) GetLiteralValueIn(ty *BasicType) interface{}

func (BoolLiteral) String

func (l BoolLiteral) String() string

type Bytes

type Bytes struct{}

func (Bytes) GetTypeBitSize

func (t Bytes) GetTypeBitSize() int64

func (Bytes) GetTypeID

func (t Bytes) GetTypeID() TypeID

func (Bytes) GetTypeName

func (t Bytes) GetTypeName() string

func (Bytes) String

func (t Bytes) String() string

type CastExpr

type CastExpr struct {
	BasePosition
	ToType *BasicType
	Expr1  Expr
}

func (CastExpr) GetExprKind

func (c CastExpr) GetExprKind() ExprKindID

func (CastExpr) GetExprType

func (c CastExpr) GetExprType() *BasicType

func (CastExpr) String

func (c CastExpr) String() string

type CompilationUnit

type CompilationUnit struct {
	UnitName *FileIdentifer
	Imports  *util.OrderedMap[string, *CompilationUnit]
	Types    *util.OrderedMap[string, CustomType] // Types contains all the top-level typedefs (inner typedefs excluded)
	Names    *util.OrderedMap[string, Position]   // Names contains all the names (inner typedefs' name included)
}

func NewCompilationUnit

func NewCompilationUnit(name *FileIdentifer) *CompilationUnit

func (*CompilationUnit) AddImport

func (c *CompilationUnit) AddImport(other *CompilationUnit) error

func (CompilationUnit) String

func (c CompilationUnit) String() string

type CompileError

type CompileError struct {
	TopLevelError
	Position
	Err error
}

func (CompileError) Error

func (e CompileError) Error() string

func (CompileError) String

func (e CompileError) String() string

type CompileWarning

type CompileWarning struct {
	TopLevelWarning
	Position
	Warning error
}

func (CompileWarning) Error

func (w CompileWarning) Error() string

func (CompileWarning) String

func (w CompileWarning) String() string

type ConstantExpr

type ConstantExpr struct {
	BasePosition
	ConstantType  *BasicType
	ConstantValue Literal
}

func (ConstantExpr) GetExprKind

func (c ConstantExpr) GetExprKind() ExprKindID

func (ConstantExpr) GetExprType

func (c ConstantExpr) GetExprType() *BasicType

func (ConstantExpr) String

func (c ConstantExpr) String() string

type ConstantField

type ConstantField struct {
	BasePosition
	FieldName     string // may be empty
	FieldType     *BasicType
	FieldBitSize  int64
	FieldConstant Literal
	FieldBelongs  *Struct
	FieldOptions  *util.OrderedMap[string, *Option]
	FromEmbedded  *EmbeddedField
}

func (ConstantField) Copy

func (f ConstantField) Copy() Field

func (ConstantField) GetFieldBelongs

func (f ConstantField) GetFieldBelongs() *Struct

func (ConstantField) GetFieldBitSize

func (f ConstantField) GetFieldBitSize() int64

func (ConstantField) GetFieldFromEmbedded

func (f ConstantField) GetFieldFromEmbedded() *EmbeddedField

func (ConstantField) GetFieldKind

func (f ConstantField) GetFieldKind() FieldKindID

func (ConstantField) GetFieldUniqueName

func (f ConstantField) GetFieldUniqueName() string

func (*ConstantField) SetFieldBelongs

func (f *ConstantField) SetFieldBelongs(s *Struct)

func (*ConstantField) SetFieldFromEmbedded

func (f *ConstantField) SetFieldFromEmbedded(e *EmbeddedField)

func (ConstantField) ShortString

func (f ConstantField) ShortString() string

func (ConstantField) String

func (f ConstantField) String() string

type CustomType

type CustomType interface {
	Type
	Position
}

type DefinitionDuplicateError

type DefinitionDuplicateError struct {
	DefName string // type, field or method name
	PrevDef Position
}

func (DefinitionDuplicateError) Error

func (e DefinitionDuplicateError) Error() string

func (DefinitionDuplicateError) String

func (e DefinitionDuplicateError) String() string

type DefinitionNotFoundError

type DefinitionNotFoundError struct {
	DefName string // type, field or method name
}

func (DefinitionNotFoundError) Error

func (e DefinitionNotFoundError) Error() string

func (DefinitionNotFoundError) String

func (e DefinitionNotFoundError) String() string

type DefinitionTypeConflictError

type DefinitionTypeConflictError struct {
	DefName string
	Expect  string
	Got     string
}

func (DefinitionTypeConflictError) Error

func (DefinitionTypeConflictError) String

type EmbeddedField

type EmbeddedField struct {
	BasePosition
	FieldType    *Struct
	FieldBitSize int64
	FieldBelongs *Struct
	FieldOptions *util.OrderedMap[string, *Option]
	FromEmbedded *EmbeddedField
}

func (EmbeddedField) Copy

func (f EmbeddedField) Copy() Field

func (EmbeddedField) GetFieldBelongs

func (f EmbeddedField) GetFieldBelongs() *Struct

func (EmbeddedField) GetFieldBitSize

func (f EmbeddedField) GetFieldBitSize() int64

func (EmbeddedField) GetFieldFromEmbedded

func (f EmbeddedField) GetFieldFromEmbedded() *EmbeddedField

func (EmbeddedField) GetFieldKind

func (f EmbeddedField) GetFieldKind() FieldKindID

func (EmbeddedField) GetFieldUniqueName

func (f EmbeddedField) GetFieldUniqueName() string

func (*EmbeddedField) SetFieldBelongs

func (f *EmbeddedField) SetFieldBelongs(s *Struct)

func (*EmbeddedField) SetFieldFromEmbedded

func (f *EmbeddedField) SetFieldFromEmbedded(e *EmbeddedField)

func (EmbeddedField) ShortString

func (f EmbeddedField) ShortString() string

func (EmbeddedField) String

func (f EmbeddedField) String() string

type EmbeddedFieldError

type EmbeddedFieldError struct {
	DefName string
	Err     error
}

func (EmbeddedFieldError) Error

func (e EmbeddedFieldError) Error() string

func (EmbeddedFieldError) String

func (e EmbeddedFieldError) String() string

type Enum

type Enum struct {
	BasePosition

	EnumName    string
	EnumBitSize int64
	EnumValues  []*EnumValue
}

func (*Enum) GetEnumValueByName

func (e *Enum) GetEnumValueByName(name string) *EnumValue

func (*Enum) GetEnumValueByValue

func (e *Enum) GetEnumValueByValue(value int64) *EnumValue

func (*Enum) GetTypeBitSize

func (e *Enum) GetTypeBitSize() int64

func (*Enum) GetTypeID

func (e *Enum) GetTypeID() TypeID

func (*Enum) GetTypeName

func (e *Enum) GetTypeName() string

func (Enum) ShortString

func (e Enum) ShortString() string

func (Enum) String

func (e Enum) String() string

type EnumValue

type EnumValue struct {
	BasePosition

	EnumValueName string
	EnumValue     int64
	EnumBelongs   *Enum
}

func (EnumValue) String

func (e EnumValue) String() string

type Expr

type Expr interface {
	Position
	GetExprKind() ExprKindID
	GetExprType() *BasicType
}

type ExprKindID

type ExprKindID int
const (
	ExprKindID_UnopExpr ExprKindID = iota
	ExprKindID_BinopExpr
	ExprKindID_CastExpr
	ExprKindID_TenaryExpr
	ExprKindID_ConstantExpr
	ExprKindID_ValueExpr
)

type ExprOp

type ExprOp int
const (
	ExprOp_ADD ExprOp = iota
	ExprOp_SUB
	ExprOp_MUL
	ExprOp_DIV
	ExprOp_MOD
	ExprOp_POW
	ExprOp_SHL
	ExprOp_SHR
	ExprOp_LT
	ExprOp_LE
	ExprOp_GT
	ExprOp_GE
	ExprOp_EQ
	ExprOp_NE
	ExprOp_BAND
	ExprOp_BXOR
	ExprOp_BOR
	ExprOp_AND
	ExprOp_OR
	ExprOp_NOT
	ExprOp_BNOT
)

func (ExprOp) String

func (e ExprOp) String() string

type Field

type Field interface {
	Position
	GetFieldKind() FieldKindID
	GetFieldUniqueName() string
	GetFieldBitSize() int64
	GetFieldBelongs() *Struct
	// GetFieldFromEmbedded() *EmbeddedField
	SetFieldBelongs(*Struct)
	// SetFieldFromEmbedded(*EmbeddedField)
	Copy() Field
}

type FieldKindID

type FieldKindID int
const (
	FieldKindID_Normal FieldKindID = iota
	FieldKindID_Void
	FieldKindID_Embedded
	FieldKindID_Constant
)

type FileIdentifer

type FileIdentifer struct {
	Name string // file name written in import statement, can be relative or absolute
	Path string // absolute path
}

func (FileIdentifer) String

func (f FileIdentifer) String() string

type FileNotFoundError

type FileNotFoundError struct {
	File *FileIdentifer
	Err  error
}

func (FileNotFoundError) Error

func (e FileNotFoundError) Error() string

func (FileNotFoundError) String

func (e FileNotFoundError) String() string

type FileReadError

type FileReadError struct {
	File *FileIdentifer
	Err  error
}

func (FileReadError) Error

func (e FileReadError) Error() string

func (FileReadError) String

func (e FileReadError) String() string

type FileWriteError

type FileWriteError struct {
	File *FileIdentifer
	Err  error
}

func (FileWriteError) Error

func (e FileWriteError) Error() string

func (FileWriteError) String

func (e FileWriteError) String() string

type FloatLiteral

type FloatLiteral struct {
	BasePosition
	FloatValue float64
}

func (FloatLiteral) GetLiteralKind

func (l FloatLiteral) GetLiteralKind() LiteralKindID

func (FloatLiteral) GetLiteralValue

func (l FloatLiteral) GetLiteralValue() interface{}

func (FloatLiteral) GetLiteralValueIn

func (l FloatLiteral) GetLiteralValueIn(ty *BasicType) interface{}

func (FloatLiteral) String

func (l FloatLiteral) String() string

type GeneralError

type GeneralError struct {
	TopLevelError
	Position
	Err error
}

func (GeneralError) Error

func (e GeneralError) Error() string

func (GeneralError) String

func (e GeneralError) String() string

type GeneralWarning

type GeneralWarning struct {
	TopLevelWarning
	Position
	Warning error
}

func (GeneralWarning) Error

func (w GeneralWarning) Error() string

func (GeneralWarning) String

func (w GeneralWarning) String() string

type ImportCycleError

type ImportCycleError struct {
	File *FileIdentifer
}

func (ImportCycleError) Error

func (e ImportCycleError) Error() string

func (ImportCycleError) String

func (e ImportCycleError) String() string

type ImportSelfError

type ImportSelfError struct{}

func (ImportSelfError) Error

func (e ImportSelfError) Error() string

func (ImportSelfError) String

func (e ImportSelfError) String() string

type ImportingError

type ImportingError struct {
	File *FileIdentifer
	Err  error
}

func (ImportingError) Error

func (e ImportingError) Error() string

func (ImportingError) String

func (e ImportingError) String() string

type ImportingWarning

type ImportingWarning struct {
	File    *FileIdentifer
	Warning error
}

func (ImportingWarning) Error

func (w ImportingWarning) Error() string

func (ImportingWarning) String

func (w ImportingWarning) String() string

type IntLiteral

type IntLiteral struct {
	BasePosition
	IntValue int64
}

func (IntLiteral) GetLiteralKind

func (l IntLiteral) GetLiteralKind() LiteralKindID

func (IntLiteral) GetLiteralValue

func (l IntLiteral) GetLiteralValue() interface{}

func (IntLiteral) GetLiteralValueIn

func (l IntLiteral) GetLiteralValueIn(ty *BasicType) interface{}

func (IntLiteral) String

func (l IntLiteral) String() string

type InvalidEmbeddedError

type InvalidEmbeddedError struct{}

func (InvalidEmbeddedError) Error

func (e InvalidEmbeddedError) Error() string

func (InvalidEmbeddedError) String

func (e InvalidEmbeddedError) String() string

type InvalidEnumDefError

type InvalidEnumDefError struct {
	DefName string
	Err     error
}

func (InvalidEnumDefError) Error

func (e InvalidEnumDefError) Error() string

func (InvalidEnumDefError) String

func (e InvalidEnumDefError) String() string

type InvalidFieldError

type InvalidFieldError struct {
	FieldName string
	Msg       string
}

func (InvalidFieldError) Error

func (e InvalidFieldError) Error() string

func (InvalidFieldError) String

func (e InvalidFieldError) String() string

type InvalidLiteralError

type InvalidLiteralError struct {
	Literal string
	Err     error
}

func (InvalidLiteralError) Error

func (e InvalidLiteralError) Error() string

func (InvalidLiteralError) String

func (e InvalidLiteralError) String() string

type InvalidSizeError

type InvalidSizeError struct {
	Size int64
	Msg  string
}

func (InvalidSizeError) Error

func (e InvalidSizeError) Error() string

func (InvalidSizeError) String

func (e InvalidSizeError) String() string

type InvalidStructDefError

type InvalidStructDefError struct {
	DefName string
	Err     error
}

func (InvalidStructDefError) Error

func (e InvalidStructDefError) Error() string

func (InvalidStructDefError) String

func (e InvalidStructDefError) String() string

type Literal

type Literal interface {
	GetLiteralKind() LiteralKindID
	GetLiteralValue() interface{}
	GetLiteralValueIn(ty *BasicType) interface{}
}

type LiteralKindID

type LiteralKindID int
const (
	LiteralKindID_Bool LiteralKindID = iota
	LiteralKindID_Int
	LiteralKindID_Float
	LiteralKindID_String
)

func (LiteralKindID) String

func (l LiteralKindID) String() string

func (LiteralKindID) ToTypeID

func (l LiteralKindID) ToTypeID() TypeID

type Method

type Method struct {
	BasePosition
	MethodKind      MethodKindID
	MethodName      string
	MethodParamType Type
	MethodExpr      Expr
	MethodBelongs   *NormalField // TODO: fix relation
}

func (Method) String

func (m Method) String() string

type MethodKindID

type MethodKindID int
const (
	MethodKindID_Get MethodKindID = iota
	MethodKindID_Set
)

func (MethodKindID) String

func (m MethodKindID) String() string

type NameStyleError

type NameStyleError struct {
	Name string
	Msg  string
}

func (NameStyleError) Error

func (e NameStyleError) Error() string

func (NameStyleError) String

func (e NameStyleError) String() string

type NameStyleWarning

type NameStyleWarning struct {
	Name string
	Msg  string
}

func (NameStyleWarning) Error

func (w NameStyleWarning) Error() string

func (NameStyleWarning) String

func (w NameStyleWarning) String() string

type NormalField

type NormalField struct {
	BasePosition
	FieldName    string
	FieldType    Type
	FieldBitSize int64
	FieldBelongs *Struct
	FieldMethods []*Method
	FieldOptions *util.OrderedMap[string, *Option]
	FromEmbedded *EmbeddedField
}

func (NormalField) Copy

func (f NormalField) Copy() Field

func (NormalField) GetFieldBelongs

func (f NormalField) GetFieldBelongs() *Struct

func (NormalField) GetFieldBitSize

func (f NormalField) GetFieldBitSize() int64

func (NormalField) GetFieldFromEmbedded

func (f NormalField) GetFieldFromEmbedded() *EmbeddedField

func (NormalField) GetFieldKind

func (f NormalField) GetFieldKind() FieldKindID

func (NormalField) GetFieldUniqueName

func (f NormalField) GetFieldUniqueName() string

func (*NormalField) SetFieldBelongs

func (f *NormalField) SetFieldBelongs(s *Struct)

func (*NormalField) SetFieldFromEmbedded

func (f *NormalField) SetFieldFromEmbedded(e *EmbeddedField)

func (NormalField) ShortString

func (f NormalField) ShortString() string

func (NormalField) String

func (f NormalField) String() string

type Option

type Option struct {
	BasePosition

	OptionName  string
	OptionValue Literal
}

func (Option) String

func (o Option) String() string

type OptionTypeError

type OptionTypeError struct {
	OptionName string
	Expect     string
	Got        string
}

func (OptionTypeError) Error

func (e OptionTypeError) Error() string

func (OptionTypeError) String

func (e OptionTypeError) String() string

type OptionUnknownWarning

type OptionUnknownWarning struct {
	OptionName string
}

func (OptionUnknownWarning) Error

func (w OptionUnknownWarning) Error() string

func (OptionUnknownWarning) String

func (w OptionUnknownWarning) String() string

type OptionValueError

type OptionValueError struct {
	OptionName string
	Expect     []any
	Got        any
}

func (OptionValueError) Error

func (e OptionValueError) Error() string

func (OptionValueError) String

func (e OptionValueError) String() string

type Position

type Position interface {
	GetFile() string
	GetLine() int
	GetColumn() int
	GetPositionString() string
}

type String

type String struct{}

func (String) GetTypeBitSize

func (t String) GetTypeBitSize() int64

func (String) GetTypeID

func (t String) GetTypeID() TypeID

func (String) GetTypeName

func (t String) GetTypeName() string

func (String) String

func (t String) String() string

type StringLiteral

type StringLiteral struct {
	BasePosition
	StringValue string
}

func (StringLiteral) GetLiteralKind

func (l StringLiteral) GetLiteralKind() LiteralKindID

func (StringLiteral) GetLiteralValue

func (l StringLiteral) GetLiteralValue() interface{}

func (StringLiteral) GetLiteralValueIn

func (l StringLiteral) GetLiteralValueIn(ty *BasicType) interface{}

func (StringLiteral) String

func (l StringLiteral) String() string

type Struct

type Struct struct {
	BasePosition

	StructName    string
	StructBitSize int64
	StructFields  []Field
}

func (*Struct) GetFieldByName

func (s *Struct) GetFieldByName(name string) Field

func (*Struct) GetFieldByUniqueName

func (s *Struct) GetFieldByUniqueName(name string) Field

func (*Struct) GetFieldsStartBit

func (s *Struct) GetFieldsStartBit() []int64

func (Struct) GetTypeBitSize

func (s Struct) GetTypeBitSize() int64

func (Struct) GetTypeID

func (s Struct) GetTypeID() TypeID

func (Struct) GetTypeName

func (s Struct) GetTypeName() string

func (Struct) ShortString

func (s Struct) ShortString() string

func (Struct) String

func (s Struct) String() string

func (*Struct) SumFieldBitSize

func (s *Struct) SumFieldBitSize() (fixed_size int64, has_dynamic bool)

type SyntaxError

type SyntaxError struct {
	TopLevelError
	Position
	Err error
}

func (SyntaxError) Error

func (e SyntaxError) Error() string

func (*SyntaxError) String

func (e *SyntaxError) String() string

type TenaryExpr

type TenaryExpr struct {
	BasePosition
	// ExprType is the type of Expr1 or Expr2
	// Expr1 and Expr2 must be the same type
	Cond  Expr
	Expr1 Expr
	Expr2 Expr
}

func (TenaryExpr) GetExprKind

func (t TenaryExpr) GetExprKind() ExprKindID

func (TenaryExpr) GetExprType

func (t TenaryExpr) GetExprType() *BasicType

func (TenaryExpr) String

func (t TenaryExpr) String() string

type TopLevelError

type TopLevelError interface {
	error
	IsTopLevelError()
}

type TopLevelWarning

type TopLevelWarning interface {
	error
	IsTopLevelWarning()
}

type Type

type Type interface {
	GetTypeID() TypeID
	GetTypeName() string
	GetTypeBitSize() int64
}

type TypeBinopError

type TypeBinopError struct {
	Expr1 string
	Expr2 string
	Type1 string
	Type2 string
}

func (TypeBinopError) Error

func (e TypeBinopError) Error() string

func (TypeBinopError) String

func (e TypeBinopError) String() string

type TypeID

type TypeID int
const (
	TypeID_Bool TypeID = iota
	TypeID_Int8
	TypeID_Uint8
	TypeID_Uint16
	TypeID_Uint32
	TypeID_Uint64
	TypeID_Int16
	TypeID_Int32
	TypeID_Int64
	TypeID_Float32
	TypeID_Float64
	TypeID_String
	TypeID_Bytes
	TypeID_Array
	TypeID_Struct
	TypeID_Enum
)

func (TypeID) IsArray

func (t TypeID) IsArray() bool

func (TypeID) IsBasic

func (t TypeID) IsBasic() bool

func (TypeID) IsBool

func (t TypeID) IsBool() bool

func (TypeID) IsBytes

func (t TypeID) IsBytes() bool

func (TypeID) IsEnum

func (t TypeID) IsEnum() bool

func (TypeID) IsFloat

func (t TypeID) IsFloat() bool

func (TypeID) IsInt

func (t TypeID) IsInt() bool

func (TypeID) IsIntOrUint

func (t TypeID) IsIntOrUint() bool

func (TypeID) IsNumber

func (t TypeID) IsNumber() bool

func (TypeID) IsString

func (t TypeID) IsString() bool

func (TypeID) IsStruct

func (t TypeID) IsStruct() bool

func (TypeID) IsUint

func (t TypeID) IsUint() bool

func (TypeID) String

func (t TypeID) String() string

type TypeNotMatchError

type TypeNotMatchError struct {
	Type1 string
	Type2 string
}

func (TypeNotMatchError) Error

func (e TypeNotMatchError) Error() string

func (TypeNotMatchError) String

func (e TypeNotMatchError) String() string

type TypeUnopError

type TypeUnopError struct {
	Expr string
	Type string
}

func (TypeUnopError) Error

func (e TypeUnopError) Error() string

func (TypeUnopError) String

func (e TypeUnopError) String() string

type UnopExpr

type UnopExpr struct {
	BasePosition
	ExprType *BasicType
	Op       ExprOp
	Expr1    Expr
}

func (UnopExpr) GetExprKind

func (u UnopExpr) GetExprKind() ExprKindID

func (UnopExpr) GetExprType

func (u UnopExpr) GetExprType() *BasicType

func (UnopExpr) String

func (u UnopExpr) String() string

type ValueExpr

type ValueExpr struct {
	BasePosition
	ValueType *BasicType
}

func (ValueExpr) GetExprKind

func (v ValueExpr) GetExprKind() ExprKindID

func (ValueExpr) GetExprType

func (v ValueExpr) GetExprType() *BasicType

func (ValueExpr) String

func (v ValueExpr) String() string

type VoidField

type VoidField struct {
	BasePosition
	FieldBitSize int64
	FieldBelongs *Struct
	FieldOptions *util.OrderedMap[string, *Option]
	FromEmbedded *EmbeddedField
}

func (VoidField) Copy

func (f VoidField) Copy() Field

func (VoidField) GetFieldBelongs

func (f VoidField) GetFieldBelongs() *Struct

func (VoidField) GetFieldBitSize

func (f VoidField) GetFieldBitSize() int64

func (VoidField) GetFieldFromEmbedded

func (f VoidField) GetFieldFromEmbedded() *EmbeddedField

func (VoidField) GetFieldKind

func (f VoidField) GetFieldKind() FieldKindID

func (VoidField) GetFieldUniqueName

func (f VoidField) GetFieldUniqueName() string

func (*VoidField) SetFieldBelongs

func (f *VoidField) SetFieldBelongs(s *Struct)

func (*VoidField) SetFieldFromEmbedded

func (f *VoidField) SetFieldFromEmbedded(e *EmbeddedField)

func (VoidField) ShortString

func (f VoidField) ShortString() string

func (VoidField) String

func (f VoidField) String() string

Jump to

Keyboard shortcuts

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