diff options
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm/program.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/program.lux | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/program.lux b/new-luxc/source/luxc/lang/translation/jvm/program.lux deleted file mode 100644 index 7ac897009..000000000 --- a/new-luxc/source/luxc/lang/translation/jvm/program.lux +++ /dev/null @@ -1,82 +0,0 @@ -(.module: - [lux #* - [target - [jvm - ["$t" type]]]] - [luxc - [lang - [host - ["_" jvm - ["$d" def] - ["$i" inst]]] - [translation - ["." jvm - ["." runtime]]]]]) - -(def: #export class "LuxProgram") - -(def: ^Object ($t.class "java.lang.Object" (list))) - -(def: #export (program programI) - (-> _.Inst _.Definition) - (let [nilI runtime.noneI - num-inputsI (|>> ($i.ALOAD 0) $i.ARRAYLENGTH) - decI (|>> ($i.int +1) $i.ISUB) - headI (|>> $i.DUP - ($i.ALOAD 0) - $i.SWAP - $i.AALOAD - $i.SWAP - $i.DUP_X2 - $i.POP) - pairI (|>> ($i.int +2) - ($i.ANEWARRAY ..^Object) - $i.DUP_X1 - $i.SWAP - ($i.int +0) - $i.SWAP - $i.AASTORE - $i.DUP_X1 - $i.SWAP - ($i.int +1) - $i.SWAP - $i.AASTORE) - consI (|>> ($i.int +1) - ($i.string "") - $i.DUP2_X1 - $i.POP2 - runtime.variantI) - prepare-input-listI (<| $i.with-label (function (_ @loop)) - $i.with-label (function (_ @end)) - (|>> nilI - num-inputsI - ($i.label @loop) - decI - $i.DUP - ($i.IFLT @end) - headI - pairI - consI - $i.SWAP - ($i.GOTO @loop) - ($i.label @end) - $i.POP)) - feed-inputsI ($i.INVOKEVIRTUAL jvm.$Function runtime.apply-method (runtime.apply-signature 1)) - run-ioI (|>> ($i.CHECKCAST jvm.$Function) - $i.NULL - ($i.INVOKEVIRTUAL jvm.$Function runtime.apply-method (runtime.apply-signature 1))) - main-type ($t.method [(list ($t.array ($t.class "java.lang.String" (list)))) - $t.void - (list)])] - [..class - ($d.class #_.V1_6 - #_.Public _.finalC - ..class - (list) ..^Object - (list) - (|>> ($d.method #_.Public _.staticM "main" main-type - (|>> programI - prepare-input-listI - feed-inputsI - run-ioI - $i.RETURN))))])) |