Adds preliminary support for new SPARK attribute `At`
GCC's Ada compiler now includes basic parsing and legality checks for the new SPARK attribute `At`, laying groundwork for formal verification.
The Ada front end of GCC has been updated to recognize and perform basic legality checks for the new SPARK attribute At. While full expansion and backend support for GNATprove are not yet implemented, this change enables the attribute to be parsed correctly and ensures its basic usage conforms to SPARK rules. This allows for initial integration with SPARK’s formal verification tools.
In Details
SPARK is a subset of Ada designed for high-integrity systems, often used with formal verification tools like GNATprove. Attributes in Ada provide additional information about program entities. This commit introduces preliminary compiler support for a new SPARK attribute, At. The changes primarily involve extending the parser (par-ch4.adb) to differentiate 'At from the keyword at, and updating semantic analysis (sem_attr.adb) to perform basic legality checks. Expansion (exp_attr.adb) and evaluation (sem_attr.adb) are explicitly disabled for now, indicating that this is a front-en…
For Context
Think of a compiler as a multi-stage process that turns your code into an executable program. The 'front end' is the first stage, responsible for understanding your code's structure and meaning. SPARK is a special, very strict way of writing Ada code that makes it easier to mathematically prove that your program behaves correctly. This update to the GCC Ada compiler adds support for a new feature in SPARK called the At attribute. Right now, the compiler can only recognize this new attribute and do some basic checks to make sure it's used correctly. It doesn't yet fully process this attribute to affect how the final program works, but it's an important step for tools that formally verify SPARK programs, allowing them to start using this new feature.