#include <nedparser.h>
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) |
| NEDErrorStore * | getErrors () |
| NEDFileBuffer * | getSource () |
| NEDParser (NEDErrorStore *e) | |
| ~NEDParser () | |
| void | setParseExpressions (bool b) |
| void | setStoreSource (bool b) |
| bool | getParseExpressionsFlag () |
| bool | getStoreSourceFlag () |
| const char * | getFileName () |
| NEDElement * | parseNEDFile (const char *osfname, const char *fname=NULL) |
| NEDElement * | parseNEDText (const char *nedtext, const char *fname=NULL) |
| NEDElement * | parseNEDExpression (const char *nedexpression) |
| NEDElement * | parseMSGFile (const char *osfname, const char *fname=NULL) |
| NEDElement * | parseMSGText (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) |
| NEDElement * | parseNED () |
| NEDElement * | parseMSG () |
Static Protected Member Functions | |
| static bool | guessIsNEDInNewSyntax (const char *txt) |
Protected Attributes | |
| bool | parseexpr |
| bool | storesrc |
| const char * | filename |
| NEDErrorStore * | errors |
| NEDFileBuffer * | nedsource |
| NEDParser::NEDParser | ( | NEDErrorStore * | e | ) |
Constructor.
| NEDParser::~NEDParser | ( | ) |
Destructor.
| 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.
bool NEDParser::parseexpr [protected] |
bool NEDParser::storesrc [protected] |
const char* NEDParser::filename [protected] |
NEDErrorStore* NEDParser::errors [protected] |
NEDFileBuffer* NEDParser::nedsource [protected] |
1.5.5