Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

JBLParserResult Class Reference

#include <JBLParserResult.h>

Collaboration diagram for JBLParserResult:

Collaboration graph
[legend]
List of all members.

Detailed Description

Returns the result of parsing a string that defines a function object.

This class is used to parse a string that defines a function object, be it an IntFun, a FloatFun, or a BaseCut.

The nomenclature of the various subroutines follows the syntax given in appendix A13 of B.W.KERNIGHAN & D.M.RITCHIE: The C programming language (2nd ed). - London (Prentice Hall) 1988.

Author: Benno List, Jenny List

Date
2005/07/21 11:20:12
Author
blist

Changelog:

Definition at line 46 of file JBLParserResult.h.

Public Types

typedef Float_FF(* Fun_f_f )(Float_FF)
typedef Float_FF(* Fun_f_f_f )(Float_FF, Float_FF)
typedef Float_FF(* Fun_f_f_i )(Float_FF, Float_FF)
typedef int(* Fun_i_i )(int)
typedef bool(* Fun_b_b )(bool)
typedef FloatFun &(* Fun_FF_FF )(const FloatFun &)
typedef FloatFun &(* Fun_FF_FF_FF )(const FloatFun &, const FloatFun &)
typedef FloatFun &(* Fun_FF_FF_IF )(const FloatFun &, const IntFun &)
typedef IntFun &(* Fun_IF_IF )(const IntFun &)
typedef BaseCut &(* Fun_BC_BC )(const BaseCut &)

Public Member Functions

 JBLParserResult ()
 Default constructor (type EMPTY).

 JBLParserResult (const JBLParserResult &rhs)
 Copy Constructor.

 ~JBLParserResult ()
 Destructor.

JBLParserResultoperator= (const JBLParserResult &rhs)
 Assignment operator.

bool isEmpty () const
 Signals whether object is empty.

bool isNumber () const
 Signals whether object is a number (int or float).

bool isInt () const
 Signals whether object is an integer.

bool isFloat () const
 Signals whether object is a float.

bool isBool () const
 Signals whether object is a bool.

bool isIntFun () const
 Signals whether object is an IntFun.

bool isFloatFun () const
 Signals whether object is a FloatFun.

bool isFun () const
 Signals whether object is any function object (IntFun or FloatFun).

bool isBaseCut () const
 Signals whether object is a BaseCut.

bool isIdentifier () const
 Signals whether object is an identifier.

int listlength () const
 Gives back the list of the argument list.

const std::string & getName () const
 Returns the name.

int getIntValue () const
 Returns the integer value (0 if not of type INT).

Float_FF getFloatValue () const
 Returns the Float_FF value (0 if not of type INT or FLOAT).

bool getBoolValue () const
 Returns the bool value (false if not of type BOOL).

IntFungetIntFunValue () const
 Returns the IntFun value (0 if not of type INT or INTFUN).

FloatFungetFloatFunValue () const
 Returns the FloatFun value (0 if not of type INT or FLOAT or INTFUN or FLOATFUN).

BaseCutgetBaseCutValue () const
 Returns the BaseCut value (0 if not of type BOOL or BASECUT).

std::ostream & print (std::ostream &os) const
 Print the object's definition.

JBLParserResultaddCopyToList (const JBLParserResult &rhs)
 Add a copy of rhs to the end of the argument list.


Static Public Member Functions

JBLParserResult parseExpression (const std::string &input)
 Parses a string expression.

JBLParserResult parseExpression (std::istream &is)
 Parses a string expression.

void initMaps ()

Private Types

enum  Type {
  EMPTY = 0, INT = 1, FLOAT = 2, NUMBER = 3,
  BOOL = 4, INTFUN = 8, FLOATFUN = 16, FUN = 24,
  BASECUT = 32, IDENTIFIER = 64
}

Private Member Functions

 JBLParserResult (int intvalue_)
 Constructor from an int (type INT).

 JBLParserResult (Float_FF floatvalue_)
 Constructor from a Float_FF (type FLOAT).

 JBLParserResult (bool boolvalue_)
 Constructor from a bool (type BOOL).

 JBLParserResult (IntFun &intfunvalue_)
 Constructor from an IntFun (type INTFUN).

 JBLParserResult (FloatFun &floatfunvalue_)
 Constructor from a FloatFun (type FLOATFUN).

 JBLParserResult (BaseCut &basecutvalue_)
 Constructor from a BaseCut (type BASECUT).

 JBLParserResult (const std::string &name_)
 Constructor from a string (type IDENTIFIER).


Static Private Member Functions

JBLParserResult expression (std::istream &is)
JBLParserResult assignment_expression (std::istream &is)
JBLParserResult conditional_expression (std::istream &is)
JBLParserResult logical_OR_expression (std::istream &is)
JBLParserResult logical_AND_expression (std::istream &is)
JBLParserResult inclusive_OR_expression (std::istream &is)
JBLParserResult exclusive_OR_expression (std::istream &is)
JBLParserResult AND_expression (std::istream &is)
JBLParserResult equality_expression (std::istream &is)
JBLParserResult relational_expression (std::istream &is)
JBLParserResult shift_expression (std::istream &is)
JBLParserResult additive_expression (std::istream &is)
JBLParserResult multiplicative_expression (std::istream &is)
JBLParserResult cast_expression (std::istream &is)
JBLParserResult unary_expression (std::istream &is)
JBLParserResult postfix_expression (std::istream &is)
JBLParserResult primary_expression (std::istream &is)
JBLParserResult argument_expression_list (std::istream &is)
JBLParserResult syntaxError (const std::string &text)
template<class T1, class T2> JBLParserResult comparison (int op, const T1 &lhs, const T2 &rhs)
JBLParserResult makeoperation (int op, const std::string &opname, JBLParserResult &lhs, JBLParserResult &rhs)
JBLParserResult makefloatfunction (const std::string &fname, JBLParserResult &arglist)

Private Attributes

Type type
int intvalue
Float_FF floatvalue
bool boolvalue
IntFunintfunvalue
FloatFunfloatfunvalue
BaseCutbasecutvalue
std::string name
JBLParserResultnext

Static Private Attributes

JBLToken token

Related Functions

(Note that these are not member functions.)

std::istream & operator>> (std::istream &is, JBLParserResult &result)
 Input a token.


Constructor & Destructor Documentation

JBLParserResult::JBLParserResult int  intvalue_  )  [private]
 

Constructor from an int (type INT).

Parameters:
intvalue_  The integer value

Definition at line 59 of file JBLParserResult.C.

JBLParserResult::JBLParserResult Float_FF  floatvalue_  )  [private]
 

Constructor from a Float_FF (type FLOAT).

Parameters:
floatvalue_  The Float_FF value

Definition at line 65 of file JBLParserResult.C.

JBLParserResult::JBLParserResult bool  boolvalue_  )  [private]
 

Constructor from a bool (type BOOL).

Parameters:
boolvalue_  The bool value

Definition at line 71 of file JBLParserResult.C.

JBLParserResult::JBLParserResult IntFun intfunvalue_  )  [private]
 

Constructor from an IntFun (type INTFUN).

Parameters:
intfunvalue_  The IntFun

Definition at line 77 of file JBLParserResult.C.

JBLParserResult::JBLParserResult FloatFun floatfunvalue_  )  [private]
 

Constructor from a FloatFun (type FLOATFUN).

Parameters:
floatfunvalue_  The FloatFun

Definition at line 83 of file JBLParserResult.C.

JBLParserResult::JBLParserResult BaseCut basecutvalue_  )  [private]
 

Constructor from a BaseCut (type BASECUT).

Parameters:
basecutvalue_  The BaseCut

Definition at line 89 of file JBLParserResult.C.

JBLParserResult::JBLParserResult const std::string &  name_  )  [private]
 

Constructor from a string (type IDENTIFIER).

Parameters:
name_  The identifier name

Definition at line 95 of file JBLParserResult.C.


Member Function Documentation

std::ostream & JBLParserResult::print std::ostream &  os  )  const
 

Print the object's definition.

Parameters:
os  The output stream

Definition at line 851 of file JBLParserResult.C.

References getBaseCutValue(), getBoolValue(), getFloatFunValue(), getFloatValue(), getIntFunValue(), getIntValue(), getName(), NamedO::getName(), isBaseCut(), isBool(), isEmpty(), isFloat(), isFloatFun(), isIdentifier(), isInt(), and isIntFun().

Referenced by operator<<().

JBLParserResult & JBLParserResult::addCopyToList const JBLParserResult rhs  ) 
 

Add a copy of rhs to the end of the argument list.

Parameters:
rhs  The additional element

Definition at line 103 of file JBLParserResult.C.

References JBLParserResult(), name, and next.


The documentation for this class was generated from the following files:
Generated on Thu Oct 26 12:54:48 2006 for SFH by doxygen 1.3.2