Added methods for finding a given module in the DDL map (F. Prino)
[u/mrichter/AliRoot.git] / STEER / AliExpression.h
CommitLineData
a5a091ce 1#ifndef ALIEXPRESSION_H
2#define ALIEXPRESSION_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
8
9///////////////////////////////////////////////////////////////////////////////
10// //
11// AliExpression Class // //
12// //
13///////////////////////////////////////////////////////////////////////////////
14
15#include <TObject.h>
16class TString;
17class TObjArray;
18
19// These are the valid operators types.
20
92c1978f 21enum { kOpAND=1, // AND '&'
a5a091ce 22 kOpOR, // OR '|'
23 kOpNOT }; // Unary negation '!'
24
25class AliExpression : public TObject {
26
27public:
92c1978f 28 AliExpression() : fVname(0), fArg1(0), fArg2(0), fOperator(0) {}
a5a091ce 29 AliExpression( TString exp );
30 virtual ~AliExpression();
31 AliExpression( const AliExpression& exp ) : TObject( exp ),
92c1978f 32 fVname(exp.fVname),
33 fArg1(exp.fArg1), fArg2(exp.fArg2),
34 fOperator(exp.fOperator) {}
a5a091ce 35 AliExpression& operator=(const AliExpression& exp);
36
51f6d619 37 virtual Bool_t Value( const TObjArray & vars );
a5a091ce 38 virtual TString Unparse() const;
39
92c1978f 40 TString fVname; // Variable name
41
a5a091ce 42private:
43 AliExpression* fArg1; // left argument
44 AliExpression* fArg2; // right argument
45 Int_t fOperator; // operator
46
47 AliExpression( int op, AliExpression* a );
48 AliExpression( int op, AliExpression* a, AliExpression* b );
49
50 TObjArray* Tokenize( TString str ) const;
51 static AliExpression* Element( TObjArray &st, Int_t &i );
52 static AliExpression* Primary( TObjArray &st, Int_t &i );
53 static AliExpression* Expression( TObjArray &st, Int_t &i );
54
92c1978f 55 ClassDef( AliExpression, 2 ) // Class to evaluate an expression
a5a091ce 56};
57
58
59
60
61///////////////////////////////////////////////////////////////////////////
62
63class AliVariableExpression: public AliExpression {
64public:
92c1978f 65 AliVariableExpression( TString a ): AliExpression() { fVname = a; };
a5a091ce 66 ~AliVariableExpression() {}
51f6d619 67 virtual Bool_t Value( const TObjArray& pgm );
a5a091ce 68 virtual TString Unparse() const { return fVname; }
69
92c1978f 70 ClassDef( AliVariableExpression, 2 ) // Class to define a variable expression
a5a091ce 71};
72
73#endif