Mercurial > hg > CbC > CbC_xv6
comparison src/gearsTools/trans_impl.pl @ 163:d116d737fed0
tweak trans_impl.pl
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 15 Jan 2020 16:34:37 +0900 |
parents | 06bf68d3b83b |
children | 9b0f4b421288 |
comparison
equal
deleted
inserted
replaced
162:efff86f375ed | 163:d116d737fed0 |
---|---|
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 $datum =~ s|//[\s\w]+||; | |
79 if ($datum =~ /^\s+#/) { | |
80 next; | |
81 } | |
82 | |
78 if ($datum =~ /\w+\s\w+\*\s(\w+)/) { | 83 if ($datum =~ /\w+\s\w+\*\s(\w+)/) { |
79 print $out " ${instance_impl}->$1 = NULL;\n"; | 84 print $out " ${instance_impl}->$1 = NULL;\n"; |
80 next; | 85 next; |
81 } | 86 } |
82 if ($datum =~ /\w+\s\w+\s(\w+)/) { | 87 if ($datum =~ /\w+\s\w+\s(\w+)/) { |
93 } | 98 } |
94 } | 99 } |
95 } | 100 } |
96 | 101 |
97 for my $datum (@inter_data) { | 102 for my $datum (@inter_data) { |
103 # remove macro, comment block | |
104 $datum =~ s|//[\s\w]+||; | |
105 if ($datum =~ /^\s+#/) { | |
106 next; | |
107 } | |
108 | |
98 if ($datum =~ /\w+\s\w+\*\s(\w+)/) { | 109 if ($datum =~ /\w+\s\w+\*\s(\w+)/) { |
99 print $out " ${instance_inter}->$1 = NULL;\n"; | 110 print $out " ${instance_inter}->$1 = NULL;\n"; |
100 next; | 111 next; |
101 } | 112 } |
102 if ($datum =~ /\w+\s\w+\s(\w+)/) { | 113 if ($datum =~ /\w+\s\w+\s(\w+)/) { |