Skip to content

Commit 01f616e

Browse files
committed
Update NEWS for v0.7.1
1 parent ece00b8 commit 01f616e

1 file changed

Lines changed: 173 additions & 4 deletions

File tree

NEWS.md

Lines changed: 173 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
# NEWS for Lrama
22

3-
## Lrama 0.7.1 (2025-xx-xx)
3+
## Lrama 0.7.1 (2025-12-24)
44

55
### Optimize IELR
66

7+
Optimized performance to a level that allows for IELR testing in practical applications.
8+
79
https://github.com/ruby/lrama/pull/595
810
https://github.com/ruby/lrama/pull/605
911
https://github.com/ruby/lrama/pull/685
1012
https://github.com/ruby/lrama/pull/700
1113

1214
### Introduce counterexamples timeout
1315

16+
Counterexample searches can sometimes take a long time, so we've added a timeout to abort the process after a set period. The current limits are:
17+
18+
* 10 seconds per case
19+
* 120 seconds total (cumulative)
20+
21+
Please note that these are hard-coded and cannot be modified by the user in the current version.
22+
1423
https://github.com/ruby/lrama/pull/623
1524

1625
### Optimize Counterexamples
1726

27+
Optimized counterexample search performance.
28+
1829
https://github.com/ruby/lrama/pull/607
1930
https://github.com/ruby/lrama/pull/610
2031
https://github.com/ruby/lrama/pull/614
@@ -47,18 +58,128 @@ operation : /* empty */
4758

4859
https://github.com/ruby/lrama/pull/637
4960

50-
### Print conflicts of each state on output file
61+
### Render conflicts of each state on output file
62+
63+
Added token information for conflicts in the output file.
64+
These information are useful when a state has many actions.
5165

5266
```
53-
TODO example
67+
State 1
68+
69+
4 class: keyword_class • tSTRING "end"
70+
5 $@1: ε • [tSTRING]
71+
7 class: keyword_class • $@1 tSTRING '!' "end" $@2
72+
8 $@3: ε • [tSTRING]
73+
10 class: keyword_class • $@3 tSTRING '?' "end" $@4
74+
75+
Conflict on tSTRING. shift/reduce($@1)
76+
Conflict on tSTRING. shift/reduce($@3)
77+
Conflict on tSTRING. reduce($@1)/reduce($@3)
78+
79+
tSTRING shift, and go to state 6
80+
81+
tSTRING reduce using rule 5 ($@1)
82+
tSTRING reduce using rule 8 ($@3)
83+
84+
$@1 go to state 7
85+
$@3 go to state 8
5486
```
5587

5688
https://github.com/ruby/lrama/pull/541
5789

58-
### Print the origin of conflicted tokens on output file
90+
### Render the origin of conflicted tokens on output file
91+
92+
For example, for the grammar file like below:
93+
94+
```
95+
%%
96+
97+
program: expr
98+
;
99+
100+
expr: expr '+' expr
101+
| tNUMBER
102+
;
103+
104+
%%
105+
```
106+
107+
Lrama generates output file which describes where `"plus"` (`'+'`) look ahead tokens come from:
108+
109+
```
110+
State 6
111+
112+
2 expr: expr • "plus" expr
113+
2 | expr "plus" expr • ["end of file", "plus"]
114+
115+
Conflict on "plus". shift/reduce(expr)
116+
"plus" comes from state 0 goto by expr
117+
"plus" comes from state 5 goto by expr
118+
```
119+
120+
state 0 and state 5 look like below:
121+
122+
```
123+
State 0
124+
125+
0 $accept: • program "end of file"
126+
1 program: • expr
127+
2 expr: • expr "plus" expr
128+
3 | • tNUMBER
129+
130+
tNUMBER shift, and go to state 1
131+
132+
program go to state 2
133+
expr go to state 3
134+
135+
State 5
136+
137+
2 expr: • expr "plus" expr
138+
2 | expr "plus" • expr
139+
3 | • tNUMBER
140+
141+
tNUMBER shift, and go to state 1
142+
143+
expr go to state 6
144+
```
59145

60146
https://github.com/ruby/lrama/pull/726
61147

148+
### Render precedences usage information on output file
149+
150+
For example, for the grammar file like below:
151+
152+
```
153+
%left tPLUS
154+
%right tUPLUS
155+
156+
%%
157+
158+
program: expr ;
159+
160+
expr: tUPLUS expr
161+
| expr tPLUS expr
162+
| tNUMBER
163+
;
164+
165+
%%
166+
```
167+
168+
Lrama generates output file which describes where these precedences are used to resolve conflicts:
169+
170+
```
171+
Precedences
172+
precedence on "unary+" is used to resolve conflict on
173+
LALR
174+
state 5. Conflict between reduce by "expr -> tUPLUS expr" and shift "+" resolved as reduce ("+" < "unary+").
175+
precedence on "+" is used to resolve conflict on
176+
LALR
177+
state 5. Conflict between reduce by "expr -> tUPLUS expr" and shift "+" resolved as reduce ("+" < "unary+").
178+
state 8. Conflict between reduce by "expr -> expr tPLUS expr" and shift "+" resolved as reduce (%left "+").
179+
```
180+
181+
https://github.com/ruby/lrama/pull/741
182+
62183
### Add support for reporting Rule Usage Frequency
63184

64185
Support to report rule usage frequency statistics for analyzing grammar characteristics.
@@ -100,6 +221,54 @@ https://github.com/ruby/lrama/pull/677
100221

101222
### Render Split States information on output file
102223

224+
For example, for the grammar file like below:
225+
226+
```
227+
%token a
228+
%token b
229+
%token c
230+
%define lr.type ielr
231+
232+
%precedence tLOWEST
233+
%precedence a
234+
%precedence tHIGHEST
235+
236+
%%
237+
238+
S: a A B a
239+
| b A B b
240+
;
241+
242+
A: a C D E
243+
;
244+
245+
B: c
246+
| // empty
247+
;
248+
249+
C: D
250+
;
251+
252+
D: a
253+
;
254+
255+
E: a
256+
| %prec tHIGHEST // empty
257+
;
258+
259+
%%
260+
```
261+
262+
Lrama generates output file which describes where which new states are created when IELR is enabled:
263+
264+
```
265+
Split States
266+
267+
State 19 is split from state 4
268+
State 20 is split from state 9
269+
State 21 is split from state 14
270+
```
271+
103272
https://github.com/ruby/lrama/pull/624
104273

105274
### Add ioption support to the Standard library

0 commit comments

Comments
 (0)