ast

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Walk

func Walk(n Node, f Visitor)

Types

type ArrayType

type ArrayType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	EndLoc               Loc
	ElementType          Type
	Length               Expr
	LengthValue          *uint64
	IsBytes              bool
}

func (*ArrayType) GetBitAlignment

func (n *ArrayType) GetBitAlignment() BitAlignment

func (*ArrayType) GetBitSize

func (n *ArrayType) GetBitSize() *uint64

func (*ArrayType) GetIsExplicit

func (n *ArrayType) GetIsExplicit() bool

func (*ArrayType) GetLoc

func (n *ArrayType) GetLoc() Loc

func (*ArrayType) GetNodeType

func (n *ArrayType) GetNodeType() NodeType

func (*ArrayType) GetNonDynamicAllocation

func (n *ArrayType) GetNonDynamicAllocation() bool

type Assert

type Assert struct {
	Loc         Loc
	Cond        *Binary
	IsIoRelated bool
}

func (*Assert) GetLoc

func (n *Assert) GetLoc() Loc

func (*Assert) GetNodeType

func (n *Assert) GetNodeType() NodeType

type AstFile

type AstFile struct {
	Success bool      `json:"success"`
	Files   []string  `json:"files"`
	Ast     *JsonAst  `json:"ast"`
	Error   *SrcError `json:"error"`
}

type Available

type Available struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Base          *Call
	Target        Expr
}

func (*Available) GetConstantLevel

func (n *Available) GetConstantLevel() ConstantLevel

func (*Available) GetExprType

func (n *Available) GetExprType() Type

func (*Available) GetLoc

func (n *Available) GetLoc() Loc

func (*Available) GetNodeType

func (n *Available) GetNodeType() NodeType

type BadExpr

type BadExpr struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Content       string
	BadExpr       Expr
}

func (*BadExpr) GetConstantLevel

func (n *BadExpr) GetConstantLevel() ConstantLevel

func (*BadExpr) GetExprType

func (n *BadExpr) GetExprType() Type

func (*BadExpr) GetLoc

func (n *BadExpr) GetLoc() Loc

func (*BadExpr) GetNodeType

func (n *BadExpr) GetNodeType() NodeType

type Binary

type Binary struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Op            BinaryOp
	Left          Expr
	Right         Expr
}

func (*Binary) GetConstantLevel

func (n *Binary) GetConstantLevel() ConstantLevel

func (*Binary) GetExprType

func (n *Binary) GetExprType() Type

func (*Binary) GetLoc

func (n *Binary) GetLoc() Loc

func (*Binary) GetNodeType

func (n *Binary) GetNodeType() NodeType

type BinaryOp

type BinaryOp int
const (
	BinaryOpMul                        BinaryOp = 0
	BinaryOpDiv                        BinaryOp = 1
	BinaryOpMod                        BinaryOp = 2
	BinaryOpLeftArithmeticShift        BinaryOp = 3
	BinaryOpRightArithmeticShift       BinaryOp = 4
	BinaryOpLeftLogicalShift           BinaryOp = 5
	BinaryOpRightLogicalShift          BinaryOp = 6
	BinaryOpBitAnd                     BinaryOp = 7
	BinaryOpAdd                        BinaryOp = 8
	BinaryOpSub                        BinaryOp = 9
	BinaryOpBitOr                      BinaryOp = 10
	BinaryOpBitXor                     BinaryOp = 11
	BinaryOpEqual                      BinaryOp = 12
	BinaryOpNotEqual                   BinaryOp = 13
	BinaryOpLess                       BinaryOp = 14
	BinaryOpLessOrEq                   BinaryOp = 15
	BinaryOpGrater                     BinaryOp = 16
	BinaryOpGraterOrEq                 BinaryOp = 17
	BinaryOpLogicalAnd                 BinaryOp = 18
	BinaryOpLogicalOr                  BinaryOp = 19
	BinaryOpCondOp1                    BinaryOp = 20
	BinaryOpCondOp2                    BinaryOp = 21
	BinaryOpRangeExclusive             BinaryOp = 22
	BinaryOpRangeInclusive             BinaryOp = 23
	BinaryOpAssign                     BinaryOp = 24
	BinaryOpDefineAssign               BinaryOp = 25
	BinaryOpConstAssign                BinaryOp = 26
	BinaryOpAddAssign                  BinaryOp = 27
	BinaryOpSubAssign                  BinaryOp = 28
	BinaryOpMulAssign                  BinaryOp = 29
	BinaryOpDivAssign                  BinaryOp = 30
	BinaryOpModAssign                  BinaryOp = 31
	BinaryOpLeftLogicalShiftAssign     BinaryOp = 32
	BinaryOpRightLogicalShiftAssign    BinaryOp = 33
	BinaryOpLeftArithmeticShiftAssign  BinaryOp = 34
	BinaryOpRightArithmeticShiftAssign BinaryOp = 35
	BinaryOpBitAndAssign               BinaryOp = 36
	BinaryOpBitOrAssign                BinaryOp = 37
	BinaryOpBitXorAssign               BinaryOp = 38
	BinaryOpComma                      BinaryOp = 39
	BinaryOpInAssign                   BinaryOp = 40
	BinaryOpAppendAssign               BinaryOp = 41
)

func (BinaryOp) String

func (n BinaryOp) String() string

func (*BinaryOp) UnmarshalJSON

func (n *BinaryOp) UnmarshalJSON(data []byte) error

type BitAlignment

type BitAlignment int
const (
	BitAlignmentByteAligned  BitAlignment = 0
	BitAlignmentBit1         BitAlignment = 1
	BitAlignmentBit2         BitAlignment = 2
	BitAlignmentBit3         BitAlignment = 3
	BitAlignmentBit4         BitAlignment = 4
	BitAlignmentBit5         BitAlignment = 5
	BitAlignmentBit6         BitAlignment = 6
	BitAlignmentBit7         BitAlignment = 7
	BitAlignmentNotTarget    BitAlignment = 8
	BitAlignmentNotDecidable BitAlignment = 9
)

func (BitAlignment) String

func (n BitAlignment) String() string

func (*BitAlignment) UnmarshalJSON

func (n *BitAlignment) UnmarshalJSON(data []byte) error

type BlockTrait

type BlockTrait int
const (
	BlockTraitNone              BlockTrait = 0
	BlockTraitFixedPrimitive    BlockTrait = 1
	BlockTraitFixedFloat        BlockTrait = 2
	BlockTraitFixedArray        BlockTrait = 4
	BlockTraitVariableArray     BlockTrait = 8
	BlockTraitStruct            BlockTrait = 16
	BlockTraitConditional       BlockTrait = 32
	BlockTraitStaticPeek        BlockTrait = 64
	BlockTraitBitField          BlockTrait = 128
	BlockTraitReadState         BlockTrait = 256
	BlockTraitWriteState        BlockTrait = 512
	BlockTraitTerminalPattern   BlockTrait = 1024
	BlockTraitBitStream         BlockTrait = 2048
	BlockTraitDynamicOrder      BlockTrait = 4096
	BlockTraitFullInput         BlockTrait = 8192
	BlockTraitBackwardInput     BlockTrait = 16384
	BlockTraitMagicValue        BlockTrait = 32768
	BlockTraitAssertion         BlockTrait = 65536
	BlockTraitExplicitError     BlockTrait = 131072
	BlockTraitProcedural        BlockTrait = 262144
	BlockTraitForLoop           BlockTrait = 524288
	BlockTraitLocalVariable     BlockTrait = 1048576
	BlockTraitDescriptionOnly   BlockTrait = 2097152
	BlockTraitUncommonSize      BlockTrait = 4194304
	BlockTraitControlFlowChange BlockTrait = 8388608
)

func (BlockTrait) String

func (n BlockTrait) String() string

func (*BlockTrait) UnmarshalJSON

func (n *BlockTrait) UnmarshalJSON(data []byte) error

type BoolLiteral

type BoolLiteral struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Value         bool
}

func (*BoolLiteral) GetConstantLevel

func (n *BoolLiteral) GetConstantLevel() ConstantLevel

func (*BoolLiteral) GetExprType

func (n *BoolLiteral) GetExprType() Type

func (*BoolLiteral) GetLoc

func (n *BoolLiteral) GetLoc() Loc

func (*BoolLiteral) GetNodeType

func (n *BoolLiteral) GetNodeType() NodeType

type BoolType

type BoolType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
}

func (*BoolType) GetBitAlignment

func (n *BoolType) GetBitAlignment() BitAlignment

func (*BoolType) GetBitSize

func (n *BoolType) GetBitSize() *uint64

func (*BoolType) GetIsExplicit

func (n *BoolType) GetIsExplicit() bool

func (*BoolType) GetLoc

func (n *BoolType) GetLoc() Loc

func (*BoolType) GetNodeType

func (n *BoolType) GetNodeType() NodeType

func (*BoolType) GetNonDynamicAllocation

func (n *BoolType) GetNonDynamicAllocation() bool

type Break

type Break struct {
	Loc         Loc
	RelatedLoop *Loop
}

func (*Break) GetLoc

func (n *Break) GetLoc() Loc

func (*Break) GetNodeType

func (n *Break) GetNodeType() NodeType

type Call

type Call struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Callee        Expr
	RawArguments  Expr
	Arguments     []Expr
	EndLoc        Loc
}

func (*Call) GetConstantLevel

func (n *Call) GetConstantLevel() ConstantLevel

func (*Call) GetExprType

func (n *Call) GetExprType() Type

func (*Call) GetLoc

func (n *Call) GetLoc() Loc

func (*Call) GetNodeType

func (n *Call) GetNodeType() NodeType

type Cast

type Cast struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Base          *Call
	Arguments     []Expr
}

func (*Cast) GetConstantLevel

func (n *Cast) GetConstantLevel() ConstantLevel

func (*Cast) GetExprType

func (n *Cast) GetExprType() Type

func (*Cast) GetLoc

func (n *Cast) GetLoc() Loc

func (*Cast) GetNodeType

func (n *Cast) GetNodeType() NodeType

type CharLiteral

type CharLiteral struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Value         string
	Code          uint64
}

func (*CharLiteral) GetConstantLevel

func (n *CharLiteral) GetConstantLevel() ConstantLevel

func (*CharLiteral) GetExprType

func (n *CharLiteral) GetExprType() Type

func (*CharLiteral) GetLoc

func (n *CharLiteral) GetLoc() Loc

func (*CharLiteral) GetNodeType

func (n *CharLiteral) GetNodeType() NodeType

type Comment

type Comment struct {
	Loc     Loc
	Comment string
}

func (*Comment) GetLoc

func (n *Comment) GetLoc() Loc

func (*Comment) GetNodeType

func (n *Comment) GetNodeType() NodeType

type CommentGroup

type CommentGroup struct {
	Loc      Loc
	Comments []*Comment
}

func (*CommentGroup) GetLoc

func (n *CommentGroup) GetLoc() Loc

func (*CommentGroup) GetNodeType

func (n *CommentGroup) GetNodeType() NodeType

type Cond

type Cond struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Cond          Expr
	Then          Expr
	ElsLoc        Loc
	Els           Expr
}

func (*Cond) GetConstantLevel

func (n *Cond) GetConstantLevel() ConstantLevel

func (*Cond) GetExprType

func (n *Cond) GetExprType() Type

func (*Cond) GetLoc

func (n *Cond) GetLoc() Loc

func (*Cond) GetNodeType

func (n *Cond) GetNodeType() NodeType

type ConstantLevel

type ConstantLevel int
const (
	ConstantLevelUnknown           ConstantLevel = 0
	ConstantLevelConstant          ConstantLevel = 1
	ConstantLevelImmutableVariable ConstantLevel = 2
	ConstantLevelVariable          ConstantLevel = 3
)

func (ConstantLevel) String

func (n ConstantLevel) String() string

func (*ConstantLevel) UnmarshalJSON

func (n *ConstantLevel) UnmarshalJSON(data []byte) error

type Continue

type Continue struct {
	Loc         Loc
	RelatedLoop *Loop
}

func (*Continue) GetLoc

func (n *Continue) GetLoc() Loc

func (*Continue) GetNodeType

func (n *Continue) GetNodeType() NodeType

type Endian

type Endian int
const (
	EndianUnspec Endian = 0
	EndianBig    Endian = 1
	EndianLittle Endian = 2
)

func (Endian) String

func (n Endian) String() string

func (*Endian) UnmarshalJSON

func (n *Endian) UnmarshalJSON(data []byte) error

type Enum

type Enum struct {
	Loc          Loc
	Belong       Member
	BelongStruct *StructType
	Ident        *Ident
	Scope        *Scope
	ColonLoc     Loc
	BaseType     Type
	Members      []*EnumMember
	EnumType     *EnumType
}

func (*Enum) GetBelong

func (n *Enum) GetBelong() Member

func (*Enum) GetBelongStruct

func (n *Enum) GetBelongStruct() *StructType

func (*Enum) GetIdent

func (n *Enum) GetIdent() *Ident

func (*Enum) GetLoc

func (n *Enum) GetLoc() Loc

func (*Enum) GetNodeType

func (n *Enum) GetNodeType() NodeType

type EnumMember

type EnumMember struct {
	Loc          Loc
	Belong       Member
	BelongStruct *StructType
	Ident        *Ident
	RawExpr      Expr
	Value        Expr
	StrLiteral   *StrLiteral
}

func (*EnumMember) GetBelong

func (n *EnumMember) GetBelong() Member

func (*EnumMember) GetBelongStruct

func (n *EnumMember) GetBelongStruct() *StructType

func (*EnumMember) GetIdent

func (n *EnumMember) GetIdent() *Ident

func (*EnumMember) GetLoc

func (n *EnumMember) GetLoc() Loc

func (*EnumMember) GetNodeType

func (n *EnumMember) GetNodeType() NodeType

type EnumType

type EnumType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	Base                 *Enum
}

func (*EnumType) GetBitAlignment

func (n *EnumType) GetBitAlignment() BitAlignment

func (*EnumType) GetBitSize

func (n *EnumType) GetBitSize() *uint64

func (*EnumType) GetIsExplicit

func (n *EnumType) GetIsExplicit() bool

func (*EnumType) GetLoc

func (n *EnumType) GetLoc() Loc

func (*EnumType) GetNodeType

func (n *EnumType) GetNodeType() NodeType

func (*EnumType) GetNonDynamicAllocation

func (n *EnumType) GetNonDynamicAllocation() bool

type ExplicitError

type ExplicitError struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Base          *Call
	Message       *StrLiteral
}

func (*ExplicitError) GetConstantLevel

func (n *ExplicitError) GetConstantLevel() ConstantLevel

func (*ExplicitError) GetExprType

func (n *ExplicitError) GetExprType() Type

func (*ExplicitError) GetLoc

func (n *ExplicitError) GetLoc() Loc

func (*ExplicitError) GetNodeType

func (n *ExplicitError) GetNodeType() NodeType

type Expr

type Expr interface {
	Node
	GetExprType() Type
	GetConstantLevel() ConstantLevel
	// contains filtered or unexported methods
}

type Field

type Field struct {
	Loc                  Loc
	Belong               Member
	BelongStruct         *StructType
	Ident                *Ident
	ColonLoc             Loc
	IsStateVariable      bool
	FieldType            Type
	Arguments            *FieldArgument
	OffsetBit            *uint64
	OffsetRecent         uint64
	TailOffsetBit        *uint64
	TailOffsetRecent     uint64
	BitAlignment         BitAlignment
	EventualBitAlignment BitAlignment
	Follow               Follow
	EventualFollow       Follow
	Next                 *Field
}

func (*Field) GetBelong

func (n *Field) GetBelong() Member

func (*Field) GetBelongStruct

func (n *Field) GetBelongStruct() *StructType

func (*Field) GetIdent

func (n *Field) GetIdent() *Ident

func (*Field) GetLoc

func (n *Field) GetLoc() Loc

func (*Field) GetNodeType

func (n *Field) GetNodeType() NodeType

type FieldArgument

type FieldArgument struct {
	Loc                Loc
	RawArguments       Expr
	EndLoc             Loc
	CollectedArguments []Expr
	Arguments          []Expr
	Assigns            []*Binary
	Alignment          Expr
	AlignmentValue     *uint64
	SubByteLength      Expr
	SubByteBegin       Expr
	Peek               Expr
	PeekValue          *uint64
	TypeMap            *TypeLiteral
	Metadata           []*Metadata
	ArgumentMapping    FieldArgumentMapping
}

func (*FieldArgument) GetLoc

func (n *FieldArgument) GetLoc() Loc

func (*FieldArgument) GetNodeType

func (n *FieldArgument) GetNodeType() NodeType

type FieldArgumentMapping

type FieldArgumentMapping int
const (
	FieldArgumentMappingNone          FieldArgumentMapping = 0
	FieldArgumentMappingDirect        FieldArgumentMapping = 1
	FieldArgumentMappingRepeat        FieldArgumentMapping = 2
	FieldArgumentMappingSomeCandidate FieldArgumentMapping = 4
)

func (FieldArgumentMapping) String

func (n FieldArgumentMapping) String() string

func (*FieldArgumentMapping) UnmarshalJSON

func (n *FieldArgumentMapping) UnmarshalJSON(data []byte) error

type FloatType

type FloatType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	Endian               Endian
	IsCommonSupported    bool
}

func (*FloatType) GetBitAlignment

func (n *FloatType) GetBitAlignment() BitAlignment

func (*FloatType) GetBitSize

func (n *FloatType) GetBitSize() *uint64

func (*FloatType) GetIsExplicit

func (n *FloatType) GetIsExplicit() bool

func (*FloatType) GetLoc

func (n *FloatType) GetLoc() Loc

func (*FloatType) GetNodeType

func (n *FloatType) GetNodeType() NodeType

func (*FloatType) GetNonDynamicAllocation

func (n *FloatType) GetNonDynamicAllocation() bool

type Follow

type Follow int
const (
	FollowUnknown  Follow = 0
	FollowEnd      Follow = 1
	FollowFixed    Follow = 2
	FollowConstant Follow = 3
	FollowNormal   Follow = 4
)

func (Follow) String

func (n Follow) String() string

func (*Follow) UnmarshalJSON

func (n *Follow) UnmarshalJSON(data []byte) error

type Format

type Format struct {
	Loc            Loc
	Belong         Member
	BelongStruct   *StructType
	Ident          *Ident
	Body           *IndentBlock
	EncodeFn       *Function
	DecodeFn       *Function
	CastFns        []*Function
	Depends        []*IdentType
	StateVariables []*Field
}

func (*Format) GetBelong

func (n *Format) GetBelong() Member

func (*Format) GetBelongStruct

func (n *Format) GetBelongStruct() *StructType

func (*Format) GetIdent

func (n *Format) GetIdent() *Ident

func (*Format) GetLoc

func (n *Format) GetLoc() Loc

func (*Format) GetNodeType

func (n *Format) GetNodeType() NodeType

type Function

type Function struct {
	Loc          Loc
	Belong       Member
	BelongStruct *StructType
	Ident        *Ident
	Parameters   []*Field
	ReturnType   Type
	Body         *IndentBlock
	FuncType     *FunctionType
	IsCast       bool
}

func (*Function) GetBelong

func (n *Function) GetBelong() Member

func (*Function) GetBelongStruct

func (n *Function) GetBelongStruct() *StructType

func (*Function) GetIdent

func (n *Function) GetIdent() *Ident

func (*Function) GetLoc

func (n *Function) GetLoc() Loc

func (*Function) GetNodeType

func (n *Function) GetNodeType() NodeType

type FunctionType

type FunctionType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	ReturnType           Type
	Parameters           []Type
}

func (*FunctionType) GetBitAlignment

func (n *FunctionType) GetBitAlignment() BitAlignment

func (*FunctionType) GetBitSize

func (n *FunctionType) GetBitSize() *uint64

func (*FunctionType) GetIsExplicit

func (n *FunctionType) GetIsExplicit() bool

func (*FunctionType) GetLoc

func (n *FunctionType) GetLoc() Loc

func (*FunctionType) GetNodeType

func (n *FunctionType) GetNodeType() NodeType

func (*FunctionType) GetNonDynamicAllocation

func (n *FunctionType) GetNonDynamicAllocation() bool

type GenerateMapFile

type GenerateMapFile struct {
	Structs []string  `json:"structs"`
	LineMap []LineMap `json:"line_map"`
}

type GenericType

type GenericType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	Belong               Member
}

func (*GenericType) GetBitAlignment

func (n *GenericType) GetBitAlignment() BitAlignment

func (*GenericType) GetBitSize

func (n *GenericType) GetBitSize() *uint64

func (*GenericType) GetIsExplicit

func (n *GenericType) GetIsExplicit() bool

func (*GenericType) GetLoc

func (n *GenericType) GetLoc() Loc

func (*GenericType) GetNodeType

func (n *GenericType) GetNodeType() NodeType

func (*GenericType) GetNonDynamicAllocation

func (n *GenericType) GetNonDynamicAllocation() bool

type Ident

type Ident struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Ident         string
	Usage         IdentUsage
	Base          Node
	Scope         *Scope
}

func (*Ident) GetConstantLevel

func (n *Ident) GetConstantLevel() ConstantLevel

func (*Ident) GetExprType

func (n *Ident) GetExprType() Type

func (*Ident) GetLoc

func (n *Ident) GetLoc() Loc

func (*Ident) GetNodeType

func (n *Ident) GetNodeType() NodeType

type IdentType

type IdentType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	ImportRef            *MemberAccess
	Ident                *Ident
	Base                 Type
}

func (*IdentType) GetBitAlignment

func (n *IdentType) GetBitAlignment() BitAlignment

func (*IdentType) GetBitSize

func (n *IdentType) GetBitSize() *uint64

func (*IdentType) GetIsExplicit

func (n *IdentType) GetIsExplicit() bool

func (*IdentType) GetLoc

func (n *IdentType) GetLoc() Loc

func (*IdentType) GetNodeType

func (n *IdentType) GetNodeType() NodeType

func (*IdentType) GetNonDynamicAllocation

func (n *IdentType) GetNonDynamicAllocation() bool

type IdentUsage

type IdentUsage int
const (
	IdentUsageUnknown             IdentUsage = 0
	IdentUsageBadIdent            IdentUsage = 1
	IdentUsageReference           IdentUsage = 2
	IdentUsageDefineVariable      IdentUsage = 3
	IdentUsageDefineConst         IdentUsage = 4
	IdentUsageDefineField         IdentUsage = 5
	IdentUsageDefineFormat        IdentUsage = 6
	IdentUsageDefineState         IdentUsage = 7
	IdentUsageDefineEnum          IdentUsage = 8
	IdentUsageDefineEnumMember    IdentUsage = 9
	IdentUsageDefineFn            IdentUsage = 10
	IdentUsageDefineCastFn        IdentUsage = 11
	IdentUsageDefineArg           IdentUsage = 12
	IdentUsageReferenceType       IdentUsage = 13
	IdentUsageReferenceMember     IdentUsage = 14
	IdentUsageReferenceMemberType IdentUsage = 15
	IdentUsageMaybeType           IdentUsage = 16
	IdentUsageReferenceBuiltinFn  IdentUsage = 17
)

func (IdentUsage) String

func (n IdentUsage) String() string

func (*IdentUsage) UnmarshalJSON

func (n *IdentUsage) UnmarshalJSON(data []byte) error

type Identity

type Identity struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Expr          Expr
}

func (*Identity) GetConstantLevel

func (n *Identity) GetConstantLevel() ConstantLevel

func (*Identity) GetExprType

func (n *Identity) GetExprType() Type

func (*Identity) GetLoc

func (n *Identity) GetLoc() Loc

func (*Identity) GetNodeType

func (n *Identity) GetNodeType() NodeType

type If

type If struct {
	Loc             Loc
	ExprType        Type
	ConstantLevel   ConstantLevel
	StructUnionType *StructUnionType
	CondScope       *Scope
	Cond            *Identity
	Then            *IndentBlock
	Els             Node
}

func (*If) GetConstantLevel

func (n *If) GetConstantLevel() ConstantLevel

func (*If) GetExprType

func (n *If) GetExprType() Type

func (*If) GetLoc

func (n *If) GetLoc() Loc

func (*If) GetNodeType

func (n *If) GetNodeType() NodeType

type ImplicitYield

type ImplicitYield struct {
	Loc  Loc
	Expr Expr
}

func (*ImplicitYield) GetLoc

func (n *ImplicitYield) GetLoc() Loc

func (*ImplicitYield) GetNodeType

func (n *ImplicitYield) GetNodeType() NodeType

type Import

type Import struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Path          string
	Base          *Call
	ImportDesc    *Program
}

func (*Import) GetConstantLevel

func (n *Import) GetConstantLevel() ConstantLevel

func (*Import) GetExprType

func (n *Import) GetExprType() Type

func (*Import) GetLoc

func (n *Import) GetLoc() Loc

func (*Import) GetNodeType

func (n *Import) GetNodeType() NodeType

type IndentBlock

type IndentBlock struct {
	Loc         Loc
	StructType  *StructType
	Elements    []Node
	Scope       *Scope
	Metadata    []*Metadata
	BlockTraits BlockTrait
}

func (*IndentBlock) GetLoc

func (n *IndentBlock) GetLoc() Loc

func (*IndentBlock) GetNodeType

func (n *IndentBlock) GetNodeType() NodeType

type Index

type Index struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Expr          Expr
	Index         Expr
	EndLoc        Loc
}

func (*Index) GetConstantLevel

func (n *Index) GetConstantLevel() ConstantLevel

func (*Index) GetExprType

func (n *Index) GetExprType() Type

func (*Index) GetLoc

func (n *Index) GetLoc() Loc

func (*Index) GetNodeType

func (n *Index) GetNodeType() NodeType

type IntLiteral

type IntLiteral struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Value         string
}

func (*IntLiteral) GetConstantLevel

func (n *IntLiteral) GetConstantLevel() ConstantLevel

func (*IntLiteral) GetExprType

func (n *IntLiteral) GetExprType() Type

func (*IntLiteral) GetLoc

func (n *IntLiteral) GetLoc() Loc

func (*IntLiteral) GetNodeType

func (n *IntLiteral) GetNodeType() NodeType

type IntLiteralType

type IntLiteralType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	Base                 *IntLiteral
}

func (*IntLiteralType) GetBitAlignment

func (n *IntLiteralType) GetBitAlignment() BitAlignment

func (*IntLiteralType) GetBitSize

func (n *IntLiteralType) GetBitSize() *uint64

func (*IntLiteralType) GetIsExplicit

func (n *IntLiteralType) GetIsExplicit() bool

func (*IntLiteralType) GetLoc

func (n *IntLiteralType) GetLoc() Loc

func (*IntLiteralType) GetNodeType

func (n *IntLiteralType) GetNodeType() NodeType

func (*IntLiteralType) GetNonDynamicAllocation

func (n *IntLiteralType) GetNonDynamicAllocation() bool

type IntType

type IntType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	Endian               Endian
	IsSigned             bool
	IsCommonSupported    bool
}

func (*IntType) GetBitAlignment

func (n *IntType) GetBitAlignment() BitAlignment

func (*IntType) GetBitSize

func (n *IntType) GetBitSize() *uint64

func (*IntType) GetIsExplicit

func (n *IntType) GetIsExplicit() bool

func (*IntType) GetLoc

func (n *IntType) GetLoc() Loc

func (*IntType) GetNodeType

func (n *IntType) GetNodeType() NodeType

func (*IntType) GetNonDynamicAllocation

func (n *IntType) GetNonDynamicAllocation() bool

type IoMethod

type IoMethod int
const (
	IoMethodUnspec             IoMethod = 0
	IoMethodOutputPut          IoMethod = 1
	IoMethodInputPeek          IoMethod = 2
	IoMethodInputGet           IoMethod = 3
	IoMethodInputBackward      IoMethod = 4
	IoMethodInputOffset        IoMethod = 5
	IoMethodInputBitOffset     IoMethod = 6
	IoMethodInputRemain        IoMethod = 7
	IoMethodInputSubrange      IoMethod = 8
	IoMethodConfigEndianLittle IoMethod = 9
	IoMethodConfigEndianBig    IoMethod = 10
	IoMethodConfigEndianNative IoMethod = 11
	IoMethodConfigBitOrderLsb  IoMethod = 12
	IoMethodConfigBitOrderMsb  IoMethod = 13
)

func (IoMethod) String

func (n IoMethod) String() string

func (*IoMethod) UnmarshalJSON

func (n *IoMethod) UnmarshalJSON(data []byte) error

type IoOperation

type IoOperation struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Base          Expr
	Method        IoMethod
	Arguments     []Expr
}

func (*IoOperation) GetConstantLevel

func (n *IoOperation) GetConstantLevel() ConstantLevel

func (*IoOperation) GetExprType

func (n *IoOperation) GetExprType() Type

func (*IoOperation) GetLoc

func (n *IoOperation) GetLoc() Loc

func (*IoOperation) GetNodeType

func (n *IoOperation) GetNodeType() NodeType

type JsonAst

type JsonAst struct {
	Node  []RawNode  `json:"node"`
	Scope []RawScope `json:"scope"`
}

type LineMap

type LineMap struct {
	Line uint64 `json:"line"`
	Loc  Loc    `json:"loc"`
}

type Literal

type Literal interface {
	Expr
	// contains filtered or unexported methods
}

type Loc

type Loc struct {
	Pos  Pos    `json:"pos"`
	File uint64 `json:"file"`
	Line uint64 `json:"line"`
	Col  uint64 `json:"col"`
}

type Loop

type Loop struct {
	Loc       Loc
	CondScope *Scope
	Init      Expr
	Cond      Expr
	Step      Expr
	Body      *IndentBlock
}

func (*Loop) GetLoc

func (n *Loop) GetLoc() Loc

func (*Loop) GetNodeType

func (n *Loop) GetNodeType() NodeType

type Match

type Match struct {
	Loc             Loc
	ExprType        Type
	ConstantLevel   ConstantLevel
	StructUnionType *StructUnionType
	CondScope       *Scope
	Cond            *Identity
	Branch          []*MatchBranch
	TrialMatch      bool
}

func (*Match) GetConstantLevel

func (n *Match) GetConstantLevel() ConstantLevel

func (*Match) GetExprType

func (n *Match) GetExprType() Type

func (*Match) GetLoc

func (n *Match) GetLoc() Loc

func (*Match) GetNodeType

func (n *Match) GetNodeType() NodeType

type MatchBranch

type MatchBranch struct {
	Loc    Loc
	Belong *Match
	Cond   *Identity
	SymLoc Loc
	Then   Node
}

func (*MatchBranch) GetLoc

func (n *MatchBranch) GetLoc() Loc

func (*MatchBranch) GetNodeType

func (n *MatchBranch) GetNodeType() NodeType

type Member

type Member interface {
	Stmt
	GetBelong() Member
	GetBelongStruct() *StructType
	GetIdent() *Ident
	// contains filtered or unexported methods
}

type MemberAccess

type MemberAccess struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Target        Expr
	Member        *Ident
	Base          *Ident
}

func (*MemberAccess) GetConstantLevel

func (n *MemberAccess) GetConstantLevel() ConstantLevel

func (*MemberAccess) GetExprType

func (n *MemberAccess) GetExprType() Type

func (*MemberAccess) GetLoc

func (n *MemberAccess) GetLoc() Loc

func (*MemberAccess) GetNodeType

func (n *MemberAccess) GetNodeType() NodeType

type MetaType

type MetaType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
}

func (*MetaType) GetBitAlignment

func (n *MetaType) GetBitAlignment() BitAlignment

func (*MetaType) GetBitSize

func (n *MetaType) GetBitSize() *uint64

func (*MetaType) GetIsExplicit

func (n *MetaType) GetIsExplicit() bool

func (*MetaType) GetLoc

func (n *MetaType) GetLoc() Loc

func (*MetaType) GetNodeType

func (n *MetaType) GetNodeType() NodeType

func (*MetaType) GetNonDynamicAllocation

func (n *MetaType) GetNonDynamicAllocation() bool

type Metadata

type Metadata struct {
	Loc    Loc
	Base   Expr
	Name   string
	Values []Expr
}

func (*Metadata) GetLoc

func (n *Metadata) GetLoc() Loc

func (*Metadata) GetNodeType

func (n *Metadata) GetNodeType() NodeType

type Node

type Node interface {
	GetLoc() Loc
	GetNodeType() NodeType
	// contains filtered or unexported methods
}

type NodeType

type NodeType int
const (
	NodeTypeProgram          NodeType = 1
	NodeTypeComment          NodeType = 2
	NodeTypeCommentGroup     NodeType = 3
	NodeTypeFieldArgument    NodeType = 4
	NodeTypeExpr             NodeType = 65536
	NodeTypeBinary           NodeType = 65537
	NodeTypeUnary            NodeType = 65538
	NodeTypeCond             NodeType = 65539
	NodeTypeIdent            NodeType = 65540
	NodeTypeCall             NodeType = 65541
	NodeTypeIf               NodeType = 65542
	NodeTypeMemberAccess     NodeType = 65543
	NodeTypeParen            NodeType = 65544
	NodeTypeIndex            NodeType = 65545
	NodeTypeMatch            NodeType = 65546
	NodeTypeRange            NodeType = 65547
	NodeTypeIdentity         NodeType = 65548
	NodeTypeTmpVar           NodeType = 65549
	NodeTypeImport           NodeType = 65550
	NodeTypeCast             NodeType = 65551
	NodeTypeAvailable        NodeType = 65552
	NodeTypeSpecifyOrder     NodeType = 65553
	NodeTypeExplicitError    NodeType = 65554
	NodeTypeIoOperation      NodeType = 65555
	NodeTypeOrCond           NodeType = 65556
	NodeTypeBadExpr          NodeType = 65557
	NodeTypeStmt             NodeType = 131072
	NodeTypeLoop             NodeType = 131073
	NodeTypeIndentBlock      NodeType = 131074
	NodeTypeScopedStatement  NodeType = 131075
	NodeTypeMatchBranch      NodeType = 131076
	NodeTypeUnionCandidate   NodeType = 131077
	NodeTypeReturn           NodeType = 131078
	NodeTypeBreak            NodeType = 131079
	NodeTypeContinue         NodeType = 131080
	NodeTypeAssert           NodeType = 131081
	NodeTypeImplicitYield    NodeType = 131082
	NodeTypeMetadata         NodeType = 131083
	NodeTypeType             NodeType = 262144
	NodeTypeIntType          NodeType = 262145
	NodeTypeFloatType        NodeType = 262146
	NodeTypeIdentType        NodeType = 262147
	NodeTypeIntLiteralType   NodeType = 262148
	NodeTypeStrLiteralType   NodeType = 262149
	NodeTypeRegexLiteralType NodeType = 262150
	NodeTypeVoidType         NodeType = 262151
	NodeTypeBoolType         NodeType = 262152
	NodeTypeArrayType        NodeType = 262153
	NodeTypeFunctionType     NodeType = 262154
	NodeTypeStructType       NodeType = 262155
	NodeTypeStructUnionType  NodeType = 262156
	NodeTypeUnionType        NodeType = 262157
	NodeTypeRangeType        NodeType = 262158
	NodeTypeEnumType         NodeType = 262159
	NodeTypeMetaType         NodeType = 262160
	NodeTypeOptionalType     NodeType = 262161
	NodeTypeGenericType      NodeType = 262162
	NodeTypeLiteral          NodeType = 2162688
	NodeTypeIntLiteral       NodeType = 2162689
	NodeTypeBoolLiteral      NodeType = 2162690
	NodeTypeStrLiteral       NodeType = 2162691
	NodeTypeRegexLiteral     NodeType = 2162692
	NodeTypeCharLiteral      NodeType = 2162693
	NodeTypeTypeLiteral      NodeType = 2162694
	NodeTypeSpecialLiteral   NodeType = 2162695
	NodeTypeMember           NodeType = 2228224
	NodeTypeField            NodeType = 2228225
	NodeTypeFormat           NodeType = 2228226
	NodeTypeState            NodeType = 2228227
	NodeTypeEnum             NodeType = 2228228
	NodeTypeEnumMember       NodeType = 2228229
	NodeTypeFunction         NodeType = 2228230
)

func (NodeType) String

func (n NodeType) String() string

func (*NodeType) UnmarshalJSON

func (n *NodeType) UnmarshalJSON(data []byte) error

type OptionalType

type OptionalType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	BaseType             Type
}

func (*OptionalType) GetBitAlignment

func (n *OptionalType) GetBitAlignment() BitAlignment

func (*OptionalType) GetBitSize

func (n *OptionalType) GetBitSize() *uint64

func (*OptionalType) GetIsExplicit

func (n *OptionalType) GetIsExplicit() bool

func (*OptionalType) GetLoc

func (n *OptionalType) GetLoc() Loc

func (*OptionalType) GetNodeType

func (n *OptionalType) GetNodeType() NodeType

func (*OptionalType) GetNonDynamicAllocation

func (n *OptionalType) GetNonDynamicAllocation() bool

type OrCond

type OrCond struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Base          *Binary
	Conds         []Expr
}

func (*OrCond) GetConstantLevel

func (n *OrCond) GetConstantLevel() ConstantLevel

func (*OrCond) GetExprType

func (n *OrCond) GetExprType() Type

func (*OrCond) GetLoc

func (n *OrCond) GetLoc() Loc

func (*OrCond) GetNodeType

func (n *OrCond) GetNodeType() NodeType

type OrderType

type OrderType int
const (
	OrderTypeByte       OrderType = 0
	OrderTypeBitStream  OrderType = 1
	OrderTypeBitMapping OrderType = 2
	OrderTypeBitBoth    OrderType = 3
)

func (OrderType) String

func (n OrderType) String() string

func (*OrderType) UnmarshalJSON

func (n *OrderType) UnmarshalJSON(data []byte) error

type Paren

type Paren struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Expr          Expr
	EndLoc        Loc
}

func (*Paren) GetConstantLevel

func (n *Paren) GetConstantLevel() ConstantLevel

func (*Paren) GetExprType

func (n *Paren) GetExprType() Type

func (*Paren) GetLoc

func (n *Paren) GetLoc() Loc

func (*Paren) GetNodeType

func (n *Paren) GetNodeType() NodeType

type Pos

type Pos struct {
	Begin uint64 `json:"begin"`
	End   uint64 `json:"end"`
}

type Program

type Program struct {
	Loc         Loc
	StructType  *StructType
	Elements    []Node
	GlobalScope *Scope
	Metadata    []*Metadata
	Endian      *SpecifyOrder
}

func ParseAST

func ParseAST(aux *JsonAst) (prog *Program, err error)

func (*Program) GetLoc

func (n *Program) GetLoc() Loc

func (*Program) GetNodeType

func (n *Program) GetNodeType() NodeType

type Range

type Range struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Op            BinaryOp
	Start         Expr
	End           Expr
}

func (*Range) GetConstantLevel

func (n *Range) GetConstantLevel() ConstantLevel

func (*Range) GetExprType

func (n *Range) GetExprType() Type

func (*Range) GetLoc

func (n *Range) GetLoc() Loc

func (*Range) GetNodeType

func (n *Range) GetNodeType() NodeType

type RangeType

type RangeType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	BaseType             Type
	Range                *Range
}

func (*RangeType) GetBitAlignment

func (n *RangeType) GetBitAlignment() BitAlignment

func (*RangeType) GetBitSize

func (n *RangeType) GetBitSize() *uint64

func (*RangeType) GetIsExplicit

func (n *RangeType) GetIsExplicit() bool

func (*RangeType) GetLoc

func (n *RangeType) GetLoc() Loc

func (*RangeType) GetNodeType

func (n *RangeType) GetNodeType() NodeType

func (*RangeType) GetNonDynamicAllocation

func (n *RangeType) GetNonDynamicAllocation() bool

type RawNode

type RawNode struct {
	NodeType NodeType        `json:"node_type"`
	Loc      Loc             `json:"loc"`
	Body     json.RawMessage `json:"body"`
}

type RawScope

type RawScope struct {
	Prev       *uintptr  `json:"prev"`
	Next       *uintptr  `json:"next"`
	Branch     *uintptr  `json:"branch"`
	Ident      []uintptr `json:"ident"`
	Owner      *uintptr  `json:"owner"`
	BranchRoot bool      `json:"branch_root"`
}

type RegexLiteral

type RegexLiteral struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Value         string
}

func (*RegexLiteral) GetConstantLevel

func (n *RegexLiteral) GetConstantLevel() ConstantLevel

func (*RegexLiteral) GetExprType

func (n *RegexLiteral) GetExprType() Type

func (*RegexLiteral) GetLoc

func (n *RegexLiteral) GetLoc() Loc

func (*RegexLiteral) GetNodeType

func (n *RegexLiteral) GetNodeType() NodeType

type RegexLiteralType

type RegexLiteralType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	Base                 *RegexLiteral
	StrongRef            *RegexLiteral
}

func (*RegexLiteralType) GetBitAlignment

func (n *RegexLiteralType) GetBitAlignment() BitAlignment

func (*RegexLiteralType) GetBitSize

func (n *RegexLiteralType) GetBitSize() *uint64

func (*RegexLiteralType) GetIsExplicit

func (n *RegexLiteralType) GetIsExplicit() bool

func (*RegexLiteralType) GetLoc

func (n *RegexLiteralType) GetLoc() Loc

func (*RegexLiteralType) GetNodeType

func (n *RegexLiteralType) GetNodeType() NodeType

func (*RegexLiteralType) GetNonDynamicAllocation

func (n *RegexLiteralType) GetNonDynamicAllocation() bool

type Return

type Return struct {
	Loc             Loc
	Expr            Expr
	RelatedFunction *Function
}

func (*Return) GetLoc

func (n *Return) GetLoc() Loc

func (*Return) GetNodeType

func (n *Return) GetNodeType() NodeType

type Scope

type Scope struct {
	Prev       *Scope
	Next       *Scope
	Branch     *Scope
	Ident      []*Ident
	Owner      Node
	BranchRoot bool
}

type ScopedStatement

type ScopedStatement struct {
	Loc        Loc
	StructType *StructType
	Statement  Node
	Scope      *Scope
}

func (*ScopedStatement) GetLoc

func (n *ScopedStatement) GetLoc() Loc

func (*ScopedStatement) GetNodeType

func (n *ScopedStatement) GetNodeType() NodeType

type SpecialLiteral

type SpecialLiteral struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Kind          SpecialLiteralKind
}

func (*SpecialLiteral) GetConstantLevel

func (n *SpecialLiteral) GetConstantLevel() ConstantLevel

func (*SpecialLiteral) GetExprType

func (n *SpecialLiteral) GetExprType() Type

func (*SpecialLiteral) GetLoc

func (n *SpecialLiteral) GetLoc() Loc

func (*SpecialLiteral) GetNodeType

func (n *SpecialLiteral) GetNodeType() NodeType

type SpecialLiteralKind

type SpecialLiteralKind int
const (
	SpecialLiteralKindInput  SpecialLiteralKind = 0
	SpecialLiteralKindOutput SpecialLiteralKind = 1
	SpecialLiteralKindConfig SpecialLiteralKind = 2
)

func (SpecialLiteralKind) String

func (n SpecialLiteralKind) String() string

func (*SpecialLiteralKind) UnmarshalJSON

func (n *SpecialLiteralKind) UnmarshalJSON(data []byte) error

type SpecifyOrder

type SpecifyOrder struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Base          *Binary
	OrderType     OrderType
	Order         Expr
	OrderValue    *uint64
}

func (*SpecifyOrder) GetConstantLevel

func (n *SpecifyOrder) GetConstantLevel() ConstantLevel

func (*SpecifyOrder) GetExprType

func (n *SpecifyOrder) GetExprType() Type

func (*SpecifyOrder) GetLoc

func (n *SpecifyOrder) GetLoc() Loc

func (*SpecifyOrder) GetNodeType

func (n *SpecifyOrder) GetNodeType() NodeType

type SrcError

type SrcError struct {
	Errs []SrcErrorEntry `json:"errs"`
}

type SrcErrorEntry

type SrcErrorEntry struct {
	Msg  string `json:"msg"`
	File string `json:"file"`
	Loc  Loc    `json:"loc"`
	Src  string `json:"src"`
	Warn bool   `json:"warn"`
}

type State

type State struct {
	Loc          Loc
	Belong       Member
	BelongStruct *StructType
	Ident        *Ident
	Body         *IndentBlock
}

func (*State) GetBelong

func (n *State) GetBelong() Member

func (*State) GetBelongStruct

func (n *State) GetBelongStruct() *StructType

func (*State) GetIdent

func (n *State) GetIdent() *Ident

func (*State) GetLoc

func (n *State) GetLoc() Loc

func (*State) GetNodeType

func (n *State) GetNodeType() NodeType

type Stmt

type Stmt interface {
	Node
	// contains filtered or unexported methods
}

type StrLiteral

type StrLiteral struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Value         string
	BinaryValue   string
	Length        uint64
}

func (*StrLiteral) GetConstantLevel

func (n *StrLiteral) GetConstantLevel() ConstantLevel

func (*StrLiteral) GetExprType

func (n *StrLiteral) GetExprType() Type

func (*StrLiteral) GetLoc

func (n *StrLiteral) GetLoc() Loc

func (*StrLiteral) GetNodeType

func (n *StrLiteral) GetNodeType() NodeType

type StrLiteralType

type StrLiteralType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	Base                 *StrLiteral
	StrongRef            *StrLiteral
}

func (*StrLiteralType) GetBitAlignment

func (n *StrLiteralType) GetBitAlignment() BitAlignment

func (*StrLiteralType) GetBitSize

func (n *StrLiteralType) GetBitSize() *uint64

func (*StrLiteralType) GetIsExplicit

func (n *StrLiteralType) GetIsExplicit() bool

func (*StrLiteralType) GetLoc

func (n *StrLiteralType) GetLoc() Loc

func (*StrLiteralType) GetNodeType

func (n *StrLiteralType) GetNodeType() NodeType

func (*StrLiteralType) GetNonDynamicAllocation

func (n *StrLiteralType) GetNonDynamicAllocation() bool

type StructType

type StructType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	Fields               []Member
	Base                 Node
	Recursive            bool
	FixedHeaderSize      uint64
	FixedTailSize        uint64
	TypeMap              *TypeLiteral
}

func (*StructType) GetBitAlignment

func (n *StructType) GetBitAlignment() BitAlignment

func (*StructType) GetBitSize

func (n *StructType) GetBitSize() *uint64

func (*StructType) GetIsExplicit

func (n *StructType) GetIsExplicit() bool

func (*StructType) GetLoc

func (n *StructType) GetLoc() Loc

func (*StructType) GetNodeType

func (n *StructType) GetNodeType() NodeType

func (*StructType) GetNonDynamicAllocation

func (n *StructType) GetNonDynamicAllocation() bool

type StructUnionType

type StructUnionType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	Cond                 *Identity
	Conds                []Expr
	Structs              []*StructType
	Base                 Expr
	UnionFields          []*Field
	Exhaustive           bool
}

func (*StructUnionType) GetBitAlignment

func (n *StructUnionType) GetBitAlignment() BitAlignment

func (*StructUnionType) GetBitSize

func (n *StructUnionType) GetBitSize() *uint64

func (*StructUnionType) GetIsExplicit

func (n *StructUnionType) GetIsExplicit() bool

func (*StructUnionType) GetLoc

func (n *StructUnionType) GetLoc() Loc

func (*StructUnionType) GetNodeType

func (n *StructUnionType) GetNodeType() NodeType

func (*StructUnionType) GetNonDynamicAllocation

func (n *StructUnionType) GetNonDynamicAllocation() bool

type TmpVar

type TmpVar struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	TmpVar        uint64
}

func (*TmpVar) GetConstantLevel

func (n *TmpVar) GetConstantLevel() ConstantLevel

func (*TmpVar) GetExprType

func (n *TmpVar) GetExprType() Type

func (*TmpVar) GetLoc

func (n *TmpVar) GetLoc() Loc

func (*TmpVar) GetNodeType

func (n *TmpVar) GetNodeType() NodeType

type Token

type Token struct {
	Tag   TokenTag `json:"tag"`
	Token string   `json:"token"`
	Loc   Loc      `json:"loc"`
}

type TokenFile

type TokenFile struct {
	Success bool      `json:"success"`
	Files   []string  `json:"files"`
	Tokens  []Token   `json:"tokens"`
	Error   *SrcError `json:"error"`
}

type TokenTag

type TokenTag int
const (
	TokenTagIndent       TokenTag = 0
	TokenTagSpace        TokenTag = 1
	TokenTagLine         TokenTag = 2
	TokenTagPunct        TokenTag = 3
	TokenTagIntLiteral   TokenTag = 4
	TokenTagBoolLiteral  TokenTag = 5
	TokenTagStrLiteral   TokenTag = 6
	TokenTagRegexLiteral TokenTag = 7
	TokenTagCharLiteral  TokenTag = 8
	TokenTagKeyword      TokenTag = 9
	TokenTagIdent        TokenTag = 10
	TokenTagComment      TokenTag = 11
	TokenTagError        TokenTag = 12
	TokenTagUnknown      TokenTag = 13
)

func (TokenTag) String

func (n TokenTag) String() string

func (*TokenTag) UnmarshalJSON

func (n *TokenTag) UnmarshalJSON(data []byte) error

type Type

type Type interface {
	Node
	GetIsExplicit() bool
	GetNonDynamicAllocation() bool
	GetBitAlignment() BitAlignment
	GetBitSize() *uint64
	// contains filtered or unexported methods
}

type TypeLiteral

type TypeLiteral struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	TypeLiteral   Type
	EndLoc        Loc
}

func (*TypeLiteral) GetConstantLevel

func (n *TypeLiteral) GetConstantLevel() ConstantLevel

func (*TypeLiteral) GetExprType

func (n *TypeLiteral) GetExprType() Type

func (*TypeLiteral) GetLoc

func (n *TypeLiteral) GetLoc() Loc

func (*TypeLiteral) GetNodeType

func (n *TypeLiteral) GetNodeType() NodeType

type Unary

type Unary struct {
	Loc           Loc
	ExprType      Type
	ConstantLevel ConstantLevel
	Op            UnaryOp
	Expr          Expr
}

func (*Unary) GetConstantLevel

func (n *Unary) GetConstantLevel() ConstantLevel

func (*Unary) GetExprType

func (n *Unary) GetExprType() Type

func (*Unary) GetLoc

func (n *Unary) GetLoc() Loc

func (*Unary) GetNodeType

func (n *Unary) GetNodeType() NodeType

type UnaryOp

type UnaryOp int
const (
	UnaryOpNot       UnaryOp = 0
	UnaryOpMinusSign UnaryOp = 1
)

func (UnaryOp) String

func (n UnaryOp) String() string

func (*UnaryOp) UnmarshalJSON

func (n *UnaryOp) UnmarshalJSON(data []byte) error

type UnionCandidate

type UnionCandidate struct {
	Loc   Loc
	Cond  Expr
	Field *Field
}

func (*UnionCandidate) GetLoc

func (n *UnionCandidate) GetLoc() Loc

func (*UnionCandidate) GetNodeType

func (n *UnionCandidate) GetNodeType() NodeType

type UnionType

type UnionType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
	Cond                 Expr
	Candidates           []*UnionCandidate
	BaseType             *StructUnionType
	CommonType           Type
	MemberCandidates     []*Field
}

func (*UnionType) GetBitAlignment

func (n *UnionType) GetBitAlignment() BitAlignment

func (*UnionType) GetBitSize

func (n *UnionType) GetBitSize() *uint64

func (*UnionType) GetIsExplicit

func (n *UnionType) GetIsExplicit() bool

func (*UnionType) GetLoc

func (n *UnionType) GetLoc() Loc

func (*UnionType) GetNodeType

func (n *UnionType) GetNodeType() NodeType

func (*UnionType) GetNonDynamicAllocation

func (n *UnionType) GetNonDynamicAllocation() bool

type VisitFn

type VisitFn func(v Visitor, n Node) bool

func (VisitFn) Visit

func (f VisitFn) Visit(v Visitor, n Node) bool

type Visitor

type Visitor interface {
	Visit(v Visitor, n Node) bool
}

type VoidType

type VoidType struct {
	Loc                  Loc
	IsExplicit           bool
	NonDynamicAllocation bool
	BitAlignment         BitAlignment
	BitSize              *uint64
}

func (*VoidType) GetBitAlignment

func (n *VoidType) GetBitAlignment() BitAlignment

func (*VoidType) GetBitSize

func (n *VoidType) GetBitSize() *uint64

func (*VoidType) GetIsExplicit

func (n *VoidType) GetIsExplicit() bool

func (*VoidType) GetLoc

func (n *VoidType) GetLoc() Loc

func (*VoidType) GetNodeType

func (n *VoidType) GetNodeType() NodeType

func (*VoidType) GetNonDynamicAllocation

func (n *VoidType) GetNonDynamicAllocation() bool

Jump to

Keyboard shortcuts

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