source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_valid.cpp @ 81

Last change on this file since 81 was 81, checked in by rosiere, 16 years ago
  • Finish Environment (and test)
  • Continue predictor_unit
  • Add external tools
  • svn keyword "Id" set
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 605 bytes
Line 
1#ifdef STATISTICS
2#include "Behavioural/include/Stat_binary_tree.h"
3
4namespace morpheo {
5namespace behavioural {
6  bool Stat_binary_tree::valid (void)
7  {
8    if ((_data_type == VARIABLE) or
9        (_data_type == CONSTANT))
10      return ((_left  == NULL) and
11              (_right == NULL) );
12
13    if (_data_type == OPERATOR_UNARY)
14      return ((_right == NULL) and
15              (_left  != NULL) and
16              (_left->valid()));
17
18    if (_data_type == OPERATOR_BINARY)
19      return ((_left  != NULL ) and
20              (_left ->valid()) and
21              (_right != NULL ) and
22              (_right->valid()));
23
24    return false;
25  }
26};
27};
28#endif
Note: See TracBrowser for help on using the repository browser.