| 1 | // Code generated by gocc; DO NOT EDIT. |
| 2 | |
| 3 | package parser |
| 4 | |
| 5 | import "github.com/goccmack/gocc/example/errorrecovery/ast" |
| 6 | |
| 7 | type ( |
| 8 | ProdTab [numProductions]ProdTabEntry |
| 9 | ProdTabEntry struct { |
| 10 | String string |
| 11 | Id string |
| 12 | NTType int |
| 13 | Index int |
| 14 | NumSymbols int |
| 15 | ReduceFunc func([]Attrib, interface{}) (Attrib, error) |
| 16 | } |
| 17 | Attrib interface { |
| 18 | } |
| 19 | ) |
| 20 | |
| 21 | var productionsTable = ProdTab{ |
| 22 | ProdTabEntry{ |
| 23 | String: `S' : StmtList << >>`, |
| 24 | Id: "S'", |
| 25 | NTType: 0, |
| 26 | Index: 0, |
| 27 | NumSymbols: 1, |
| 28 | ReduceFunc: func(X []Attrib, C interface{}) (Attrib, error) { |
| 29 | return X[0], nil |
| 30 | }, |
| 31 | }, |
| 32 | ProdTabEntry{ |
| 33 | String: `StmtList : Stmt << ast.NewStmtList(X[0]) >>`, |
| 34 | Id: "StmtList", |
| 35 | NTType: 1, |
| 36 | Index: 1, |
| 37 | NumSymbols: 1, |
| 38 | ReduceFunc: func(X []Attrib, C interface{}) (Attrib, error) { |
| 39 | return ast.NewStmtList(X[0]) |
| 40 | }, |
| 41 | }, |
| 42 | ProdTabEntry{ |
| 43 | String: `StmtList : StmtList Stmt << ast.AppendStmt(X[0], X[1]) >>`, |
| 44 | Id: "StmtList", |
| 45 | NTType: 1, |
| 46 | Index: 2, |
| 47 | NumSymbols: 2, |
| 48 | ReduceFunc: func(X []Attrib, C interface{}) (Attrib, error) { |
| 49 | return ast.AppendStmt(X[0], X[1]) |
| 50 | }, |
| 51 | }, |
| 52 | ProdTabEntry{ |
| 53 | String: `Stmt : id << ast.NewStmt(X[0]) >>`, |
| 54 | Id: "Stmt", |
| 55 | NTType: 2, |
| 56 | Index: 3, |
| 57 | NumSymbols: 1, |
| 58 | ReduceFunc: func(X []Attrib, C interface{}) (Attrib, error) { |
| 59 | return ast.NewStmt(X[0]) |
| 60 | }, |
| 61 | }, |
| 62 | ProdTabEntry{ |
| 63 | String: `Stmt : error << >>`, |
| 64 | Id: "Stmt", |
| 65 | NTType: 2, |
| 66 | Index: 4, |
| 67 | NumSymbols: 1, |
| 68 | ReduceFunc: func(X []Attrib, C interface{}) (Attrib, error) { |
| 69 | return X[0], nil |
| 70 | }, |
| 71 | }, |
| 72 | } |