OMNeT++ NEDXML  5.4.1
MsgCompiler Class Reference

#include <msgcompiler.h>

Description

Generates C++ code from a MSG file object tree.

Assumes object tree has already passed all validation stages (DTD, syntax, semantic).

Public Types

typedef std::set< std::string > StringSet
 
typedef std::vector< std::string > StringVector
 
typedef MsgTypeTable::Property Property
 
typedef MsgTypeTable::Properties Properties
 
typedef MsgTypeTable::FieldInfo FieldInfo
 
typedef MsgTypeTable::ClassInfo ClassInfo
 
typedef MsgTypeTable::EnumItem EnumItem
 
typedef MsgTypeTable::EnumInfo EnumInfo
 

Public Member Functions

 MsgCompiler (const MsgCompilerOptions &options, ErrorStore *errors)
 
 ~MsgCompiler ()
 
void generate (MsgFileElement *fileElement, const char *hFile, const char *ccFile, StringSet &outImportedFiles)
 

Protected Member Functions

void importBuiltinDefinitions ()
 
void processBuiltinImport (const char *txt, const char *fname)
 
void processImport (ImportElement *importElem, const std::string &currentDir)
 
std::string resolveImport (const std::string &importName, const std::string &currentDir)
 
void collectTypes (MsgFileElement *fileElement, bool isImport)
 
void generateCode (MsgFileElement *fileElement)
 
std::string prefixWithNamespace (const std::string &name, const std::string &namespaceName)
 
void validateNamespaceName (const std::string &namespaceName, ASTNode *element)
 

Protected Attributes

MsgCompilerOptions opts
 
MsgTypeTable typeTable
 
MsgAnalyzer analyzer
 
MsgCodeGenerator codegen
 
bool used = false
 
ErrorStoreerrors
 
StringSet importsSeen
 
StringSet importedFiles
 

Member Typedef Documentation

typedef std::set<std::string> StringSet
typedef std::vector<std::string> StringVector

Constructor & Destructor Documentation

MsgCompiler ( const MsgCompilerOptions options,
ErrorStore errors 
)

Constructor.

Destructor.

Member Function Documentation

void importBuiltinDefinitions ( )
protected
void processBuiltinImport ( const char *  txt,
const char *  fname 
)
protected
void processImport ( ImportElement *  importElem,
const std::string &  currentDir 
)
protected
std::string resolveImport ( const std::string &  importName,
const std::string &  currentDir 
)
protected
void collectTypes ( MsgFileElement *  fileElement,
bool  isImport 
)
protected
void generateCode ( MsgFileElement *  fileElement)
protected
std::string prefixWithNamespace ( const std::string &  name,
const std::string &  namespaceName 
)
protected
void validateNamespaceName ( const std::string &  namespaceName,
ASTNode element 
)
protected
void generate ( MsgFileElement *  fileElement,
const char *  hFile,
const char *  ccFile,
StringSet outImportedFiles 
)

Generates C++ code from the specified message file. Assumes that the object tree has already passed DTD and syntax validation.

Member Data Documentation

MsgCompilerOptions opts
protected
MsgTypeTable typeTable
protected
MsgAnalyzer analyzer
protected
MsgCodeGenerator codegen
protected
bool used = false
protected
ErrorStore* errors
protected
StringSet importsSeen
protected
StringSet importedFiles
protected

The documentation for this class was generated from the following file: