library: libRooFit #include "RooStreamParser.h"

# RooStreamParser

class description - source file - inheritance tree (.pdf)

## class RooStreamParser

| Inheritance Chart:
`RooStreamParser` |

        public:

                          RooStreamParser(istream& is)
                          RooStreamParser(istream& is, const TString& errPrefix)
                  virtual ~RooStreamParser()
                   Bool_t atEOF()
                   Bool_t atEOL()
           static TClass* Class()
                   Bool_t convertToDouble(const TString& token, Double_t& value)
                   Bool_t convertToInteger(const TString& token, Int_t& value)
                   Bool_t convertToString(const TString& token, TString& string)
                   Bool_t expectToken(const TString& expected, Bool_t zapOnError = kFALSE)
                  TString getPunctuation() const
          virtual TClass* IsA() const
                   Bool_t isPunctChar(char c) const
                   Bool_t readDouble(Double_t& value, Bool_t zapOnError = kFALSE)
                   Bool_t readInteger(Int_t& value, Bool_t zapOnError = kFALSE)
                  TString readLine()
                   Bool_t readString(TString& value, Bool_t zapOnError = kFALSE)
                  TString readToken()
                     void setPunctuation(const TString& punct)
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)
                     void zapToEnd(Bool_t inclContLines = kFALSE)

### Data Members

        protected:

          istream& _is
            Bool_t _atEOL
            Bool_t _atEOF
           TString _prefix
           TString _punct

## Class Description

     The general tokenizing philosophy is that there are two kinds of tokens: value
     and punctuation. The former are variable length, the latter always
     one character. A token is terminated if one of the following conditions
     occur
             - space character found (' ',tab,newline)
             - change of token type (value -> punctuation or vv)
             - end of fixed-length token (punctuation only)
             - start or end of quoted string

     The parser is aware of floating point notation and will assign leading
     minus signs, decimal points etc to a value token when this is obvious
     from the context. The definition of what is punctuation can be redefined.

RooStreamParser(istream& is) : _is(is), _atEOF(kFALSE), _prefix(""), _punct("()[]<>|/\\:?.,=+-&^%$#@!`~")

     Constructor

RooStreamParser(istream& is, const TString& errorPrefix) : _is(is), _atEOF(kFALSE), _prefix(errorPrefix), _punct("()[]<>|/\\:?.,=+-&^%$#@!`~")

     Constructor with error message prefix

~RooStreamParser()

     Destructor

void setPunctuation(const TString& punct)

     Change list of punctuation characters

Bool_t isPunctChar(char c) const

     Check if given char is considered punctuation

TString readToken()

     Read one token

TString readLine()

     Read an entire line

void zapToEnd(Bool_t inclContLines)

     Skip over everything until the end of the current line

Bool_t expectToken(const TString& expected, Bool_t zapOnError)

     Read a token and check if it matches the given expected value

Bool_t readDouble(Double_t& value, Bool_t /*zapOnError*/)

     Read a token and convert it to a Double_t

Bool_t convertToDouble(const TString& token, Double_t& value)

     Convert given string to a double

Bool_t readInteger(Int_t& value, Bool_t /*zapOnError*/)

     Read a token and convert it to an Int_t

Bool_t convertToInteger(const TString& token, Int_t& value)

     Convert given string to an Int_t

Bool_t readString(TString& value, Bool_t /*zapOnError*/)

     Read a string token

Bool_t convertToString(const TString& token, TString& string)

     Convert given token to a string (i.e. remove eventual quotation marks)

### Inline Functions

                TString getPunctuation() const
                 Bool_t atEOL()
                 Bool_t atEOF()
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)

Last update: Tue Jun 28 18:15:20 2005
Copyright (c) 2000-2005, Regents of the University of California *