Debian Codegraph @

example/sr/parser/productionstable.go

raw symbols SCIP
1 // Code generated by gocc; DO NOT EDIT.
2
3 package parser
4
5 import "github.com/goccmack/gocc/example/sr/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' : Stmt << >>`,
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: `Stmt : "if" id "then" Stmt << ast.NewIf(X[1], X[3]), nil >>`,
34 Id: "Stmt",
35 NTType: 1,
36 Index: 1,
37 NumSymbols: 4,
38 ReduceFunc: func(X []Attrib, C interface{}) (Attrib, error) {
39 return ast.NewIf(X[1], X[3]), nil
40 },
41 },
42 ProdTabEntry{
43 String: `Stmt : "if" id "then" Stmt "else" Stmt << ast.NewIfElse(X[1], X[3], X[5]), nil >>`,
44 Id: "Stmt",
45 NTType: 1,
46 Index: 2,
47 NumSymbols: 6,
48 ReduceFunc: func(X []Attrib, C interface{}) (Attrib, error) {
49 return ast.NewIfElse(X[1], X[3], X[5]), nil
50 },
51 },
52 ProdTabEntry{
53 String: `Stmt : id << ast.NewIdStmt(X[0]), nil >>`,
54 Id: "Stmt",
55 NTType: 1,
56 Index: 3,
57 NumSymbols: 1,
58 ReduceFunc: func(X []Attrib, C interface{}) (Attrib, error) {
59 return ast.NewIdStmt(X[0]), nil
60 },
61 },
62 }