Open alvaro-vantis-pt opened 3 years ago
As defined in IBM formal documentation at https://www.ibm.com/support/knowledgecenter/en/SSEPEK_12.0.0/apsg/src/tpc/db2z_sqlstatementscobol.html there are several SQL Statements type that can be used in LINKAGE SECTION. ANTLR4 Parser used at Parse time accepts SQL statements in LINKAGE SECTION but CUP parser used at Semantic Check step doesn't.
We should expect that CUP Parser also accepts SQL Statements in LINKAGE SECTION.
Program with SQL Statements in LINKAGE gives the following error in Semantic Check step:
Synntax error : extraneous input 'EXECSQLDECLARE tablename1 TABLE ( num DECIMAL(45) NOT NULL, str VARCHAR(256) NOT NULL )END-EXEC' expecting {ProgramIdentification, ProgramEnd, ClassIdentification, MethodEnd, ProcedureDivisionHeader, DataDescriptionEntry, DataRedefinesEntry, DataRenamesEntry, DataConditionEntry, FunctionDeclarationEnd}
Compile the following program using "develop" branch and CFG analyzer provider to reproduce the error: