Skip to content
This repository
Browse code

Merge hllmagic branch into trunk.

Mostly looks okay.
If anyone runs into problems fixing the last few issues with their languages, address issues to Tene or pmichaud.


git-svn-id: https://svn.parrot.org/parrot/trunk@31862 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit 1ebf2db784f4a178694065a0776c80edce8acd3a 1 parent 628a39a
Stephen Weeks tene authored

Showing 91 changed files with 1,152 additions and 859 deletions. Show diff stats Hide diff stats

  1. +1 1  compilers/nqp/bootstrap/actions.pm
  2. +3 3 compilers/nqp/bootstrap/nqp.pir
  3. +3 3 compilers/nqp/nqp.pir
  4. +6 6 compilers/nqp/src/Grammar.pg
  5. +5 4 compilers/nqp/src/Grammar/Actions.pir
  6. +35 35 compilers/pct/src/PAST/Compiler.pir
  7. +6 6 compilers/pct/src/PAST/Node.pir
  8. +4 3 compilers/pct/src/PCT/Grammar.pir
  9. +22 8 compilers/pct/src/PCT/HLLCompiler.pir
  10. +3 3 compilers/pct/src/PCT/Node.pir
  11. +6 6 compilers/pct/src/POST/Compiler.pir
  12. +7 7 compilers/pct/src/POST/Node.pir
  13. +37 32 compilers/pge/PGE/Exp.pir
  14. +16 7 compilers/pge/PGE/Match.pir
  15. +3 3 compilers/pge/PGE/OPTable.pir
  16. +10 10 compilers/pge/PGE/P5Regex.pir
  17. +31 31 compilers/pge/PGE/Perl6Regex.pir
  18. +1 1  compilers/pge/PGE/Regex.pir
  19. +3 3 compilers/tge/TGE.pir
  20. +1 1  compilers/tge/TGE/Compiler.pir
  21. +13 13 examples/past/01-sub.pir
  22. +3 3 examples/past/blocktype_immediate.pir
  23. +15 15 examples/past/four_plus_one.pir
  24. +1 1  examples/pge/simple.pir
  25. +1 1  languages/APL/APL.pir
  26. +1 0  languages/WMLScript/pmc/wmlsstring.pmc
  27. +2 2 languages/c99/c99.pir
  28. +38 42 languages/c99/src/CPP_PASTNodes.pir
  29. +3 3 languages/c99/src/CPP_PGE2AST.pir
  30. +4 4 languages/c99/src/c99_PGE.pir
  31. +2 2 languages/c99/src/cpp/cpp.pir
  32. +2 1  languages/c99/src/parser/grammar.pg
  33. +1 1  languages/cardinal/cardinal.pir
  34. +6 6 languages/eclectus/compiler.scm
  35. +1 1  languages/eclectus/driver_nqp.pir
  36. +2 2 languages/ecmascript/js.pir
  37. +1 1  languages/hq9plus/hq9plus.pir
  38. +1 1  languages/json/json.pir
  39. +2 2 languages/lolcode/lolcode.pir
  40. +1 1  languages/lolcode/src/parser/yarn_literal.pir
  41. +33 33 languages/lua/src/PASTGrammar.tg
  42. +1 1  languages/lua/src/build/translator.pl
  43. +3 3 languages/lua/src/grammar51.pir
  44. +8 11 languages/lua/src/lib/lpeg.pir
  45. +28 50 languages/lua/src/lib/luabytecode.pir
  46. +27 25 languages/lua/src/lib/luaregex.pir
  47. +14 13 languages/lua/src/lua51.pir
  48. +22 22 languages/lua/test_lex.pir
  49. +2 2 languages/markdown/markdown.pir
  50. +18 17 languages/markdown/src/Compiler.pir
  51. +2 2 languages/markdown/src/Node.pir
  52. +1 1  languages/markdown/src/builtins/length.pir
  53. +3 3 languages/perl6/perl6.pir
  54. +1 1  languages/perl6/src/parser/actions.pm
  55. +3 3 languages/perl6/src/parser/expression.pir
  56. +2 2 languages/perl6/src/parser/quote_expression.pir
  57. +2 2 languages/perl6/src/utils/perl6doc.pir
  58. +5 7 languages/pheme/lib/PhemeCompiler.pir
  59. +1 1  languages/pheme/lib/PhemeGrammar.pir
  60. +17 17 languages/pheme/lib/pge2past.tg
  61. +7 4 languages/pheme/pheme.pir
  62. +5 5 languages/pipp/src/common/pipp.pir
  63. +1 1  languages/pipp/src/pct/actions.pm
  64. +1 1  languages/pipp/src/pct/quote_expression.pir
  65. +1 1  languages/punie/punie.pir
  66. +1 1  languages/pynie/src/parser/indent.pir
  67. +1 1  languages/squaak/squaak.pir
  68. +8 8 languages/squaak/src/parser/grammar.pg
  69. +78 4 runtime/parrot/library/P6object.pir
  70. +17 17 runtime/parrot/library/PGE/Dumper.pir
  71. +11 10 runtime/parrot/library/PGE/Glob.pir
  72. +6 6 runtime/parrot/library/PGE/Hs.pir
  73. +23 13 runtime/parrot/library/PGE/Perl6Grammar.pir
  74. +4 3 runtime/parrot/library/PGE/Text.pir
  75. +6 5 runtime/parrot/library/PGE/Util.pir
  76. +12 11 t/compilers/pct/past.t
  77. +8 7 t/compilers/pct/pct_hllcompiler.t
  78. +8 7 t/compilers/pct/post.t
  79. +1 1  t/compilers/pge/02-match.t
  80. +3 2 t/compilers/pge/03-optable.t
  81. +2 2 t/compilers/pge/04-compile.t
  82. +2 1  t/compilers/pge/06-grammar.t
  83. +3 3 t/compilers/pge/perl6regex/context.t
  84. +2 2 t/compilers/pge/pge-hs.t
  85. +1 1  t/compilers/pge/pge_examples.t
  86. +1 1  t/compilers/pge/pge_text.t
  87. +7 7 t/compilers/pge/pge_util.t
  88. +2 2 t/compilers/tge/parser.t
  89. +431 238 t/library/p6object.t
  90. +2 2 t/pmc/sub.t
  91. +1 1  tools/dev/mk_language_shell.pl
2  compilers/nqp/bootstrap/actions.pm
@@ -747,7 +747,7 @@ method package_declarator($/, $key) {
747 747 #if ($<sym> eq 'class') { ...code to make class... }
748 748
749 749 make $past;
750   - # PIR q< $P0 = get_hll_global ['NQP::Grammar::Actions'], 'package_declarator_helper' >;
  750 + # PIR q< $P0 = get_hll_global ['NQP';'Grammar';'Actions'], 'package_declarator_helper' >;
751 751 # PIR q< $P1 = find_lex '$/' >;
752 752 # PIR q< $P2 = find_lex '$key' >;
753 753 # PIR q< $P0($P1, $P2) >;
6 compilers/nqp/bootstrap/nqp.pir
@@ -21,7 +21,7 @@ object.
21 21
22 22 =cut
23 23
24   -.namespace [ 'NQP::Compiler' ]
  24 +.namespace [ 'NQP';'Compiler' ]
25 25
26 26 .loadlib 'nqp_group'
27 27
@@ -81,7 +81,7 @@ to the nqp compiler.
81 81 .end
82 82
83 83
84   -#.namespace [ 'NQP::Grammar::Actions' ]
  84 +#.namespace [ 'NQP';'Grammar';'Actions' ]
85 85 #
86 86 #.sub 'package_declarator_helper'
87 87 # .param pmc match
@@ -123,7 +123,7 @@ to the nqp compiler.
123 123
124 124 ## initialize optable with inline PIR
125 125 .local pmc optable
126   - optable = get_hll_global [ 'NQP::Grammar' ], '$optable'
  126 + optable = get_hll_global [ 'NQP';'Grammar' ], '$optable'
127 127 optable['prefix:~'; 'inline'] = <<" END"
128 128 ## inline prefix:~
129 129 $S0 = %0
6 compilers/nqp/nqp.pir
... ... @@ -1,19 +1,19 @@
1 1 # Copyright (C) 2007-2008, The Perl Foundation.
2 2 # $Id$
3 3
4   -.namespace [ 'NQP::Compiler' ]
  4 +.namespace [ 'NQP';'Compiler' ]
5 5
6 6 .sub '__onload' :load :init
7 7 load_bytecode 'PGE.pbc'
8 8 load_bytecode 'PCT.pbc'
9 9
10   - $P0 = new [ 'PCT::HLLCompiler' ]
  10 + $P0 = new [ 'PCT';'HLLCompiler' ]
11 11 $P0.'language'('NQP')
12 12 $P0.'parsegrammar'('NQP::Grammar')
13 13 $P0.'parseactions'('NQP::Grammar::Actions')
14 14
15 15 $P0 = new 'Integer'
16   - set_hll_global ['NQP::Grammar'], '$!endstmt', $P0
  16 + set_hll_global ['NQP';'Grammar'], '$!endstmt', $P0
17 17 .end
18 18
19 19 .sub 'main' :main
12 compilers/nqp/src/Grammar.pg
@@ -31,13 +31,13 @@ token TOP {
31 31 ## yet handle all valid forms of Perl 6 whitespace.
32 32 token ws {
33 33 {{ $P0 = match.'to'()
34   - $P1 = get_hll_global [ 'NQP::Grammar' ], '$!ws'
  34 + $P1 = get_hll_global [ 'NQP';'Grammar' ], '$!ws'
35 35 if null $P1 goto set_new_ws
36 36 $P2 = $P1.'to'()
37 37 if $P0 != $P2 goto set_new_ws
38 38 .return (1)
39 39 set_new_ws:
40   - set_hll_global [ 'NQP::Grammar' ], '$!ws', match
  40 + set_hll_global [ 'NQP';'Grammar' ], '$!ws', match
41 41 }}
42 42 [ \s+
43 43 | ^^ [ \# \N*
@@ -51,7 +51,7 @@ token ws {
51 51 token afterws {
52 52 ## <?{ $¢ == $!ws_to != $!ws_from }>
53 53 {{ $P0 = match.'to'()
54   - $P1 = get_hll_global [ 'NQP::Grammar' ], '$!ws'
  54 + $P1 = get_hll_global [ 'NQP';'Grammar' ], '$!ws'
55 55 $P2 = $P1.'to'()
56 56 if $P0 != $P2 goto end
57 57 $P2 = $P1.'from'()
@@ -121,8 +121,8 @@ token terminator { <[ } \] ) ]> | $ }
121 121 token statement_end {
122 122 || ';'
123 123 || <?before <terminator>>
124   - || {{ $P0 = get_hll_global ['NQP::Grammar'], '$!endstmt'
125   - $P1 = get_hll_global ['NQP::Grammar'], '$!ws'
  124 + || {{ $P0 = get_hll_global ['NQP';'Grammar'], '$!endstmt'
  125 + $P1 = get_hll_global ['NQP';'Grammar'], '$!ws'
126 126 $P2 = $P1.'from'()
127 127 if $P0 != $P2 goto end
128 128 .return (1)
@@ -133,7 +133,7 @@ token statement_end {
133 133 token MARK_STATEMENT_END {
134 134 {{ $P0 = match.'to'()
135 135 $P0 = clone $P0
136   - set_hll_global ['NQP::Grammar'], '$!endstmt', $P0
  136 + set_hll_global ['NQP';'Grammar'], '$!endstmt', $P0
137 137 }}
138 138 <.ws>
139 139 }
9 compilers/nqp/src/Grammar/Actions.pir
@@ -2,15 +2,16 @@
2 2 # $Id$
3 3
4 4 .sub '__onload' :init :load
5   - $P0 = newclass 'NQP::Grammar::Actions'
  5 + $P0 = get_hll_global 'P6metaclass'
  6 + $P0 = $P0.'new_class'('NQP::Grammar::Actions')
6 7
7 8 ## create the stack for nested lexical blocks
8 9 $P0 = new 'ResizablePMCArray'
9   - set_hll_global ['NQP::Grammar::Actions'], '@?BLOCK', $P0
  10 + set_hll_global ['NQP';'Grammar';'Actions'], '@?BLOCK', $P0
10 11
11 12 ## initialize optable with inline PIR
12 13 .local pmc optable
13   - optable = get_hll_global [ 'NQP::Grammar' ], '$optable'
  14 + optable = get_hll_global [ 'NQP';'Grammar' ], '$optable'
14 15
15 16 optable['postfix:++'; 'inline'] = <<" END"
16 17 ## inline postfix:++
@@ -27,7 +28,7 @@
27 28 .return ()
28 29 .end
29 30
30   -.namespace [ 'NQP::Grammar::Actions' ]
  31 +.namespace [ 'NQP';'Grammar';'Actions' ]
31 32
32 33
33 34 ## method TOP($/, $key) {
70 compilers/pct/src/PAST/Compiler.pir
@@ -40,7 +40,7 @@ any value type.
40 40 .include "except_types.pasm"
41 41 .include "interpinfo.pasm"
42 42
43   -.namespace [ 'PAST::Compiler' ]
  43 +.namespace [ 'PAST';'Compiler' ]
44 44
45 45 .sub 'onload' :anon :load :init
46 46 load_bytecode 'PCT/HLLCompiler.pbc'
@@ -481,7 +481,7 @@ nodes of type C<PAST::Stmts>.
481 481
482 482 =cut
483 483
484   -.sub 'as_post' :method :multi(_, PAST::Node)
  484 +.sub 'as_post' :method :multi(_, ['PAST';'Node'])
485 485 .param pmc node
486 486 .param pmc options :slurpy :named
487 487
@@ -510,7 +510,7 @@ Return the POST representation of a C<PAST::Block>.
510 510
511 511 =cut
512 512
513   -.sub 'as_post' :method :multi(_, ['PAST::Block'])
  513 +.sub 'as_post' :method :multi(_, ['PAST';'Block'])
514 514 .param pmc node
515 515 .param pmc options :slurpy :named
516 516
@@ -618,7 +618,7 @@ Return the POST representation of a C<PAST::Block>.
618 618 bpost.'push'(ctrllabel)
619 619 bpost.'push_pirop'('.local pmc exception')
620 620 bpost.'push_pirop'('.get_results (exception)')
621   - $I0 = isa ctrlpast, 'PAST::Node'
  621 + $I0 = isa ctrlpast, ['PAST';'Node']
622 622 if $I0 goto control_past
623 623 if ctrlpast == 'return_pir' goto control_return
624 624 self.panic("Unrecognized control handler '", ctrlpast, "'")
@@ -724,7 +724,7 @@ the node's "pasttype" attribute.
724 724
725 725 =cut
726 726
727   -.sub 'as_post' :method :multi(_, ['PAST::Op'])
  727 +.sub 'as_post' :method :multi(_, ['PAST';'Op'])
728 728 .param pmc node
729 729 .param pmc options :slurpy :named
730 730
@@ -766,7 +766,7 @@ a 'pasttype' of 'pirop'.
766 766
767 767 =cut
768 768
769   -.sub 'pirop' :method :multi(_, ['PAST::Op'])
  769 +.sub 'pirop' :method :multi(_, ['PAST';'Op'])
770 770 .param pmc node
771 771 .param pmc options :slurpy :named
772 772
@@ -813,7 +813,7 @@ for calling a sub.
813 813
814 814 =cut
815 815
816   -.sub 'call' :method :multi(_, ['PAST::Op'])
  816 +.sub 'call' :method :multi(_, ['PAST';'Op'])
817 817 .param pmc node
818 818 .param pmc options :slurpy :named
819 819 .local string pasttype
@@ -838,7 +838,7 @@ for calling a sub.
838 838 goto children_done
839 839 call_by_name:
840 840 (ops, posargs, namedargs) = self.'post_children'(node, 'signature'=>signature)
841   - $I0 = isa name, 'PAST::Node'
  841 + $I0 = isa name, ['PAST';'Node']
842 842 if $I0 goto call_by_name_past
843 843 $S0 = self.'escape'(name)
844 844 unshift posargs, $S0
@@ -868,7 +868,7 @@ to invoke a method on a PMC.
868 868
869 869 =cut
870 870
871   -.sub 'callmethod' :method :multi(_, ['PAST::Op'])
  871 +.sub 'callmethod' :method :multi(_, ['PAST';'Op'])
872 872 .param pmc node
873 873 .param pmc options :slurpy :named
874 874 .return self.'call'(node, options :flat :named)
@@ -884,7 +884,7 @@ a 'pasttype' of if/unless.
884 884
885 885 =cut
886 886
887   -.sub 'if' :method :multi(_,['PAST::Op'])
  887 +.sub 'if' :method :multi(_,['PAST';'Op'])
888 888 .param pmc node
889 889 .param pmc options :slurpy :named
890 890
@@ -978,7 +978,7 @@ a 'pasttype' of if/unless.
978 978 ret
979 979 .end
980 980
981   -.sub 'unless' :method :multi(_, ['PAST::Op'])
  981 +.sub 'unless' :method :multi(_, ['PAST';'Op'])
982 982 .param pmc node
983 983 .param pmc options :slurpy :named
984 984 .return self.'if'(node, options :flat :named)
@@ -993,7 +993,7 @@ Return the POST representation of a C<while> or C<until> loop.
993 993
994 994 =cut
995 995
996   -.sub 'while' :method :multi(_, ['PAST::Op'])
  996 +.sub 'while' :method :multi(_, ['PAST';'Op'])
997 997 .param pmc node
998 998 .param pmc options :slurpy :named
999 999
@@ -1044,7 +1044,7 @@ Return the POST representation of a C<while> or C<until> loop.
1044 1044 .return (ops)
1045 1045 .end
1046 1046
1047   -.sub 'until' :method :multi(_, ['PAST::Op'])
  1047 +.sub 'until' :method :multi(_, ['PAST';'Op'])
1048 1048 .param pmc node
1049 1049 .param pmc options :slurpy :named
1050 1050 .return self.'while'(node, options :flat :named)
@@ -1058,7 +1058,7 @@ Return the POST representation of a C<repeat_while> or C<repeat_until> loop.
1058 1058
1059 1059 =cut
1060 1060
1061   -.sub 'repeat_while' :method :multi(_, ['PAST::Op'])
  1061 +.sub 'repeat_while' :method :multi(_, ['PAST';'Op'])
1062 1062 .param pmc node
1063 1063 .param pmc options :slurpy :named
1064 1064
@@ -1104,7 +1104,7 @@ Return the POST representation of a C<repeat_while> or C<repeat_until> loop.
1104 1104 .return (ops)
1105 1105 .end
1106 1106
1107   -.sub 'repeat_until' :method :multi(_, ['PAST::Op'])
  1107 +.sub 'repeat_until' :method :multi(_, ['PAST';'Op'])
1108 1108 .param pmc node
1109 1109 .param pmc options :slurpy :named
1110 1110 .return self.'repeat_while'(node, options :flat :named)
@@ -1118,7 +1118,7 @@ by C<node>.
1118 1118
1119 1119 =cut
1120 1120
1121   -.sub 'for' :method :multi(_, ['PAST::Op'])
  1121 +.sub 'for' :method :multi(_, ['PAST';'Op'])
1122 1122 .param pmc node
1123 1123 .param pmc options :slurpy :named
1124 1124
@@ -1213,7 +1213,7 @@ to C<ResizablePMCArray> if not set.
1213 1213
1214 1214 =cut
1215 1215
1216   -.sub 'list' :method :multi(_, ['PAST::Op'])
  1216 +.sub 'list' :method :multi(_, ['PAST';'Op'])
1217 1217 .param pmc node
1218 1218 .param pmc options :slurpy :named
1219 1219
@@ -1249,7 +1249,7 @@ a return value.
1249 1249
1250 1250 =cut
1251 1251
1252   -.sub 'return' :method :multi(_, ['PAST::Op'])
  1252 +.sub 'return' :method :multi(_, ['PAST';'Op'])
1253 1253 .param pmc node
1254 1254 .param pmc options :slurpy :named
1255 1255
@@ -1286,7 +1286,7 @@ handler.
1286 1286
1287 1287 =cut
1288 1288
1289   -.sub 'try' :method :multi(_, ['PAST::Op'])
  1289 +.sub 'try' :method :multi(_, ['PAST';'Op'])
1290 1290 .param pmc node
1291 1291 .param pmc options :slurpy :named
1292 1292
@@ -1341,7 +1341,7 @@ $x < $y and $y < $z, but $y only gets evaluated once.
1341 1341
1342 1342 =cut
1343 1343
1344   -.sub 'chain' :method :multi(_, ['PAST::Op'])
  1344 +.sub 'chain' :method :multi(_, ['PAST';'Op'])
1345 1345 .param pmc node
1346 1346 .param pmc options :slurpy :named
1347 1347 .local pmc clist, cpast
@@ -1350,7 +1350,7 @@ $x < $y and $y < $z, but $y only gets evaluated once.
1350 1350 clist = new 'ResizablePMCArray'
1351 1351 cpast = node
1352 1352 chain_loop:
1353   - $I0 = isa cpast, 'PAST::Op'
  1353 + $I0 = isa cpast, ['PAST';'Op']
1354 1354 if $I0 == 0 goto chain_end
1355 1355 .local string pasttype
1356 1356 pasttype = cpast.'pasttype'()
@@ -1403,7 +1403,7 @@ being refactored out using thunks of some sort.)
1403 1403
1404 1404 =cut
1405 1405
1406   -.sub 'def_or' :method :multi(_, ['PAST::Op'])
  1406 +.sub 'def_or' :method :multi(_, ['PAST';'Op'])
1407 1407 .param pmc node
1408 1408 .param pmc options :slurpy :named
1409 1409
@@ -1445,7 +1445,7 @@ a second child is found that evaluates as true.
1445 1445
1446 1446 =cut
1447 1447
1448   -.sub 'xor' :method :multi(_,['PAST::Op'])
  1448 +.sub 'xor' :method :multi(_,['PAST';'Op'])
1449 1449 .param pmc node
1450 1450 .param pmc options :slurpy :named
1451 1451
@@ -1504,7 +1504,7 @@ node with a 'pasttype' of bind.
1504 1504
1505 1505 =cut
1506 1506
1507   -.sub 'bind' :method :multi(_, ['PAST::Op'])
  1507 +.sub 'bind' :method :multi(_, ['PAST';'Op'])
1508 1508 .param pmc node
1509 1509 .param pmc options :slurpy :named
1510 1510
@@ -1533,7 +1533,7 @@ opcode -- see RT#47828).
1533 1533
1534 1534 =cut
1535 1535
1536   -.sub 'copy' :method :multi(_, ['PAST::Op'])
  1536 +.sub 'copy' :method :multi(_, ['PAST';'Op'])
1537 1537 .param pmc node
1538 1538 .param pmc options :slurpy :named
1539 1539 .local pmc rpast, rpost, lpast, lpost
@@ -1556,7 +1556,7 @@ node with a 'pasttype' of inline.
1556 1556
1557 1557 =cut
1558 1558
1559   -.sub 'inline' :method :multi(_, ['PAST::Op'])
  1559 +.sub 'inline' :method :multi(_, ['PAST';'Op'])
1560 1560 .param pmc node
1561 1561 .param pmc options :slurpy :named
1562 1562
@@ -1611,7 +1611,7 @@ attribute.
1611 1611
1612 1612 =cut
1613 1613
1614   -.sub 'as_post' :method :multi(_, ['PAST::Var'])
  1614 +.sub 'as_post' :method :multi(_, ['PAST';'Var'])
1615 1615 .param pmc node
1616 1616 .param pmc options :slurpy :named
1617 1617
@@ -1681,7 +1681,7 @@ attribute.
1681 1681 .end
1682 1682
1683 1683
1684   -.sub 'parameter' :method :multi(_, ['PAST::Var'])
  1684 +.sub 'parameter' :method :multi(_, ['PAST';'Var'])
1685 1685 .param pmc node
1686 1686 .param pmc bindpost
1687 1687
@@ -1727,7 +1727,7 @@ attribute.
1727 1727 .end
1728 1728
1729 1729
1730   -.sub 'package' :method :multi(_, ['PAST::Var'])
  1730 +.sub 'package' :method :multi(_, ['PAST';'Var'])
1731 1731 .param pmc node
1732 1732 .param pmc bindpost
1733 1733
@@ -1772,7 +1772,7 @@ attribute.
1772 1772 .end
1773 1773
1774 1774
1775   -.sub 'lexical' :method :multi(_, ['PAST::Var'])
  1775 +.sub 'lexical' :method :multi(_, ['PAST';'Var'])
1776 1776 .param pmc node
1777 1777 .param pmc bindpost
1778 1778
@@ -1814,7 +1814,7 @@ attribute.
1814 1814 .end
1815 1815
1816 1816
1817   -.sub 'keyed' :method :multi(_, ['PAST::Var'])
  1817 +.sub 'keyed' :method :multi(_, ['PAST';'Var'])
1818 1818 .param pmc node
1819 1819 .param pmc bindpost
1820 1820 .param string keyrtype :optional
@@ -1875,14 +1875,14 @@ attribute.
1875 1875 .end
1876 1876
1877 1877
1878   -.sub 'keyed_int' :method :multi(_, ['PAST::Var'])
  1878 +.sub 'keyed_int' :method :multi(_, ['PAST';'Var'])
1879 1879 .param pmc node
1880 1880 .param pmc bindpost
1881 1881 .return self.'keyed'(node, bindpost, 'i')
1882 1882 .end
1883 1883
1884 1884
1885   -.sub 'attribute' :method :multi(_, ['PAST::Var'])
  1885 +.sub 'attribute' :method :multi(_, ['PAST';'Var'])
1886 1886 .param pmc node
1887 1887 .param pmc bindpost
1888 1888
@@ -1928,7 +1928,7 @@ attribute.
1928 1928 .end
1929 1929
1930 1930
1931   -.sub 'register' :method :multi(_, ['PAST::Var'])
  1931 +.sub 'register' :method :multi(_, ['PAST';'Var'])
1932 1932 .param pmc node
1933 1933 .param pmc bindpost
1934 1934
@@ -1978,7 +1978,7 @@ to have a PMC generated containing the constant value.
1978 1978
1979 1979 =cut
1980 1980
1981   -.sub 'as_post' :method :multi(_, ['PAST::Val'])
  1981 +.sub 'as_post' :method :multi(_, ['PAST';'Val'])
1982 1982 .param pmc node
1983 1983 .param pmc options :slurpy :named
1984 1984
12 compilers/pct/src/PAST/Node.pir
@@ -9,7 +9,7 @@ for compiling programs in Parrot.
9 9
10 10 =cut
11 11
12   -.namespace [ 'PAST::Node' ]
  12 +.namespace [ 'PAST';'Node' ]
13 13
14 14 .sub 'onload' :anon :load :init
15 15 ## create the PAST::Node base class
@@ -118,7 +118,7 @@ Get/set the constant value for this node.
118 118
119 119 =cut
120 120
121   -.namespace [ 'PAST::Val' ]
  121 +.namespace [ 'PAST';'Val' ]
122 122
123 123 .sub 'value' :method
124 124 .param pmc value :optional
@@ -146,7 +146,7 @@ members and (optionally named) Parrot registers respectively.
146 146
147 147 =cut
148 148
149   -.namespace [ 'PAST::Var' ]
  149 +.namespace [ 'PAST';'Var' ]
150 150
151 151 .sub 'scope' :method
152 152 .param pmc value :optional
@@ -320,7 +320,7 @@ assumes "call".
320 320
321 321 =cut
322 322
323   -.namespace [ 'PAST::Op' ]
  323 +.namespace [ 'PAST';'Op' ]
324 324
325 325 .sub 'pasttype' :method
326 326 .param pmc value :optional
@@ -448,7 +448,7 @@ blocks in Perl6 C<if>, C<while>, and other similar statements).
448 448
449 449 =cut
450 450
451   -.namespace [ 'PAST::Block' ]
  451 +.namespace [ 'PAST';'Block' ]
452 452
453 453 .sub 'blocktype' :method
454 454 .param pmc value :optional
@@ -639,7 +639,7 @@ Get/set any pirflags for this block.
639 639 .end
640 640
641 641
642   -.namespace [ 'PAST::VarList' ]
  642 +.namespace [ 'PAST';'VarList' ]
643 643
644 644 .sub 'bindvalue' :method
645 645 .param pmc value :optional
7 compilers/pct/src/PCT/Grammar.pir
@@ -35,7 +35,7 @@ also included.
35 35
36 36 =cut
37 37
38   -.namespace [ 'PCT::Grammar' ]
  38 +.namespace [ 'PCT';'Grammar' ]
39 39
40 40 .sub 'onload' :anon :init :load
41 41 load_bytecode 'PGE.pbc'
@@ -43,8 +43,9 @@ also included.
43 43 .local pmc p6meta
44 44 p6meta = new 'P6metaclass'
45 45 p6meta.'new_class'('PCT::Grammar', 'parent'=>'PGE::Grammar')
46   - $P0 = get_class 'PCT::Grammar'
47   - $P1 = get_hll_global ['PGE::Util'], 'die'
  46 + $P0 = split '::', 'PCT::Grammar'
  47 + $P0 = get_class $P0
  48 + $P1 = get_hll_global ['PGE';'Util'], 'die'
48 49 $P0.'add_method'('panic', $P1)
49 50 .return ()
50 51 .end
30 compilers/pct/src/PCT/HLLCompiler.pir
@@ -19,7 +19,7 @@ running compilers from a command line.
19 19 $P0.'new_class'('PCT::HLLCompiler', 'attr'=>$S0)
20 20 .end
21 21
22   -.namespace [ 'PCT::HLLCompiler' ]
  22 +.namespace [ 'PCT';'HLLCompiler' ]
23 23
24 24 .include 'cclass.pasm'
25 25
@@ -319,7 +319,7 @@ to any options and return the resulting parse tree.
319 319 .sub 'parse' :method
320 320 .param pmc source
321 321 .param pmc adverbs :slurpy :named
322   - .local pmc parsegrammar_name, top
  322 + .local pmc parsegrammar, top
323 323
324 324 .local string tcode
325 325 tcode = adverbs['transcode']
@@ -336,11 +336,25 @@ to any options and return the resulting parse tree.
336 336 target = adverbs['target']
337 337 target = downcase target
338 338
339   - parsegrammar_name = self.'parsegrammar'()
340   - unless parsegrammar_name goto err_no_parsegrammar
341   - top = get_hll_global parsegrammar_name, 'TOP'
  339 + parsegrammar = self.'parsegrammar'()
  340 + $I0 = can parsegrammar, 'TOP'
  341 + unless $I0 goto parsegrammar_string
  342 + top = find_method parsegrammar, 'TOP'
  343 + goto have_top
  344 + parsegrammar_string:
  345 + $P0 = self.'parse_name'(parsegrammar)
  346 + $S0 = pop $P0
  347 + $P1 = get_hll_global $P0, $S0
  348 + $I0 = can $P1, 'TOP'
  349 + unless $I0 goto parsegrammar_ns
  350 + top = find_method $P1, 'TOP'
  351 + goto have_top
  352 + parsegrammar_ns:
  353 + $P0 = self.'parse_name'(parsegrammar)
  354 + top = get_hll_global $P0, 'TOP'
342 355 unless null top goto have_top
343   - self.'panic'('Cannot find TOP regex in ', parsegrammar_name)
  356 + err_notop:
  357 + self.'panic'('Cannot find TOP regex in ', parsegrammar)
344 358 have_top:
345 359 .local pmc parseactions, action
346 360 null action
@@ -367,7 +381,7 @@ to any options and return the resulting parse tree.
367 381 action = new parseactions
368 382 have_action:
369 383 .local pmc match
370   - match = top(source, 'grammar' => parsegrammar_name, 'action' => action)
  384 + match = top(source, 'grammar' => parsegrammar, 'action' => action)
371 385 unless match goto err_failedparse
372 386 .return (match)
373 387
@@ -406,7 +420,7 @@ resulting ast.
406 420 .local pmc ast
407 421 ast = source.'item'()
408 422 pop_eh
409   - $I0 = isa ast, 'PAST::Node'
  423 + $I0 = isa ast, ['PAST';'Node']
410 424 unless $I0 goto err_past
411 425 .return (ast)
412 426
6 compilers/pct/src/PCT/Node.pir
@@ -9,7 +9,7 @@ and opcode syntax tree (POST) nodes in the Parrot Compiler Toolkit.
9 9
10 10 =cut
11 11
12   -.namespace [ 'PCT::Node' ]
  12 +.namespace [ 'PCT';'Node' ]
13 13
14 14 .sub 'onload' :anon :load :init
15 15 ## create the PCT::Node base class
@@ -24,7 +24,7 @@ and opcode syntax tree (POST) nodes in the Parrot Compiler Toolkit.
24 24
25 25 $P0 = new 'Integer'
26 26 $P0 = 10
27   - set_hll_global ['PCT::Node'], '$!serno', $P0
  27 + set_hll_global ['PCT';'Node'], '$!serno', $P0
28 28
29 29 .return ()
30 30 .end
@@ -221,7 +221,7 @@ a C<Match> object and obtains source/position information from that.
221 221
222 222 .sub 'node' :method
223 223 .param pmc node
224   - $I0 = isa node, 'PAST::Node'
  224 + $I0 = isa node, ['PAST';'Node']
225 225 if $I0 goto clone_past
226 226 clone_pge:
227 227 $S0 = node
12 compilers/pct/src/POST/Compiler.pir
@@ -13,7 +13,7 @@ PIR or an Eval PMC (bytecode).
13 13
14 14 =cut
15 15
16   -.namespace [ 'POST::Compiler' ]
  16 +.namespace [ 'POST';'Compiler' ]
17 17
18 18 .sub '__onload' :load :init
19 19 .local pmc p6meta, cproto
@@ -37,7 +37,7 @@ PIR or an Eval PMC (bytecode).
37 37 .param pmc adverbs :slurpy :named
38 38
39 39 .local pmc newself
40   - newself = new 'POST::Compiler'
  40 + newself = new ['POST';'Compiler']
41 41
42 42 ## start with empty code
43 43 .local pmc subcode, code
@@ -46,7 +46,7 @@ PIR or an Eval PMC (bytecode).
46 46 push subcode, code
47 47
48 48 ## if the root node isn't a Sub, wrap it
49   - $I0 = isa post, 'POST::Sub'
  49 + $I0 = isa post, ['POST';'Sub']
50 50 if $I0 goto have_sub
51 51 $P0 = get_hll_global ['POST'], 'Sub'
52 52 post = $P0.'new'(post, 'name'=>'anon')
@@ -103,7 +103,7 @@ Return pir for an operation node.
103 103
104 104 =cut
105 105
106   -.sub 'pir' :method :multi(_,['POST::Op'])
  106 +.sub 'pir' :method :multi(_,['POST';'Op'])
107 107 .param pmc node
108 108
109 109 ## determine the type of operation
@@ -173,7 +173,7 @@ Generate a label.
173 173
174 174 =cut
175 175
176   -.sub 'pir' :method :multi(_, ['POST::Label'])
  176 +.sub 'pir' :method :multi(_, ['POST';'Label'])
177 177 .param pmc node
178 178 .local string code, value
179 179 value = node.'result'()
@@ -192,7 +192,7 @@ the sub.
192 192
193 193 =cut
194 194
195   -.sub 'pir' :method :multi(_, ['POST::Sub'])
  195 +.sub 'pir' :method :multi(_, ['POST';'Sub'])
196 196 .param pmc node
197 197
198 198 .local pmc subcode
14 compilers/pct/src/POST/Node.pir
@@ -29,7 +29,7 @@ for compiling programs in Parrot.
29 29 $P0[4] = " .param pmc %0 :named(%1)"
30 30 $P0[5] = " .param pmc %0 :optional :named(%1)\n .param int has_%0 :opt_flag"
31 31 $P0[6] = " .param pmc %0 :slurpy :named"
32   - set_hll_global ['POST::Sub'], '%!paramfmt', $P0
  32 + set_hll_global ['POST';'Sub'], '%!paramfmt', $P0
33 33 .return ()
34 34 .end
35 35
@@ -49,7 +49,7 @@ Get/set
49 49
50 50 =cut
51 51
52   -.namespace [ 'POST::Node' ]
  52 +.namespace [ 'POST';'Node' ]
53 53
54 54 =item result([value])
55 55
@@ -66,7 +66,7 @@ as the result of the current node.
66 66 if has_value == 1 goto set_value
67 67 value = self['result']
68 68 if null value goto result_null
69   - $I0 = isa value, 'POST::Node'
  69 + $I0 = isa value, ['POST';'Node']
70 70 if $I0 goto result_node
71 71 .return (value)
72 72 result_node:
@@ -138,7 +138,7 @@ Get/set the opcode type for this node.
138 138
139 139 =cut
140 140
141   -.namespace [ 'POST::Op' ]
  141 +.namespace [ 'POST';'Op' ]
142 142
143 143 .sub 'pirop' :method
144 144 .param pmc value :optional
@@ -153,7 +153,7 @@ Get/set the opcode type for this node.
153 153 .end
154 154
155 155
156   -.namespace [ 'POST::Label' ]
  156 +.namespace [ 'POST';'Label' ]
157 157
158 158 .sub 'result' :method
159 159 .param pmc value :optional
@@ -171,7 +171,7 @@ Get/set the opcode type for this node.
171 171 .end
172 172
173 173
174   -.namespace [ 'POST::Sub' ]
  174 +.namespace [ 'POST';'Sub' ]
175 175
176 176 .sub 'blocktype' :method
177 177 .param pmc value :optional
@@ -256,7 +256,7 @@ Get/set the opcode type for this node.
256 256 have_code:
257 257
258 258 .local pmc paramfmt
259   - paramfmt = get_hll_global ['POST::Sub'], '%!paramfmt'
  259 + paramfmt = get_hll_global ['POST';'Sub'], '%!paramfmt'
260 260 $S0 = paramfmt[paramseq]
261 261 named = code.'escape'(named)
262 262 code.'emit'($S0, pname, named)
69 compilers/pge/PGE/Exp.pir
@@ -4,7 +4,7 @@ PGE::Exp - base class for expressions
4 4
5 5 =cut
6 6
7   -.namespace [ "PGE::Exp" ]
  7 +.namespace [ 'PGE';'Exp' ]
8 8
9 9 .include "interpinfo.pasm"
10 10 .include "cclass.pasm"
@@ -22,7 +22,7 @@ PGE::Exp - base class for expressions
22 22 .local pmc term
23 23
24 24 .local pmc p6meta, expproto
25   - p6meta = new 'P6metaclass'
  25 + p6meta = get_hll_global 'P6metaclass'
26 26 expproto = p6meta.'new_class'('PGE::Exp', 'parent'=>'PGE::Match')
27 27 p6meta.'new_class'('PGE::Exp::Literal', 'parent'=>expproto)
28 28 p6meta.'new_class'('PGE::Exp::Scalar', 'parent'=>expproto)
@@ -76,7 +76,9 @@ C<target> adverbs.
76 76 .local string grammar
77 77 grammar = adverbs['grammar']
78 78 if grammar == '' goto ns_root
79   - code.'emit'(".namespace [ '%0' ]", grammar)
  79 + $P0 = split '::', grammar
  80 + $P0 = code.'key'($P0 :flat)
  81 + code.'emit'(".namespace %0", $P0)
80 82 goto ns_done
81 83 ns_root:
82 84 code.'emit'('.namespace')
@@ -91,8 +93,9 @@ C<target> adverbs.
91 93 $P0 = compreg 'PIR'
92 94 $P1 = $P0(code)
93 95 make_grammar:
  96 + if grammar == '' goto end
94 97 push_eh end
95   - $P0 = new 'P6metaclass'
  98 + $P0 = get_hll_global 'P6metaclass'
96 99 $P0.'new_class'(grammar, 'parent'=>'PGE::Grammar')
97 100 pop_eh
98 101 end:
@@ -131,7 +134,7 @@ tree as a PIR code object that can be compiled.
131 134 .local pmc exp
132 135 .local string explabel
133 136 exp = self
134   - set_hll_global ['PGE::Exp'], '$!group', exp
  137 + set_hll_global ['PGE';'Exp'], '$!group', exp
135 138 exp = exp.reduce(self)
136 139
137 140 ## we don't need a coroutine if :ratchet is set
@@ -327,7 +330,7 @@ tree as a PIR code object that can be compiled.
327 330 .end
328 331
329 332
330   -.namespace [ 'PGE::Exp::Literal' ]
  333 +.namespace [ 'PGE';'Exp';'Literal' ]
331 334
332 335 .sub 'reduce' :method
333 336 .param pmc next
@@ -369,7 +372,7 @@ tree as a PIR code object that can be compiled.
369 372 .end
370 373
371 374
372   -.namespace [ 'PGE::Exp::Concat' ]
  375 +.namespace [ 'PGE';'Exp';'Concat' ]
373 376
374 377 .sub 'reduce' :method
375 378 .param pmc next
@@ -396,10 +399,10 @@ tree as a PIR code object that can be compiled.
396 399 inc i
397 400 if i >= n goto concat_lit_end
398 401 exp1 = children[i]
399   - $I1 = isa exp1, 'PGE::Exp::Literal'
  402 + $I1 = isa exp1, ['PGE';'Exp';'Literal']
400 403 if $I1 == 0 goto concat_lit_shift
401 404 exp0 = children[j]
402   - $I0 = isa exp0, 'PGE::Exp::Literal'
  405 + $I0 = isa exp0, ['PGE';'Exp';'Literal']
403 406 if $I0 == 0 goto concat_lit_shift
404 407 $I0 = exp0['ignorecase']
405 408 $I1 = exp1['ignorecase']
@@ -450,7 +453,7 @@ tree as a PIR code object that can be compiled.
450 453 .end
451 454
452 455
453   -.namespace [ 'PGE::Exp::Quant' ]
  456 +.namespace [ 'PGE';'Exp';'Quant' ]
454 457
455 458 .sub 'reduce' :method
456 459 .param pmc next
@@ -620,7 +623,7 @@ tree as a PIR code object that can be compiled.
620 623 .end
621 624
622 625
623   -.namespace [ 'PGE::Exp::Group' ]
  626 +.namespace [ 'PGE';'Exp';'Group' ]
624 627
625 628 .sub 'reduce' :method
626 629 .param pmc next
@@ -631,9 +634,9 @@ tree as a PIR code object that can be compiled.
631 634 ## This group is non-backtracking, so concatenate a "cut group"
632 635 ## node (PGE::Exp::Cut) to its child.
633 636 exp = self[0]
634   - $P0 = new 'PGE::Exp::Concat'
  637 + $P0 = new ['PGE';'Exp';'Concat']
635 638 $P0[0] = exp
636   - $P1 = new 'PGE::Exp::Cut'
  639 + $P1 = new ['PGE';'Exp';'Cut']
637 640 $P0[1] = $P1
638 641 self[0] = $P0
639 642
@@ -641,11 +644,11 @@ tree as a PIR code object that can be compiled.
641 644 .local pmc group
642 645 ## Temporarily store this group as the current group. Any
643 646 ## cut nodes we encounter will set a cutmark into this group.
644   - group = get_hll_global ['PGE::Exp'], '$!group'
645   - set_hll_global ['PGE::Exp'], '$!group', self
  647 + group = get_hll_global ['PGE';'Exp'], '$!group'
  648 + set_hll_global ['PGE';'Exp'], '$!group', self
646 649 exp = self[0]
647 650 exp = exp.reduce(next)
648   - set_hll_global ['PGE::Exp'], '$!group', group
  651 + set_hll_global ['PGE';'Exp'], '$!group', group
649 652 $I0 = self['cutmark']
650 653 if $I0 > 0 goto keep_group
651 654 $I0 = self['iscapture']
@@ -683,7 +686,7 @@ tree as a PIR code object that can be compiled.
683 686 .end
684 687
685 688
686   -.namespace [ 'PGE::Exp::CGroup' ]
  689 +.namespace [ 'PGE';'Exp';'CGroup' ]
687 690
688 691 .sub 'pir' :method
689 692 .param pmc code
@@ -751,7 +754,7 @@ tree as a PIR code object that can be compiled.
751 754 .end
752 755
753 756
754   -.namespace [ 'PGE::Exp::Subrule' ]
  757 +.namespace [ 'PGE';'Exp';'Subrule' ]
755 758
756 759 .sub 'reduce' :method
757 760 .param pmc next
@@ -796,11 +799,13 @@ tree as a PIR code object that can be compiled.
796 799 rname = substr subname, $I0
797 800 $I0 -= 2
798 801 grammar = substr subname, 0, $I0
799   - code.emit(<<" CODE", grammar, rname, args :flat :named)
  802 + $P0 = split '::', grammar
  803 + $P0 = code.'key'($P0)
  804 + code.emit(<<" CODE", grammar, rname, $P0, args :flat :named)
800 805 %L: # grammar subrule %0::%1
801 806 captob = captscope.'new'(captscope, 'grammar'=>'%0')
802 807 captob.'to'(pos)
803   - $P0 = get_hll_global ['%0'], '%1'
  808 + $P0 = get_hll_global %2, '%1'
804 809 CODE
805 810 goto subrule_match
806 811
@@ -893,7 +898,7 @@ tree as a PIR code object that can be compiled.
893 898 .end
894 899
895 900
896   -.namespace [ 'PGE::Exp::Alt' ]
  901 +.namespace [ 'PGE';'Exp';'Alt' ]
897 902
898 903 .sub 'reduce' :method
899 904 .param pmc next
@@ -932,7 +937,7 @@ tree as a PIR code object that can be compiled.
932 937 .end
933 938
934 939
935   -.namespace [ 'PGE::Exp::Anchor' ]
  940 +.namespace [ 'PGE';'Exp';'Anchor' ]
936 941
937 942 .sub 'reduce' :method
938 943 .param pmc next
@@ -1046,7 +1051,7 @@ tree as a PIR code object that can be compiled.
1046 1051 .end
1047 1052
1048 1053
1049   -.namespace [ 'PGE::Exp::CCShortcut' ]
  1054 +.namespace [ 'PGE';'Exp';'CCShortcut' ]
1050 1055
1051 1056 .sub 'reduce' :method
1052 1057 .param pmc next
@@ -1186,7 +1191,7 @@ tree as a PIR code object that can be compiled.
1186 1191
1187 1192 .end
1188 1193
1189   -.namespace [ 'PGE::Exp::Cut' ]
  1194 +.namespace [ 'PGE';'Exp';'Cut' ]
1190 1195
1191 1196 .sub 'reduce' :method
1192 1197 .param pmc next
@@ -1198,7 +1203,7 @@ tree as a PIR code object that can be compiled.
1198 1203 ## This node is cutting a group. We need to
1199 1204 ## get the current group's cutmark, or set
1200 1205 ## one if it doesn't already have one.
1201   - group = get_hll_global ['PGE::Exp'], '$!group'
  1206 + group = get_hll_global ['PGE';'Exp'], '$!group'
1202 1207 cutmark = group['cutmark']
1203 1208 if cutmark > 0 goto has_cutmark
1204 1209 $P1 = new 'CodeString'
@@ -1238,7 +1243,7 @@ tree as a PIR code object that can be compiled.
1238 1243 .end
1239 1244
1240 1245
1241   -.namespace [ 'PGE::Exp::Scalar' ]
  1246 +.namespace [ 'PGE';'Exp';'Scalar' ]
1242 1247
1243 1248 .sub 'reduce' :method
1244 1249 .param pmc next
@@ -1272,7 +1277,7 @@ tree as a PIR code object that can be compiled.
1272 1277 .end
1273 1278
1274 1279
1275   -.namespace [ 'PGE::Exp::EnumCharList' ]
  1280 +.namespace [ 'PGE';'Exp';'EnumCharList' ]
1276 1281
1277 1282 .sub 'reduce' :method
1278 1283 .param pmc next
@@ -1314,7 +1319,7 @@ tree as a PIR code object that can be compiled.
1314 1319 .end
1315 1320
1316 1321
1317   -.namespace [ 'PGE::Exp::Newline' ]
  1322 +.namespace [ 'PGE';'Exp';'Newline' ]
1318 1323
1319 1324 .sub 'reduce' :method
1320 1325 .param pmc next
@@ -1339,7 +1344,7 @@ tree as a PIR code object that can be compiled.
1339 1344 .end
1340 1345
1341 1346
1342   -.namespace [ 'PGE::Exp::Conj' ]
  1347 +.namespace [ 'PGE';'Exp';'Conj' ]
1343 1348
1344 1349 .sub 'reduce' :method
1345 1350 .param pmc next
@@ -1397,7 +1402,7 @@ tree as a PIR code object that can be compiled.
1397 1402 .return ()
1398 1403 .end
1399 1404
1400   -.namespace [ "PGE::Exp::Closure" ]
  1405 +.namespace [ 'PGE';'Exp';'Closure' ]
1401 1406
1402 1407 .sub 'reduce' :method
1403 1408 .param pmc next
@@ -1422,7 +1427,7 @@ tree as a PIR code object that can be compiled.
1422 1427 code.emit(<<" CODE", label, next, lang, value)
1423 1428 %0: # closure
1424 1429 $S1 = %3
1425   - $P0 = get_hll_global ['PGE::Match'], '%!cache'
  1430 + $P0 = get_hll_global ['PGE';'Match'], '%!cache'
1426 1431 $P1 = $P0[$S1]
1427 1432 unless null $P1 goto %0_1
1428 1433 $P1 = compreg %2
@@ -1443,7 +1448,7 @@ tree as a PIR code object that can be compiled.
1443 1448 .return ()
1444 1449 .end
1445 1450
1446   -.namespace [ "PGE::Exp::Action" ]
  1451 +.namespace [ 'PGE';'Exp';'Action' ]
1447 1452
1448 1453 .sub 'reduce' :method
1449 1454 .param pmc next
23 compilers/pge/PGE/Match.pir
@@ -8,7 +8,7 @@ This file implements match objects returned by the Parrot Grammar Engine.
8 8
9 9 =cut
10 10
11   -.namespace [ 'PGE::Match' ]
  11 +.namespace [ 'PGE';'Match' ]
12 12
13 13 .sub '__onload' :load
14 14 load_bytecode 'P6object.pbc'
@@ -57,23 +57,24 @@ is set or implied.
57 57
58 58 ## set values based on src param
59 59 .local int issrcmatch, pos, iscont
60   - .local string grammar
61   - .local pmc target
62   - issrcmatch = isa src, 'PGE::Match'
  60 + .local pmc grammar
  61 + .local pmc target, grammar_class
  62 + issrcmatch = isa src, ['PGE';'Match']
63 63 if issrcmatch goto target_from_src
64 64 .local pmc target
65 65 target = new 'String'
66 66 target = src
67 67 pos = 0
68 68 iscont = 1
69   - grammar = typeof self
  69 + $P0 = self.'HOW'()
  70 + grammar_class = getattribute $P0, 'parrotclass'
70 71 goto adverb_pos
71 72 target_from_src:
72 73 target = getattribute src, '$.target'
73 74 $P0 = getattribute src, '$.pos'
74 75 pos = $P0
75 76 iscont = 0
76   - grammar = typeof src
  77 + grammar_class = typeof src
77 78 if pos >= 0 goto adverb_pos
78 79 pos = 0
79 80
@@ -108,12 +109,20 @@ is set or implied.
108 109 $I0 = exists adverbs['grammar']
109 110 unless $I0 goto with_grammar
110 111 grammar = adverbs['grammar']
  112 + $S0 = typeof grammar
  113 + eq $S0, 'NameSpace', grammar_namespace
  114 + $S0 = grammar
  115 + $P0 = split '::', $S0
  116 + grammar_class = get_class $P0
  117 + goto with_grammar
  118 + grammar_namespace:
  119 + grammar_class = grammar
111 120 with_grammar:
112 121 with_adverbs:
113 122
114 123 ## create the new match object
115 124 .local pmc mob, mfrom, mpos
116   - mob = new grammar
  125 + mob = new grammar_class
117 126 setattribute mob, '$.target', target
118 127 mfrom = new 'Integer'
119 128 mfrom = pos
6 compilers/pge/PGE/OPTable.pir
@@ -10,7 +10,7 @@ PGE::OPTable - PGE operator precedence table and parser
10 10
11 11 =cut
12 12
13   -.namespace [ "PGE::OPTable" ]
  13 +.namespace [ 'PGE';'OPTable' ]