ATLAS Offline Software
Loading...
Searching...
No Matches
ExpressionParser.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6// ExpressionParser.h, (c) ATLAS Detector software
8// Author: Thomas Gillam (thomas.gillam@cern.ch)
9// ExpressionParsing library
11
12#ifndef EXPRESSION_PARSER_H
13#define EXPRESSION_PARSER_H
14
19
22
23#include <sstream>
24#include <stdexcept>
25
27 class VirtualMachine;
28
30 {
31 public:
33 ExpressionParser(IProxyLoader *proxyLoader);
34 ExpressionParser(IUnitInterpreter *unitInterpreter);
35 ExpressionParser(IProxyLoader *proxyLoader, IUnitInterpreter *unitInterpreter);
37
40
41 bool loadExpression(const std::string &expression);
42 StackElement evaluate() const;
43 bool evaluateAsBool() const;
44 double evaluateAsDouble() const;
45 std::vector<int> evaluateAsVector() const;
46 std::vector<std::string> getVariables() const;
47
48 private:
49 void setup();
50
51 private:
54 std::vector<StackElement> m_code;
55 VirtualMachine *m_vm;
56 };
57}
58
59#endif // EXPRESSION_PARSER_H
Manage index tracking and synchronization of auxiliary data.
Handle class for reading a decoration on an object.
std::vector< StackElement > m_code
ExpressionParser & operator=(const ExpressionParser &)=delete
std::vector< int > evaluateAsVector() const
bool loadExpression(const std::string &expression)
std::vector< std::string > getVariables() const
ExpressionParser(const ExpressionParser &)=delete
Class describing a single element in a text expression.
Namespace holding all the expression evaluation code.