Permalink
Browse files

Remove non-dotnet backends, including nam; its role will be filled later

  • Loading branch information...
1 parent eefe939 commit c984628b5c319be03bc4725c7016b7651e816775 @sorear committed Sep 15, 2011
Showing with 27 additions and 98 deletions.
  1. +1 −6 Makefile
  2. +0 −17 src/NieczaBackendClisp.pm6
  3. +25 −2 src/NieczaBackendDotnet.pm6
  4. +0 −17 src/NieczaBackendHoopl.pm6
  5. +0 −43 src/NieczaBackendNAM.pm6
  6. +1 −13 src/niecza
View
@@ -17,8 +17,7 @@ csbackend=CLRBackend.cs
libunits=CORE JSYNC
srcunits=CClass CgOp Op OpHelpers Sig RxOp STD NieczaGrammar Metamodel \
OptRxSimple NAMOutput Operator NieczaActions NieczaFrontendSTD \
- NieczaPassSimplifier OptBeta NieczaPathSearch NieczaBackendNAM \
- NieczaBackendDotnet NieczaBackendClisp NieczaBackendHoopl \
+ NieczaPassSimplifier OptBeta NieczaPathSearch NieczaBackendDotnet \
NieczaCompiler GetOptLong
all: run/Niecza.exe obj/Kernel.dll obj/CORE.nam obj/CLRBackend.exe
@@ -135,11 +134,7 @@ boot/obj/NieczaActions.nam: boot/obj/Sig.nam
boot/obj/NieczaActions.nam: boot/obj/CClass.nam
boot/obj/NieczaActions.nam: boot/obj/OpHelpers.nam
boot/obj/NieczaActions.nam: boot/obj/Operator.nam
-boot/obj/NieczaBackendClisp.nam: boot/obj/NieczaBackendNAM.nam
-boot/obj/NieczaBackendDotnet.nam: boot/obj/NieczaBackendNAM.nam
boot/obj/NieczaBackendDotnet.nam: boot/obj/NAMOutput.nam
-boot/obj/NieczaBackendHoopl.nam: boot/obj/NieczaBackendNAM.nam
-boot/obj/NieczaBackendNAM.nam: boot/obj/NAMOutput.nam
boot/obj/NieczaCompiler.nam: boot/obj/JSYNC.nam
boot/obj/NieczaFrontendSTD.nam: boot/obj/STD.nam
boot/obj/NieczaFrontendSTD.nam: boot/obj/NieczaGrammar.nam
View
@@ -1,17 +0,0 @@
-use NieczaBackendNAM;
-class NieczaBackendClisp is NieczaBackendNAM;
-
-# XXX XXX .NET doesn't seem to have any real spawnl functionality,
-# only system
-sub run_command($cmd, $args) {
- Q:CgOp { (rnull (rawscall Builtins,Kernel.RunSubtask (obj_getstr {$cmd}) (obj_getstr {$args}))) };
-}
-
-method post_save($name, :$main) {
- # None needed; run does all the work
-}
-
-method run($name) {
- my $fname = $name.split('::').join('.');
- run_command("clisp", "cl-backend/backend.lisp obj/" ~ $fname ~ ".nam");
-}
@@ -1,9 +1,32 @@
-use NieczaBackendNAM;
-class NieczaBackendDotnet is NieczaBackendNAM;
+class NieczaBackendDotnet;
use NAMOutput;
has $.safemode = False;
+has $.obj_dir;
+has $.run_args = [];
+
+# The purpose of the backend is twofold. It must be able to accept
+# and process units; and it must be able to retrieve processed units
+# at a later time.
+
+# Return Metamodel::Unit, undefined if unit not available. The caller
+# will check tdeps, load them if needed, and maybe even discard the
+# returned unit.
+method get_unit($name) {
+ my $file = ($name.split('::').join('.') ~ ".nam").IO\
+ .relative($.obj_dir);
+ $file.e ?? NAMOutput.load($file.slurp) !! ::Metamodel::Unit;
+}
+
+# Save a unit. If $main is true, it is being considered as a main
+# module; if $run, it should be auto-run. Main modules do not need
+# to be retrievable.
+method save_unit($name, $unit) {
+ my $file = ($name.split('::').join('.') ~ ".nam").IO\
+ .relative($.obj_dir);
+ $file.spew(NAMOutput.run($unit));
+}
sub upcalled(@strings) {
given @strings[0] {
View
@@ -1,17 +0,0 @@
-use NieczaBackendNAM;
-class NieczaBackendHoopl is NieczaBackendNAM;
-
-# XXX XXX .NET doesn't seem to have any real spawnl functionality,
-# only system
-sub run_command($cmd, $args) {
- Q:CgOp { (rnull (rawscall Builtins,Kernel.RunSubtask (obj_getstr {$cmd}) (obj_getstr {$args}))) };
-}
-
-method post_save($name, :$main) {
- # None needed; run does all the work
-}
-
-method run($name) {
- my $fname = $name.split('::').join('.');
- run_command("hoopl/dist/build/niecza-hoopl/niecza-hoopl", "obj/" ~ $fname ~ ".nam");
-}
View
@@ -1,43 +0,0 @@
-class NieczaBackendNAM;
-
-use NAMOutput;
-
-has $.obj_dir;
-has $.run_args = [];
-
-# The purpose of the backend is twofold. It must be able to accept
-# and process units; and it must be able to retrieve processed units
-# at a later time.
-
-# Return Metamodel::Unit, undefined if unit not available. The caller
-# will check tdeps, load them if needed, and maybe even discard the
-# returned unit.
-method get_unit($name) {
- my $file = ($name.split('::').join('.') ~ ".nam").IO\
- .relative($.obj_dir);
- $file.e ?? NAMOutput.load($file.slurp) !! ::Metamodel::Unit;
-}
-
-# Save a unit. If $main is true, it is being considered as a main
-# module; if $run, it should be auto-run. Main modules do not need
-# to be retrievable.
-method save_unit($name, $unit) {
- my $file = ($name.split('::').join('.') ~ ".nam").IO\
- .relative($.obj_dir);
- $file.spew(NAMOutput.run($unit));
-}
-
-method post_save($name, :$main) { #OK not used
-}
-
-method run($name) { #OK not used
- die "nam backend does not support running code";
-}
-
-method accept($unitname, $ast is rw, :$main, :$run, :$evalmode, :$repl) { #OK not used
- self.save_unit($unitname, $ast);
- $ast.clear_optrees;
- $ast = Any;
- self.post_save($unitname, :$main);
- $run && self.run($unitname);
-}
View
@@ -6,10 +6,7 @@ use JSYNC;
use Metamodel;
use NAMOutput;
use NieczaActions;
-use NieczaBackendClisp;
use NieczaBackendDotnet;
-use NieczaBackendHoopl;
-use NieczaBackendNAM;
use NieczaCompiler;
use NieczaFrontendSTD;
use NieczaPassSimplifier;
@@ -251,18 +248,9 @@ GetOptions(:!permute,
my @*INC;
my $backend;
-if $bcnd eq 'nam' {
- $backend = NieczaBackendNAM.new(obj_dir => $odir);
-}
-elsif $bcnd eq 'dotnet' || $bcnd eq 'mono' {
+if $bcnd eq 'dotnet' || $bcnd eq 'mono' {
$backend = NieczaBackendDotnet.new(obj_dir => $odir, safemode => $safe);
}
-elsif $bcnd eq 'clisp' {
- $backend = NieczaBackendClisp.new(obj_dir => $odir);
-}
-elsif $bcnd eq 'hoopl' {
- $backend = NieczaBackendHoopl.new(obj_dir => $odir);
-}
else {
note "Backend '$bcnd' not supported";
exit 1;

0 comments on commit c984628

Please sign in to comment.