generate: Add PDL language structures
This commit is contained in:
parent
8ece6436b8
commit
6bc98b3f77
47
generate/protocol.go
Normal file
47
generate/protocol.go
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
package generate
|
||||||
|
|
||||||
|
type Protocol struct {
|
||||||
|
Messages map[uint16] Message
|
||||||
|
Types map[string] Type
|
||||||
|
}
|
||||||
|
|
||||||
|
type Message struct {
|
||||||
|
Name string
|
||||||
|
Type Type
|
||||||
|
}
|
||||||
|
|
||||||
|
type Type interface {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
type TypeInt struct {
|
||||||
|
Bits int
|
||||||
|
Signed bool
|
||||||
|
}
|
||||||
|
|
||||||
|
type TypeFloat struct {
|
||||||
|
Bits int
|
||||||
|
}
|
||||||
|
|
||||||
|
type TypeString struct { }
|
||||||
|
|
||||||
|
type TypeBuffer struct { }
|
||||||
|
|
||||||
|
type TypeArray struct {
|
||||||
|
Element Type
|
||||||
|
}
|
||||||
|
|
||||||
|
type TypeTable struct { }
|
||||||
|
|
||||||
|
type TypeTableDefined struct {
|
||||||
|
Fields map[uint16] Field
|
||||||
|
}
|
||||||
|
|
||||||
|
type Field struct {
|
||||||
|
Name string
|
||||||
|
Type Type
|
||||||
|
}
|
||||||
|
|
||||||
|
type TypeNamed struct {
|
||||||
|
Name string
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user