MAD

acme on 2007-07-09T09:44:48

Now that Perl 5.9.5 is out, you can finally play with Misc Attribution Declaration to use the perl parser for fun and profit. First you compile it with something like:

./configure.gnu --prefix=/home/acme/perl595 -Dusedevel -Dmad=y 
make && make test && make install

Then if you have a foo.pl:

my $a = 1;
my $b = 2;
print $a + $b;

Then running "PERL_XMLDUMP="foo.xml" ./perl foo.pl " gives the following in foo.xml:


    
    
        
            
        
    
    
        
            
            
        
    
    
        
            
            
        
        
            
                
                
            
        
        
            
                
                
                
                
            
        
    
    
        
            
            
        
    
    
        
            
            
        
        
            
                
                
            
        
        
            
                
                
                
            
        
    
    
        
            
            
            
        
    
    
        
            
        
        
        
            
                
                
            
            
                
                    
                    
                
            
            
                
                    
                    
                
            
        
    
    

Figure out what all that XML means and you can write the first correct Perl syntax highlighter, implement JPerl (Jerl?), save the planet...


Perl syntax highlighter?

Alias on 2007-07-09T12:25:52

... or optree syntax highlighter?

“madprops”

Aristotle on 2007-07-09T14:09:07

*rimshot*