Main Neurospaces logo neurospaces 0.1675 Thu, 27 Dec 2007 15:58:18 -0600 hugo

Index of group ./specifications/code/allocations


Index
Up

symbol allocations and alias creation

1. Alias creation count consistency checker

1. Alias creation count consistency checker

This command definition is currently disabled (disabled is 'This test worked until I added code for automatic generation of the grammar rules. Likely this made hierarchy/symbols more complicated such that this test triggers bugs in Data::Transormator.')

01: $VAR1 = sub {
02:             use strict 'refs';
03:             my $self = shift @_;
04:             my $config = shift @_;
05:             my $directory = $$config{'c_code'}{'directory'};
06:             my $symbol_hierarchy = do "$directory/hierarchy/symbols";
07:             require Data::Transformator;
08:             my $transformator = 'Data::Transformator'->new('apply_identity_transformation', 0, 'name', 'symbol-alias-selector', 'contents', $symbol_hierarchy, 'separator', '/', 'hash_filter', sub {
09:                 my($context, $component) = @_;
10:                 if ($$context{'path'} =~ m[^[^/]*/class_hierarchy/([^/]*)/allows/create_alias$]) {
11:                     my $symbol = $1;
12:                     my $type = Data::Transformator::_context_get_current_content($context);
13:                     my $result = Data::Transformator::_context_get_main_result($context);
14:                     if (not $$result{'content'}) {
15:                         $$result{'content'} = [];
16:                     }
17:                     push @{$$result{'content'};}, [$symbol, $type];
18:                 }
19:                 1;
20:             }
21:             );
22:             my $create_alias_selection = $transformator->transform;
23:             my $symbols_with_aliasses = $#$create_alias_selection + 1;
24:             my $code_calls_grep = [`cd $directory/components ; grep -n SymbolIncrementAliases *.c`];
25:             my $code_calls = $#$code_calls_grep + 1;
26:             if ($symbols_with_aliasses eq $code_calls) {
27:                 print "Found $symbols_with_aliasses create_alias declarations (in $directory)\n";
28:                 print "Found $code_calls incrementors in the code (in $directory)\n";
29:                 return undef;
30:             }
31:             else {
32:                 print "Found $symbols_with_aliasses create_alias declarations (in $directory)\n";
33:                 print "Found $code_calls incrementors in the code (in $directory)\n";
34:                 return 'Mismatch of count of create_alias declarations and create_alias incrementors';
35:             }
36:         };
37: 

1.1. alias creation count consistency checker

1. Part of expected output

2. This test is currently not executed
(disabled is 'This test worked until I added code for automatic generation of the grammar rules.  Likely this made hierarchy/symbols more complicated such that this test triggers bugs in Data::Transormator.')