Author: pmichaud
Date: Thu Oct  4 23:28:44 2007
New Revision: 21872

Modified:
   trunk/compilers/pge/PGE/OPTable.pir

Log:
[pge]:
* Convert 'newfrom' to 'new' in PGE::OPTable.


Modified: trunk/compilers/pge/PGE/OPTable.pir
==============================================================================
--- trunk/compilers/pge/PGE/OPTable.pir (original)
+++ trunk/compilers/pge/PGE/OPTable.pir Thu Oct  4 23:28:44 2007
@@ -214,7 +214,6 @@
     .param pmc adverbs         :slurpy :named
     .local pmc tokentable, keytable, klentable
     .local pmc tokenstack, operstack, termstack
-    .local pmc newfrom
     .local string target
     .local pmc mfrom, mpos
     .local int pos, lastpos, wspos
@@ -285,8 +284,7 @@
     operstack = new 'ResizablePMCArray'
     termstack = new 'ResizablePMCArray'
 
-    newfrom = get_hll_global ["PGE::Match"], "newfrom"
-    $P0 = getclass 'PGE::Match'
+    $P0 = get_hll_global ['PGE'], 'Match'
     (mob, pos, target, mfrom, mpos) = $P0.'new'(mob, adverbs :flat :named)
     lastpos = length target
     circumnest = 0
@@ -368,7 +366,7 @@
     $I0 = expect & PGE_OPTABLE_EXPECT_TERM
     if $I0 == 0 goto end
     ##   otherwise, let's add a "dummy" term to the stack for reduction
-    (oper, $S0, $P0, $P1) = newfrom(mob, pos, "PGE::Match")
+    oper = mob.'new'(mob)
     push termstack, oper
     ##   if the current operator doesn't allow nullterm, end match
     unless tokenstack goto end
@@ -376,7 +374,7 @@
     $I0 = top['nullterm']
     if $I0 == 0 goto end
     ##   it's a nullterm operator, so we can continue parsing
-    $P1 = pos
+    oper.'to'(pos)
     expect = PGE_OPTABLE_EXPECT_OPER
     goto token_next
 
@@ -467,7 +465,7 @@
     wspos = -1
     $P0 = pop termstack
     if topcat != PGE_OPTABLE_CIRCUMFIX goto reduce_end
-    (oper, $S0, $P0, $P1) = newfrom(mob, pos, "PGE::Match")
+    oper = mob.'new'(mob)
     push termstack, oper
     goto reduce_end
   reduce_close:
@@ -521,10 +519,10 @@
     $I0 = exists token['parsed']
     if $I0 goto token_match_sub
     $S0 = token['match']
-    (oper, $P99, $P99, $P0) = newfrom(mob, pos, $S0)
+    oper = mob.'new'(mob, 'grammar'=>$S0)
     $I0 = length key
     $I0 += pos
-    $P0 = $I0
+    oper.'to'($I0)
     goto token_match_success
   token_match_sub:
     $P0 = token['parsed']

Reply via email to