develooper Front page | perl.recdescent | Postings from October 2004

R:RD grammars inside object

Thread Next
From:
raptor@tvskat.net
Date:
October 13, 2004 01:38
Subject:
R:RD grammars inside object
Message ID:
20041013113750.09703164@bugs
hi,

if i have something like this :


package Blah;

our %hash;

$::RD_AUTOACTION = q{ 	$Blah::hash{$item[0]} = $item[0]; 1 };# f.e.
my $grammar =q{

	........
}


sub parse { 
	my $self = shift;
	my $str = join ' ',  @{ $$self{cmd} };
	my $parser = new Parse::RecDescent ($grammar); 
	$parser->start($str) or die "parsing error !!\n";                                                                                                                                                                                             }

 

Now I want to do something like this :

$::RD_AUTOACTION = q{ 	$$self{_blah}{$item[0]} = $item[0]; 1 };

i.e. How to accesses object-instance-data from inside the grammar instead of the class-data.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About