Author: coke
Date: Thu Mar 29 10:47:05 2007
New Revision: 17839
Modified:
trunk/ (props changed)
trunk/languages/BASIC/compiler/COMP_assignments.pm
trunk/languages/BASIC/compiler/COMP_expressions.pm
trunk/languages/BASIC/compiler/COMP_parsefuncs.pm
trunk/languages/BASIC/compiler/COMP_parser.pm
trunk/languages/BASIC/compiler/COMP_toker.pm
trunk/languages/BASIC/compiler/RT_aggregates.pir
trunk/languages/BASIC/compiler/RT_debugger.pir
trunk/languages/BASIC/compiler/RT_initialize.pir
trunk/languages/BASIC/compiler/RT_io.pir
trunk/languages/BASIC/compiler/RT_platform_ANSIscreen.pir
trunk/languages/BASIC/compiler/RT_platform_win32.pir
trunk/languages/BASIC/compiler/RT_support.pir
trunk/languages/BASIC/compiler/compile.pl
trunk/languages/BASIC/compiler/testrun.pl
trunk/languages/BASIC/compiler/testsuite.pl
Log:
[BASIC]
- Remove reference to all Perl PMCs
- update to current .param syntax
- remove 'strict and warnings' temporarily from perl code.
Modified: trunk/languages/BASIC/compiler/COMP_assignments.pm
==============================================================================
--- trunk/languages/BASIC/compiler/COMP_assignments.pm (original)
+++ trunk/languages/BASIC/compiler/COMP_assignments.pm Thu Mar 29 10:47:05 2007
@@ -1,8 +1,5 @@
#! perl
-use strict;
-use warnings;
-
# Variable name may have a SIGIL and is in S1
# % & INT
# ! # FLO
@@ -17,7 +14,7 @@
sub ASSIGNMENT_FUNC {
my ($varname) = @_; # P6 already has the RHS Loaded...
print CODE<<ASS_FUNC;
- new P0, .PerlArray
+ new P0, .ResizablePMCArray
set P0[.TYPE], "BARE"
set P0[.VALUE], "$varname"
bsr ASSIGNMENT # Do this type manually
Modified: trunk/languages/BASIC/compiler/COMP_expressions.pm
==============================================================================
--- trunk/languages/BASIC/compiler/COMP_expressions.pm (original)
+++ trunk/languages/BASIC/compiler/COMP_expressions.pm Thu Mar 29 10:47:05 2007
@@ -2,8 +2,6 @@
use subs qw(fetchvar);
use vars qw(@builtins @keywords);
-use strict;
-use warnings;
my $retcount = 200;
my $currentexpr;
Modified: trunk/languages/BASIC/compiler/COMP_parsefuncs.pm
==============================================================================
--- trunk/languages/BASIC/compiler/COMP_parsefuncs.pm (original)
+++ trunk/languages/BASIC/compiler/COMP_parsefuncs.pm Thu Mar 29 10:47:05 2007
@@ -1,9 +1,6 @@
# Aux. functions needed by the parser. (For cleanliness)
#
-use strict;
-use warnings;
-
use vars qw( %usertypes );
use vars qw( %arrays );
use vars qw( $funcname $subname );
@@ -708,9 +705,9 @@
print CODE<<CASE_SETUP;
goto CASE_${jump}_FIN
CASE_${jump}_${incase}:
- new P12, .PerlArray # OR
- new P13, .PerlArray # TO
- new P14, .PerlArray # Operators. Op first, then value
+ new P12, .ResizablePMCArray # OR
+ new P13, .ResizablePMCArray # TO
+ new P14, .ResizablePMCArray # Operators. Op first, then value
CASE_SETUP
my ( $ors, $tos, $ops ) = ( 0, 0, 0 );
while (1) {
@@ -1008,11 +1005,11 @@
$usertypes{$typename} = [EMAIL PROTECTED];
print CODE <<TYPE;
# Type definition for $typename
- new P0, .PerlArray
+ new P0, .ResizablePMCArray
TYPE
foreach (@types) {
print CODE<<ADDT;
- new P1, .PerlHash
+ new P1, .Hash
P1["name"]= '$_->[0]'
P1["type"]= '$_->[1]'
push P0, P1
@@ -1026,13 +1023,13 @@
DIM_$typename:
#print "Dimensioning $typename\\n"
pushp
- P2= .PerlHash
+ P2= .Hash
TYPEE
foreach (@types) {
my %val = ( INT => 0, FLO => '0.0', STRING => '""' );
if ( $_->[2] ne "USER" ) {
print CODE<<NOTUSER;
- new P1, .PerlHash
+ new P1, .Hash
P1["name"]= '$_->[0]'
P1["type"]= '$_->[2]'
P1["value"]= $val{$_->[2]}
@@ -1041,7 +1038,7 @@
}
else {
print CODE<<USERTYPE;
- new P1, .PerlHash
+ new P1, .Hash
P1["name"]= '$_->[0]'
P1["type"]= "USER"
bsr DIM_$_->[1]
@@ -1060,14 +1057,14 @@
COPY_$typename: # Source in P6 Dest in P1 (don't trash P0)
#print "--Copying a $typename\\n"
pushp # Makes an internal mess of P2, P3, P4, P5, P6
(popped)
- new P3, .PerlHash # Uses S0, I0, N0
+ new P3, .Hash # Uses S0, I0, N0
FINDIM
foreach (@types) {
my %val = ( INT => 'I0', FLO => 'N0', STRING => 'S0' );
if ( $_->[2] ne "USER" ) {
print CODE<<NOTUSER;
- new P2, .PerlHash
+ new P2, .Hash
P2["name"]= '$_->[0]'
P2["type"]= '$_->[2]'
P4= P6["storage"]
@@ -1082,7 +1079,7 @@
}
else {
print CODE<<USER;
- new P2, .PerlHash
+ new P2, .Hash
P2["name"]= '$_->[0]'
P2["type"]= "USER"
P5= P6 # Remember where we were...
@@ -1124,7 +1121,7 @@
P1= P10[I25]
P2= P1["USER"]
bsr DIM_$type
- P1 = new .PerlHash
+ P1 = new .Hash
P1["_type"]= '$type'
P1["type"]= "USER"
P1["storage"]= P0
@@ -1183,9 +1180,9 @@
#print STDERR "Marking ${var}${seg}\n";
push @{ $code{$seg}->{code} }, <<DIMARR;
# Set aside storage for Array $var
- \$P0 = new .PerlHash
- \$P2 = new .PerlArray
- \$P3 = new .PerlHash
+ \$P0 = new .Hash
+ \$P2 = new .ResizablePMCArray
+ \$P3 = new .Hash
\$P3["index"]=\$P2
\$P3["hash"]=\$P0
find_global \$P1, "BASICARR"
@@ -1395,7 +1392,7 @@
#print STDERR "Marking ${_}${seg}\n";
$arrays{"${_}${seg}"} = 1;
push @{ $code{$seg}->{code} }, <<PUSHARR;
- .param PerlHash array_$englishname
+ .param pmc array_$englishname
find_global \$P1, "BASICARR"
\$P1["${_}$seg"]= array_$englishname
store_global "BASICARR", \$P1
Modified: trunk/languages/BASIC/compiler/COMP_parser.pm
==============================================================================
--- trunk/languages/BASIC/compiler/COMP_parser.pm (original)
+++ trunk/languages/BASIC/compiler/COMP_parser.pm Thu Mar 29 10:47:05 2007
@@ -1,7 +1,5 @@
#! perl
-use strict;
-use warnings;
use constant VERSION => 2.3;
use constant PREV => 2;
Modified: trunk/languages/BASIC/compiler/COMP_toker.pm
==============================================================================
--- trunk/languages/BASIC/compiler/COMP_toker.pm (original)
+++ trunk/languages/BASIC/compiler/COMP_toker.pm Thu Mar 29 10:47:05 2007
@@ -1,8 +1,5 @@
#! perl
-use strict;
-use warnings;
-
my ( $cur, $next, $afternext, $curtok );
my $stmts = 0;
Modified: trunk/languages/BASIC/compiler/RT_aggregates.pir
==============================================================================
--- trunk/languages/BASIC/compiler/RT_aggregates.pir (original)
+++ trunk/languages/BASIC/compiler/RT_aggregates.pir Thu Mar 29 10:47:05 2007
@@ -41,7 +41,7 @@
noop
.end
- # void ARRAY_ASSIGN_N(string array, PerlArray rhs, int
keycount[, string|float keys])
+ # void ARRAY_ASSIGN_N(string array, ResizablePMCArray
rhs, int keycount[, string|float keys])
# void ARRAY_ASSIGN_N(string array, string rhs, int
keycount[, string|float keys])
.sub _ARRAY_ASSIGN # void ARRAY_ASSIGN_N(string array, float rhs, int
keycount[, string|float keys])
.param string array
@@ -118,7 +118,7 @@
end
END_ASSIGN:
- # Temporary, needed only until PerlHash->keys() gets implemented
+ # Temporary, needed only until Hash->keys() gets implemented
find_global BASICARR, "BASICARR"
$P1 = BASICARR[array]
$P0 = $P1["index"]
@@ -138,7 +138,7 @@
REALEND:
noop
.end
-# This gets a *lot* easier when PerlHash->keys() gets implemented
+# This gets a *lot* easier when Hash->keys() gets implemented
.sub _ARRAY_KEYS # void ARRAY_KEYS(string source, string target)
.param string source
.param string target
Modified: trunk/languages/BASIC/compiler/RT_debugger.pir
==============================================================================
--- trunk/languages/BASIC/compiler/RT_debugger.pir (original)
+++ trunk/languages/BASIC/compiler/RT_debugger.pir Thu Mar 29 10:47:05 2007
@@ -1,4 +1,4 @@
-.sub _DEBUGGER_STOP_FOR_REAL # void Debugger_stop(int line, PerlHash
local_values)
+.sub _DEBUGGER_STOP_FOR_REAL # void Debugger_stop(int line, Hash
local_values)
.param int line
.param pmc locals
find_global $P25, "DEBUGGER"
@@ -104,7 +104,7 @@
branch DEBUGGER_COMMAND
DEBUGGER_DELALLWATCH:
- $P0=new PerlArray
+ $P0=new .ResizablePMCArray
set $P25["watch"], $P0
print "All watches cleared.\n"
branch DEBUGGER_COMMAND
Modified: trunk/languages/BASIC/compiler/RT_initialize.pir
==============================================================================
--- trunk/languages/BASIC/compiler/RT_initialize.pir (original)
+++ trunk/languages/BASIC/compiler/RT_initialize.pir Thu Mar 29 10:47:05 2007
@@ -3,26 +3,26 @@
.const int TYPE = 0
.const int VALUE = 1
.sub _main :main
- $P0 = new .PerlHash
+ $P0 = new .Hash
store_global "BASICARR", $P0
- $P0 = new .PerlArray
+ $P0 = new .ResizablePMCArray
store_global "READDATA", $P0
- $P0 = new .PerlHash
+ $P0 = new .Hash
store_global "RESTOREINFO", $P0
- $P0=new .PerlHash
+ $P0=new .Hash
$P0["value"]=0
store_global "READPOINTER", $P0
- $P0=new .PerlHash
+ $P0=new .Hash
$P0["value"]=20021107
store_global "RANDSEED", $P0
- $P0=new .PerlHash
+ $P0=new .Hash
$P0["value"]=0
store_global "PRINTCOL", $P0
- $P0=new .PerlHash
+ $P0=new .Hash
store_global "DEBUGGER", $P0
- $P0=new .PerlHash
+ $P0=new .Hash
store_global "COMMON", $P0
- $P0=new .PerlArray
+ $P0=new .ResizablePMCArray
fdopen $P1, 0, "r" # STDIN and friends...
$P1 = getstdin
$P0[0]=$P1
Modified: trunk/languages/BASIC/compiler/RT_io.pir
==============================================================================
--- trunk/languages/BASIC/compiler/RT_io.pir (original)
+++ trunk/languages/BASIC/compiler/RT_io.pir Thu Mar 29 10:47:05 2007
@@ -84,13 +84,13 @@
# # SPLITLINE Splits a line into parts
# # Outputs:
# # P1 Array of strings
-.sub _SPLITLINE # PerlArray splitline (string line, int
splitflag)
+.sub _SPLITLINE # ResizablePMCArray splitline (string line, int
splitflag)
.param string line
.param int splitflag
.local string token
line = _CHOMP(line)
- $P1=new PerlArray
+ $P1=new .ResizablePMCArray
eq splitflag, 0, SPLITSINGLE
SPLITAGAIN:
Modified: trunk/languages/BASIC/compiler/RT_platform_ANSIscreen.pir
==============================================================================
--- trunk/languages/BASIC/compiler/RT_platform_ANSIscreen.pir (original)
+++ trunk/languages/BASIC/compiler/RT_platform_ANSIscreen.pir Thu Mar 29
10:47:05 2007
@@ -19,7 +19,7 @@
.const int STDIN = 0
.sub _ansi_setup
- $P0=new .PerlArray
+ $P0=new .ResizablePMCArray
$P0[0]= BLACK
$P0[1]= BLUE
$P0[2]= GREEN
@@ -30,7 +30,7 @@
$P0[7]= WHITE
store_global "ANSI_fgcolors", $P0
- $P0=new .PerlArray
+ $P0=new .ResizablePMCArray
$P0[0]= BLACK
$P0[1]= BLUE
$P0[2]= GREEN
@@ -49,7 +49,7 @@
$P0[15]= 8
store_global "ANSI_bgcolors", $P0
- $P0=new .PerlHash
+ $P0=new .Hash
$P0["value"]=0
store_global "scankey", $P0
.end
@@ -182,7 +182,7 @@
#invoke # nmode=fcntl(0, F_SETFL, mode | O_NONBLOCK)
fcntl(STDIN, F_SETFL, $I7)
- $P0=new .PerlHash
+ $P0=new .Hash
$P0["value"]= old_value
store_global "fcntl_mode", $P0
.end
Modified: trunk/languages/BASIC/compiler/RT_platform_win32.pir
==============================================================================
--- trunk/languages/BASIC/compiler/RT_platform_win32.pir (original)
+++ trunk/languages/BASIC/compiler/RT_platform_win32.pir Thu Mar 29
10:47:05 2007
@@ -16,7 +16,7 @@
set I5, -10
invoke
store_global "Win32Inputhandle", P5
- $P0= new .PerlHash
+ $P0= new .Hash
store_global "Win32console", $P0
_WIN32_CONSOLE_INFO()
.end
@@ -52,7 +52,7 @@
.end
.sub _UMS_GET_SHORT # int value ums_get_short(int offset,
ManagedStruct buf)
.param int offset
- .param ManagedStruct buf
+ .param pmc buf
set $I2, buf[offset]
inc offset
set $I3, buf[offset]
Modified: trunk/languages/BASIC/compiler/RT_support.pir
==============================================================================
--- trunk/languages/BASIC/compiler/RT_support.pir (original)
+++ trunk/languages/BASIC/compiler/RT_support.pir Thu Mar 29 10:47:05 2007
@@ -24,7 +24,7 @@
# print "Out of data"
# branch GEN_ERROR
-.sub _READ # PerlArray READ(void)
+.sub _READ # ResizablePMCArray READ(void)
.local pmc READDATA
.local int READPOINTER
find_global READDATA, "READDATA"
Modified: trunk/languages/BASIC/compiler/compile.pl
==============================================================================
--- trunk/languages/BASIC/compiler/compile.pl (original)
+++ trunk/languages/BASIC/compiler/compile.pl Thu Mar 29 10:47:05 2007
@@ -4,8 +4,6 @@
# First tokenize the input stream into:
# @tokens and @tokdsc
# Then compile.
-use strict;
-use warnings;
use Getopt::Std;
use vars qw( @tokens @tokdsc);
use vars qw(%code %options @basic %common);
@@ -173,7 +171,7 @@
exists \$I0, \$P1[\$S0]
eq \$I0, 0, DEBUGGER_DONE # This breakpoint doesn't
exist
DEBUGGER_STOP:
- \$P1=new .PerlHash
+ \$P1=new .Hash
@debdecl .arg \$P1
.arg debline
_DEBUGGER_STOP_FOR_REAL()
@@ -186,7 +184,7 @@
print CODE<<FOO;
.sub _DEBUG_INIT
saveall
- \$P0=new .PerlArray
+ \$P0=new .ResizablePMCArray
find_global \$P1, "DEBUGGER"
FOO
foreach ( 0 .. @main::basic - 1 ) {
@@ -197,9 +195,9 @@
print CODE<<FOO;
\$P1["code"]= \$P0
\$P1["step"]= 1 # Turn on stepping mode
- \$P0=new .PerlHash
+ \$P0=new .Hash
\$P1["break"]= \$P0 # Breakpoints
- \$P0=new .PerlArray
+ \$P0=new .ResizablePMCArray
\$P1["watch"]= \$P0 # Watch
store_global "DEBUGGER", \$P1
.end
Modified: trunk/languages/BASIC/compiler/testrun.pl
==============================================================================
--- trunk/languages/BASIC/compiler/testrun.pl (original)
+++ trunk/languages/BASIC/compiler/testrun.pl Thu Mar 29 10:47:05 2007
@@ -1,7 +1,4 @@
#! perl
-use strict;
-use warnings;
-no warnings 'once';
$parpath = '../../../';
unlink "_test.pbc";
Modified: trunk/languages/BASIC/compiler/testsuite.pl
==============================================================================
--- trunk/languages/BASIC/compiler/testsuite.pl (original)
+++ trunk/languages/BASIC/compiler/testsuite.pl Thu Mar 29 10:47:05 2007
@@ -4,9 +4,6 @@
#
#
-use strict;
-use warnings;
-
$tn = 0;
while (1) {
{