Debian Codegraph @

example/astx/parser/productionstable.go

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