diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-10-31T17·09+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-10-31T17·09+0000 |
commit | 9210d4d530b68b5f19ac7062f129c88ccdc03e04 (patch) | |
tree | 7c6033dba3915c1f16bde9a72531157f6f1eebac /src/fix-ng/fix-expr.hh | |
parent | f1c1a3c97f1dc81b2d9b19f58589b4b8a5ed196e (diff) |
* Working evaluator.
* Mutually recursive attribute sets. * Print evaluator efficiency statistics.
Diffstat (limited to 'src/fix-ng/fix-expr.hh')
-rw-r--r-- | src/fix-ng/fix-expr.hh | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/fix-ng/fix-expr.hh b/src/fix-ng/fix-expr.hh index 5c50e9170fe5..700f7beca906 100644 --- a/src/fix-ng/fix-expr.hh +++ b/src/fix-ng/fix-expr.hh @@ -1,6 +1,8 @@ #ifndef __FIXEXPR_H #define __FIXEXPR_H +#include <map> + #include <aterm2.h> #include "util.hh" @@ -15,13 +17,27 @@ typedef ATerm Expr; /* Generic bottomup traversal over ATerms. The traversal first recursively descends into subterms, and then applies the given term function to the resulting term. */ - struct TermFun { virtual ATerm operator () (ATerm e) = 0; }; - ATerm bottomupRewrite(TermFun & f, ATerm e); +/* Query all attributes in an attribute set expression. The + expression must be in normal form. */ +typedef map<string, Expr> Attrs; +void queryAllAttrs(Expr e, Attrs & attrs); + +/* Query a specific attribute from an attribute set expression. The + expression must be in normal form. */ +Expr queryAttr(Expr e, const string & name); + +/* Create an attribute set expression from an Attrs value. */ +Expr makeAttrs(const Attrs & attrs); + +/* Perform a set of substitutions on an expression. */ +typedef map<string, Expr> Subs; +ATerm substitute(Subs & subs, ATerm e); + #endif /* !__FIXEXPR_H */ |