NEDParser Class Reference
[NED Parsing]

Parses NED files into a NED object tree. More...

#include <nedparser.h>

List of all members.

Public Member Functions

void error (const char *msg, int line)
NEDErrorStoregetErrors ()
NEDFileBuffergetSource ()
 NEDParser (NEDErrorStore *e)
 ~NEDParser ()
void setParseExpressions (bool b)
void setStoreSource (bool b)
bool getParseExpressionsFlag ()
bool getStoreSourceFlag ()
const char * getFileName ()
NEDElementparseNEDFile (const char *osfname, const char *fname=NULL)
NEDElementparseNEDText (const char *nedtext, const char *fname=NULL)
NEDElementparseNEDExpression (const char *nedexpression)
NEDElementparseMSGFile (const char *osfname, const char *fname=NULL)
NEDElementparseMSGText (const char *nedtext, const char *fname=NULL)

Static Public Member Functions

static const char * getBuiltInDeclarations ()

Protected Member Functions

bool loadFile (const char *osfname, const char *fname)
bool loadText (const char *nedtext, const char *fname)
NEDElementparseNED ()
NEDElementparseMSG ()

Static Protected Member Functions

static bool guessIsNEDInNewSyntax (const char *txt)

Protected Attributes

bool parseexpr
bool storesrc
const char * filename
NEDErrorStoreerrors
NEDFileBuffernedsource

Detailed Description

Parses NED files into a NED object tree.

Elements of the tree are subclassed from NEDElement; NEDElementFactory is used to actually create the objects. Internally this class uses a bison/flex grammar and NEDFileBuffer.


Constructor & Destructor Documentation

NEDParser::NEDParser ( NEDErrorStore e  ) 

Constructor.

NEDParser::~NEDParser (  ) 

Destructor.


Member Function Documentation

void NEDParser::error ( const char *  msg,
int  line 
)
static const char* NEDParser::getBuiltInDeclarations (  )  [static]

Returns a NED source which contains declarations of built-in NED types.

NEDErrorStore* NEDParser::getErrors (  )  [inline]
const char* NEDParser::getFileName (  )  [inline]

May only be called during parsing.

It returns the name of the source file being parsed.

bool NEDParser::getParseExpressionsFlag (  )  [inline]

Returns the "parse expressions" flag; see setParseExpressions().

NEDFileBuffer* NEDParser::getSource (  )  [inline]
bool NEDParser::getStoreSourceFlag (  )  [inline]

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

static bool NEDParser::guessIsNEDInNewSyntax ( const char *  txt  )  [static, protected]
bool NEDParser::loadFile ( const char *  osfname,
const char *  fname 
) [protected]
bool NEDParser::loadText ( const char *  nedtext,
const char *  fname 
) [protected]
NEDElement* NEDParser::parseMSG (  )  [protected]
NEDElement* NEDParser::parseMSGFile ( const char *  osfname,
const char *  fname = NULL 
)

Parse the given MSG (.msg) file and return the result tree.

Returns NULL 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.

NEDElement* NEDParser::parseMSGText ( const char *  nedtext,
const char *  fname = NULL 
)

Parse the given MSG source and return the result tree.

Returns NULL 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.

NEDElement* NEDParser::parseNED (  )  [protected]
NEDElement* NEDParser::parseNEDExpression ( const char *  nedexpression  ) 

Parse the given text as a NED expression, and return the result tree.

Returns NULL or partial tree if there was an error.

NEDElement* NEDParser::parseNEDFile ( const char *  osfname,
const char *  fname = NULL 
)

Parses the given NED file (osfname), and returns the result tree.

Returns NULL 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.

NEDElement* NEDParser::parseNEDText ( const char *  nedtext,
const char *  fname = NULL 
)

Parse the given NED source and return the result tree.

Returns NULL or partial tree if there was an error. The fname parameter will be used to fill in the source location attributes; it defaults to "buffer".

void NEDParser::setParseExpressions ( bool  b  )  [inline]

Affects operation of parseFile() and parseText(), specifies whether expressions should be parsed or not.

Default is true.

void NEDParser::setStoreSource ( bool  b  )  [inline]

Affects operation of parseFile() and parseText(), specifies whether sourceCode attributes in NEDElements should be filled out.

Default is false.


Member Data Documentation

const char* NEDParser::filename [protected]
bool NEDParser::parseexpr [protected]
bool NEDParser::storesrc [protected]

The documentation for this class was generated from the following file:
Generated on Mon Jul 14 12:57:27 2014 for OMNeT++ NEDXML by  doxygen 1.6.3