Changes in src/Parser/ExpressionNode.cc [7f5566b:51b1202]
- File:
-
- 1 edited
-
src/Parser/ExpressionNode.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cc
r7f5566b r51b1202 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Jul 30 14:53:23201513 // Update Count : 18812 // Last Modified On : Tue Aug 11 15:13:48 2015 13 // Update Count : 200 14 14 // 15 15 … … 284 284 os << "Variable: " << get_name(); 285 285 os << endl; 286 } 287 288 //############################################################################## 289 290 DesignatorNode::DesignatorNode( ExpressionNode *expr, bool isArrayIndex ) : isArrayIndex( isArrayIndex ) { 291 set_argName( expr ); 292 } 293 294 DesignatorNode::DesignatorNode( const DesignatorNode &other ) : ExpressionNode( other ), isArrayIndex( other.isArrayIndex ) { 295 } 296 297 Expression *DesignatorNode::build() const { 298 if ( isArrayIndex ) { 299 return new NameExpr( get_name(), maybeBuild< Expression >( get_argName() ) ); 300 } else { 301 return new NameExpr( get_name(), maybeBuild< Expression >( get_argName() ) ); 302 } // if 303 } 304 305 void DesignatorNode::printOneLine( std::ostream &os, int indent ) const { 306 if ( get_argName() ) { 307 if ( isArrayIndex ) { 308 os << "["; 309 get_argName()->printOneLine( os, indent ); 310 os << "]"; 311 } else { 312 os << "."; 313 get_argName()->printOneLine( os, indent ); 314 } 315 } // if 316 } 317 318 void DesignatorNode::print( std::ostream &os, int indent ) const { 319 if ( get_argName() ) { 320 if ( isArrayIndex ) { 321 os << "["; 322 get_argName()->print( os, indent ); 323 os << "]"; 324 } else { 325 os << "."; 326 get_argName()->print( os, indent ); 327 } 328 } // if 286 329 } 287 330
Note:
See TracChangeset
for help on using the changeset viewer.