OMNeT++ NEDXML
5.4.1
|
#include <msgparser.h>
Parses MSG files into an AST.
Elements of the tree are subclassed from ASTNode; ASTNodeFactory is used to actually create the objects. Internally this class uses a bison/flex grammar and SourceDocument.
Public Member Functions | |
MsgParser (ErrorStore *e) | |
~MsgParser () | |
void | setStoreSource (bool b) |
bool | getStoreSourceFlag () |
void | setMsgNewSyntaxFlag (bool b) |
bool | getMsgNewSyntaxFlag () |
ASTNode * | parseMsgFile (const char *osfname, const char *fname=nullptr) |
ASTNode * | parseMsgText (const char *text, const char *fname=nullptr) |
Public Attributes | |
ParseContext | np |
Protected Member Functions | |
bool | loadFile (const char *osfname, const char *fname) |
bool | loadText (const char *nedtext, const char *fname) |
ASTNode * | parseMsg () |
MsgParser | ( | ErrorStore * | e | ) |
Constructor.
~MsgParser | ( | ) |
Destructor.
|
protected |
|
protected |
|
protected |
|
inline |
Affects operation of parseFile() and parseText(), specifies whether sourceCode attributes in ASTNodes should be filled out. Default is false.
References ParseContext::storesrc.
|
inline |
Returns the "store source code" flag; see setStoreSource().
References ParseContext::storesrc.
|
inline |
References ParseContext::msgNewSyntax.
|
inline |
References ParseContext::msgNewSyntax.
ASTNode* parseMsgFile | ( | const char * | osfname, |
const char * | fname = nullptr |
||
) |
Parse the given MSG (.msg) file and return the result tree. Returns nullptr or partial tree if there was an error. The fname parameter will be used to fill in the source location attributes; it defaults to osfname.
ASTNode* parseMsgText | ( | const char * | text, |
const char * | fname = nullptr |
||
) |
Parse the given MSG source and return the result tree. Returns nullptr or partial tree if there was an error. The fname parameter will be used to fill in the source location attributes; it defaults to osfname.
ParseContext np |