OMNeT++ NEDXML 6.1
Discrete Event Simulation Library
MsgParser Class Reference

Description

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.

Collaboration diagram for MsgParser:
[legend]

Public Member Functions

 MsgParser (ErrorStore *e)
 
 ~MsgParser ()
 
void setStoreSource (bool b)
 
bool getStoreSourceFlag ()
 
ASTNodeparseMsgFile (const char *osfname, const char *fname=nullptr)
 
ASTNodeparseMsgText (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)
 
ASTNodeparseMsg ()
 

Constructor & Destructor Documentation

◆ MsgParser()

Constructor.

◆ ~MsgParser()

~MsgParser ( )

Destructor.

Member Function Documentation

◆ loadFile()

bool loadFile ( const char *  osfname,
const char *  fname 
)
protected

◆ loadText()

bool loadText ( const char *  nedtext,
const char *  fname 
)
protected

◆ parseMsg()

ASTNode* parseMsg ( )
protected

◆ setStoreSource()

void setStoreSource ( bool  b)
inline

Affects operation of parseFile() and parseText(), specifies whether sourceCode attributes in ASTNodes should be filled out. Default is false.

References ParseContext::storesrc.

◆ getStoreSourceFlag()

bool getStoreSourceFlag ( )
inline

Returns the "store source code" flag; see setStoreSource().

References ParseContext::storesrc.

◆ parseMsgFile()

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.

◆ parseMsgText()

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.

Member Data Documentation

◆ np


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