Open sergiosa61 opened 8 months ago
I haven't checked the result (maybe it doesn't even build) - but can you please recheck after applying #176 ?
Hi, I applied the changes to libgixpp/gix_esql_parser.yy 117 %token LOCALSTORAGEEND "End of LOCAL-STORAGE SECTION" 118 %token FD "FILE description (FD)" 119 %token SD "SORT description (SD)" 830 ; 831 832 file_def: 833 FD token_list PERIOD {} 834 |SD token_list PERIOD {} 835 ; 836 837 838 sqlvariantstate_list: 839 %empty 840 |sqlvariantstate_list file_def 841 |sqlvariantstate_list incfile 842 |sqlvariantstate_list includesql I ran the commands make clean ./configure --prefix=/opt/install --enable-pgsql --disable-mysql --disable-odbc --disable-oracle make sudo make install But the error persists 16:16:33 /dati/HDS/home/parsbt/SC3/WORK/MU057R.PCO(99): error: syntax error, unexpected WORD
Il 20/03/24 13:57, Simon Sobisch ha scritto:
I haven't checked the result (maybe it doesn't even build) - but can you please recheck after applying #176 https://github.com/mridoni/gixsql/pull/176 ?
Adjusting the code, then make && sudo make install
is enough. Nice to see that it compiles. But I've forgot to adjust the scanner (which creates the token for the parser).
It just occurred to me that the parser does not need to differ between FD and SD, so you can revert the change, then only adjust the scanner as follows:
--- a/libgixpp/gix_esql_scanner.ll
+++ b/libgixpp/gix_esql_scanner.ll
@@ -1245,7 +1245,7 @@ SUBSYSTEM "SQL"|"CICS"|"DLI"
return yy::gix_esql_parser::make_WORKINGEND(loc);
}
- "FD" {
+ ("FD"|"SD") {
if (driver->data_division_section == DD_SECTION_FS) {
__yy_push_state(FD_STATE);
}
Hi, i revert the change to libgixpp/gix_esql_parser.yy. I applied the new changes to libgixpp/gix_esql_scanner.ll
1206 "SCREEN"[ ]+"SECTION"[ ]*"." {
1207 driver->startlineno = yylineno - 1;
1208 driver->endlineno = yylineno - 1;
1209 driver->host_reference_list->clear();
1210 driver->res_host_reference_list->clear();
1211
1212 driver->commandname = "WORKING_END";
1213 driver->cursorname = "";
1214 driver->sqlname = "";
1215 driver->incfilename = "";
1216 driver->data_division_section = DD_SECTION_INITIAL;
1217
1218 driver->hostreferenceCount = 0;
1219 driver->command_putother = 0;
1220 driver->sql_list->clear();
1221
1222 __yy_pop_state();
1223 return yy::gix_esql_parser::make_WORKINGEND(loc);
1224 }
1225 ("FD"|"SD") {
1226 if (driver->data_division_section == DD_SECTION_FS) {
1227 __yy_push_state(FD_STATE);
1228 }
1229 return yy::gix_esql_parser::make_FD(loc);
1230 }
1231
1232 "PIC" |
1233 "PICTURE" {
1234 __yy_push_state(PICTURE_STATE);
1235 }
gixpp still throws error
00086 : 000086 DATA DIVISION.
00087 : 000087 FILE SECTION.
00088 : 000088 FD F-XSET
00089 : 000089 LABEL RECORD STANDARD.
00090 : 000090 01 A-XSET.
00091 : 000091 03 RECXSET PIC X(80).
00092 : 000092 03 FILLER REDEFINES RECXSET.
00093 : 000093 05 XSET-TIP PIC X(04).
00094 : 000094 05 XSET-NOMEINT PIC X(10).
00095 : 000095 05 XSET-NOMEEXT PIC X(66).
00096 : 000096 05 FILLER REDEFINES XSET-NOMEEXT.
00097 : 000097 07 FILLER PIC X(59).
00098 : 000098 07 XSET-MAXREL PIC X(07).
00099 : 000099 SD F-FSORT
/dati/HDS/home/parsbt/SC3/WORK/MU057R.PCO(99): error: syntax error, unexpected WORD
I added the --parser-scanner-debug parameter
00099 : 000099 SD F-FSORT --accepting rule at line 1396(" ") --accepting rule at line 1388("SD") Next token is token WORD (1.1-2546: SD) Error: popping nterm sqlvariantstate_list (1.2204-2542: ) Stack now 0 1 6 44 Error: popping nterm $@3 (1.2204: ) Stack now 0 1 6 Error: popping token Begin of FILE SECTION (1.1-2203: ) Stack now 0 1 Error: popping nterm sqlstate_list (MU057R.PCO:1.1: ) Stack now 0 Cleanup: discarding lookahead token WORD (1.1-2546: SD) Stack now 0 /dati/HDS/home/parsbt/SC3/WORK/MU057R.PCO(99): error: syntax error, unexpected WORD
In trying to process a cobol program for our Oracle migration project, I get the following error.
--accepting rule at line 1388("SD") Next token is token WORD (1.1-2546: SD) Error: popping nterm sqlvariantstate_list (1.2204-2542: ) Stack now 0 1 6 44 Error: popping nterm $@3 (1.2204: ) Stack now 0 1 6 Error: popping token Begin of FILE SECTION (1.1-2203: ) Stack now 0 1 Error: popping nterm sqlstate_list (MU057R.PCO:1.1: ) Stack now 0 Cleanup: discarding lookahead token WORD (1.1-2546: SD) Stack now 0 /dati/HDS/home/parsbt/SC3/WORK/MU057R.PCO(99): error: syntax error, unexpected WORD
These are the Cobol lines that generate the error.
This is the syntax from the GnuCobol manual
The gixpp version
The cobc version