uwol / proleap-cobol-parser

ProLeap ANTLR4-based parser for COBOL
MIT License
136 stars 74 forks source link

function when-compiled not yet recognized #17

Closed Reinhard-Prehofer closed 7 years ago

Reinhard-Prehofer commented 7 years ago

Obviously the intrinsic function when-compiled is not yet implemented:

Statements like the following

000300             MOVE 'Compile-Datum: '      TO P190-TEXT (30:15)     15.04.98
000200             MOVE FUNCTION WHEN-COMPILED (7:2)                    22.09.97
000450                                         TO P190-TEXT (45:02)     15.04.98
000440             MOVE '.'                    TO P190-TEXT (47:01)     15.04.98
000200             MOVE FUNCTION WHEN-COMPILED (5:2)                    22.09.97
000300                                         TO P190-TEXT (48:02)     15.04.98
000440             MOVE '.'                    TO P190-TEXT (50:01)     15.04.98
000200             MOVE FUNCTION WHEN-COMPILED (1:4)                    22.09.97
000300                                         TO P190-TEXT (51:04)     15.04.98

lead to the following errors:

call to unknown data element FUNCTIONWHEN-COMPILED(7:2)
call to unknown data element FUNCTIONWHEN-COMPILED(5:2)
call to unknown data element FUNCTIONWHEN-COMPILED(1:4)
call to unknown data element FUNCTIONWHEN-COMPILED(9:2)
...
Reinhard-Prehofer commented 7 years ago

WHENCOMP1.CBL.txt A .CBL extension ist not allowed ! so I added a .txt suffix

uwol commented 7 years ago

Thanks! Should be fixed in 7b5cb5152eb52585c928162c1b87567fab11b10a.

The concept of function calls had been implemented in the grammar/AST and thus could be parsed, however has been missing in the semantic analyzer/ASG. Therefore I have added the class FunctionCall and extended the corresponding unit tests with the example provided by you.