MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
NameSpaceDR Struct Reference
Inheritance diagram for NameSpaceDR:
Collaboration diagram for NameSpaceDR:

Public Member Functions

bool Read (HighParser &HP)
 
- Public Member Functions inherited from DescRead
virtual ~DescRead (void)
 

Detailed Description

Definition at line 87 of file module-namespace.cc.

Member Function Documentation

bool NameSpaceDR::Read ( HighParser HP)
virtual

Implements DescRead.

Definition at line 92 of file module-namespace.cc.

References MathParser::bNameValidate(), HighParser::GetLineData(), HighParser::GetMathParser(), HighParser::GetString(), HighParser::IsArg(), MBDYN_EXCEPT_ARGS, and MathParser::RegisterNameSpace().

93 {
94  if (!HP.IsArg()) {
95  silent_cerr("Parser error in NameSpaceDR::Read(), "
96  " arg expected at line "
97  << HP.GetLineData() << std::endl);
99  }
100 
101  const char *sName = HP.GetString();
102  if (!HP.GetMathParser().bNameValidate(sName)) {
103  silent_cerr("Parser error in NameSpaceDR::Read(), "
104  " invalid namespace \"" << sName << "\" at line "
105  << HP.GetLineData() << std::endl);
107  }
108 
109  MathParser::NameSpace *pNS = new TableNameSpace(sName);
110  int rc = HP.GetMathParser().RegisterNameSpace(pNS);
111  if (rc != 0) {
112  delete pNS;
113  }
114 
115  return (rc == 0);
116 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
int RegisterNameSpace(NameSpace *ns)
Definition: mathp.cc:4602
virtual HighParser::ErrOut GetLineData(void) const
Definition: parser.cc:681
bool bNameValidate(const std::string &s) const
Definition: mathp.cc:3292
virtual MathParser & GetMathParser(void)
Definition: parser.cc:668
virtual std::string GetString(const std::string &sDefVal)
Definition: parser.cc:1074
virtual bool IsArg(void)
Definition: parser.cc:807

Here is the call graph for this function:


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