MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
parser.h File Reference
#include <iostream>
#include <fstream>
#include <limits>
#include <ac/f2c.h>
#include <string.h>
#include <ctype.h>
#include <cstdlib>
#include <unistd.h>
#include <typeinfo>
#include "myassert.h"
#include "input.h"
#include "mathp.h"
#include "matvec3.h"
#include "matvec3n.h"
#include "matvec6.h"
#include "mbsleep.h"
#include "ltstrcase.h"
Include dependency graph for parser.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  LowParser
 
class  KeyTable
 
struct  DescRead
 
class  HighParser
 
class  HighParser::ErrInvalidCallToGetDescription
 
class  HighParser::ErrKeyWordExpected
 
class  HighParser::ErrSemicolonExpected
 
class  HighParser::ErrColonExpected
 
class  HighParser::ErrMissingSeparator
 
class  HighParser::ErrIntegerExpected
 
class  HighParser::ErrRealExpected
 
class  HighParser::ErrStringExpected
 
class  HighParser::ErrIllegalDelimiter
 
class  HighParser::ErrValueOutOfRange< T >
 
struct  HighParser::ErrOut
 
struct  HighParser::WordSet
 
struct  HighParser::range_base< T >
 
struct  HighParser::range_any< T >
 
struct  HighParser::range_ge< T >
 
struct  HighParser::range_gt< T >
 
struct  HighParser::range_le< T >
 
struct  HighParser::range_lt< T >
 
struct  HighParser::range_2_base< T >
 
struct  HighParser::range_ge_le< T >
 
struct  HighParser::range_gt_le< T >
 
struct  HighParser::range_ge_lt< T >
 
struct  HighParser::range_gt_lt< T >
 

Functions

bool SetDescData (const std::string &s, DescRead *rf)
 
bool ReadDescription (HighParser &HP, const std::string &desc)
 
std::ostream & operator<< (std::ostream &out, const HighParser::ErrOut &err)
 
HighParser::ErrOut mbdyn_get_line_data (void)
 
std::ostream & mbdyn_print_line_data (std::ostream &out)
 

Variables

const unsigned int iDefaultBufSize
 

Function Documentation

HighParser::ErrOut mbdyn_get_line_data ( void  )

Definition at line 603 of file parser.cc.

References pHP, and unknownErr.

Referenced by TypedValue::Cast(), and MathParser::stmt().

604 {
605  if (!pHP.empty()) {
606  return pHP.top()->GetLineData();
607  }
608 
609  return unknownErr;
610 }
static const HighParser::ErrOut unknownErr
Definition: parser.cc:600
static std::stack< const HighParser * > pHP
Definition: parser.cc:598
std::ostream& mbdyn_print_line_data ( std::ostream &  out)

Definition at line 613 of file parser.cc.

References pHP.

614 {
615  if (!pHP.empty()) {
616  out << pHP.top()->GetLineData();
617  }
618 
619  return out;
620 }
static std::stack< const HighParser * > pHP
Definition: parser.cc:598
std::ostream& operator<< ( std::ostream &  out,
const HighParser::ErrOut err 
)

Definition at line 1372 of file parser.cc.

References DIR_SEP, HighParser::ErrOut::iLineNumber, HighParser::ErrOut::sFileName, and HighParser::ErrOut::sPathName.

1373 {
1374  out << err.iLineNumber;
1375 
1376  if (err.sFileName != 0) {
1377  out << ", file <";
1378  if (err.sPathName != 0) {
1379  out << err.sPathName << DIR_SEP;
1380  }
1381  out << err.sFileName << '>';
1382  }
1383 
1384  return out;
1385 }
const char * sFileName
Definition: parser.h:304
unsigned int iLineNumber
Definition: parser.h:306
const char DIR_SEP
Definition: filename.h:88
const char * sPathName
Definition: parser.h:305
bool ReadDescription ( HighParser HP,
const std::string &  desc 
)

Definition at line 310 of file parser.cc.

References DEBUGCOUTFNAME, DescFuncMap, func(), HighParser::GetLineData(), HighParser::GotDescription(), HighParser::IsArg(), HighParser::IsDescription(), and MBDYN_EXCEPT_ARGS.

Referenced by HighParser::GetDescription().

311 {
312  DEBUGCOUTFNAME("ReadDescription()");
313 
314  bool bRC(false);
315  DescFuncMapType::iterator func = DescFuncMap.find(desc);
316  if (func != DescFuncMap.end()) {
317  HP.GotDescription();
318  if (!HP.IsArg() && !HP.IsDescription()) {
319  silent_cerr("Parser error in ReadDescription(),"
320  " colon or semicolon expected after description at line "
321  << HP.GetLineData() << std::endl);
323  }
324 
325  bRC = func->second->Read(HP);
326 
327  if (HP.IsArg()) {
328  silent_cerr("semicolon expected at line " << HP.GetLineData() << std::endl);
330  }
331  }
332 
333  return bRC;
334 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
bool IsDescription(void) const
Definition: parser.cc:692
virtual HighParser::ErrOut GetLineData(void) const
Definition: parser.cc:681
Token GotDescription(void)
Definition: parser.cc:698
void func(const T &u, const T &v, const T &w, doublereal e, T &f)
static DescFuncMapType DescFuncMap
Definition: parser.cc:290
virtual bool IsArg(void)
Definition: parser.cc:807

Here is the call graph for this function:

bool SetDescData ( const std::string &  s,
DescRead rf 
)

Definition at line 301 of file parser.cc.

References DescFuncMap.

Referenced by InitDescData(), and module_init().

302 {
303  pedantic_cout("registering description \"" << name << "\"" << std::endl);
304  return DescFuncMap.insert(DescFuncMapType::value_type(name, rf)).second;
305 }
static DescFuncMapType DescFuncMap
Definition: parser.cc:290

Variable Documentation

const unsigned int iDefaultBufSize