ACATS is for complete Ada compilers. Is there a test suite for Ada syntax only?
Presumably one could just use ACATS for that and not actually compile the programs. You could also use one of the formal grammars that exists to fuzz syntactically valid programs, but then you run into issues if your parser does a little bit of static semantics validation.
What’s the purpose?
Depends on the use case, I guess you could go the long way with treesitter.
To validate a parser.
I do not see how implementing another parser can help validating the given one. Even less I trust in generator tools. They just add another source of errors and make diagnostic hard as you need two grammars one for strict conformity and another for malformed programs, like when an identifier is recognized yet invalid etc.
Ada 2022 syntax still allows plain recursive descent parsing.
There is a lot of of valid Ada code available, such as the PragmAda Reusable Components or Kazakov’s Simple Components, but I guess you’re looking for “typical” invalid Ada code to test against.
Yes, both “must pass” and “must fail” cases with most possible coverage. Ada 2022 is very large.
Almost any text file will fall in the “must fail” category. What you want are syntax errors frequently submitted to compilers: missing semicolons, colons, binary operators; missing compound-statement terminators; and omitting the reserved word loop from a loop termination come to mind. Perhaps reviewing the error messages in the GNAT source would be helpful.
Correct. Parsers are designed to relaxed and
I want it automated to be able to run tests many times.
My point is that code with syntax errors is hard to find, since they are usually corrected before the code is released, so you will have to build your own. GNAT’s syntax-related error messages might serve as a guide to what errors to include.