final pass to update instruction encoding; should now match the spec
[fleet.git] / contrib / f0 / Main.lhs
diff --git a/contrib/f0/Main.lhs b/contrib/f0/Main.lhs
new file mode 100644 (file)
index 0000000..f81a0b9
--- /dev/null
@@ -0,0 +1,36 @@
+\begin{code}
+
+{-
+ next step:
+
+  - Transform code involving standing moves into two sequential
+    blocks: setup and teardown.  Then establish proper sequencing
+    between them.  The teardown block consists only of kills.
+
+  - Implement sequencing.
+-}
+
+module Main
+where
+import SBP
+import Types
+import Util
+import Fleet
+import Compile
+
+main = do t <- parseFile "src/edu/berkeley/fleet/f0/f0.g" "contrib/demo.f0"
+          putStrLn ""
+          putStrLn $ show $ coalesceFlatHeadlessNodes t
+          putStrLn ""
+          putStrLn $ join "\n\n" $ map show $ ((fromTree $ coalesceFlatHeadlessNodes t) :: [Def])
+          putStrLn ""
+          compiled <- return $ join "\n\n" $ map compileDef $ ((fromTree $ coalesceFlatHeadlessNodes t) :: [Def])
+          putStrLn $ compiled
+          writeFile "compiled.fleet" ("// compiled with f0\n\n"++compiled++"\n")
+          putStrLn ""
+
+\end{code}
+
+
+
+