Cobol: Improve data-item validation for implicit PICTURE.
Cobol compiler now supports implicit PICTURE clause for data items and corrects currency symbol validation.
The COBOL compiler now supports implicit PICTURE clauses for data items as defined in ISO 13.16.2. A data item with a VALUE clause but no explicit PICTURE is now initially marked as invalid and then validated if subsequent data items meet specific conditions. This change also corrects currency symbol validation, addressing RT 3681.
In Details
The COBOL front-end's symbol table handling is updated to correctly implement implicit PICTURE clauses. When a data item with a VALUE clause lacks an explicit PICTURE, it's initially marked as invalid. If a subsequent, non-subordinate data item meets the criteria for an implicit PICTURE, the prior item is marked as valid. Currency symbol validation logic in symbol_currency_add is also refined.
- PICTURE clause
- In COBOL, a PICTURE clause describes the format of a data item, specifying its type and size (e.g., numeric, alphabetic, alphanumeric, and the number of characters).
- VALUE clause
- In COBOL, a VALUE clause assigns an initial literal value to a data item when it is defined.
- Implicit PICTURE
- A PICTURE clause that is not explicitly stated by the programmer but is inferred by the compiler based on context, such as the presence of a VALUE clause and the characteristics of adjacent data items.
- RT 3681
- A reference to a specific bug or issue reported in the GCC bug tracking system, in this case related to currency symbol validation in the COBOL front-end.