17 #ifndef __OMNETPP_NEDXML_NEDGENERATOR_H 18 #define __OMNETPP_NEDXML_NEDGENERATOR_H 23 #include "nedelements.h" 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 generateNedItem(
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);
98 void printInheritance(
ASTNode *node,
const char *indent);
99 bool hasExpression(
ASTNode *node,
const char *attr);
100 void printExpression(
ASTNode *node,
const char *attr,
const char *indent);
101 void printOptVector(
ASTNode *node,
const char *attr,
const char *indent);
102 void doMsgClassOrStructBody(
ASTNode *msgclassorstruct,
const char *indent);
107 std::string concatInnerComments(
ASTNode *node);
108 std::string getBannerComment(
ASTNode *node,
const char *indent);
109 std::string getRightComment(
ASTNode *node);
110 std::string getInlineRightComment(
ASTNode *node);
111 std::string getTrailingComment(
ASTNode *node);
116 void doFiles(FilesElement *node,
const char *indent,
bool islast,
const char *);
117 void doNedFile(NedFileElement *node,
const char *indent,
bool islast,
const char *);
118 void doPackage(PackageElement *node,
const char *indent,
bool islast,
const char *);
119 void doImport(ImportElement *node,
const char *indent,
bool islast,
const char *);
120 void doPropertyDecl(PropertyDeclElement *node,
const char *indent,
bool islast,
const char *);
121 void doExtends(ExtendsElement *node,
const char *indent,
bool islast,
const char *);
122 void doInterfaceName(InterfaceNameElement *node,
const char *indent,
bool islast,
const char *);
123 void doSimpleModule(SimpleModuleElement *node,
const char *indent,
bool islast,
const char *);
124 void doModuleInterface(ModuleInterfaceElement *node,
const char *indent,
bool islast,
const char *);
125 void doCompoundModule(CompoundModuleElement *node,
const char *indent,
bool islast,
const char *);
126 void doChannelInterface(ChannelInterfaceElement *node,
const char *indent,
bool islast,
const char *);
127 void doChannel(ChannelElement *node,
const char *indent,
bool islast,
const char *);
128 void doParameters(ParametersElement *node,
const char *indent,
bool islast,
const char *);
129 void doParam(ParamElement *node,
const char *indent,
bool islast,
const char *);
130 void doProperty(PropertyElement *node,
const char *indent,
bool islast,
const char *);
131 void doPropertyKey(PropertyKeyElement *node,
const char *indent,
bool islast,
const char *);
132 void doGates(GatesElement *node,
const char *indent,
bool islast,
const char *);
133 void doGate(GateElement *node,
const char *indent,
bool islast,
const char *);
134 void doTypes(TypesElement *node,
const char *indent,
bool islast,
const char *);
135 void doSubmodules(SubmodulesElement *node,
const char *indent,
bool islast,
const char *);
136 void doSubmodule(SubmoduleElement *node,
const char *indent,
bool islast,
const char *);
137 void doConnections(ConnectionsElement *node,
const char *indent,
bool islast,
const char *);
138 void doConnection(ConnectionElement *node,
const char *indent,
bool islast,
const char *);
139 void doConnectionGroup(ConnectionGroupElement *node,
const char *indent,
bool islast,
const char *);
140 void doLoop(LoopElement *node,
const char *indent,
bool islast,
const char *);
141 void doCondition(ConditionElement *node,
const char *indent,
bool islast,
const char *);
142 void printConnectionGate(
ASTNode *conn,
const char *modname,
const char *modindexattr,
143 const char *gatename,
const char *gateindexattr,
bool isplusplus,
144 int gatesubg,
const char *indent);
147 void doExpression(ExpressionElement *node,
const char *indent,
bool islast,
const char *);
148 int getOperatorPrecedence(
const char *op,
int args);
149 bool isOperatorLeftAssoc(
const char *op);
150 void doOperator(OperatorElement *node,
const char *indent,
bool islast,
const char *);
151 void doFunction(FunctionElement *node,
const char *indent,
bool islast,
const char *);
152 void doIdent(IdentElement *node,
const char *indent,
bool islast,
const char *);
153 void doLiteral(LiteralElement *node,
const char *indent,
bool islast,
const char *);
154 void doComment(CommentElement *node,
const char *indent,
bool islast,
const char *);
#define NEDXML_API
Definition: nedxmldefs.h:31
NEDXML_API void generateNed(std::ostream &out, ASTNode *node)
Simple front-end to NedGenerator.
std::ostream * outp
Definition: nedgenerator.h:48
Definition: astbuilder.h:25
Generates NED code from a NED AST.
Definition: nedgenerator.h:44
int indentSize
Definition: nedgenerator.h:47