Changes in src/Parser/ExpressionNode.cc [51b1202:7f5566b]
- File:
-
- 1 edited
-
src/Parser/ExpressionNode.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cc
r51b1202 r7f5566b 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Aug 11 15:13:48201513 // Update Count : 20012 // Last Modified On : Thu Jul 30 14:53:23 2015 13 // Update Count : 188 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 } // if303 }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 } // if316 }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 } // if329 286 } 330 287
Note:
See TracChangeset
for help on using the changeset viewer.