diff options
author | Eduardo Julian | 2017-06-12 21:14:55 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-06-12 21:14:55 -0400 |
commit | 9cd2927a4f6175784e081d6b512d3e900c8069e7 (patch) | |
tree | d1fe512bc84ea1e3a50ad86eeb3265771edd23c6 /new-luxc/source/luxc/compiler/expr.jvm.lux | |
parent | c50667a431a5ca67328a230f0c59956dc6ff43fa (diff) |
- Renamed the "compilation" phase as the "generation" phase.
- Implemented compilation of primitives.
- Implemented compilation of structures.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/compiler/expr.jvm.lux | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/new-luxc/source/luxc/compiler/expr.jvm.lux b/new-luxc/source/luxc/compiler/expr.jvm.lux deleted file mode 100644 index b2e4923c4..000000000 --- a/new-luxc/source/luxc/compiler/expr.jvm.lux +++ /dev/null @@ -1,62 +0,0 @@ -(;module: - lux - (lux (control monad) - (data text/format) - [macro #+ Monad<Lux> "Lux/" Monad<Lux>] - [host #+ jvm-import]) - (luxc ["&" base] - (lang ["la" analysis] - ["ls" synthesis]) - ["&;" analyser] - ["&;" synthesizer] - (compiler ["&;" common]))) - -(jvm-import #long java.lang.Object) - -(jvm-import org.objectweb.asm.Opcodes) - -(jvm-import org.objectweb.asm.MethodVisitor - (visitLdcInsn [Object] void)) - -(def: unit-value Text "\u0000unit\u0000") - -(def: (compiler-literal value) - (-> Top (Lux &common;Compiled)) - (do Monad<Lux> - [visitor &common;get-visitor - #let [_ (MethodVisitor.visitLdcInsn [(:! java.lang.Object value)])]] - (wrap []))) - -(def: (compile-synthesis synthesis) - (-> ls;Synthesis (Lux &common;Compiled)) - (case synthesis - #ls;Unit - (compiler-literal &common;unit-value) - - (^template [<tag>] - (<tag> value) - (compiler-literal value)) - ([#ls;Bool] - [#ls;Nat] - [#ls;Int] - [#ls;Deg] - [#ls;Real] - [#ls;Char] - [#ls;Text]) - - _ - (macro;fail "Unrecognized synthesis."))) - -(def: (eval type code) - &;Eval - (undefined)) - -(def: analyse - &;Analyser - (&analyser;analyser eval)) - -(def: #export (compile input) - (-> Code (Lux &common;Compiled)) - (do Monad<Lux> - [analysis (analyse input)] - (compile-synthesis (&synthesizer;synthesize analysis)))) |