“缺少私有类型的完整声明..”在艾达
我在 Ada 中使用 ADS 包文件时遇到问题。 我收到错误“缺少私有类型 LETTER 的完整声明”。 我该如何处理?
这是我写的代码:
封装LETTER_SPEC是
类型 LETTER 是私有的;
过程 DATE_OF_LETTER(THE_LETTER:输入输出 LETTER;日期:STRING);
程序RECIPIENT_NAME(THE_LETTER:输入LETTER;名称:STRING);
过程SUBJECT_LINE(THE_LETTER:输入输出LETTER;SUBJECT:STRING);
过程TEXT_OF_LETTER(THE_LETTER:in out LETTER;TEXT:STRING);
过程SENDER_NAME(THE_LETTER:输入输出LETTER;名称:STRING);
过程PUT_LETTER(THE_LETTER:在LETTER中);
私人
类型 PTR_LETTER 是访问 STRING;
LETTER_DATA 类型为
<前><代码>记录 DATE_OF_LETTER:PTR_LETTER; RECIPIENT_NAME:PTR_LETTER; SUBJECT_LINE:PTR_LETTER; TEXT_OF_LETTER:PTR_LETTER; SENDER_NAME:PTR_LETTER; 结束记录;结束LETTER_SPEC;'
提前致谢..
I'm having a problem using a package ADS file in Ada.
I'm getting an error of "Missing full declaration for private type LETTER".
How do I deal with it?
this is the code I wrote:
package LETTER_SPEC is
type LETTER is private;
procedure DATE_OF_LETTER (THE_LETTER: in out LETTER; DATE: STRING);
procedure RECIPIENT_NAME (THE_LETTER: in out LETTER; NAME: STRING);
procedure SUBJECT_LINE (THE_LETTER: in out LETTER; SUBJECT: STRING);
procedure TEXT_OF_LETTER (THE_LETTER: in out LETTER; TEXT: STRING);
procedure SENDER_NAME (THE_LETTER: in out LETTER; NAME: STRING);
procedure PUT_LETTER (THE_LETTER: in LETTER);
private
type PTR_LETTER is access STRING;
type LETTER_DATA is
record DATE_OF_LETTER: PTR_LETTER; RECIPIENT_NAME: PTR_LETTER; SUBJECT_LINE: PTR_LETTER; TEXT_OF_LETTER: PTR_LETTER; SENDER_NAME: PTR_LETTER; end record;
end LETTER_SPEC;'
Thanks in advance..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Ada 抱怨是因为您在私有部分声明了
LETTER_DATA
类型,而不是LETTER
类型。Ada complains because you declare in the private part a
LETTER_DATA
type and not aLETTER
type.