我正在使用ASIS(Ada Semantics接口规范)实现一个简单的工具。我在列出给定Elements中的子元素时遇到问题。例如,我将赋值语句作为 …
A + B 是函数调用,因此您必须使用以下方法提取函数调用的实际参数:
A + B
declare use ASIS.Expressions; begin for Parameter_Association of Function_Call_Parameters (Expression => Element, Normalized => True) loop declare Formal : constant Asis.Element := Formal_Parameter (Parameter_Association); Actual : constant Asis.Element := Actual_Parameter (Parameter_Association); begin ... end; end loop; end;