Skip to content

Commit

Permalink
Replace participle with PEG based parser
Browse files Browse the repository at this point in the history
  • Loading branch information
robinvdvleuten committed Feb 9, 2024
1 parent 52756dd commit cba666e
Show file tree
Hide file tree
Showing 6 changed files with 1,572 additions and 1 deletion.
33 changes: 33 additions & 0 deletions grammar/ast.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package grammar

type Node interface{}

type Telegram struct {
Header *Header
Data []*Object
Footer *Footer
}

type Header struct {
Value string
}

type Footer struct {
Value string
}

// Object is a COSEM object in the Telegram represented by the
// OBIS (Object Identification System) and one or more attributes.
type Object struct {
Id *OBIS
Value interface{}
}

// ...
type OBIS struct {
A int
B int
C int
D int
E int
}
Loading

0 comments on commit cba666e

Please sign in to comment.