-
Notifications
You must be signed in to change notification settings - Fork 0
/
grammar.go
75 lines (72 loc) · 1.77 KB
/
grammar.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
// Code generated with llxgen.
package internal
import "github.com/ava12/llx/grammar"
var confGrammar = &grammar.Grammar{
Tokens: []grammar.Token{
{Name: "space", Re: "[ \\t]+", Groups: 6, Flags: 132},
{Name: "comment", Re: "#.*?(?:\\n|$)", Groups: 6, Flags: 132},
{Name: "nl", Re: "\\n", Groups: 6, Flags: 128},
{Name: "sec-name", Re: "[a-zA-Z_][a-zA-Z_0-9]*(?:[.-][a-zA-Z_][a-zA-Z_0-9]*)*", Groups: 1, Flags: 128},
{Name: "name", Re: "[a-zA-Z_][a-zA-Z_0-9]*(?:-[a-zA-Z_][a-zA-Z_0-9]*)*", Groups: 4, Flags: 128},
{Name: "op", Re: "[\\[\\]=]", Groups: 5, Flags: 0},
{Name: "value", Re: "\\S[^\\n#]*", Groups: 2, Flags: 128},
{Name: "=", Re: "", Groups: 5, Flags: 1},
{Name: "[", Re: "", Groups: 5, Flags: 1},
{Name: "]", Re: "", Groups: 5, Flags: 1},
},
Nodes: []grammar.Node{
{Name: "confGrammar", FirstState: 0},
{Name: "def-section", FirstState: 2},
{Name: "section", FirstState: 4},
{Name: "entry", FirstState: 6},
{Name: "sep", FirstState: 10},
{Name: "header", FirstState: 11},
},
States: []grammar.State{
{2, 0, 0, 0, 4},
{2, 0, 0, 4, 6},
{2, 0, 0, 6, 8},
{2, 0, 0, 8, 11},
{2, 0, 0, 11, 12},
{2, 0, 0, 12, 15},
{2, 0, 0, 15, 16},
{2, 0, 0, 16, 17},
{1, 0, 0, 17, 20},
{2, 0, 0, 20, 22},
{2, 0, 0, 22, 23},
{2, 0, 0, 23, 24},
{0, 0, 0, 24, 25},
{2, 0, 0, 25, 26},
{2, 0, 0, 26, 27},
},
MultiRules: []grammar.MultiRule{},
Rules: []grammar.Rule{
{-1, -1, -1},
{2, 1, 1},
{4, 1, 1},
{8, 1, 2},
{-1, -1, -1},
{8, 1, 2},
{2, 3, 4},
{4, 3, 3},
{-1, -1, -1},
{2, 3, 4},
{4, 3, 3},
{8, 5, 5},
{-1, -1, -1},
{2, 5, 4},
{4, 5, 3},
{4, 7, -1},
{7, 8, -1},
{-1, -1, -1},
{2, -1, -1},
{6, 9, -1},
{-1, -1, -1},
{2, -1, -1},
{2, -1, -1},
{8, 12, -1},
{3, 13, -1},
{9, 14, -1},
{2, -1, -1},
},
}