重命名Ada包 [英] Rename an Ada package

查看:85
本文介绍了重命名Ada包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

包的文件名可能不同于实际名称吗?我尝试使用下面的编译指示,但会收到类似编译指示符source_file_name_project参数的标识符不正确的错误。

Is it possible to have a different file name for a package than its actual name? I have tried to use the pragmas below but get errors like "pragma source_file_name_project argument has incorrect identifier"

package Parent_With_Very_Long_Name is end Parent_with_Very_Long_Name;
...
package Parent_With_Very_Long_Name.Child is
    pragma Source_File_Name_Project("parent-child.ads");
end Parent_With_Very_Long_Name.Child;




  • Source_File_Name_Project

  • Source_File_Name

    • Source_File_Name_Project
    • Source_File_Name
    • 推荐答案

      Ada源文本的实际存储从技术上来说是编译器的实现细节。

      The actual storage of Ada source text is technically an implementation detail of the compiler.

      看看您的编译器期望的文件名,我想您正在使用GNAT(GCC-Ada)。 GNAT允许您覆盖项目文件中的默认命名方案:

      Looking at the file names your compiler expects, I would guess that you are using GNAT (GCC-Ada). GNAT allows you to override the default naming scheme in project files:

      project Short_File_Names is
         package Naming is
            for Specification ("Parent_With_Very_Long_Name.Child")
              use "parent-child.ads";
         end Naming;
      end Short_File_Names;
      

      这篇关于重命名Ada包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆