1 /* do not edit automatically generated by mc from mcComment. */
2 /* mcComment.def provides a module to remember the comments.
4 Copyright (C) 2015-2025 Free Software Foundation, Inc.
5 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
7 This file is part of GNU Modula-2.
9 GNU Modula-2 is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 GNU Modula-2 is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GNU Modula-2; see the file COPYING3. If not see
21 <http://www.gnu.org/licenses/>. */
24 #if !defined (_mcComment_H)
33 # if !defined (PROC_D)
35 typedef void (*PROC_t
) (void);
36 typedef struct { PROC_t proc
; } PROC
;
40 # include "GDynamicStrings.h"
41 # include "GnameKey.h"
43 # if defined (_mcComment_C)
46 # define EXTERN extern
49 #if !defined (mcComment_commentDesc_D)
50 # define mcComment_commentDesc_D
51 typedef void *mcComment_commentDesc
;
56 initComment - the start of a new comment has been seen by the lexical analyser.
57 A new comment block is created and all addText contents are placed
58 in this block. onlySpaces indicates whether we have only seen
59 spaces on this line. The new comment descriptor is returned.
60 If onlySpaces is TRUE then an inbody comment is created.
61 If onlySpaces is FALSE then an after statement comment is created.
64 EXTERN mcComment_commentDesc
mcComment_initComment (bool onlySpaces
);
67 addText - cs is a C string (null terminated) which contains comment text.
70 EXTERN
void mcComment_addText (mcComment_commentDesc cd
, void * cs
);
73 getContent - returns the content of comment, cd.
76 EXTERN DynamicStrings_String
mcComment_getContent (mcComment_commentDesc cd
);
79 getCommentCharStar - returns the contents of the comment, cd.
82 EXTERN
void * mcComment_getCommentCharStar (mcComment_commentDesc cd
);
85 setProcedureComment - changes the type of comment, cd, to a
86 procedure heading comment,
87 providing it has the procname as the first word.
90 EXTERN
void mcComment_setProcedureComment (mcComment_commentDesc cd
, nameKey_Name procname
);
93 getProcedureComment - returns the procedure comment if available.
96 EXTERN DynamicStrings_String
mcComment_getProcedureComment (mcComment_commentDesc cd
);
99 getAfterStatementComment - returns the after comment if available.
102 EXTERN DynamicStrings_String
mcComment_getAfterStatementComment (mcComment_commentDesc cd
);
105 getInbodyStatementComment - returns the statement comment if available.
108 EXTERN DynamicStrings_String
mcComment_getInbodyStatementComment (mcComment_commentDesc cd
);
111 isProcedureComment - returns TRUE if, cd, is a procedure comment.
114 EXTERN
bool mcComment_isProcedureComment (mcComment_commentDesc cd
);
117 isBodyComment - returns TRUE if, cd, is a body comment.
120 EXTERN
bool mcComment_isBodyComment (mcComment_commentDesc cd
);
123 isAfterComment - returns TRUE if, cd, is an after comment.
126 EXTERN
bool mcComment_isAfterComment (mcComment_commentDesc cd
);