Skip to content

Commit 4f10780

Browse files
committed
Improved some logs
1 parent c90a460 commit 4f10780

File tree

7 files changed

+37
-20
lines changed

7 files changed

+37
-20
lines changed

issues/bas01/files/clc1.exp_err

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Read 1st char for any kind: `97 / 'a'´, @ 1:1 (tm)
1313
Looking to move from state: <,>-2, for token: <10 / <Id>> (tm)
1414
Done with NFA, at pos: 2 (tm)
1515
Put back: 1 looked ahead chars (tm)
16-
Found a TOKEN MATCH ***: <10 / "aa"> at lexical state: 0; returning (tm)
16+
Found a TOKEN MATCH ***: <10 / <Id> / "aa"> at lexical state: 0; returning (tm)
1717
Read 1st char for any kind: `9 / '\t'´, @ 1:3 (tm)
1818
<DEFAULT>-0 Current input char: `9 / '\t'´, @ 1:3 (tm)
1919
Looking for string literal match of token: <2 / "\t"> (tm)
@@ -242,7 +242,7 @@ Read 1st char for any kind: `116 / 't'´, @ 2:1 (tm)
242242
Looking to move from state: <,>-2, for token: <10 / <Id>> (tm)
243243
Done with NFA, at pos: 3 (tm)
244244
Put back: 1 looked ahead chars (tm)
245-
Found a TOKEN MATCH ***: <10 / "ten"> at lexical state: 0; returning (tm)
245+
Found a TOKEN MATCH ***: <10 / <Id> / "ten"> at lexical state: 0; returning (tm)
246246
Read 1st char for any kind: `32 / ' '´, @ 2:4 (tm)
247247
<DEFAULT>-0 Current input char: `32 / ' '´, @ 2:4 (tm)
248248
Looking for string literal match of token: <1 / " "> (tm)
@@ -271,7 +271,7 @@ Read 1st char for any kind: `73 / 'I'´, @ 2:5 (tm)
271271
Looking to move from state: <,>-2, for token: <10 / <Id>> (tm)
272272
Done with NFA, at pos: 4 (tm)
273273
Put back: 1 looked ahead chars (tm)
274-
Found a TOKEN MATCH ***: <10 / "Int1"> at lexical state: 0; returning (tm)
274+
Found a TOKEN MATCH ***: <10 / <Id> / "Int1"> at lexical state: 0; returning (tm)
275275
Read 1st char for any kind: `32 / ' '´, @ 2:9 (tm)
276276
<DEFAULT>-0 Current input char: `32 / ' '´, @ 2:9 (tm)
277277
Looking for string literal match of token: <1 / " "> (tm)
@@ -315,7 +315,7 @@ Read 1st char for any kind: `111 / 'o'´, @ 2:10 (tm)
315315
Looking to move from state: <,>-2, for token: <10 / <Id>> (tm)
316316
Done with NFA, at pos: 9 (tm)
317317
Put back: 1 looked ahead chars (tm)
318-
Found a TOKEN MATCH ***: <10 / "other-ten"> at lexical state: 0; returning (tm)
318+
Found a TOKEN MATCH ***: <10 / <Id> / "other-ten"> at lexical state: 0; returning (tm)
319319
Read 1st char for any kind: `13 / '\r'´, @ 2:19 (tm)
320320
<DEFAULT>-0 Current input char: `13 / '\r'´, @ 2:19 (tm)
321321
Looking for string literal match of token: <4 / "\r"> (tm)
@@ -366,7 +366,7 @@ Read 1st char for any kind: `111 / 'o'´, @ 3:1 (tm)
366366
Looking to move from state: <,>-2, for token: <10 / <Id>> (tm)
367367
Done with NFA, at pos: 9 (tm)
368368
Put back: 1 looked ahead chars (tm)
369-
Found a TOKEN MATCH ***: <10 / "other-ten"> at lexical state: 0; returning (tm)
369+
Found a TOKEN MATCH ***: <10 / <Id> / "other-ten"> at lexical state: 0; returning (tm)
370370
Read 1st char for any kind: `32 / ' '´, @ 3:10 (tm)
371371
<DEFAULT>-0 Current input char: `32 / ' '´, @ 3:10 (tm)
372372
Looking for string literal match of token: <1 / " "> (tm)
@@ -395,7 +395,7 @@ Read 1st char for any kind: `73 / 'I'´, @ 3:11 (tm)
395395
Looking to move from state: <,>-2, for token: <10 / <Id>> (tm)
396396
Done with NFA, at pos: 4 (tm)
397397
Put back: 1 looked ahead chars (tm)
398-
Found a TOKEN MATCH ***: <10 / "Int2"> at lexical state: 0; returning (tm)
398+
Found a TOKEN MATCH ***: <10 / <Id> / "Int2"> at lexical state: 0; returning (tm)
399399
Read 1st char for any kind: `13 / '\r'´, @ 3:15 (tm)
400400
<DEFAULT>-0 Current input char: `13 / '\r'´, @ 3:15 (tm)
401401
Looking for string literal match of token: <4 / "\r"> (tm)

issues/bas01/files/clc2.exp_err

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Read 1st char for any kind: `97 / 'a'´, @ 1:1 (tm)
1313
Looking to move from state: <,>-2, for token: <10 / <Id>> (tm)
1414
Done with NFA, at pos: 2 (tm)
1515
Put back: 1 looked ahead chars (tm)
16-
Found a TOKEN MATCH ***: <10 / "aa"> at lexical state: 0; returning (tm)
16+
Found a TOKEN MATCH ***: <10 / <Id> / "aa"> at lexical state: 0; returning (tm)
1717
Read 1st char for any kind: `32 / ' '´, @ 1:3 (tm)
1818
<DEFAULT>-0 Current input char: `32 / ' '´, @ 1:3 (tm)
1919
Looking for string literal match of token: <1 / " "> (tm)
@@ -99,7 +99,7 @@ Read 1st char for any kind: `98 / 'b'´, @ 1:14 (tm)
9999
Looking to move from state: <,>-2, for token: <10 / <Id>> (tm)
100100
Done with NFA, at pos: 2 (tm)
101101
Put back: 1 looked ahead chars (tm)
102-
Found a TOKEN MATCH ***: <10 / "bb"> at lexical state: 0; returning (tm)
102+
Found a TOKEN MATCH ***: <10 / <Id> / "bb"> at lexical state: 0; returning (tm)
103103
Read 1st char for any kind: `13 / '\r'´, @ 1:16 (tm)
104104
<DEFAULT>-0 Current input char: `13 / '\r'´, @ 1:16 (tm)
105105
Looking for string literal match of token: <4 / "\r"> (tm)
@@ -129,10 +129,5 @@ Read 1st char for any kind: `52 / '4'´, @ 2:1 (tm)
129129
Looking to move from state: <DEFAULT>-0, for token: <7 / <INTEGER>> (tm)
130130
Done with NFA, at pos: 2 (tm)
131131
Put back: 1 looked ahead chars (tm)
132-
Found a TOKEN MATCH ***: <7 / "45"> at lexical state: 0; returning (tm)
133-
ParseException parsing input file
134-
Encountered: <INTEGER> / "45", at line 2, column 1.
135-
Was expecting one of these terminals within expansion starting at 147:3:
136-
<EOF> (inside 147:3)
137-
<Id> (inside 145:3) ...
138-
132+
Found a TOKEN MATCH ***: <7 / <INTEGER> / "45"> at lexical state: 0; returning (tm)
133+
Input file parsed successfully

issues/bas01/files/clc3.exp_err

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Read 1st char for any kind: `97 / 'a'´, @ 1:1 (tm)
1313
Looking to move from state: <,>-2, for token: <10 / <Id>> (tm)
1414
Done with NFA, at pos: 2 (tm)
1515
Put back: 1 looked ahead chars (tm)
16-
Found a TOKEN MATCH ***: <10 / "aa"> at lexical state: 0; returning (tm)
16+
Found a TOKEN MATCH ***: <10 / <Id> / "aa"> at lexical state: 0; returning (tm)
1717
Read 1st char for any kind: `32 / ' '´, @ 1:3 (tm)
1818
<DEFAULT>-0 Current input char: `32 / ' '´, @ 1:3 (tm)
1919
Looking for string literal match of token: <1 / " "> (tm)
@@ -99,7 +99,7 @@ Read 1st char for any kind: `98 / 'b'´, @ 1:14 (tm)
9999
Looking to move from state: <,>-2, for token: <10 / <Id>> (tm)
100100
Done with NFA, at pos: 2 (tm)
101101
Put back: 1 looked ahead chars (tm)
102-
Found a TOKEN MATCH ***: <10 / "bb"> at lexical state: 0; returning (tm)
102+
Found a TOKEN MATCH ***: <10 / <Id> / "bb"> at lexical state: 0; returning (tm)
103103
Read 1st char for any kind: `13 / '\r'´, @ 1:16 (tm)
104104
<DEFAULT>-0 Current input char: `13 / '\r'´, @ 1:16 (tm)
105105
Looking for string literal match of token: <4 / "\r"> (tm)
@@ -166,5 +166,14 @@ Read 1st char for any kind: `44 / ','´, @ 3:1 (tm)
166166
Looking to move from state: <LineComment>-1, for token: <10 / <Id>> (tm)
167167
Done with NFA, at pos: 0 (tm)
168168
Matched empty string as kind: 2147483647 (tm)
169-
Error parsing input file
170-
Lexical error at line 3, column 1. Encountered: "," (44) after: ""
169+
Read 1st char for any kind: `44 / ','´, @ 3:2 (tm)
170+
<DEFAULT>-0 Current input char: `44 / ','´, @ 3:2 (tm)
171+
No string literal start with char: `44 / ','´ (tm)
172+
Starting NFA with start state: <LineComment>-1 (tm)
173+
Cur char: `44 / ','´ (tm)
174+
Looking to move from state: <DEFAULT>-0, for token: <7 / <INTEGER>> (tm)
175+
Looking to move from state: <LineComment>-1, for token: <10 / <Id>> (tm)
176+
Done with NFA, at pos: 0 (tm)
177+
Matched empty string as kind: 2147483647 (tm)
178+
<DEFAULT>-0 Reached EOF (1st), @ 3:2 (tm)
179+
Input file parsed successfully

issues/bas01/files/clc3.exp_out

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
aa
22
bb
3+
Lexical error at line 3, column 1. Encountered: ',' ..after: "".
4+
Lexical error at line 3, column 3. Encountered: ',' ..after: "".

issues/bas01/files/clc4.exp_err

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1-
<DEFAULT>-0 Reached EOF (1st), @ 1:0 (tm)
1+
Read 1st char for any kind: `0 / '\u0000'´, @ 1:1 (tm)
2+
<DEFAULT>-0 Current input char: `0 / '\u0000'´, @ 1:1 (tm)
3+
No string literal start with char: `0 / '\u0000'´ (tm)
4+
Starting NFA with start state: <LineComment>-1 (tm)
5+
Cur char: `0 / '\u0000'´ (tm)
6+
Looking to move from state: <DEFAULT>-0, for token: <7 / <INTEGER>> (tm)
7+
Looking to move from state: <LineComment>-1, for token: <10 / <Id>> (tm)
8+
Done with NFA, at pos: 0 (tm)
9+
Matched empty string as kind: 2147483647 (tm)
10+
<DEFAULT>-0 Reached EOF (1st), @ 1:1 (tm)
211
Input file parsed successfully

issues/bas01/files/clc4.exp_out

67 Bytes
Binary file not shown.

src/main/resources/templates/cpp/TokenManagerDriver.cc.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ Token * ${parserName}TokenManager::getNextToken() {
231231
#if DEBUG_TOKEN_MANAGER
232232
if (trace_enabled()) {
233233
JJERR << JJWIDE(Found a TOKEN MATCH ***: <) << jjmatchedKind
234+
<< JJSPACE << JJWIDE(/) << JJSPACE
235+
<< tokenImage[jjmatchedKind]
234236
<< JJSPACE << JJWIDE(/) << JJSPACE
235237
<< JJDBQUOTE << addUnicodeEscapes(matchedToken->image()) << JJDBQUOTE
236238
<< JJWIDE(> at lexical state:) << JJSPACE << curLexState

0 commit comments

Comments
 (0)