ATLAS Offline Software
Loading...
Searching...
No Matches
ExpressionParser.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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 StackElement evaluate(const EventContext& ctx) const;
44 bool evaluateAsBool() const;
45 double evaluateAsDouble() const;
46 std::vector<int> evaluateAsVector() const;
47 std::vector<std::string> getVariables() const;
48
49 private:
50 void setup();
51
52 private:
55 std::vector<StackElement> m_code;
56 VirtualMachine *m_vm;
57 };
58}
59
60#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.