From bb85dcc57cc3c0fff6cc9dc09540d58fef400d6f Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Sun, 29 Aug 2021 23:40:10 +0900 Subject: Add precedences and associativities to the description file --- spec/description.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'spec/description.go') diff --git a/spec/description.go b/spec/description.go index d2b6d3b..08b037e 100644 --- a/spec/description.go +++ b/spec/description.go @@ -1,11 +1,13 @@ package spec type Terminal struct { - Number int `json:"number"` - Name string `json:"name"` - Anonymous bool `json:"anonymous"` - Alias string `json:"alias"` - Pattern string `json:"pattern"` + Number int `json:"number"` + Name string `json:"name"` + Anonymous bool `json:"anonymous"` + Alias string `json:"alias"` + Pattern string `json:"pattern"` + Precedence int `json:"prec"` + Associativity string `json:"assoc"` } type NonTerminal struct { @@ -14,9 +16,11 @@ type NonTerminal struct { } type Production struct { - Number int `json:"number"` - LHS int `json:"lhs"` - RHS []int `json:"rhs"` + Number int `json:"number"` + LHS int `json:"lhs"` + RHS []int `json:"rhs"` + Precedence int `json:"prec"` + Associativity string `json:"assoc"` } type Item struct { -- cgit v1.2.3