OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
Expressions Namespace Reference

Representation objects and parsers for attribute expressions. More...

Classes

class  Scalar
 A scalar expression. More...
class  PtrToScalar
 A pointer to a scalar expression. More...
class  ArrayOfPtrs
 An array of pointers to scalar expressions. More...
class  OArray
 An array expression. More...
class  PtrToArray
 A pointer to an array expression. More...
class  SRefAttr
 An attribute defined as a reference to a scalar. More...
class  AAutomatic
 Object attribute with an ``automatic'' array value. More...
class  ABinary
 An array expression with two array operands. More...
class  AColumn
 An array expression defined as a table column. More...
class  ADeferred
 Object attribute with a ``deferred'' array value. More...
class  AList
 An array expression defined by a list of scalar expressions. More...
class  ARefExpr
 An expression defined as a reference to an array. More...
class  ARow
 An array expression defined as a table row. More...
class  ASUnary
 A scalar expression with one array operand. More...
class  ATable
 An array expression generated from a TABLE() function. More...
class  AUnary
 An array expression with one array operand. More...
class  AValue
 Object attribute with a constant array value. More...
class  Indexer
 A scalar expression to retrieve an indexed component from an array. More...
class  SAutomatic
 Object attribute with an ``automatic'' scalar value. More...
class  SBinary
 A scalar expression with two scalar operands. More...
class  SCell
 A scalar expression referring to a table cell. More...
class  SConstant
 A scalar constant expression. More...
class  SDeferred
 Object attribute with a ``deferred'' scalar value. More...
class  SHash
 A scalar expression. More...
class  SNull
 A scalar expression without operands. More...
class  SRefExpr
 An expression defined as a reference to a scalar. More...
class  SUnary
 A scalar expression with one scalar operand. More...
class  SValue
 Object attribute with a constant scalar value. More...
struct  TFunction0
 An operand-less function returning a T. More...
struct  TFunction1
 A function of one U, returning a T. More...
struct  TFunction2
 A function of two U's returning a T. More...

Typedefs

typedef TFunction1< double, const std::vector< double > & > ArrayFun

Functions

PtrToScalar< bool > parseBool (Statement &)
 Parse boolean expression.
PtrToScalar< double > parseReal (Statement &)
 Parse real expression.
double parseRealConst (Statement &)
 Parse real constant.
std::string parseString (Statement &, const char msg[])
 Parse string value.
std::string parseStringValue (Statement &, const char msg[])
PtrToArray< bool > parseBoolArray (Statement &)
 Parse boolean array expression.
PtrToArray< double > parseRealArray (Statement &)
 Parse real array expression.
PtrToArray< double > parseRealConstArray (Statement &)
 Parse real array constant.
std::vector< std::string > parseStringArray (Statement &)
 Parse string array.
void parseDelimiter (Statement &stat, char delim)
 Test for one-character delimiter.
void parseDelimiter (Statement &stat, const char delim[2])
 Test for two-character delimiter.
PlaceRep parsePlace (Statement &)
 Parse place specification.
RangeRep parseRange (Statement &)
 Parse range specification.
SRefAttr< double > * parseReference (Statement &)
 Parse variable reference.
TableRowRep parseTableRow (Statement &)
 Parse a token list (for macro argument and the like).
std::list< TokenparseTokenList (Statement &)
 Parse a token list (for macro argument and the like).
std::vector< std::list< Token > > parseTokenListArray (Statement &)
 Parse a token list array (for LIST commands).
PtrToScalar< double > parseTableExpression (Statement &, const Table *)
 Parse table expression (depends on a table's rows).
bool Or (bool a, bool b)
bool And (bool a, bool b)
bool Le (double a, double b)
bool Lt (double a, double b)
bool Ge (double a, double b)
bool Gt (double a, double b)
bool Eq (double a, double b)
bool Ne (double a, double b)
double Neg (double a)
double Sign (double a)
double Tgauss (double a)
double Add (double a, double b)
double Sub (double a, double b)
double Mpy (double a, double b)
double Div (double a, double b)
double getEkin ()
double ranf ()
double gauss ()
double Max (double a, double b)
double Min (double a, double b)
double Mod (double a, double b)
double Mina (const std::vector< double > &array)
double Maxa (const std::vector< double > &array)
double Rmsa (const std::vector< double > &array)
double AbsMax (const std::vector< double > &array)
PtrToScalar< bool > parseAnd (Statement &stat)
PtrToArray< double > parseArrayFactor (Statement &stat)
PtrToArray< double > parseArrayPrimary (Statement &stat)
PtrToArray< double > parseArrayTerm (Statement &stat)
void parseBracketList (Statement &stat, char close, std::list< Token > &result)
PtrToScalar< double > parseFactor (Statement &stat)
PtrToScalar< double > parsePrimary (Statement &stat)
PtrToScalar< bool > parseRelation (Statement &stat)
PtrToScalar< double > parseTerm (Statement &stat)
PtrToArray< double > parseColumnGenerator (Statement &stat)
PtrToArray< double > parseRowGenerator (Statement &stat)
PtrToArray< double > parseTableGenerator (Statement &stat)
template<class T>
std::ostream & operator<< (std::ostream &os, const SRefAttr< T > &a)
template<class T>
const Tfind (const T table[], const std::string &name)
 Look up name.

Variables

const TablecurrentTable = 0
OwnPtr< ATablecurrentArray

Detailed Description

Representation objects and parsers for attribute expressions.


Class Documentation

◆ Expressions::TFunction0

struct Expressions::TFunction0
template<class T>
struct Expressions::TFunction0< T >

An operand-less function returning a T.

Definition at line 31 of file TFunction0.h.

Collaboration diagram for Expressions::TFunction0< T >:
Class Members
T(*)() function The actual operation.
const char * name The function name or operator representation.
int precedence The operator precedence.

◆ Expressions::TFunction1

struct Expressions::TFunction1
template<class T, class U>
struct Expressions::TFunction1< T, U >

A function of one U, returning a T.

Definition at line 31 of file TFunction1.h.

Inheritance diagram for Expressions::TFunction1< T, U >:
Collaboration diagram for Expressions::TFunction1< T, U >:
Class Members
T(*)(U) function The actual operation.
const char * name The function name or operator representation.
int precedence The operator precedence.

◆ Expressions::TFunction2

struct Expressions::TFunction2
template<class T, class U>
struct Expressions::TFunction2< T, U >

A function of two U's returning a T.

Definition at line 31 of file TFunction2.h.

Collaboration diagram for Expressions::TFunction2< T, U >:
Class Members
T(*)(U, U) function The actual operation.
const char * name The function name or operator representation.
int precedence The operator precedence.

Typedef Documentation

◆ ArrayFun

typedef TFunction1<double, const std::vector<double>&> Expressions::ArrayFun

Definition at line 288 of file Expressions.cpp.

Function Documentation

◆ AbsMax()

double Expressions::AbsMax ( const std::vector< double > & array)

Definition at line 275 of file Expressions.cpp.

References Options::warn.

◆ Add()

double Expressions::Add ( double a,
double b )

Definition at line 133 of file Expressions.cpp.

◆ And()

bool Expressions::And ( bool a,
bool b )

Definition at line 77 of file Expressions.cpp.

◆ Div()

double Expressions::Div ( double a,
double b )

Definition at line 151 of file Expressions.cpp.

◆ Eq()

bool Expressions::Eq ( double a,
double b )

Definition at line 102 of file Expressions.cpp.

◆ find()

template<class T>
const T * Expressions::find ( const T table[],
const std::string & name )
inline

Look up name.

Definition at line 34 of file TFind.h.

Referenced by parseArrayPrimary(), and parsePrimary().

Here is the caller graph for this function:

◆ gauss()

double Expressions::gauss ( )

Definition at line 184 of file Expressions.cpp.

References Options::rangen.

◆ Ge()

bool Expressions::Ge ( double a,
double b )

Definition at line 92 of file Expressions.cpp.

◆ getEkin()

double Expressions::getEkin ( )

Definition at line 165 of file Expressions.cpp.

References OpalData::getInstance(), and OpalData::getPartBunch().

Here is the call graph for this function:

◆ Gt()

bool Expressions::Gt ( double a,
double b )

Definition at line 97 of file Expressions.cpp.

◆ Le()

bool Expressions::Le ( double a,
double b )

Definition at line 82 of file Expressions.cpp.

◆ Lt()

bool Expressions::Lt ( double a,
double b )

Definition at line 87 of file Expressions.cpp.

◆ Max()

double Expressions::Max ( double a,
double b )

Definition at line 213 of file Expressions.cpp.

◆ Maxa()

double Expressions::Maxa ( const std::vector< double > & array)

Definition at line 249 of file Expressions.cpp.

References Options::warn.

◆ Min()

double Expressions::Min ( double a,
double b )

Definition at line 217 of file Expressions.cpp.

Referenced by Mina().

Here is the caller graph for this function:

◆ Mina()

double Expressions::Mina ( const std::vector< double > & array)

Definition at line 236 of file Expressions.cpp.

References Min(), and Options::warn.

Here is the call graph for this function:

◆ Mod()

double Expressions::Mod ( double a,
double b )

Definition at line 221 of file Expressions.cpp.

◆ Mpy()

double Expressions::Mpy ( double a,
double b )

Definition at line 145 of file Expressions.cpp.

◆ Ne()

bool Expressions::Ne ( double a,
double b )

Definition at line 107 of file Expressions.cpp.

◆ Neg()

double Expressions::Neg ( double a)

Definition at line 115 of file Expressions.cpp.

◆ operator<<()

template<class T>
std::ostream & Expressions::operator<< ( std::ostream & os,
const SRefAttr< T > & a )
inline

Definition at line 106 of file SRefAttr.h.

References Expressions::SRefAttr< T >::print().

Here is the call graph for this function:

◆ Or()

bool Expressions::Or ( bool a,
bool b )

Definition at line 72 of file Expressions.cpp.

◆ parseAnd()

PtrToScalar< bool > Expressions::parseAnd ( Statement & stat)

Definition at line 707 of file Expressions.cpp.

References Statement::delimiter(), Expressions::SBinary< T, U >::make(), and parseRelation().

Referenced by parseBool().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseArrayFactor()

PtrToArray< double > Expressions::parseArrayFactor ( Statement & stat)

Definition at line 719 of file Expressions.cpp.

References Statement::delimiter(), and parseArrayPrimary().

Referenced by parseArrayTerm().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseArrayPrimary()

PtrToArray< double > Expressions::parseArrayPrimary ( Statement & stat)

Definition at line 731 of file Expressions.cpp.

References Statement::delimiter(), find(), Statement::keyword(), Expressions::SNull< T >::make(), parseColumnGenerator(), parseDelimiter(), parsePlace(), parseReal(), parseRealArray(), parseRealConstArray(), parseRowGenerator(), parseString(), parseStringArray(), parseTableGenerator(), and Statement::real().

Referenced by parseArrayFactor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseArrayTerm()

PtrToArray< double > Expressions::parseArrayTerm ( Statement & stat)

Definition at line 805 of file Expressions.cpp.

References Statement::delimiter(), and parseArrayFactor().

Referenced by parseRealArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseBool()

PtrToScalar< bool > Expressions::parseBool ( Statement & stat)
extern

Parse boolean expression.

Definition at line 343 of file Expressions.cpp.

References Statement::delimiter(), Expressions::SBinary< T, U >::make(), and parseAnd().

Referenced by Attributes::Bool::parse(), parseBoolArray(), Attributes::BoolArray::parseComponent(), and parseRelation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseBoolArray()

PtrToArray< bool > Expressions::parseBoolArray ( Statement & stat)
extern

Parse boolean array expression.

Definition at line 471 of file Expressions.cpp.

References Statement::delimiter(), parseBool(), and parseDelimiter().

Referenced by Attributes::BoolArray::parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseBracketList()

void Expressions::parseBracketList ( Statement & stat,
char close,
std::list< Token > & result )

Definition at line 824 of file Expressions.cpp.

References Statement::atEnd(), Statement::delimiter(), Statement::getCurrent(), Token::isDel(), and parseBracketList().

Referenced by parseBracketList(), and parseTokenList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseColumnGenerator()

PtrToArray< double > Expressions::parseColumnGenerator ( Statement & stat)

Definition at line 1011 of file Expressions.cpp.

References Statement::delimiter(), parseDelimiter(), parseRange(), and parseString().

Referenced by parseArrayPrimary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseDelimiter() [1/2]

void Expressions::parseDelimiter ( Statement & stat,
char delim )
extern

Test for one-character delimiter.

Definition at line 549 of file Expressions.cpp.

References Statement::delimiter().

Referenced by Line::parse(), Object::parse(), OpalElement::parse(), parseArrayPrimary(), OpalParser::parseAssign(), parseBoolArray(), parseColumnGenerator(), Macro::parseFormals(), Line::parseList(), parsePlace(), SequenceParser::parsePosition(), parsePrimary(), parseReference(), parseRelation(), parseRowGenerator(), parseString(), parseStringArray(), parseStringValue(), parseTableGenerator(), parseTableRow(), and parseTokenListArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseDelimiter() [2/2]

void Expressions::parseDelimiter ( Statement & stat,
const char delim[2] )
extern

Test for two-character delimiter.

Definition at line 557 of file Expressions.cpp.

References Statement::delimiter().

Here is the call graph for this function:

◆ parseFactor()

PtrToScalar< double > Expressions::parseFactor ( Statement & stat)

Definition at line 847 of file Expressions.cpp.

References Statement::delimiter(), Expressions::SBinary< T, U >::make(), and parsePrimary().

Referenced by parseTerm().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parsePlace()

PlaceRep Expressions::parsePlace ( Statement & stat)
extern

Parse place specification.

Definition at line 565 of file Expressions.cpp.

References PlaceRep::append(), Statement::delimiter(), Statement::keyword(), parseDelimiter(), parseRealConst(), and parseString().

Referenced by Attributes::Place::parse(), parseArrayPrimary(), parsePrimary(), parseRange(), parseRowGenerator(), and parseTableRow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parsePrimary()

PtrToScalar< double > Expressions::parsePrimary ( Statement & stat)

Definition at line 859 of file Expressions.cpp.

References currentArray, currentTable, Statement::delimiter(), find(), OwnPtr< Object >::isValid(), Expressions::SBinary< T, U >::make(), Expressions::SNull< T >::make(), Expressions::SUnary< T, U >::make(), parseDelimiter(), parsePlace(), parseReal(), parseRealArray(), parseRealConst(), parseString(), and Statement::real().

Referenced by parseFactor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseRange()

RangeRep Expressions::parseRange ( Statement & stat)
extern

Parse range specification.

Definition at line 603 of file Expressions.cpp.

References Statement::delimiter(), Statement::keyword(), and parsePlace().

Referenced by Attributes::Range::parse(), and parseColumnGenerator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseReal()

PtrToScalar< double > Expressions::parseReal ( Statement & stat)
extern

Parse real expression.

Definition at line 355 of file Expressions.cpp.

References Statement::delimiter(), Expressions::SBinary< T, U >::make(), Expressions::SUnary< T, U >::make(), and parseTerm().

Referenced by Attributes::Real::parse(), parseArrayPrimary(), Attributes::RealArray::parseComponent(), parsePrimary(), parseRealConst(), parseRelation(), parseTableExpression(), and parseTableGenerator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseRealArray()

PtrToArray< double > Expressions::parseRealArray ( Statement & stat)
extern

Parse real array expression.

Definition at line 489 of file Expressions.cpp.

References Statement::delimiter(), and parseArrayTerm().

Referenced by Attributes::RealArray::parse(), parseArrayPrimary(), parsePrimary(), and parseRealConstArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseRealConst()

double Expressions::parseRealConst ( Statement & stat)
extern

Parse real constant.

Definition at line 385 of file Expressions.cpp.

References parseReal().

Referenced by Object::parse(), OpalElement::parse(), OpalParser::parseAssign(), parsePlace(), SequenceParser::parsePosition(), parsePrimary(), parseReference(), parseString(), parseStringValue(), and parseTableGenerator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseRealConstArray()

PtrToArray< double > Expressions::parseRealConstArray ( Statement & stat)
extern

Parse real array constant.

Definition at line 519 of file Expressions.cpp.

References parseRealArray().

Referenced by parseArrayPrimary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseReference()

SRefAttr< double > * Expressions::parseReference ( Statement & stat)
extern

Parse variable reference.

Definition at line 615 of file Expressions.cpp.

References Statement::delimiter(), parseDelimiter(), parseRealConst(), and parseString().

Referenced by Attributes::Reference::parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseRelation()

PtrToScalar< bool > Expressions::parseRelation ( Statement & stat)

Definition at line 947 of file Expressions.cpp.

References Statement::boolean(), Statement::delimiter(), BoolConstant::getBool(), OpalData::getInstance(), Expressions::SBinary< T, U >::make(), Statement::mark(), parseBool(), parseDelimiter(), parseReal(), Statement::restore(), and Statement::word().

Referenced by parseAnd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseRowGenerator()

PtrToArray< double > Expressions::parseRowGenerator ( Statement & stat)

Definition at line 1033 of file Expressions.cpp.

References Statement::delimiter(), parseDelimiter(), parsePlace(), parseString(), and parseStringArray().

Referenced by parseArrayPrimary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseString()

std::string Expressions::parseString ( Statement & stat,
const char msg[] )
extern

Parse string value.

Definition at line 390 of file Expressions.cpp.

References Statement::delimiter(), parseDelimiter(), parseRealConst(), Statement::str(), and Statement::word().

Referenced by Line::parse(), Object::parse(), OpalElement::parse(), OpalParser::parse(), OpalParser::parseAction(), parseArrayPrimary(), OpalParser::parseAssign(), parseColumnGenerator(), OpalParser::parseDefine(), Macro::parseFormals(), Line::parseList(), OpalParser::parseMacro(), SequenceParser::parseMember(), parsePlace(), SequenceParser::parsePosition(), parsePrimary(), parseReference(), parseRowGenerator(), and parseTableRow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseStringArray()

std::vector< std::string > Expressions::parseStringArray ( Statement & stat)
extern

Parse string array.

Definition at line 531 of file Expressions.cpp.

References Statement::delimiter(), parseDelimiter(), and parseStringValue().

Referenced by Attributes::StringArray::parse(), Attributes::UpperCaseStringArray::parse(), parseArrayPrimary(), and parseRowGenerator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseStringValue()

std::string Expressions::parseStringValue ( Statement & stat,
const char msg[] )
extern

Definition at line 421 of file Expressions.cpp.

References Statement::delimiter(), OpalData::find(), OpalData::getInstance(), StringConstant::getString(), parseDelimiter(), parseRealConst(), Statement::str(), and Statement::word().

Referenced by Attributes::PredefinedString::parse(), Attributes::String::parse(), Attributes::UpperCaseString::parse(), Attributes::StringArray::parseComponent(), Attributes::UpperCaseStringArray::parseComponent(), and parseStringArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseTableExpression()

PtrToScalar< double > Expressions::parseTableExpression ( Statement & stat,
const Table * t )
extern

Parse table expression (depends on a table's rows).

Definition at line 651 of file Expressions.cpp.

References currentTable, and parseReal().

Here is the call graph for this function:

◆ parseTableGenerator()

PtrToArray< double > Expressions::parseTableGenerator ( Statement & stat)

Definition at line 1055 of file Expressions.cpp.

References currentArray, Statement::delimiter(), parseDelimiter(), parseReal(), and parseRealConst().

Referenced by parseArrayPrimary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseTableRow()

TableRowRep Expressions::parseTableRow ( Statement & stat)
extern

Parse a token list (for macro argument and the like).

Definition at line 642 of file Expressions.cpp.

References parseDelimiter(), parsePlace(), and parseString().

Referenced by Attributes::TableRow::parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseTerm()

PtrToScalar< double > Expressions::parseTerm ( Statement & stat)

Definition at line 992 of file Expressions.cpp.

References Statement::delimiter(), Expressions::SBinary< T, U >::make(), and parseFactor().

Referenced by parseReal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseTokenList()

std::list< Token > Expressions::parseTokenList ( Statement & stat)
extern

Parse a token list (for macro argument and the like).

Definition at line 658 of file Expressions.cpp.

References Statement::atEnd(), Statement::getCurrent(), Token::isDel(), Statement::mark(), parseBracketList(), and Statement::restore().

Referenced by Attributes::TokenList::parse(), Attributes::TokenListArray::parseComponent(), and parseTokenListArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseTokenListArray()

std::vector< std::list< Token > > Expressions::parseTokenListArray ( Statement & stat)
extern

Parse a token list array (for LIST commands).

Definition at line 688 of file Expressions.cpp.

References Statement::delimiter(), parseDelimiter(), and parseTokenList().

Referenced by Attributes::TokenListArray::parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ranf()

double Expressions::ranf ( )

Definition at line 180 of file Expressions.cpp.

References Options::rangen.

◆ Rmsa()

double Expressions::Rmsa ( const std::vector< double > & array)

Definition at line 262 of file Expressions.cpp.

References Options::warn.

◆ Sign()

double Expressions::Sign ( double a)

Definition at line 121 of file Expressions.cpp.

◆ Sub()

double Expressions::Sub ( double a,
double b )

Definition at line 139 of file Expressions.cpp.

◆ Tgauss()

double Expressions::Tgauss ( double a)

Definition at line 125 of file Expressions.cpp.

References Options::rangen.

Variable Documentation

◆ currentArray

OwnPtr<ATable> Expressions::currentArray

Definition at line 298 of file Expressions.cpp.

Referenced by parsePrimary(), and parseTableGenerator().

◆ currentTable

const Table* Expressions::currentTable = 0

Definition at line 297 of file Expressions.cpp.

Referenced by parsePrimary(), and parseTableExpression().