about summary refs log tree commit diff
path: root/src/fix-ng/fix.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-10-29T16·05+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-10-29T16·05+0000
commitb95a3dc45bcbbe8a0985bab82146ed00afcf0239 (patch)
tree75ec3e901b3af65a814770aae807c790d20eff1d /src/fix-ng/fix.cc
parent4d728f6a36c83ff684426788df775b385fae9e88 (diff)
* Basic grammar and parser for the Fix language. We use libsglr and
  friends to do the parsing.  The parse table is embedded in the Fix
  executable using bin2c, which converts an arbitrary file into a C
  character array.

Diffstat (limited to 'src/fix-ng/fix.cc')
-rw-r--r--src/fix-ng/fix.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/fix-ng/fix.cc b/src/fix-ng/fix.cc
index 9a8ff1513042..e13413bb4ad4 100644
--- a/src/fix-ng/fix.cc
+++ b/src/fix-ng/fix.cc
@@ -1,13 +1,12 @@
 #include <map>
 #include <iostream>
 
+#include "parser.hh"
 #include "globals.hh"
 #include "normalise.hh"
 #include "shared.hh"
 
 
-typedef ATerm Expr;
-
 typedef map<ATerm, ATerm> NormalForms;
 typedef map<Path, PathSet> PkgPaths;
 typedef map<Path, Hash> PkgHashes;
@@ -406,9 +405,7 @@ static Expr evalFile(EvalState & state, const Path & relPath)
 {
     Path path = searchPath(state.searchDirs, relPath);
     Nest nest(lvlTalkative, format("evaluating file `%1%'") % path);
-    Expr e = ATreadFromNamedFile(path.c_str());
-    if (!e) 
-        throw Error(format("unable to read a term from `%1%'") % path);
+    Expr e = parseExprFromFile(path);
     return evalExpr(state, e);
 }