OMNeT++ NEDXML  6.0.3
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)
 
void printPropertiesLatexDocu (std::ostream &out)
 

Static Public Member Functions

static const char * getBuiltinDefinitions ()
 

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

◆ StringSet

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

◆ StringVector

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

◆ Property

◆ Properties

◆ FieldInfo

◆ ClassInfo

◆ EnumItem

◆ EnumInfo

Constructor & Destructor Documentation

◆ MsgCompiler()

MsgCompiler ( const MsgCompilerOptions options,
ErrorStore errors 
)

Constructor.

◆ ~MsgCompiler()

~MsgCompiler ( )
inline

Destructor.

Member Function Documentation

◆ importBuiltinDefinitions()

void importBuiltinDefinitions ( )
protected

◆ processBuiltinImport()

void processBuiltinImport ( const char *  txt,
const char *  fname 
)
protected

◆ processImport()

void processImport ( ImportElement *  importElem,
const std::string &  currentDir 
)
protected

◆ resolveImport()

std::string resolveImport ( const std::string &  importName,
const std::string &  currentDir 
)
protected

◆ collectTypes()

void collectTypes ( MsgFileElement *  fileElement,
bool  isImport 
)
protected

◆ generateCode()

void generateCode ( MsgFileElement *  fileElement)
protected

◆ prefixWithNamespace()

std::string prefixWithNamespace ( const std::string &  name,
const std::string &  namespaceName 
)
protected

◆ validateNamespaceName()

void validateNamespaceName ( const std::string &  namespaceName,
ASTNode element 
)
protected

◆ generate()

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.

◆ printPropertiesLatexDocu()

void printPropertiesLatexDocu ( std::ostream &  out)

Print properties documentation in LaTeX format, for use in the Manual.

◆ getBuiltinDefinitions()

static const char* getBuiltinDefinitions ( )
inlinestatic

Returns the built-in MSG definitions.

Member Data Documentation

◆ opts

MsgCompilerOptions opts
protected

◆ typeTable

MsgTypeTable typeTable
protected

◆ analyzer

MsgAnalyzer analyzer
protected

◆ codegen

MsgCodeGenerator codegen
protected

◆ used

bool used = false
protected

◆ errors

ErrorStore* errors
protected

◆ importsSeen

StringSet importsSeen
protected

◆ importedFiles

StringSet importedFiles
protected

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