Documentation ¶
Index ¶
- type Array
- type BadNode
- type Bits
- type BooleanLiteral
- type BooleanType
- type BstrType
- type BytesType
- type CDDL
- type CDDLEntry
- type Comment
- type CommentGroup
- type ComparatorOpControl
- type Entry
- type Enumeration
- type FloatLiteral
- type FloatType
- type Group
- type GroupChoice
- type GroupEntry
- type Identifier
- type IntegerLiteral
- type IntegerType
- type Map
- type NMOccurrence
- type NegativeIntegerType
- type Node
- type NullType
- type Optional
- type Range
- type Regexp
- type Rule
- type SizeOperatorControl
- type Tag
- type TextLiteral
- type TstrType
- type TypeChoice
- type UintLiteral
- type UintType
- type Unwrap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct { Pos token.Position Rules []GroupEntry }
type BadNode ¶
type BadNode struct { // The start position of the bad node Pos token.Position // The position of the triggering token Token token.Token // The base node of the bad node Base Node // The end position EndPos token.Position }
BadNode represents a node formed due to parsing error
type Bits ¶
type Bits struct { // Pos: the position of the .size token Pos token.Position // Token: the token responsible for the node Token token.Token // Base: the base node Base Node // Constraint: the bits constraint to apply Contstraint Node }
Bits represents the AST Node for `.bits` control operator
type BooleanLiteral ¶
type BooleanLiteral struct { Range token.PositionRange Bool bool }
func (*BooleanLiteral) End ¶
func (bl *BooleanLiteral) End() token.Position
func (*BooleanLiteral) Start ¶
func (bl *BooleanLiteral) Start() token.Position
type BooleanType ¶
BooleanType represents the AST Node for the `bool` type definition token.
func (*BooleanType) End ¶
func (b *BooleanType) End() token.Position
func (*BooleanType) Start ¶
func (b *BooleanType) Start() token.Position
type CommentGroup ¶
type CommentGroup struct {
List []*Comment
}
CommentGroup represents a sequence of comments with no empty lines
func (*CommentGroup) End ¶
func (cg *CommentGroup) End() token.Position
func (*CommentGroup) Start ¶
func (cg *CommentGroup) Start() token.Position
func (*CommentGroup) String ¶
func (cg *CommentGroup) String() (out string)
type ComparatorOpControl ¶
type ComparatorOpControl struct { Pos token.Position Token token.Token Operator string Left, Right Node }
ControlOpControl represents the AST Node for operators `.lt, .le, .gt, .ge, .eq, .ne` with numeric left and right values. This also takes identifiers that resolve to numeric types.
Numeric values are: `int, uint, nint, float, float16, float32, float64`
func (*ComparatorOpControl) End ¶
func (cc *ComparatorOpControl) End() token.Position
func (*ComparatorOpControl) Start ¶
func (cc *ComparatorOpControl) Start() token.Position
type Entry ¶
type Entry struct { Pos token.Position Name *Identifier Value Node TrailingComment *Comment }
Entry represents the Node for a group entry It maps the name of the type to the type
type Enumeration ¶
func (*Enumeration) End ¶
func (e *Enumeration) End() token.Position
func (*Enumeration) Start ¶
func (e *Enumeration) Start() token.Position
type FloatLiteral ¶
type FloatLiteral struct { Range token.PositionRange Token token.Token Literal float64 }
FloatLiteral represesnts the AST Node for float type token i.e. 3.412
func (*FloatLiteral) End ¶
func (fl *FloatLiteral) End() token.Position
func (*FloatLiteral) Start ¶
func (fl *FloatLiteral) Start() token.Position
type FloatType ¶
FloatType represents the AST Node for `float, float16, float32, float64` type definition tokens.
type Group ¶
type Group struct { Pos token.Position Entries []GroupEntry }
type GroupChoice ¶
func (*GroupChoice) End ¶
func (gc *GroupChoice) End() token.Position
func (*GroupChoice) Start ¶
func (gc *GroupChoice) Start() token.Position
type GroupEntry ¶
type GroupEntry interface { Node // contains filtered or unexported methods }
type Identifier ¶
Identifer represents the AST Node for named identifiers
func (*Identifier) End ¶
func (i *Identifier) End() token.Position
func (*Identifier) IsPlug ¶
func (i *Identifier) IsPlug() bool
func (*Identifier) IsSocket ¶
func (i *Identifier) IsSocket() bool
func (*Identifier) Start ¶
func (i *Identifier) Start() token.Position
func (*Identifier) String ¶
func (i *Identifier) String() string
type IntegerLiteral ¶
IntegerLiteral represents the AST Node for an integer literal i.e 3
func (*IntegerLiteral) End ¶
func (il *IntegerLiteral) End() token.Position
func (*IntegerLiteral) Start ¶
func (il *IntegerLiteral) Start() token.Position
type IntegerType ¶
IntegerType represents the AST Node for the `int` type decalration token
func (*IntegerType) End ¶
func (it *IntegerType) End() token.Position
func (*IntegerType) Start ¶
func (it *IntegerType) Start() token.Position
type NMOccurrence ¶
func (*NMOccurrence) End ¶
func (nm *NMOccurrence) End() token.Position
func (*NMOccurrence) Start ¶
func (nm *NMOccurrence) Start() token.Position
type NegativeIntegerType ¶
func (*NegativeIntegerType) End ¶
func (nt *NegativeIntegerType) End() token.Position
func (*NegativeIntegerType) Start ¶
func (nt *NegativeIntegerType) Start() token.Position
type Node ¶
type Node interface { // Start returns the start token of the node Start() token.Position // End returns the end token of the node End() token.Position }
Node interface represents an AST Node
type Rule ¶
type Rule struct { Pos token.Position Name *Identifier Value Node TrailingComment *Comment }
Rule represents the AST Node for typed identifer. It maps the name of the type to the type
type SizeOperatorControl ¶
type SizeOperatorControl struct { // Pos: the position of the .size token Pos token.Position // Token: the token responsible for the node Token token.Token // Size: number of bytes Size Node // Type: the base type to apply the contraint to Type Node }
SizeOperatorControl represents the AST Node for `.size` control operator
func (*SizeOperatorControl) End ¶
func (sc *SizeOperatorControl) End() token.Position
End returns the end of the size
func (*SizeOperatorControl) Start ¶
func (sc *SizeOperatorControl) Start() token.Position
Start returns the start of the base type
type TextLiteral ¶
TextLiteral represents the AST Node for a text literal
func (*TextLiteral) End ¶
func (tl *TextLiteral) End() token.Position
func (*TextLiteral) Start ¶
func (tl *TextLiteral) Start() token.Position
type TypeChoice ¶
TypeChoice represents the AST Node for `/` type choice operator
func (*TypeChoice) End ¶
func (tc *TypeChoice) End() token.Position
func (*TypeChoice) Start ¶
func (tc *TypeChoice) Start() token.Position
type UintLiteral ¶
IntegerLiteral represents the AST Node for an integer literal i.e 3
func (*UintLiteral) End ¶
func (ul *UintLiteral) End() token.Position
func (*UintLiteral) Start ¶
func (ul *UintLiteral) Start() token.Position
Source Files ¶
- array.go
- bad_node.go
- boolean.go
- bytes.go
- cddl_entry.go
- cddl_root.go
- comment.go
- control_bits.go
- control_comparator.go
- control_regexp.go
- control_size.go
- entry.go
- enumeration.go
- float.go
- group.go
- groupchoice.go
- identifier.go
- integer.go
- map.go
- node.go
- null.go
- occurrence.go
- range.go
- rule.go
- tag.go
- text.go
- typechoice.go
- uint.go
- uint_literal.go
- unwrap.go