NEDParser Class Reference
[NED Parsing]

#include <nedparser.h>

List of all members.


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.

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


Constructor & Destructor Documentation

NEDParser::NEDParser ( NEDErrorStore e  ) 

Constructor.

NEDParser::~NEDParser (  ) 

Destructor.


Member Function Documentation

void NEDParser::error ( const char *  msg,
int  line 
)

NEDErrorStore* NEDParser::getErrors (  )  [inline]

NEDFileBuffer* NEDParser::getSource (  )  [inline]

bool NEDParser::loadFile ( const char *  osfname,
const char *  fname 
) [protected]

bool NEDParser::loadText ( const char *  nedtext,
const char *  fname 
) [protected]

NEDElement* NEDParser::parseNED (  )  [protected]

NEDElement* NEDParser::parseMSG (  )  [protected]

static bool NEDParser::guessIsNEDInNewSyntax ( const char *  txt  )  [static, protected]

static const char* NEDParser::getBuiltInDeclarations (  )  [static]

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

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.

bool NEDParser::getParseExpressionsFlag (  )  [inline]

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

bool NEDParser::getStoreSourceFlag (  )  [inline]

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

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

May only be called during parsing.

It returns the name of the source file being parsed.

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".

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::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.


Member Data Documentation

bool NEDParser::parseexpr [protected]

bool NEDParser::storesrc [protected]

const char* NEDParser::filename [protected]


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

Generated on Wed Apr 3 14:40:29 2013 for OMNeT++ NEDXML by  doxygen 1.5.5