Geant4  10.03
Evaluator.cc File Reference
#include "CLHEP/Evaluator/Evaluator.h"
#include <iostream>
#include <sstream>
#include <cmath>
#include "CLHEP/Evaluator/stack.icc"
#include "CLHEP/Evaluator/string.icc"
#include "CLHEP/Evaluator/hash_map.icc"
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
+ Include dependency graph for Evaluator.cc:

Go to the source code of this file.

Classes

struct  Item
 
struct  Struct
 

Namespaces

 HepTool
 

Macros

#define EVAL   HepTool::Evaluator
 
#define REMOVE_BLANKS
 
#define SKIP_BLANKS
 
#define EVAL_EXIT(STATUS, POSITION)   endp = POSITION; return STATUS
 
#define MAX_N_PAR   5
 

Typedefs

typedef void(* voidfuncptr )()
 
typedef char * pchar
 
typedef hash_map< string, Itemdic_type
 

Enumerations

enum  {
  ENDL, LBRA, OR, AND,
  EQ, NE, GE, GT,
  LE, LT, PLUS, MINUS,
  UNARY_PLUS, UNARY_MINUS, MULT, DIV,
  POW, RBRA, VALUE
}
 

Functions

static int engine (pchar, pchar, double &, pchar &, const dic_type &)
 
static int variable (const string &name, double &result, const dic_type &dictionary)
 
static int function (const string &name, stack< double > &par, double &result, const dic_type &dictionary)
 
static int operand (pchar begin, pchar end, double &result, pchar &endp, const dic_type &dictionary)
 
static int maker (int op, stack< double > &val)
 
static void setItem (const char *prefix, const char *name, const Item &item, Struct *s)
 

Variables

static const char sss [MAX_N_PAR+2] = "012345"
 

Macro Definition Documentation

#define EVAL   HepTool::Evaluator

Definition at line 49 of file Evaluator.cc.

#define EVAL_EXIT (   STATUS,
  POSITION 
)    endp = POSITION; return STATUS

Definition at line 61 of file Evaluator.cc.

Referenced by engine(), and operand().

#define MAX_N_PAR   5

Definition at line 62 of file Evaluator.cc.

Referenced by function().

#define REMOVE_BLANKS
Value:
for(pointer=name;;pointer++) if (!isspace(*pointer)) break; \
for(n=strlen(pointer);n>0;n--) if (!isspace(*(pointer+n-1))) break
const char * name(G4int ptype)
const G4int n

Definition at line 51 of file Evaluator.cc.

Referenced by setItem().

#define SKIP_BLANKS
Value:
for(;;pointer++) { \
c = (pointer > end) ? '\0' : *pointer; \
if (!isspace(c)) break; \
}

Definition at line 55 of file Evaluator.cc.

Referenced by engine(), and operand().

Typedef Documentation

typedef hash_map<string,Item> dic_type

Definition at line 38 of file Evaluator.cc.

typedef char* pchar

Definition at line 37 of file Evaluator.cc.

typedef void(* voidfuncptr)()

Definition at line 21 of file Evaluator.cc.

Enumeration Type Documentation

anonymous enum
Enumerator
ENDL 
LBRA 
OR 
AND 
EQ 
NE 
GE 
GT 
LE 
LT 
PLUS 
MINUS 
UNARY_PLUS 
UNARY_MINUS 
MULT 
DIV 
POW 
RBRA 
VALUE 

Definition at line 66 of file Evaluator.cc.

Function Documentation

static int engine ( pchar  begin,
pchar  end,
double &  result,
pchar endp,
const dic_type dictionary 
)
static

Definition at line 358 of file Evaluator.cc.

References AND, DIV, ENDL, EQ, EVAL_EXIT, GE, GT, LBRA, LE, LT, maker(), MINUS, MULT, NE, operand(), OR, PLUS, pos, POW, RBRA, SKIP_BLANKS, UNARY_MINUS, UNARY_PLUS, and VALUE.

Referenced by operand(), and variable().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int function ( const string &  name,
stack< double > &  par,
double &  result,
const dic_type dictionary 
)
static

Definition at line 107 of file Evaluator.cc.

References Item::function, MAX_N_PAR, G4InuclParticleNames::name(), G4InuclParticleNames::pp, and sss.

+ Here is the call graph for this function:

static int maker ( int  op,
stack< double > &  val 
)
static

Definition at line 284 of file Evaluator.cc.

References AND, DIV, EQ, GE, GT, LE, LT, MINUS, MULT, NE, OR, PLUS, POW, UNARY_MINUS, and UNARY_PLUS.

Referenced by engine().

+ Here is the caller graph for this function:

static int operand ( pchar  begin,
pchar  end,
double &  result,
pchar endp,
const dic_type dictionary 
)
static

Definition at line 162 of file Evaluator.cc.

References engine(), EVAL_EXIT, G4InuclParticleNames::name(), pos, SKIP_BLANKS, and variable().

Referenced by any_cast(), engine(), and G4BooleanSolid::StackPolyhedron().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void setItem ( const char *  prefix,
const char *  name,
const Item item,
Struct s 
)
static

Definition at line 549 of file Evaluator.cc.

References n, REMOVE_BLANKS, Struct::theDictionary, and Struct::theStatus.

static int variable ( const string &  name,
double &  result,
const dic_type dictionary 
)
static

Definition at line 71 of file Evaluator.cc.

References engine(), Item::EXPRESSION, Item::expression, Item::VARIABLE, Item::variable, and Item::what.

Referenced by operand().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation