Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Usage for yarp.pl:
perl yarp.pl <compile_log> <output_csv>
Usage for dump_recipe_at_line.pl:
perl dump_recipe_at_line.pl <compile_log> <line|line_list_file>
The idea of dump_recipe_at_line.pl is so you can take a column of line numbers from the CSV created by yarp and see what happened (without having to open the 300MB file)
with a single column:
...
226242
...
you get:
...
226242 <recipe name blah blah blah...
...
With two columns in the file, you can have some more readable output:
...
226242 m:/sf/mw/classicui/group/bld.inf
...
you get:
...
m:/sf/mw/classicui/group/bld.inf(226242): <recipe name blah blah blah...
...
#!/usr/bin/perl
# Copyright (c) 2009 Symbian Foundation Ltd
# This component and the accompanying materials are made available
# under the terms of the License "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Symbian Foundation Ltd - initial contribution.
#
# Contributors:
# Matt Davies <mattd@symbian.org>
#
# Description:
# dumprecipe.pl : Gives you the recipe starting with the given line number
# perl dumprecipe.pl <log> <line>
#
# Tool is generally for use with yarp, to look at individual errors, and was written as the logs are too verbose for many editors to handle.
# As usual, this tool is rough and ready.
use strict;
my $file = shift @ARGV;
my $number = shift @ARGV;
my %numbers;
if(!-e $number && $number =~ m/^\d+$/)
{
$numbers{$number} = $number;
}
else
{
open(NUMBERS, "<$number") or die "Couldn't open $number";
while(my $line = <NUMBERS>)
{
if($line =~ m/(\d+)\s+(\S+)/)
{
$numbers{$1} = "$2($1)";
}
elsif($line =~ m/(\d+)/)
{
$numbers{$1} = $1;
}
}
close NUMBERS;
}
open(FILE,"<$file") or die "Coudln't open file $file\n";
my $linecount = 0;
my $recipe = 0;
while(my $line = <FILE>)
{
++$linecount;
if(!$recipe && defined $numbers{$linecount})
{
$recipe = $numbers{$linecount};
}
if($recipe)
{
print $recipe."\t".$line;
}
if($line =~ m/<\/recipe>/)
{
$recipe = 0;
}
}
#print $linecount;