Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / site_perl / 5.8.0 / Psh / Support / Debug.pm
CommitLineData
86530b38
AT
1package Psh::Support::Debug;
2
3my %token_types= ( 0=> 'END', 1=>'WORD:',2=>'PIPE',
4 3=>'REDIRECT',4=>'BACKGROUND',
5 5=>'OR', 6=> 'AND');
6
7sub explain_tokens {
8 my $tokens= shift;
9 my @result=();
10 my @tokens= @$tokens;
11 foreach my $tok (@tokens) {
12 if (ref $tok eq 'ARRAY') {
13 my @tok=@$tok;
14 my $type= shift @tok;
15 if ($type==0) {
16 push @result,"\n";
17 } else {
18 $type= $token_types{$type} if $token_types{$type};
19 push @result, join('',$type,@tok,' ');
20 }
21 }
22 }
23 return join('',@result);
24}
25
261;