forked from goccmack/gocc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
productionstable.go
82 lines (78 loc) · 1.79 KB
/
productionstable.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Code generated by gocc; DO NOT EDIT.
package parser
import "github.com/Desuuuu/gocc/example/usercontext/ast"
type (
ProdTab [numProductions]ProdTabEntry
ProdTabEntry struct {
String string
Id string
NTType int
Index int
NumSymbols int
ReduceFunc func([]Attrib, interface{}) (Attrib, error)
}
Attrib interface {
}
)
var productionsTable = ProdTab{
ProdTabEntry{
String: `S' : Grammar << >>`,
Id: "S'",
NTType: 0,
Index: 0,
NumSymbols: 1,
ReduceFunc: func(X []Attrib, C interface{}) (Attrib, error) {
return X[0], nil
},
},
ProdTabEntry{
String: `Grammar : Words "...42..." << X[0], nil >>`,
Id: "Grammar",
NTType: 1,
Index: 1,
NumSymbols: 2,
ReduceFunc: func(X []Attrib, C interface{}) (Attrib, error) {
return X[0], nil
},
},
ProdTabEntry{
String: `Words : capitalized << >>`,
Id: "Words",
NTType: 2,
Index: 2,
NumSymbols: 1,
ReduceFunc: func(X []Attrib, C interface{}) (Attrib, error) {
return X[0], nil
},
},
ProdTabEntry{
String: `Words : Words capitalized << >>`,
Id: "Words",
NTType: 2,
Index: 3,
NumSymbols: 2,
ReduceFunc: func(X []Attrib, C interface{}) (Attrib, error) {
return X[0], nil
},
},
ProdTabEntry{
String: `Words : lowercase << ast.NewIdentifier(X[0], C) >>`,
Id: "Words",
NTType: 2,
Index: 4,
NumSymbols: 1,
ReduceFunc: func(X []Attrib, C interface{}) (Attrib, error) {
return ast.NewIdentifier(X[0], C)
},
},
ProdTabEntry{
String: `Words : Words lowercase << ast.NewIdentifier(X[1], C) >>`,
Id: "Words",
NTType: 2,
Index: 5,
NumSymbols: 2,
ReduceFunc: func(X []Attrib, C interface{}) (Attrib, error) {
return ast.NewIdentifier(X[1], C)
},
},
}