comparison src/gearsTools/trans_impl.pl @ 161:06bf68d3b83b

tweak
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Tue, 14 Jan 2020 20:54:21 +0900
parents eef045e9772a
children d116d737fed0
comparison
equal deleted inserted replaced
160:5de948efb678 161:06bf68d3b83b
73 struct $impl_ir->{name}* $instance_impl = new $impl_ir->{name}(); 73 struct $impl_ir->{name}* $instance_impl = new $impl_ir->{name}();
74 $instance_inter->$instance_inter = (union Data*)$instance_impl; 74 $instance_inter->$instance_inter = (union Data*)$instance_impl;
75 EOF 75 EOF
76 76
77 for my $datum (@impl_data) { 77 for my $datum (@impl_data) {
78 if ($datum =~ /\w+ \w+\* (\w+)/) { 78 if ($datum =~ /\w+\s\w+\*\s(\w+)/) {
79 print $out " ${instance_impl}->$1 = NULL;\n"; 79 print $out " ${instance_impl}->$1 = NULL;\n";
80 next; 80 next;
81 } 81 }
82 if ($datum =~ /\w+ \w+ (\w+)/) { 82 if ($datum =~ /\w+\s\w+\s(\w+)/) {
83 print $out " ${instance_impl}->$1 = 0;\n"; 83 print $out " ${instance_impl}->$1 = 0;\n";
84 } 84 }
85 85
86 if ($datum =~ /\w+(\*)? (\w+)/) { 86 if ($datum =~ /\w+(\*)?\s(\w+)/) {
87 my $is_pointer = $1; 87 my $is_pointer = $1;
88 my $var_name = $2; 88 my $var_name = $2;
89 if ($1) { 89 if ($1) {
90 print $out " ${instance_impl}->$var_name = NULL;\n"; 90 print $out " ${instance_impl}->$var_name = NULL;\n";
91 } else { 91 } else {
93 } 93 }
94 } 94 }
95 } 95 }
96 96
97 for my $datum (@inter_data) { 97 for my $datum (@inter_data) {
98 if ($datum =~ /\w+ \w+\* (\w+)/) { 98 if ($datum =~ /\w+\s\w+\*\s(\w+)/) {
99 print $out " ${instance_inter}->$1 = NULL;\n"; 99 print $out " ${instance_inter}->$1 = NULL;\n";
100 next; 100 next;
101 } 101 }
102 if ($datum =~ /\w+ \w+ (\w+)/) { 102 if ($datum =~ /\w+\s\w+\s(\w+)/) {
103 print $out " ${instance_inter}->$1 = 0;\n"; 103 print $out " ${instance_inter}->$1 = 0;\n";
104 next; 104 next;
105 } 105 }
106 if ($datum =~ /\w+(\*)? (\w+)/) { 106 if ($datum =~ /\w+(\*)?\s(\w+)/) {
107 my $is_pointer = $1; 107 my $is_pointer = $1;
108 my $var_name = $2; 108 my $var_name = $2;
109 if ($1) { 109 if ($1) {
110 print $out " ${instance_inter}->$var_name = NULL;\n"; 110 print $out " ${instance_inter}->$var_name = NULL;\n";
111 } else { 111 } else {