about summary refs log tree commit diff
path: root/src/fix-ng/eval.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/fix-ng/eval.hh')
-rw-r--r--src/fix-ng/eval.hh31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/fix-ng/eval.hh b/src/fix-ng/eval.hh
new file mode 100644
index 000000000000..5fcb648a7403
--- /dev/null
+++ b/src/fix-ng/eval.hh
@@ -0,0 +1,31 @@
+#ifndef __EVAL_H
+#define __EVAL_H
+
+#include <map>
+
+#include "fix-expr.hh"
+
+
+typedef map<Expr, Expr> NormalForms;
+//typedef map<Path, PathSet> PkgPaths;
+//typedef map<Path, Hash> PkgHashes;
+
+struct EvalState 
+{
+    NormalForms normalForms;
+    //    PkgPaths pkgPaths;
+    //    PkgHashes pkgHashes; /* normalised package hashes */
+    Expr blackHole;
+
+    EvalState();
+};
+
+
+/* Evaluate an expression to normal form. */
+Expr evalExpr(EvalState & state, Expr e);
+
+/* Evaluate an expression read from the given file to normal form. */
+Expr evalFile(EvalState & state, const Path & path);
+
+
+#endif /* !__EVAL_H */