17#ifndef __OMNETPP_NEDXML_YYUTIL_H
18#define __OMNETPP_NEDXML_YYUTIL_H
27extern bool parseInProgress;
29#define DETECT_PARSER_REENTRY() \
31 Guard() {if (parseInProgress) throw opp_runtime_error("non-reentrant parser invoked again while parsing"); parseInProgress = true;} \
32 ~Guard() {parseInProgress = false;} \
35std::string slashifyFilename(
const char *fname);
39void storePos(ParseContext *np,
ASTNode *node, YYLoc pos);
40void storePos(ParseContext *np,
ASTNode *node, YYLoc firstpos, YYLoc lastpos);
42void swapAttributes(
ASTNode *node,
const char *attr1,
const char *attr2);
45YYLoc trimQuotes(YYLoc vectorpos);
46YYLoc trimDoubleBraces(YYLoc vectorpos);
48const char *toString(ParseContext *np, YYLoc);
49const char *toString(
long);
50std::string removeSpaces(ParseContext *np, YYLoc pos);
52inline bool isEmpty(YYLoc pos) {
53 return pos.first_line > pos.last_line ||
54 (pos.first_line == pos.last_line && pos.first_column >= pos.last_column);
57inline YYLoc makeYYLoc(
int fl,
int fc,
int ll,
int lc) {
60 pos.first_column = fc;
66inline YYLoc makeEmptyYYLoc() {
67 return makeYYLoc(1,0,1,0);
Base class for ASTNode factories.
Definition astnode.h:460