aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ConstantEvaluator.h
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/ConstantEvaluator.h')
-rw-r--r--libsolidity/ConstantEvaluator.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/libsolidity/ConstantEvaluator.h b/libsolidity/ConstantEvaluator.h
new file mode 100644
index 00000000..cf3d2094
--- /dev/null
+++ b/libsolidity/ConstantEvaluator.h
@@ -0,0 +1,50 @@
+/*
+ This file is part of cpp-ethereum.
+
+ cpp-ethereum is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ cpp-ethereum is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
+*/
+/**
+ * @author Christian <c@ethdev.com>
+ * @date 2015
+ * Evaluator for types of constant expressions.
+ */
+
+#pragma once
+
+#include <libsolidity/ASTVisitor.h>
+
+namespace dev
+{
+namespace solidity
+{
+
+class TypeChecker;
+
+/**
+ * Small drop-in replacement for TypeChecker to evaluate simple expressions of integer constants.
+ */
+class ConstantEvaluator: private ASTConstVisitor
+{
+public:
+ ConstantEvaluator(Expression const& _expr) { _expr.accept(*this); }
+
+private:
+ virtual void endVisit(BinaryOperation const& _operation);
+ virtual void endVisit(UnaryOperation const& _operation);
+ virtual void endVisit(Literal const& _literal);
+
+};
+
+}
+}
3-07-052-1/+53 * accessibility/at-spi2-core: update to 2.46.0Tobias C. Berner2023-03-021-1/+1 * net/unison240: Remove unneeded RUN_DEPENDS on ocaml-lablgtk2.Guido Falsi2022-11-261-2/+1 * Remove WWW entries moved into port MakefilesStefan Eßer2022-09-081-2/+0 * Add WWW entries to port MakefilesStefan Eßer2022-09-081-0/+1 * net: remove 'Created by' linesTobias C. Berner2022-07-201-2/+0 * net/unison2{32,40}: unbreak against immutable strings in OCaml 4.06+.Alexey Dokuchaev2021-09-272-4/+29 * Remove # $FreeBSD$ from Makefiles.Mathieu Arnold2021-04-061-1/+0 * - Update x11-toolkits/ocaml-lablgtk2 to 2.18.11 [1]Guido Falsi2020-11-162-3/+21 * - Fix LICENSEDmitry Marakasov2020-05-022-2/+3 * net/unison*, audio/asterisk-*: Set FLAVOR to a non-empty value by defaultTobias Kortkamp2019-11-251-1/+1 * net: Add missing USES={gnome,php}Tobias Kortkamp2019-11-081-1/+1 * Convert to UCL & cleanup pkg-message (categories n)Mathieu Arnold2019-08-142-4/+12 * Unbreak the build against modern versions of OCaml.Alexey Dokuchaev2019-06-201-0/+5 * - Add x11/nox11 flavors to old unison portsGuido Falsi2018-04-122-28/+44 * Remove WANT_GNOME and HAVE_GNOME.Mathieu Arnold2017-10-121-1/+0 * Fix options helperSunpoet Po-Chuan Hsieh2017-05-291-1/+3 * - Convert unison ports to option helpersGuido Falsi2017-03-081-22/+15 * When there is a do-install target, do not use a post-install target, doMathieu Arnold2016-07-191-1/+0 * Do not attempt to create ${STAGEDIR}${DESKTOPDIR}: `share/applications'Alexey Dokuchaev2016-04-161-1/+0 * Remove ${PORTSDIR}/ from dependencies, categories m, n, o, and p.Mathieu Arnold2016-04-011-3/+3 * Cleanup DIST* variables.Mathieu Arnold2015-05-121-4/+4 * - Add USE_OCAML_CAMLP4 and USE_OCAML_TK to bsd.ocaml.mk which addGuido Falsi2015-05-041-3/+3 * Update checksum files. Distfiles were rerolled.Guido Falsi2015-03-171-5/+5 * - Fix dependency on ocaml to avoid conflicting oringins when buildingGuido Falsi2015-03-171-6/+4