TNO / Renaissance-Ada

Tooling for analysis and manipulation of Ada software
BSD 3-Clause "New" or "Revised" License
28 stars 2 forks source link

Enhanced functionality: advanced nesting of rewriters #9

Open pjljvandelaar opened 2 years ago

pjljvandelaar commented 2 years ago

Our current rewrite lib has some limitations.

For example, currently we don't support the following rewrite

use element instead of index when index is only used to access elements

To be more precise: Replace for $S_I in $S_A'Range loop $M_Stmts; end loop; when $M_Stmts; only uses $S_I in $S_A ($S_I) by for Element of $S_A loop <$M_Stmts;> end loop; where <$M_Stmts;> is obtained by replacing $S_A ($S_I) by Element in $M_Stmts;

Can we come up with an interface that is clear for our users and enables them to perform these kind of nested rewrites?