* Factor out evaluation into a separate file.
This commit is contained in:
		
							parent
							
								
									9f8f39aa3c
								
							
						
					
					
						commit
						403cb9327f
					
				
					 4 changed files with 87 additions and 56 deletions
				
			
		
							
								
								
									
										31
									
								
								src/fix-ng/eval.hh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								src/fix-ng/eval.hh
									
										
									
									
									
										Normal 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 */ | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue