Author: pmichaud
Date: Fri Oct 5 00:33:17 2007
New Revision: 21882
Modified:
branches/pdd15oo/compilers/pge/PGE/Exp.pir
branches/pdd15oo/compilers/pge/PGE/OPTable.pir
Log:
[pge]:
* Make some initial pdd15oo conversions.
Modified: branches/pdd15oo/compilers/pge/PGE/Exp.pir
==============================================================================
--- branches/pdd15oo/compilers/pge/PGE/Exp.pir (original)
+++ branches/pdd15oo/compilers/pge/PGE/Exp.pir Fri Oct 5 00:33:17 2007
@@ -21,7 +21,7 @@
.local pmc optable
.local pmc term
- $P0 = getclass "PGE::Match"
+ $P0 = get_class "PGE::Match"
$P0 = subclass $P0, "PGE::Exp"
$P1 = subclass $P0, "PGE::Exp::Literal"
$P1 = subclass $P0, "PGE::Exp::Scalar"
@@ -45,15 +45,14 @@
=over 4
-=item C<compile(PMC source, PMC adverbs :slurpy :named)>
+=item C<compile(PMC adverbs :slurpy :named)>
-Compile the C<source> expression into PIR or a subroutine,
-according to the C<target> adverb.
+Compile C<self> into PIR or a subroutine, according to the
+C<target> adverbs.
=cut
-.sub 'compile'
- .param pmc source
+.sub 'compile' :method
.param pmc adverbs :slurpy :named
.local string target
@@ -72,7 +71,7 @@
.local pmc code
code = new 'CodeString'
code.'emit'(nsformat, grammar)
- $P0 = source.'root_pir'(adverbs :flat :named)
+ $P0 = self.'root_pir'(adverbs :flat :named)
code .= $P0
if target != 'pir' goto bytecode
.return (code)
@@ -88,7 +87,7 @@
.return ($P1)
return_exp:
- .return (source)
+ .return (self)
.end
@@ -149,7 +148,7 @@
.local string target :unique_reg
.local pmc mfrom, mpos :unique_reg
.local int cpos, iscont :unique_reg
- $P0 = getclass 'PGE::Match'
+ $P0 = get_hll_global ['PGE'], 'Match'
(mob, cpos, target, mfrom, mpos, iscont) = $P0.'new'(mob, adverbs
:flat :named)
$P0 = interpinfo %1
setattribute mob, '&!corou', $P0
@@ -166,7 +165,7 @@
.local string target :unique_reg
.local pmc mfrom, mpos :unique_reg
.local int cpos, iscont :unique_reg
- $P0 = getclass 'PGE::Match'
+ $P0 = get_global ['PGE'], 'Match'
(mob, cpos, target, mfrom, mpos, iscont) = $P0.'new'(mob, adverbs
:flat :named)
CODE
Modified: branches/pdd15oo/compilers/pge/PGE/OPTable.pir
==============================================================================
--- branches/pdd15oo/compilers/pge/PGE/OPTable.pir (original)
+++ branches/pdd15oo/compilers/pge/PGE/OPTable.pir Fri Oct 5 00:33:17 2007
@@ -34,8 +34,7 @@
.sub '__onload' :load
.local pmc base
.local pmc sctable
- $P0 = getclass 'Hash'
- base = subclass $P0, 'PGE::OPTable'
+ base = subclass 'Hash', 'PGE::OPTable'
addattribute base, '%!key'
addattribute base, '%!klen'
addattribute base, '&!ws'
@@ -77,8 +76,8 @@
tokentable = self
keytable = new 'Hash'
klentable = new 'Hash'
- setattribute self, "PGE::OPTable\x0%!key", keytable
- setattribute self, "PGE::OPTable\x0%!klen", klentable
+ setattribute self, '%!key', keytable
+ setattribute self, '%!klen', klentable
.end
@@ -173,8 +172,8 @@
add_key:
.local pmc keytable, klentable
- keytable = getattribute self, "PGE::OPTable\x0%!key"
- klentable = getattribute self, "PGE::OPTable\x0%!klen"
+ keytable = getattribute self, '%!key'
+ klentable = getattribute self, '%!klen'
$I1 = length key
$S0 = substr key, 0, 1
$I0 = klentable[$S0]
@@ -226,8 +225,8 @@
.local int circumnest
tokentable = self
- keytable = getattribute self, "PGE::OPTable\x0%!key"
- klentable = getattribute self, "PGE::OPTable\x0%!klen"
+ keytable = getattribute self, '%!key'
+ klentable = getattribute self, '%!klen'
unless null adverbs goto with_adverbs
adverbs = new 'Hash'
@@ -279,7 +278,7 @@
tighter = token['precedence']
with_tighter:
- ws = getattribute self, "PGE::OPTable\x0&!ws"
+ ws = getattribute self, '&!ws'
tokenstack = new 'ResizablePMCArray'
operstack = new 'ResizablePMCArray'
termstack = new 'ResizablePMCArray'