OMNeT++ NEDXML
5.4.1
|
#include <nedparser.h>
Parses NED 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 | |
NedParser (ErrorStore *e) | |
~NedParser () | |
void | setParseExpressions (bool b) |
void | setStoreSource (bool b) |
bool | getParseExpressionsFlag () |
bool | getStoreSourceFlag () |
ASTNode * | parseNedFile (const char *osfname, const char *fname=nullptr) |
ASTNode * | parseNedText (const char *nedtext, const char *fname=nullptr) |
ASTNode * | parseNedExpression (const char *nedexpression) |
Static Public Member Functions | |
static const char * | getBuiltInDeclarations () |
Public Attributes | |
ParseContext | np |
Protected Member Functions | |
bool | loadFile (const char *osfname, const char *fname) |
bool | loadText (const char *nedtext, const char *fname) |
ASTNode * | parseNed () |
NedParser | ( | ErrorStore * | e | ) |
Constructor.
~NedParser | ( | ) |
Destructor.
|
protected |
|
protected |
|
protected |
|
static |
Returns a NED source which contains declarations of built-in NED types.
|
inline |
Affects operation of parseFile() and parseText(), specifies whether expressions should be parsed or not. Default is true.
References ParseContext::parseexpr.
|
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 "parse expressions" flag; see setParseExpressions().
References ParseContext::parseexpr.
|
inline |
Returns the "store source code" flag; see setStoreSource().
References ParseContext::storesrc.
ASTNode* parseNedFile | ( | const char * | osfname, |
const char * | fname = nullptr |
||
) |
Parses the given NED file (osfname), and returns 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* parseNedText | ( | const char * | nedtext, |
const char * | fname = nullptr |
||
) |
Parse the given NED 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 "buffer".
ASTNode* parseNedExpression | ( | const char * | nedexpression | ) |
Parse the given text as a NED expression, and return the result tree. Returns nullptr or partial tree if there was an error.
ParseContext np |