antelope 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/deterministic.output +85 -80
- data/examples/example.output +251 -243
- data/examples/simple.output +69 -57
- data/lib/antelope/ace/grammar.rb +0 -1
- data/lib/antelope/ace/production.rb +57 -0
- data/lib/antelope/ace/token.rb +5 -0
- data/lib/antelope/ace.rb +1 -0
- data/lib/antelope/generation/constructor/follow.rb +3 -9
- data/lib/antelope/generation/constructor.rb +21 -6
- data/lib/antelope/generation/recognizer/rule.rb +18 -9
- data/lib/antelope/generation/recognizer/state.rb +10 -1
- data/lib/antelope/generation/recognizer.rb +2 -4
- data/lib/antelope/version.rb +1 -1
- data/spec/antelope/constructor_spec.rb +4 -0
- metadata +3 -3
- data/lib/antelope/ace/grammar/production.rb +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c791a71ff3ecc84f17a84ccb5955122154b61361
|
4
|
+
data.tar.gz: ef9c05b620950ffe04782135adc6a71005528976
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7be5f67f4f2198bc767b78664ba1764194e9d5f34037f5fa3327cd7de748e36a6af30f7fee0fad62d6d0776fc7fe988f4d0073786df3d5a19a3bad23171809d8
|
7
|
+
data.tar.gz: 64a61b82594d2dc2b78b36f392365842794a41c04aeca5569d15887e39ccd78bc1f02a817ac54f151c61ec9ec560bc4612924e8a135ddcccf16a14bb9d974e58
|
@@ -1,10 +1,21 @@
|
|
1
1
|
Productions:
|
2
|
-
|
3
|
-
|
4
|
-
e → t "
|
5
|
-
|
6
|
-
t →
|
7
|
-
|
2
|
+
0 $start(0) → s(0:1) $
|
3
|
+
1 s(0:1) → e(0:2)
|
4
|
+
2 e(0:2) → t(0:3) ";"
|
5
|
+
3 e(0:2) → t(0:3) "+" e(8:10)
|
6
|
+
4 t(0:3) → NUMBER
|
7
|
+
5 t(0:3) → "(" e(5:9) ")"
|
8
|
+
2 e(5:9) → t(5:3) ";"
|
9
|
+
3 e(5:9) → t(5:3) "+" e(8:10)
|
10
|
+
4 t(5:3) → NUMBER
|
11
|
+
5 t(5:3) → "(" e(5:9) ")"
|
12
|
+
2 e(8:10) → t(8:3) ";"
|
13
|
+
3 e(8:10) → t(8:3) "+" e(8:10)
|
14
|
+
4 t(8:3) → NUMBER
|
15
|
+
5 t(8:3) → "(" e(5:9) ")"
|
16
|
+
|
17
|
+
Nontemrinals:
|
18
|
+
["$start(0)", "s(0:1)", "e(0:2)", "t(0:3)", "e(5:9)", "t(5:3)", "e(8:10)", "t(8:3)"]
|
8
19
|
|
9
20
|
Precedence:
|
10
21
|
--- highest
|
@@ -15,122 +26,116 @@ Precedence:
|
|
15
26
|
--- lowest
|
16
27
|
|
17
28
|
State 0:
|
18
|
-
0/n0: $start
|
19
|
-
{}
|
20
|
-
1/n1: s
|
21
|
-
{}
|
22
|
-
2/n1: e
|
23
|
-
{}
|
24
|
-
3/n1: e
|
25
|
-
{}
|
26
|
-
4/n1: t
|
27
|
-
{}
|
28
|
-
5/n1: t
|
29
|
-
{}
|
29
|
+
0/n0: $start → • s $
|
30
|
+
{} ($start)
|
31
|
+
1/n1: s → • e
|
32
|
+
{} (s)
|
33
|
+
2/n1: e → • t ";"
|
34
|
+
{} (e)
|
35
|
+
3/n1: e → • t "+" e
|
36
|
+
{} (e)
|
37
|
+
4/n1: t → • NUMBER
|
38
|
+
{} (t)
|
39
|
+
5/n1: t → • "(" e ")"
|
40
|
+
{} (t)
|
30
41
|
transitions:
|
31
42
|
s: State 1
|
32
43
|
e: State 2
|
33
44
|
t: State 3
|
34
|
-
NUMBER: State
|
35
|
-
LPAREN: State
|
45
|
+
NUMBER: State 4
|
46
|
+
LPAREN: State 5
|
36
47
|
|
37
48
|
State 1:
|
38
49
|
6/n0: $start → s • $
|
39
|
-
{}
|
50
|
+
{} ($start)
|
40
51
|
transitions:
|
41
|
-
$: State
|
52
|
+
$: State 6
|
42
53
|
|
43
54
|
State 2:
|
44
55
|
7/n1: s → e •
|
45
|
-
{$}
|
56
|
+
{$} (s)
|
46
57
|
reductions:
|
47
58
|
$: Rule 1
|
48
59
|
|
49
60
|
State 3:
|
50
61
|
8/n1: e → t • ";"
|
51
|
-
{}
|
52
|
-
|
53
|
-
{}
|
62
|
+
{} (e)
|
63
|
+
9/n1: e → t • "+" e
|
64
|
+
{} (e)
|
54
65
|
transitions:
|
55
|
-
SEMICOLON: State
|
56
|
-
ADD: State
|
66
|
+
SEMICOLON: State 7
|
67
|
+
ADD: State 8
|
57
68
|
|
58
69
|
State 4:
|
59
|
-
10/n1:
|
60
|
-
{}
|
61
|
-
transitions:
|
62
|
-
ADD: State 9
|
63
|
-
|
64
|
-
State 5:
|
65
|
-
11/n1: t → NUMBER •
|
66
|
-
{";", "+"}
|
70
|
+
10/n1: t → NUMBER •
|
71
|
+
{";", "+"} (t)
|
67
72
|
reductions:
|
68
73
|
SEMICOLON: Rule 4
|
69
74
|
ADD: Rule 4
|
70
75
|
|
71
|
-
State
|
72
|
-
|
73
|
-
{}
|
74
|
-
|
75
|
-
{}
|
76
|
-
|
77
|
-
{}
|
78
|
-
|
79
|
-
{}
|
80
|
-
|
81
|
-
{}
|
76
|
+
State 5:
|
77
|
+
11/n1: t → "(" • e ")"
|
78
|
+
{} (t)
|
79
|
+
12/n1: e → • t ";"
|
80
|
+
{} (e)
|
81
|
+
13/n1: e → • t "+" e
|
82
|
+
{} (e)
|
83
|
+
14/n1: t → • NUMBER
|
84
|
+
{} (t)
|
85
|
+
15/n1: t → • "(" e ")"
|
86
|
+
{} (t)
|
82
87
|
transitions:
|
83
|
-
e: State
|
88
|
+
e: State 9
|
84
89
|
t: State 3
|
85
|
-
NUMBER: State
|
86
|
-
LPAREN: State
|
90
|
+
NUMBER: State 4
|
91
|
+
LPAREN: State 5
|
87
92
|
|
88
|
-
State
|
89
|
-
|
90
|
-
{}
|
93
|
+
State 6:
|
94
|
+
16/n0: $start → s $ •
|
95
|
+
{} ($start)
|
91
96
|
accepting:
|
92
97
|
$: Rule 0
|
93
98
|
|
94
|
-
State
|
95
|
-
|
96
|
-
{$, ")"}
|
99
|
+
State 7:
|
100
|
+
17/n1: e → t ";" •
|
101
|
+
{$, ")"} (e)
|
97
102
|
reductions:
|
98
103
|
$: Rule 2
|
99
104
|
RPAREN: Rule 2
|
100
105
|
|
101
|
-
State
|
102
|
-
|
103
|
-
{}
|
104
|
-
|
105
|
-
{}
|
106
|
-
|
107
|
-
{}
|
108
|
-
|
109
|
-
{}
|
110
|
-
|
111
|
-
{}
|
106
|
+
State 8:
|
107
|
+
18/n1: e → t "+" • e
|
108
|
+
{} (e)
|
109
|
+
19/n1: e → • t ";"
|
110
|
+
{} (e)
|
111
|
+
20/n1: e → • t "+" e
|
112
|
+
{} (e)
|
113
|
+
21/n1: t → • NUMBER
|
114
|
+
{} (t)
|
115
|
+
22/n1: t → • "(" e ")"
|
116
|
+
{} (t)
|
112
117
|
transitions:
|
113
|
-
e: State
|
118
|
+
e: State 10
|
114
119
|
t: State 3
|
115
|
-
NUMBER: State
|
116
|
-
LPAREN: State
|
120
|
+
NUMBER: State 4
|
121
|
+
LPAREN: State 5
|
117
122
|
|
118
|
-
State
|
119
|
-
|
120
|
-
{}
|
123
|
+
State 9:
|
124
|
+
23/n1: t → "(" e • ")"
|
125
|
+
{} (t)
|
121
126
|
transitions:
|
122
|
-
RPAREN: State
|
127
|
+
RPAREN: State 11
|
123
128
|
|
124
|
-
State
|
125
|
-
|
126
|
-
{$, ")"}
|
129
|
+
State 10:
|
130
|
+
24/n1: e → t "+" e •
|
131
|
+
{$, ")"} (e)
|
127
132
|
reductions:
|
128
133
|
$: Rule 3
|
129
134
|
RPAREN: Rule 3
|
130
135
|
|
131
|
-
State
|
132
|
-
|
133
|
-
{";", "+"}
|
136
|
+
State 11:
|
137
|
+
25/n1: t → "(" e ")" •
|
138
|
+
{";", "+"} (t)
|
134
139
|
reductions:
|
135
140
|
SEMICOLON: Rule 5
|
136
141
|
ADD: Rule 5
|