17 #ifndef __OMNETPP_NEDXML_MSGGENERATOR_H
18 #define __OMNETPP_NEDXML_MSGGENERATOR_H
23 #include "msgelements.h"
48 std::ostream *outp =
nullptr;
64 void setIndentSize(
int indentsize);
70 void generate(std::ostream& out,
ASTNode *node,
const char *indent);
75 std::string generate(
ASTNode *node,
const char *indent);
80 const char *increaseIndent(
const char *indent);
81 const char *decreaseIndent(
const char *indent);
85 void generateItem(
ASTNode *node,
const char *indent,
bool islast,
const char *arg=
nullptr);;
88 void generateChildren(
ASTNode *node,
const char *indent,
const char *arg=
nullptr);
91 void generateChildrenWithType(
ASTNode *node,
int tagcode,
const char *indent,
const char *arg=
nullptr);
94 void generateChildrenWithTypes(
ASTNode *node,
int tagcodes[],
const char *indent,
const char *arg=
nullptr);
96 void doMsgClassOrStructBody(
ASTNode *msgclassorstruct,
const char *indent);
100 std::string concatInnerComments(
ASTNode *node);
101 std::string getBannerComment(
ASTNode *node,
const char *indent);
102 std::string getRightComment(
ASTNode *node);
103 std::string getInlineRightComment(
ASTNode *node);
104 std::string getTrailingComment(
ASTNode *node);
109 void doFiles(FilesElement *node,
const char *indent,
bool islast,
const char *);
110 void doMsgFile(MsgFileElement *node,
const char *indent,
bool islast,
const char *);
111 void doImport(ImportElement *node,
const char *indent,
bool islast,
const char *);
112 void doProperty(PropertyElement *node,
const char *indent,
bool islast,
const char *sep);
113 void doPropertyKey(PropertyKeyElement *node,
const char *indent,
bool islast,
const char *sep);
114 void doLiteral(LiteralElement *node,
const char *indent,
bool islast,
const char *);
115 void doNamespace(NamespaceElement *node,
const char *indent,
bool islast,
const char *);
116 void doCplusplus(CplusplusElement *node,
const char *indent,
bool islast,
const char *);
117 void doStructDecl(StructDeclElement *node,
const char *indent,
bool islast,
const char *);
118 void doClassDecl(ClassDeclElement *node,
const char *indent,
bool islast,
const char *);
119 void doMessageDecl(MessageDeclElement *node,
const char *indent,
bool islast,
const char *);
120 void doPacketDecl(PacketDeclElement *node,
const char *indent,
bool islast,
const char *);
121 void doEnumDecl(EnumDeclElement *node,
const char *indent,
bool islast,
const char *);
122 void doEnum(EnumElement *node,
const char *indent,
bool islast,
const char *);
123 void doEnumField(EnumFieldElement *node,
const char *indent,
bool islast,
const char *);
124 void doMessage(MessageElement *node,
const char *indent,
bool islast,
const char *);
125 void doPacket(PacketElement *node,
const char *indent,
bool islast,
const char *);
126 void doClass(ClassElement *node,
const char *indent,
bool islast,
const char *);
127 void doStruct(StructElement *node,
const char *indent,
bool islast,
const char *);
128 void doField(FieldElement *node,
const char *indent,
bool islast,
const char *);
129 void doComment(CommentElement *node,
const char *indent,
bool islast,
const char *);