Skip to content

Commit 8e69b14

Browse files
mmazasmmazas
authored andcommitted
Fixes, structure, readme.
Signed-off-by: mmazas <mmazas@ITEM-S104678.emea.msad.sopra>
1 parent aa1986c commit 8e69b14

File tree

197 files changed

+6833
-3874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+6833
-3874
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# This workflow will build a Java project with Maven
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
33
#
4-
# Copyright (c) 2020-2024, Sreeni Viswanadha <sreeni@viswanadha.net>.
5-
# Copyright (c) 2024, Marc Mazas <mazas.marc@gmail.com>.
4+
# Copyright (c) 2020-2025, Sreeni Viswanadha <sreeni@viswanadha.net>.
5+
# Copyright (c) 2024-2025, Marc Mazas <mazas.marc@gmail.com>.
66
# All rights reserved.
77
#
88
# Redistribution and use in source and binary forms, with or without

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
BSD 3-Clause License
22

33
Copyright (c) 2020-2021, javacc
4-
Copyright (c) 2020-2024, Sreeni Viswanadha <sreeni@viswanadha.net>.
5-
Copyright (c) 2024, Marc Mazas <mazas.marc@gmail.com>.
4+
Copyright (c) 2020-2025, Sreeni Viswanadha <sreeni@viswanadha.net>.
5+
Copyright (c) 2024-2025, Marc Mazas <mazas.marc@gmail.com>.
66
All rights reserved.
77

88
Redistribution and use in source and binary forms, with or without

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# JavaCC-8 C++ (CPP)
2+
3+
This is the JavaCC **C++** generator Git repository / java & maven project of JavaCC version 8.
4+
5+
See the README at [javacc-8](https://github.com/javacc/javacc-8)

bugs/bug001/files/clc1.exp_err

Lines changed: 354 additions & 523 deletions
Large diffs are not rendered by default.

bugs/bug001/files/clc2.exp_err

Lines changed: 89 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,106 @@
1-
<DEFAULT>
2-
Current character: 'a' at 1:1
1+
<DEFAULT> Current input char: 'a' at 1:1
32
No string literal start with char: 'a'
43
Starting NFA with start state: 0
5-
Current character: 'a'
6-
Looking to move from state: 0 for: <Id>
7-
state=0 vectorindex=1 bitpattern=8589934592 jjChars[state][vectorIndex]=576460743847706622
8-
Found a match of kind:9; kind: <Id> using the first: 0 characters.
9-
Current character: 'a'
10-
Looking to move from state: 1 for: <Id>
11-
state=1 vectorindex=1 bitpattern=8589934592 jjChars[state][vectorIndex]=576460743847706622
12-
Found a match of kind:9; kind: <Id> using the first: 1 characters.
13-
Current character: ' '
14-
Looking to move from state: 1 for: <Id>
15-
state=1 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=287984085547089920
4+
Cur char: 'a'
5+
Looking to move from state: 0 <Id>
6+
Found a match of kind: 9 [<Id>] using the first: 0 characters
7+
Cur char: 'a'
8+
Looking to move from state: 1 <Id>
9+
Found a match of kind: 9 [<Id>] using the first: 1 characters
10+
Cur char: ' '
11+
Looking to move from state: 1 <Id>
1612
Done with NFA at pos: 2
17-
Returning token: 'aa'
18-
<DEFAULT>
19-
Current character: ' ' at 1:3
20-
Looking for string literal match of kind:1 token image: ' '
21-
Current character: ' '
22-
Currently matched the first: 1 chars as kind: 1,with image:
13+
Returning token: 'aa'
14+
<DEFAULT> Current input char: ' ' at 1:3
15+
Looking for string literal match of kind: 1 " "
16+
Cur char: ' '
17+
Currently matched the first: 1 chars as kind: 1 " "
2318
No NFA state at pos: 2
24-
Found a SKIP match.
25-
<DEFAULT>
26-
Current character: '-' at 1:4
27-
Looking for string literal match of kind:7 token image: '--'
28-
Current character: '-'
29-
Current character: '-'
30-
Currently matched the first: 2 chars as kind: 7,with image: --
19+
Found a SKIP match
20+
<DEFAULT> Current input char: '-' at 1:4
21+
Looking for string literal match of kind: 7 "--"
22+
Cur char: '-'
23+
Cur char: '-'
24+
Currently matched the first: 2 chars as kind: 7 "--"
3125
No NFA state at pos: 3
32-
Found a SKIP match.
33-
<LineComment>
34-
Current character: ' ' at 1:6
26+
Found a SKIP match
27+
<LineComment> Current input char: ' ' at 1:6
3528
No string literal start with char: ' '
3629
Starting NFA with start state: 9
37-
Current character: ' '
38-
Looking to move from state: 6 for: <UNKNOWN>
39-
state=6 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=35184372088832
40-
Looking to move from state: 5 for: <token of kind 8>
41-
state=5 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=9216
42-
Looking to move from state: 4 for: <UNKNOWN>
43-
state=4 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=8192
44-
Looking to move from state: 2 for: <token of kind 8>
45-
state=2 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=18446708889337453567
46-
Found a match of kind:8; kind: <token of kind 8> using the first: 0 characters.
47-
Looking to move from state: 9 for: <UNKNOWN>
48-
state=9 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=0
49-
Current character: 'o'
50-
Looking to move from state: 6 for: <UNKNOWN>
51-
state=6 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=0
52-
Looking to move from state: 5 for: <token of kind 8>
53-
state=5 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=0
54-
Looking to move from state: 4 for: <UNKNOWN>
55-
state=4 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=0
56-
Looking to move from state: 2 for: <token of kind 8>
57-
state=2 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=18446744073709551615
58-
Found a match of kind:8; kind: <token of kind 8> using the first: 1 characters.
59-
Current character: '-'
60-
Looking to move from state: 6 for: <UNKNOWN>
61-
state=6 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=35184372088832
62-
Looking to move from state: 5 for: <token of kind 8>
63-
state=5 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=9216
64-
Looking to move from state: 4 for: <UNKNOWN>
65-
state=4 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=8192
66-
Looking to move from state: 2 for: <token of kind 8>
67-
state=2 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=18446708889337453567
68-
Current character: 'i'
69-
Looking to move from state: 8 for: <token of kind 8>
70-
state=8 vectorindex=1 bitpattern=2199023255552 jjChars[state][vectorIndex]=0
71-
Looking to move from state: 7 for: <UNKNOWN>
72-
state=7 vectorindex=1 bitpattern=2199023255552 jjChars[state][vectorIndex]=0
73-
Looking to move from state: 5 for: <token of kind 8>
74-
state=5 vectorindex=1 bitpattern=2199023255552 jjChars[state][vectorIndex]=0
75-
Looking to move from state: 2 for: <token of kind 8>
76-
state=2 vectorindex=1 bitpattern=2199023255552 jjChars[state][vectorIndex]=18446744073709551615
77-
Found a match of kind:8; kind: <token of kind 8> using the first: 3 characters.
78-
Current character: ' '
79-
Looking to move from state: 6 for: <UNKNOWN>
80-
state=6 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=35184372088832
81-
Looking to move from state: 5 for: <token of kind 8>
82-
state=5 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=9216
83-
Looking to move from state: 4 for: <UNKNOWN>
84-
state=4 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=8192
85-
Looking to move from state: 2 for: <token of kind 8>
86-
state=2 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=18446708889337453567
87-
Found a match of kind:8; kind: <token of kind 8> using the first: 4 characters.
88-
Current character: '-'
89-
Looking to move from state: 6 for: <UNKNOWN>
90-
state=6 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=35184372088832
91-
Looking to move from state: 5 for: <token of kind 8>
92-
state=5 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=9216
93-
Looking to move from state: 4 for: <UNKNOWN>
94-
state=4 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=8192
95-
Looking to move from state: 2 for: <token of kind 8>
96-
state=2 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=18446708889337453567
97-
Current character: '-'
98-
Looking to move from state: 8 for: <token of kind 8>
99-
state=8 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=35184372088832
100-
Found a match of kind:8; kind: <token of kind 8> using the first: 6 characters.
101-
Looking to move from state: 7 for: <UNKNOWN>
102-
state=7 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=8192
103-
Looking to move from state: 5 for: <token of kind 8>
104-
state=5 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=9216
105-
Looking to move from state: 2 for: <token of kind 8>
106-
state=2 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=18446708889337453567
30+
Cur char: ' '
31+
Looking to move from state: 6 <UNKNOWN>
32+
Looking to move from state: 5 <token of kind 8>
33+
Looking to move from state: 4 <UNKNOWN>
34+
Looking to move from state: 2 <token of kind 8>
35+
Found a match of kind: 8 [<token of kind 8>] using the first: 0 characters
36+
Looking to move from state: 9 <UNKNOWN>
37+
Cur char: 'o'
38+
Looking to move from state: 6 <UNKNOWN>
39+
Looking to move from state: 5 <token of kind 8>
40+
Looking to move from state: 4 <UNKNOWN>
41+
Looking to move from state: 2 <token of kind 8>
42+
Found a match of kind: 8 [<token of kind 8>] using the first: 1 characters
43+
Cur char: '-'
44+
Looking to move from state: 6 <UNKNOWN>
45+
Looking to move from state: 5 <token of kind 8>
46+
Looking to move from state: 4 <UNKNOWN>
47+
Looking to move from state: 2 <token of kind 8>
48+
Cur char: 'i'
49+
Looking to move from state: 8 <token of kind 8>
50+
Looking to move from state: 7 <UNKNOWN>
51+
Looking to move from state: 5 <token of kind 8>
52+
Looking to move from state: 2 <token of kind 8>
53+
Found a match of kind: 8 [<token of kind 8>] using the first: 3 characters
54+
Cur char: ' '
55+
Looking to move from state: 6 <UNKNOWN>
56+
Looking to move from state: 5 <token of kind 8>
57+
Looking to move from state: 4 <UNKNOWN>
58+
Looking to move from state: 2 <token of kind 8>
59+
Found a match of kind: 8 [<token of kind 8>] using the first: 4 characters
60+
Cur char: '-'
61+
Looking to move from state: 6 <UNKNOWN>
62+
Looking to move from state: 5 <token of kind 8>
63+
Looking to move from state: 4 <UNKNOWN>
64+
Looking to move from state: 2 <token of kind 8>
65+
Cur char: '-'
66+
Looking to move from state: 8 <token of kind 8>
67+
Found a match of kind: 8 [<token of kind 8>] using the first: 6 characters
68+
Looking to move from state: 7 <UNKNOWN>
69+
Looking to move from state: 5 <token of kind 8>
70+
Looking to move from state: 2 <token of kind 8>
10771
Done with NFA at pos: 6
108-
Found a SKIP match.
109-
<DEFAULT>
110-
Current character: ' ' at 1:13
111-
Looking for string literal match of kind:1 token image: ' '
112-
Current character: ' '
113-
Currently matched the first: 1 chars as kind: 1,with image:
72+
Found a SKIP match
73+
<DEFAULT> Current input char: ' ' at 1:13
74+
Looking for string literal match of kind: 1 " "
75+
Cur char: ' '
76+
Currently matched the first: 1 chars as kind: 1 " "
11477
No NFA state at pos: 2
115-
Found a SKIP match.
116-
<DEFAULT>
117-
Current character: 'b' at 1:14
78+
Found a SKIP match
79+
<DEFAULT> Current input char: 'b' at 1:14
11880
No string literal start with char: 'b'
11981
Starting NFA with start state: 0
120-
Current character: 'b'
121-
Looking to move from state: 0 for: <Id>
122-
state=0 vectorindex=1 bitpattern=17179869184 jjChars[state][vectorIndex]=576460743847706622
123-
Found a match of kind:9; kind: <Id> using the first: 0 characters.
124-
Current character: 'b'
125-
Looking to move from state: 1 for: <Id>
126-
state=1 vectorindex=1 bitpattern=17179869184 jjChars[state][vectorIndex]=576460743847706622
127-
Found a match of kind:9; kind: <Id> using the first: 1 characters.
128-
Current character: ''
129-
Looking to move from state: 1 for: <Id>
130-
state=1 vectorindex=0 bitpattern=8192 jjChars[state][vectorIndex]=287984085547089920
82+
Cur char: 'b'
83+
Looking to move from state: 0 <Id>
84+
Found a match of kind: 9 [<Id>] using the first: 0 characters
85+
Cur char: 'b'
86+
Looking to move from state: 1 <Id>
87+
Found a match of kind: 9 [<Id>] using the first: 1 characters
88+
Cur char: ''
89+
Looking to move from state: 1 <Id>
13190
Done with NFA at pos: 2
132-
Returning token: 'bb'
133-
<DEFAULT>
134-
Current character: '' at 1:16
135-
Looking for string literal match of kind:4 token image: '\r'
136-
Current character: ''
137-
Currently matched the first: 1 chars as kind: 4,with image: \r
91+
Returning token: 'bb'
92+
<DEFAULT> Current input char: '' at 1:16
93+
Looking for string literal match of kind: 4 "\r"
94+
Cur char: ''
95+
Currently matched the first: 1 chars as kind: 4 "\r"
13896
No NFA state at pos: 2
139-
Found a SKIP match.
140-
<DEFAULT>
141-
Current character: '
97+
Found a SKIP match
98+
<DEFAULT> Current input char: '
14299
' at 1:17
143-
Looking for string literal match of kind:3 token image: '\n'
144-
Current character: '
100+
Looking for string literal match of kind: 3 "\n"
101+
Cur char: '
145102
'
146-
Currently matched the first: 1 chars as kind: 3,with image: \n
147-
Found a SKIP match.
103+
Currently matched the first: 1 chars as kind: 3 "\n"
104+
Found a SKIP match
148105
<DEFAULT> Reached EOF at 1:17
149106
Input file parsed successfully

bugs/bug001/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright (c) 2020-2024, Sreeni Viswanadha <sreeni@viswanadha.net>.
4-
Copyright (c) 2024, Marc Mazas <mazas.marc@gmail.com>.
3+
Copyright (c) 2020-2025, Sreeni Viswanadha <sreeni@viswanadha.net>.
4+
Copyright (c) 2024-2025, Marc Mazas <mazas.marc@gmail.com>.
55
All rights reserved.
66
77
Redistribution and use in source and binary forms, with or without

bugs/bug001/src/main/javacc/ComplexLineComment.jj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
options {
22
DEBUG_TOKEN_MANAGER=true;
3+
JAVA_UNICODE_ESCAPE = true; // (JavaCC - default false)
4+
// KEEP_LINE_COLUMN = false; // (JavaCC - default true; undocumented) // test
35
}
46

57
PARSER_BEGIN(ComplexLineComment)

bugs/bug002/files/bug.exp_err

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,40 @@
1-
<DEFAULT>
2-
Current character: '{' at 1:1
3-
Looking for string literal match of kind:7 token image: '{'
4-
Current character: '{'
5-
Currently matched the first: 1 chars as kind: 7,with image: {
1+
<DEFAULT> Current input char: '{' at 1:1
2+
Looking for string literal match of kind: 7 "{"
3+
Cur char: '{'
4+
Currently matched the first: 1 chars as kind: 7 "{"
65
No NFA state at pos: 2
7-
Returning token: '{'
8-
<DEFAULT>
9-
Current character: ' ' at 1:2
10-
Looking for string literal match of kind:1 token image: ' '
11-
Current character: ' '
12-
Currently matched the first: 1 chars as kind: 1,with image:
6+
Returning token: '{'
7+
<DEFAULT> Current input char: ' ' at 1:2
8+
Looking for string literal match of kind: 1 " "
9+
Cur char: ' '
10+
Currently matched the first: 1 chars as kind: 1 " "
1311
No NFA state at pos: 2
14-
Found a SKIP match.
15-
<DEFAULT>
16-
Current character: 'c' at 1:3
12+
Found a SKIP match
13+
<DEFAULT> Current input char: 'c' at 1:3
1714
No string literal start with char: 'c'
1815
Starting NFA with start state: 0
19-
Current character: 'c'
20-
Looking to move from state: 3 for: <IDENTIFIANT>
21-
state=3 vectorindex=1 bitpattern=34359738368 jjChars[state][vectorIndex]=576460743713488896
22-
Found a match of kind:17; kind: <IDENTIFIANT> using the first: 0 characters.
23-
Looking to move from state: 1 for: <NUMBER>
24-
state=1 vectorindex=1 bitpattern=34359738368 jjChars[state][vectorIndex]=0
25-
Looking to move from state: 0 for: <NUMBER>
26-
state=0 vectorindex=1 bitpattern=34359738368 jjChars[state][vectorIndex]=0
27-
Current character: ' '
28-
Looking to move from state: 7 for: <VALUEREFERENCE>
29-
state=7 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=287948901175001088
30-
Looking to move from state: 6 for: <UNKNOWN>
31-
state=6 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=35184372088832
32-
Looking to move from state: 5 for: <IDENTIFIANT>
33-
state=5 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=287948901175001088
34-
Looking to move from state: 4 for: <UNKNOWN>
35-
state=4 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=35184372088832
16+
Cur char: 'c'
17+
Looking to move from state: 3 <IDENTIFIANT>
18+
Found a match of kind: 17 [<IDENTIFIANT>] using the first: 0 characters
19+
Looking to move from state: 1 <NUMBER>
20+
Looking to move from state: 0 <NUMBER>
21+
Cur char: ' '
22+
Looking to move from state: 7 <VALUEREFERENCE>
23+
Looking to move from state: 6 <UNKNOWN>
24+
Looking to move from state: 5 <IDENTIFIANT>
25+
Looking to move from state: 4 <UNKNOWN>
3626
Done with NFA at pos: 1
37-
Returning token: 'c'
38-
<DEFAULT>
39-
Current character: ' ' at 1:4
40-
Looking for string literal match of kind:1 token image: ' '
41-
Current character: ' '
42-
Currently matched the first: 1 chars as kind: 1,with image:
27+
Returning token: 'c'
28+
<DEFAULT> Current input char: ' ' at 1:4
29+
Looking for string literal match of kind: 1 " "
30+
Cur char: ' '
31+
Currently matched the first: 1 chars as kind: 1 " "
4332
No NFA state at pos: 2
44-
Found a SKIP match.
45-
<DEFAULT>
46-
Current character: '}' at 1:5
47-
Looking for string literal match of kind:8 token image: '}'
48-
Current character: '}'
49-
Currently matched the first: 1 chars as kind: 8,with image: }
33+
Found a SKIP match
34+
<DEFAULT> Current input char: '}' at 1:5
35+
Looking for string literal match of kind: 8 "}"
36+
Cur char: '}'
37+
Currently matched the first: 1 chars as kind: 8 "}"
5038
No NFA state at pos: 2
51-
Returning token: '}'
39+
Returning token: '}'
5240
Input file parsed successfully

bugs/bug002/files/bug.exp_out

19 Bytes
Binary file not shown.

bugs/bug002/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright (c) 2020-2024, Sreeni Viswanadha <sreeni@viswanadha.net>.
4-
Copyright (c) 2024, Marc Mazas <mazas.marc@gmail.com>.
3+
Copyright (c) 2020-2025, Sreeni Viswanadha <sreeni@viswanadha.net>.
4+
Copyright (c) 2024-2025, Marc Mazas <mazas.marc@gmail.com>.
55
All rights reserved.
66
77
Redistribution and use in source and binary forms, with or without

0 commit comments

Comments
 (0)