printarg stubbed out

git-svn-id: svn://10.0.0.236/trunk@67454 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rginda%netscape.com
2000-04-28 02:20:23 +00:00
parent f0659c6849
commit 3708c97e3c
2 changed files with 34 additions and 12 deletions

View File

@@ -61,7 +61,6 @@ $ops{"NOP"} =
{
super => "Instruction",
rem => "do nothing and like it",
params => [ () ]
};
$ops{"MOVE"} =
{
@@ -184,7 +183,6 @@ $ops{"ENDTRY"} =
{
super => "Instruction",
rem => "mmm, there is no try, only do",
params => [ () ]
};
$ops{"JSR"} =
{
@@ -196,7 +194,6 @@ $ops{"RTS"} =
{
super => "Instruction",
rem => "Return to sender",
params => [ () ]
};
#
@@ -248,6 +245,8 @@ sub collect {
my $rem = $c->{"rem"};
my ($dec_list, $call_list, $template_list) =
&get_paramlists(@params);
my @types = split (", ", $template_list);
my $constr_params = $call_list ? $opname . ", " . $call_list : $opname;
if ($super =~ /Instruction_\d/) {
@@ -264,12 +263,12 @@ sub collect {
"$init_tab$tab$tab($constr_params) " .
"{};\n");
if (!$c->{"super_has_print"}) {
my $printbody = &get_printbody(split (", ", $template_list));
my $print_body = &get_print_body(@types);
$class_decs .= ($init_tab . $tab .
"virtual Formatter& print (Formatter& f) {\n" .
$init_tab . $tab . $tab . "f << opcodeNames[$opname]" .
$printbody . ";\n" .
$print_body . ";\n" .
$init_tab . $tab . $tab . "return f;\n" .
$init_tab . $tab . "}\n");
} else {
@@ -277,6 +276,12 @@ sub collect {
"/* print() inherited from $super */\n";
}
$class_decs .= ($init_tab . $tab . "virtual Formatter& print_args " .
"(Formatter &f, JSValues &registers) {\n" .
$init_tab . $tab . $tab . &get_printargs_body(@types) .
"\n" .
$init_tab . $tab . "}\n");
$class_decs .= $init_tab . "};\n\n";
}
@@ -351,7 +356,7 @@ sub get_paramlists {
return (join (", ", @dec), join (", ", @call), join (", ", @template));
}
sub get_printbody {
sub get_print_body {
# generate the body of the print() function
my (@types) = @_;
my $type;
@@ -380,3 +385,9 @@ sub get_printbody {
}
}
sub get_printargs_body {
my (@type) = @_;
return "return f;";
}

View File

@@ -61,7 +61,6 @@ $ops{"NOP"} =
{
super => "Instruction",
rem => "do nothing and like it",
params => [ () ]
};
$ops{"MOVE"} =
{
@@ -184,7 +183,6 @@ $ops{"ENDTRY"} =
{
super => "Instruction",
rem => "mmm, there is no try, only do",
params => [ () ]
};
$ops{"JSR"} =
{
@@ -196,7 +194,6 @@ $ops{"RTS"} =
{
super => "Instruction",
rem => "Return to sender",
params => [ () ]
};
#
@@ -248,6 +245,8 @@ sub collect {
my $rem = $c->{"rem"};
my ($dec_list, $call_list, $template_list) =
&get_paramlists(@params);
my @types = split (", ", $template_list);
my $constr_params = $call_list ? $opname . ", " . $call_list : $opname;
if ($super =~ /Instruction_\d/) {
@@ -264,12 +263,12 @@ sub collect {
"$init_tab$tab$tab($constr_params) " .
"{};\n");
if (!$c->{"super_has_print"}) {
my $printbody = &get_printbody(split (", ", $template_list));
my $print_body = &get_print_body(@types);
$class_decs .= ($init_tab . $tab .
"virtual Formatter& print (Formatter& f) {\n" .
$init_tab . $tab . $tab . "f << opcodeNames[$opname]" .
$printbody . ";\n" .
$print_body . ";\n" .
$init_tab . $tab . $tab . "return f;\n" .
$init_tab . $tab . "}\n");
} else {
@@ -277,6 +276,12 @@ sub collect {
"/* print() inherited from $super */\n";
}
$class_decs .= ($init_tab . $tab . "virtual Formatter& print_args " .
"(Formatter &f, JSValues &registers) {\n" .
$init_tab . $tab . $tab . &get_printargs_body(@types) .
"\n" .
$init_tab . $tab . "}\n");
$class_decs .= $init_tab . "};\n\n";
}
@@ -351,7 +356,7 @@ sub get_paramlists {
return (join (", ", @dec), join (", ", @call), join (", ", @template));
}
sub get_printbody {
sub get_print_body {
# generate the body of the print() function
my (@types) = @_;
my $type;
@@ -380,3 +385,9 @@ sub get_printbody {
}
}
sub get_printargs_body {
my (@type) = @_;
return "return f;";
}