#!/usr/bin/perl

## * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
## * This file is part of SableJIT.                            *
## * See the file "LICENSE.JIT" for Copyright information and  *
## * the terms and conditions for copying, distribution and    *
## * modification of SableJIT.                                 *
## * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

#
# Makes a template class for a new architecture.
#

print <<EOF
package sablejit.arch.ARCH

import sablejit.arch.*

public class ARCH extends Architecture {

  public ARCH() {
    super(new RegisterARCH(...),
          new (int or byte)[N]);
  } 

EOF
;

open(FILE, "../src/sablejit/arch/Architecture.java");
while ($line = <FILE>) {
    if ($line =~ /  (public|protected) abstract (\w* (\w*).*);/) {
	print "  $1 $2 {\n";
	print "    throw new NotImplementedException(\"$3\");\n";
	print "  }\n\n";
    }
}
print "}\n";


