Skip to content

Commit 31fbf24

Browse files
committed
add test for issue #216 (macros in char classes)
1 parent 43acee8 commit 31fbf24

File tree

6 files changed

+104
-0
lines changed

6 files changed

+104
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Cclmacros.java
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AXBCDX
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
match: --A--
2+
action [16] { /* X */ }
3+
match: --X--
4+
action [17] { /* NCD */ }
5+
match: --B--
6+
action [17] { /* NCD */ }
7+
match: --C--
8+
action [16] { /* X */ }
9+
match: --D--
10+
action [19] { /* default */ }
11+
match: --X--
12+
action [17] { /* NCD */ }
13+
-1
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Reading "src/test/cases/ccl-macros/cclmacros.flex"
2+
CharClasses:
3+
class 0:
4+
{ [0-'@']['B']['E'-1114111] }
5+
class 1:
6+
{ ['A'] }
7+
class 2:
8+
{ ['C'] }
9+
class 3:
10+
{ ['D'] }
11+
12+
Constructing NFA : NFA is
13+
State 0
14+
with epsilon in {2, 4, 6}
15+
State 1
16+
with epsilon in {2, 4, 6}
17+
State 2
18+
with 1 in {3}
19+
with 2 in {3}
20+
State[FINAL] 3
21+
State 4
22+
with 0 in {5}
23+
with 1 in {5}
24+
State[FINAL] 5
25+
State 6
26+
with 0 in {7}
27+
with 1 in {7}
28+
with 2 in {7}
29+
with 3 in {7}
30+
State[FINAL] 7
31+
32+
33+
8 states in NFA
34+
Converting NFA to DFA :
35+
....
36+
DFA is
37+
State 0:
38+
with 0 in 2
39+
with 1 in 3
40+
with 2 in 4
41+
with 3 in 5
42+
State 1:
43+
with 0 in 2
44+
with 1 in 3
45+
with 2 in 4
46+
with 3 in 5
47+
State [FINAL] 2:
48+
State [FINAL] 3:
49+
State [FINAL] 4:
50+
State [FINAL] 5:
51+
52+
53+
6 states before minimization, 4 states in minimized DFA
54+
Miniminal DFA is
55+
State 0:
56+
with 0 in 1
57+
with 1 in 2
58+
with 2 in 2
59+
with 3 in 3
60+
State [FINAL] 1:
61+
State [FINAL] 2:
62+
State [FINAL] 3:
63+
64+
Writing code to "src/test/cases/ccl-macros/Cclmacros.java"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
%%
3+
4+
%public
5+
%class Cclmacros
6+
%int
7+
%debug
8+
9+
A = [A]
10+
NCD = [^CD]
11+
C = [BC--{NCD}]
12+
X = [{A}{C}]
13+
14+
%%
15+
16+
{X} { /* X */ }
17+
[{NCD}] { /* NCD */ }
18+
19+
[^] { /* default */ }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: cclmacros
2+
3+
description:
4+
test for issue #216 (Macros in character classes are not supported)
5+
6+
jflex: --nobak --dump

0 commit comments

Comments
 (0)