comparison compile_old.rhope @ 114:25a205094f9b

More performance optimizations
author Mike Pavone <pavone@retrodev.com>
date Wed, 13 Oct 2010 01:15:04 +0000
parents
children
comparison
equal deleted inserted replaced
110:336da6ce8174 114:25a205094f9b
1 Import parser_old.rhope
2
3 Main[args]
4 {
5 fname <- [args]Index[1]
6 {
7 file <- <String@File[~]
8 ,text <- [file]Get FString[[file]Length]
9 params <- New@Parser[]
10 Print[["Parsing "]Append[fname]]
11 Null[text, params, New@Parse Program[], 0]
12 {
13 Print["Parsing imports"]
14 Process Imports[~, params]
15 {
16 tree <- [~]Workers << [ Map[[~]Workers >>, ["Check Worker Literals"]Set Input[1, ~]] ]
17 { Print["Compiling"] }
18 }
19 compiled <- [Tree to Program Native[tree]]Compile Program[C Program[]]
20 { Print["Compiled program to backend"] }
21 outfile <- <String@File[ [fname]Append[".c"] ]
22 [outfile]Put String[ [compiled]Text ]
23 { Print[["Wrote output to "]Append[ [fname]Append[".c"] ]] }
24 }
25 }{
26 REPL[New@Parser[]]
27 }
28 }
29