Meta

 view release on metacpan or  search on metacpan

Meta/Baseline/Cook.pm  view on Meta::CPAN

sub print_deps_handle($$) {
	my($deps,$file)=@_;
	#put a nice emblem to begin the file
	Meta::Baseline::Utils::cook_emblem_print($file);
	# iterate over the nodes
	for(my($i)=0;$i<$deps->node_size();$i++) {
		my($node)=$deps->nodes()->elem($i);
		my($out_edges)=$deps->edge_ou($node);
		# only if there are dependencies
		if($out_edges->size()>0) {
			print $file "cascade ".$node."=\n";
			for(my($j)=0;$j<$out_edges->size();$j++) {
				my($edge)=$out_edges->elem($j);
				print $file $edge."\n";
			}
			print $file ";\n";
		}
	}
	return(1);
}

Meta/Baseline/Cook.pm  view on Meta::CPAN

	my($exte)="deps/".$f_path.$f_name.".deps";
	#Meta::Utils::Output::print("trying [".$exte."]\n");
	my($full)=Meta::Baseline::Aegis::which_nodie($exte);
	if(defined($full)) {
		my(@list);
		my($io)=Meta::IO::File->new_reader($full);
		# read the first comment line.
		my($line)=$io->cgetline();
		# if we have dep information
		if(!$io->eof()) {
			# read the cascade line
			$line=$io->cgetline();
			my($new)=($line=~/^cascade (.*)=$/);
			#Meta::Utils::Output::print("inserting node [".$new."]\n");
			$deps->node_insert($new);
			while(!$io->eof()) {
				if($line ne ";") {
					if(!$deps->node_has($line)) {
						push(@list,$line);
					}
					$deps->node_insert($line);
					#Meta::Utils::Output::print("inserting node [".$line."]\n");
					$deps->edge_insert($new,$line);

Meta/Baseline/Lang/Java.pm  view on Meta::CPAN

}

sub c2deps($) {
	my($buil)=@_;
	my($srcx)=$buil->get_srcx();
	my($modu)=$buil->get_modu();
	my($targ)=$buil->get_targ();
	my($path)=$buil->get_path();
	open(FILE,"> ".$targ) || throw Meta::Error::Simple("unable to open file [".$targ."]");
	Meta::Baseline::Utils::cook_emblem_print(*FILE);
	print FILE "cascade ".$srcx."=\n";
	my($obje)=Meta::Utils::Parse::Text->new();
	$obje->init_file($srcx);
	while(!$obje->get_over()) {
		my($line)=$obje->get_line();
		if($line=~/^import meta\..*;$/) {
#			Meta::Utils::Output::print("line is [".$line."]\n");
			my($class)=($line=~/^import (.*);$/);
			my($file)=class2file($class);
			print FILE $file."\n";
		}

Meta/Baseline/Lang/Xmlx.pm  view on Meta::CPAN

		#}
	}
	if($type eq "perlpkgs") {
		my($pkgs)=Meta::Lang::Perl::Perlpkgs->new_file($srcx);
		my($string);
		for(my($i)=0;$i<$pkgs->size();$i++) {
			my($curr)=$pkgs->getx($i);
			$string.="base_xmlx_file_objx_perl+=".$curr->get_pack_file_name().";\n";
			$string.=$curr->get_pack_file_name().": ".$modu."\n";
			$string.="\t[base_tool_depx]\n";
			$string.="\tset cascade\n";
			$string.="\thost-binding [base_host_scr]\n";
			$string.="{\n";
			$string.="function base_doit [base_tool] [base_protect [head [need]]] [base_protect [resolve [head [need]]]] [base_protect [targets]] [base_search_path] --type perl --lang xmlx;\n";
			$string.="}\n";
		}
		Meta::Utils::File::File::save($targ,$string);
		return(1);
	}
	throw Meta::Error::Simple("what kind of xml type is [".$type."]");
	return(0);

Meta/Lang/Cpp/cpp_check_cycles.pl  view on Meta::CPAN

	Meta::Utils::Output::print("Constructing edges...\n");
}
while(my($key,$val)=each(%$sour)) {
	if(Meta::Lang::Perl::Perl::is_perl($key)) {
		my($basename)=File::Basename::basename($key,"\.pm","\.pl");
		my($dirname)=File::Basename::dirname($key);
		my($real)="deps/".$dirname."/".$basename.".deps";
		my($load);
		Meta::Utils::File::File::load_deve($real,$load);
		if(defined($load)) {
			my($addx)=$load=~/^.*\ncascade $key=\n(.*);$/s;
			my(@allx)=split('\n',$addx);
			for(my($i)=0;$i<=$#allx;$i++) {
				my($curr)=$allx[$i];
				#make sure we have the nodes
				$grap->node_insert($key);
				$grap->node_insert($curr);
				$grap->edge_insert($key,$curr);
			}
		}
	}

Meta/Lang/Perl/Deps.pm  view on Meta::CPAN

	my($grap,$modu,$inte,$exte,$path)=@_;
	$grap->node_insert($modu);
	my($fdep)=&module_to_deps($modu);
	my($deps)=Meta::Utils::File::Path::resolve($path,$fdep,":");
	my($io)=Meta::IO::File->new_reader($deps);
	while(!$io->eof()) {
		my($line)=$io->cgetline();
		if($line=~/^\/\*/) {#skip comment lines
			next;
		}
		if($line=~/^cascade .*=$/) {#read name of module and make sure it's the one we got
			my($node)=($line=~/^cascade (.*)=$/);
			if($node ne $modu) {
				throw Meta::Error::Simple("node [".$node."] ne modu [".$modu."]");
			}
			next;
		}
		if($line eq ";") {#skip the end line
			next;
		}
		#otherwise - its an edge-find out if we want to add it
		my($addx);

Meta/Tool/Cincl.pm  view on Meta::CPAN

		push(@args,"--Absent_Local_Error");
	}

	push(@args,(
		"--Language=C",
		"--No_Cache",
		"--No_Source_Relative_Includes",
		"--No_Recursion",
		"--No_Absolute_Paths",
		"--Output",$targ,
		"--PREfix=".Meta::Baseline::Utils::get_cook_emblem()."cascade ".$modu."=",
		"--SUFfix=;",
		"--Absent_Program_Error",
		"-I-"
	));

# see (4)

	for(my($i)=0;$i<=$#edir;$i++) {
		push(@args,"-I");
		push(@args,$edir[$i]);

Meta/Tool/Cincl.pm  view on Meta::CPAN

=over 4

=item B<BEGIN()>

A bootstrap method to find where your c_incl is.

=item B<run($)>

This method does most of the work. A lot of documentation will now follow. 

If you do not know what is the cascade method for dependency managment
and calculation in cook I hereby refer you to the cook manual to that
chapter.
If you do not know what the cc,hh,ii,tt suffixes stand for in C++ development
please read about it in the C++ sections.

parameters to this utility:
0. modu - source file that the dependencies are for without prefixes.
1. srcx - source file to generate dependencies for.
2. targ - file to be the output file.
3. path - orderd search path for in project include files.

Meta/Tool/Cincl.pm  view on Meta::CPAN

	with libraries which store header files not in the standard directories
	searched by the compiler.
1. elib - extra path to look for libraries in. This should not point into the
	baseline or change as it is referenced only to enable you to link
	with libraries which stroe dll files not in the standard directories
	searched by the compiler.

Here are the explanations for all the parameters that are give to c_incl:
0. $srcx - this is the C++ file that we wish to analyze dependencies for.
1. C<--Language=C> - we are working with C. If you dont like it - go home.
2. C<--No_Cache> - do not use c_incl caching (we are using the cascade
	dependency method and caching is useless in this method).
3. C<--No_Source_Relative_Includes> - this is a must in a source control
	environment so people wont do "include "../that.h" (they dont
	actually know if that.h is in their change or in the baseline).
4. C<--No_Recursion> - do not recurse - print only the direct includes for
	this file (scan only this file). This is an integral part of the
	cascade method for dependency handling - consult the cook
	manual if you do not understand this.
5. C<--No_Absolute_Paths> - do not put absolute paths in the output.
6. C<--Output $targ> - what file is the output of this process.
7. C<--PREfix> - this is to make the syntax for the cook work.
	notice the $modu parameter which is the name of the source file
	without the baseline or change prefix.
8. C<--SUFfix> - this is to make the syntax for the cook work.
9. C<--Absent_Program_Error> - we want c_incl to go crazy if it cannot find
	the source file.
10. B<-I-> - to prevent any misconceptions of c_incl about where our include



( run in 0.663 second using v1.01-cache-2.11-cpan-49f99fa48dc )