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

Last change on this file since 94 was 94, checked in by rosiere, 15 years ago

Update document on Vhdl generation.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 702 bytes
Line 
1#ifdef STATISTICS
2#include "Behavioural/include/Stat_binary_tree.h"
3
4namespace morpheo {
5namespace behavioural {
6
7  bool Stat_binary_tree::valid (void)
8  {
9    if (_data_type == NONE)
10      return false;
11
12    if ((_data_type == VARIABLE) or
13        (_data_type == CONSTANT))
14      return ((_left  == NULL) and
15              (_right == NULL) );
16   
17    if (_data_type == OPERATOR_UNARY)
18      return ((_right == NULL) and
19              (_left  != NULL) and
20              (_left->valid()));
21
22    if (_data_type == OPERATOR_BINARY)
23      return ((_left  != NULL ) and
24              (_left ->valid()) and
25              (_right != NULL ) and
26              (_right->valid()));
27
28    return false;
29  }
30
31};
32};
33#endif
Note: See TracBrowser for help on using the repository browser.