* Factor out evaluation into a separate file.

This commit is contained in:
Eelco Dolstra 2003-10-30 16:48:26 +00:00
parent 9f8f39aa3c
commit 403cb9327f
4 changed files with 87 additions and 56 deletions

31
src/fix-ng/eval.hh Normal file
View file

@ -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 */