Changes in src/SynTree/Visitor.cc [6eb8948:906e24d]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Visitor.cc
r6eb8948 r906e24d 150 150 151 151 void Visitor::visit( ApplicationExpr *applicationExpr ) { 152 acceptAll( applicationExpr->get_results(), *this );152 maybeAccept( applicationExpr->get_result(), *this ); 153 153 maybeAccept( applicationExpr->get_function(), *this ); 154 154 acceptAll( applicationExpr->get_args(), *this ); … … 156 156 157 157 void Visitor::visit( UntypedExpr *untypedExpr ) { 158 acceptAll( untypedExpr->get_results(), *this );158 maybeAccept( untypedExpr->get_result(), *this ); 159 159 acceptAll( untypedExpr->get_args(), *this ); 160 160 } 161 161 162 162 void Visitor::visit( NameExpr *nameExpr ) { 163 acceptAll( nameExpr->get_results(), *this );163 maybeAccept( nameExpr->get_result(), *this ); 164 164 } 165 165 166 166 void Visitor::visit( AddressExpr *addressExpr ) { 167 acceptAll( addressExpr->get_results(), *this );167 maybeAccept( addressExpr->get_result(), *this ); 168 168 maybeAccept( addressExpr->get_arg(), *this ); 169 169 } 170 170 171 171 void Visitor::visit( LabelAddressExpr *labAddressExpr ) { 172 acceptAll( labAddressExpr->get_results(), *this );172 maybeAccept( labAddressExpr->get_result(), *this ); 173 173 maybeAccept( labAddressExpr->get_arg(), *this ); 174 174 } 175 175 176 176 void Visitor::visit( CastExpr *castExpr ) { 177 acceptAll( castExpr->get_results(), *this );177 maybeAccept( castExpr->get_result(), *this ); 178 178 maybeAccept( castExpr->get_arg(), *this ); 179 179 } 180 180 181 181 void Visitor::visit( UntypedMemberExpr *memberExpr ) { 182 acceptAll( memberExpr->get_results(), *this );182 maybeAccept( memberExpr->get_result(), *this ); 183 183 maybeAccept( memberExpr->get_aggregate(), *this ); 184 maybeAccept( memberExpr->get_member(), *this );185 184 } 186 185 187 186 void Visitor::visit( MemberExpr *memberExpr ) { 188 acceptAll( memberExpr->get_results(), *this );187 maybeAccept( memberExpr->get_result(), *this ); 189 188 maybeAccept( memberExpr->get_aggregate(), *this ); 190 189 } 191 190 192 191 void Visitor::visit( VariableExpr *variableExpr ) { 193 acceptAll( variableExpr->get_results(), *this );192 maybeAccept( variableExpr->get_result(), *this ); 194 193 } 195 194 196 195 void Visitor::visit( ConstantExpr *constantExpr ) { 197 acceptAll( constantExpr->get_results(), *this );196 maybeAccept( constantExpr->get_result(), *this ); 198 197 maybeAccept( constantExpr->get_constant(), *this ); 199 198 } 200 199 201 200 void Visitor::visit( SizeofExpr *sizeofExpr ) { 202 acceptAll( sizeofExpr->get_results(), *this );201 maybeAccept( sizeofExpr->get_result(), *this ); 203 202 if ( sizeofExpr->get_isType() ) { 204 203 maybeAccept( sizeofExpr->get_type(), *this ); … … 209 208 210 209 void Visitor::visit( AlignofExpr *alignofExpr ) { 211 acceptAll( alignofExpr->get_results(), *this );210 maybeAccept( alignofExpr->get_result(), *this ); 212 211 if ( alignofExpr->get_isType() ) { 213 212 maybeAccept( alignofExpr->get_type(), *this ); … … 218 217 219 218 void Visitor::visit( UntypedOffsetofExpr *offsetofExpr ) { 220 acceptAll( offsetofExpr->get_results(), *this );219 maybeAccept( offsetofExpr->get_result(), *this ); 221 220 maybeAccept( offsetofExpr->get_type(), *this ); 222 221 } 223 222 224 223 void Visitor::visit( OffsetofExpr *offsetofExpr ) { 225 acceptAll( offsetofExpr->get_results(), *this );224 maybeAccept( offsetofExpr->get_result(), *this ); 226 225 maybeAccept( offsetofExpr->get_type(), *this ); 227 226 maybeAccept( offsetofExpr->get_member(), *this ); … … 229 228 230 229 void Visitor::visit( OffsetPackExpr *offsetPackExpr ) { 231 acceptAll( offsetPackExpr->get_results(), *this );230 maybeAccept( offsetPackExpr->get_result(), *this ); 232 231 maybeAccept( offsetPackExpr->get_type(), *this ); 233 232 } 234 233 235 234 void Visitor::visit( AttrExpr *attrExpr ) { 236 acceptAll( attrExpr->get_results(), *this );235 maybeAccept( attrExpr->get_result(), *this ); 237 236 if ( attrExpr->get_isType() ) { 238 237 maybeAccept( attrExpr->get_type(), *this ); … … 243 242 244 243 void Visitor::visit( LogicalExpr *logicalExpr ) { 245 acceptAll( logicalExpr->get_results(), *this );244 maybeAccept( logicalExpr->get_result(), *this ); 246 245 maybeAccept( logicalExpr->get_arg1(), *this ); 247 246 maybeAccept( logicalExpr->get_arg2(), *this ); … … 249 248 250 249 void Visitor::visit( ConditionalExpr *conditionalExpr ) { 251 acceptAll( conditionalExpr->get_results(), *this );250 maybeAccept( conditionalExpr->get_result(), *this ); 252 251 maybeAccept( conditionalExpr->get_arg1(), *this ); 253 252 maybeAccept( conditionalExpr->get_arg2(), *this ); … … 256 255 257 256 void Visitor::visit( CommaExpr *commaExpr ) { 258 acceptAll( commaExpr->get_results(), *this );257 maybeAccept( commaExpr->get_result(), *this ); 259 258 maybeAccept( commaExpr->get_arg1(), *this ); 260 259 maybeAccept( commaExpr->get_arg2(), *this ); 261 260 } 262 261 262 void Visitor::visit( TupleExpr *tupleExpr ) { 263 maybeAccept( tupleExpr->get_result(), *this ); 264 acceptAll( tupleExpr->get_exprs(), *this ); 265 } 266 267 void Visitor::visit( SolvedTupleExpr *tupleExpr ) { 268 maybeAccept( tupleExpr->get_result(), *this ); 269 acceptAll( tupleExpr->get_exprs(), *this ); 270 } 271 263 272 void Visitor::visit( TypeExpr *typeExpr ) { 264 acceptAll( typeExpr->get_results(), *this );273 maybeAccept( typeExpr->get_result(), *this ); 265 274 maybeAccept( typeExpr->get_type(), *this ); 266 275 } … … 279 288 280 289 void Visitor::visit( ConstructorExpr * ctorExpr ) { 281 acceptAll( ctorExpr->get_results(), *this );290 maybeAccept( ctorExpr->get_result(), *this ); 282 291 maybeAccept( ctorExpr->get_callExpr(), *this ); 283 292 } 284 293 285 294 void Visitor::visit( CompoundLiteralExpr *compLitExpr ) { 286 acceptAll( compLitExpr->get_results(), *this );295 maybeAccept( compLitExpr->get_result(), *this ); 287 296 maybeAccept( compLitExpr->get_type(), *this ); 288 297 maybeAccept( compLitExpr->get_initializer(), *this ); … … 290 299 291 300 void Visitor::visit( UntypedValofExpr *valofExpr ) { 292 acceptAll( valofExpr->get_results(), *this );301 maybeAccept( valofExpr->get_result(), *this ); 293 302 maybeAccept( valofExpr->get_body(), *this ); 294 303 } … … 297 306 maybeAccept( rangeExpr->get_low(), *this ); 298 307 maybeAccept( rangeExpr->get_high(), *this ); 299 }300 301 void Visitor::visit( TupleExpr *tupleExpr ) {302 acceptAll( tupleExpr->get_results(), *this );303 acceptAll( tupleExpr->get_exprs(), *this );304 }305 306 void Visitor::visit( TupleIndexExpr *tupleExpr ) {307 acceptAll( tupleExpr->get_results(), *this );308 maybeAccept( tupleExpr->get_tuple(), *this );309 }310 311 void Visitor::visit( MemberTupleExpr *tupleExpr ) {312 acceptAll( tupleExpr->get_results(), *this );313 maybeAccept( tupleExpr->get_member(), *this );314 maybeAccept( tupleExpr->get_aggregate(), *this );315 }316 317 void Visitor::visit( TupleAssignExpr *assignExpr ) {318 acceptAll( assignExpr->get_results(), *this );319 acceptAll( assignExpr->get_tempDecls(), *this );320 acceptAll( assignExpr->get_assigns(), *this );321 }322 323 void Visitor::visit( StmtExpr *stmtExpr ) {324 acceptAll( stmtExpr->get_results(), *this );325 maybeAccept( stmtExpr->get_statements(), *this );326 308 } 327 309
Note: See TracChangeset
for help on using the changeset viewer.