Author: kjs
Date: Wed Mar 26 04:24:05 2008
New Revision: 26563
Modified:
trunk/compilers/nqp/bootstrap/actions.pm
Log:
[nqp] update bootstrap/actions.pm a bit.
Modified: trunk/compilers/nqp/bootstrap/actions.pm
==============================================================================
--- trunk/compilers/nqp/bootstrap/actions.pm (original)
+++ trunk/compilers/nqp/bootstrap/actions.pm Wed Mar 26 04:24:05 2008
@@ -1,16 +1,12 @@
# Copyright (C) 2007-2008, The Perl Foundation.
# $Id$
-## Actions for the NQP compiler, written in NQP.
-## Some minor changes were made to the grammar, such as
-## removal of superfluous keys. This actions file must be
-## aligned to NQP's current grammar file, and some parts
-## should be finished, such as some built-in operators,
-## the for-statement seems broken, etc.
-##
+
+
class NQP::Grammar::Actions;
+
method TOP($/) {
my $past := $($<statement_block>);
$past.blocktype('declaration');
@@ -459,7 +455,7 @@
#### Terms and expressions ####
-method term($/) {
+method term($/, $key) {
my $past := $($<noun>);
for $<postfix> {
my $term := $past;
@@ -752,6 +748,10 @@
#if ($<sym> eq 'class') { ...code to make class... }
make $past;
+ # PIR q< $P0 = get_hll_global ['NQP::Grammar::Actions'],
'package_declarator_helper' >;
+ # PIR q< $P1 = find_lex '$/' >;
+ # PIR q< $P2 = find_lex '$key' >;
+ # PIR q< $P0($P1, $P2) >;
}
#
##.sub 'package_declarator' :method
@@ -902,7 +902,7 @@
-## stolen from NQP
+
method typename($/) {
my $ns := $<name><ident>;
my $shortname;
@@ -977,6 +977,7 @@
my $past := PAST::Op.new( :name($<type>),
:pasttype($<top><pasttype>),
:pirop($<top><pirop>),
+ :inline($<top><inline>),
:lvalue($<top><lvalue>),
:node($/)
);
@@ -988,22 +989,6 @@
}
-#method EXPR($/, $key) {
-# if ($key eq 'end') {
-# make $($<expr>);
-# }
-# my $past := PAST::Op.new( :node($/),
-# :name($<type>),
-# :pasttype($<top><pasttype>),
-# :inline($<top><inline>),
-# :pirop($<top><pirop>),
-# :lvalue($<top><lvalue>)
-# );
-# for @($/) {
-# $past.push($($_));
-# }
-# make $past;
-#}
##.sub 'EXPR' :method
## .param pmc match
## .param pmc key