vrq

/builddir/build/BUILD/vrq-1.0.62/src/cnode.h File Reference

#include <stdio.h>
#include <math.h>
#include <list>
#include <set>
#include "glue.h"
#include "csymbol.h"
#include "cdecl.h"
#include "cvector.h"
#include "cobstack.h"
#include "cattr.h"
#include "cnode_def.h"

Go to the source code of this file.

Classes

struct  StrengthPair_t
 Pair of strengths. More...
class  CNode_sp< T >
 Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment, dereference, and equality operations. More...
struct  CNode_pr
 Helper class for building tail recursive binary CNode trees Used by parser. More...
class  CNode
 Primary data structure representing parse tree nodes. More...

Defines

#define DEFINE_ENUM
#define ILLEGAL_OP2(op)
#define ILLEGAL_OP1(op)
#define DEFINE_CONSTRUCTOR

Typedefs

typedef CBlock CScope

Enumerations

enum  Edge_t {
  eEDGE01 = 0x1, eEDGE10 = 0x2, eEDGE0x = 0x4, eEDGEx1 = 0x8,
  eEDGE1x = 0x10, eEDGEx0 = 0x20
}
 

Edge values.

More...
enum  DelayMode_t { eMIN_DELAY, eTYP_DELAY, eMAX_DELAY }
 

Timing mode values.

More...
enum  Strength_t {
  eUNDEFINED = 0, eSUPPLY, eSTRONG, ePULL,
  eLARGE, eWEAK, eMEDIUM, eSMALL,
  eHIGHZ
}
 

Strength values.

More...

Functions

char * d2s (double d, CObstack *heap)
 Convert double to char string allocating storage on given heap.
int Equivalent (CNode *a, CNode *b)
void Add (double *r, double *a, double *b)
void Sub (double *r, double *a, double *b)
void Mul (double *r, double *a, double *b)
void Div (double *r, double *a, double *b)
void Neg (double *r, double *a)
void Pow (double *r, double *a, double *b)
 ILLEGAL_OP2 (Rsh)
 ILLEGAL_OP2 (Lsh)
 ILLEGAL_OP2 (Rep)
 ILLEGAL_OP2 (Mod)
 ILLEGAL_OP2 (And)
 ILLEGAL_OP2 (Xor)
 ILLEGAL_OP2 (Xnor)
 ILLEGAL_OP2 (Or)
 ILLEGAL_OP2 (Lor)
 ILLEGAL_OP2 (Land)
 ILLEGAL_OP1 (Com)
 ILLEGAL_OP1 (Rand)
 ILLEGAL_OP1 (Rnand)
 ILLEGAL_OP1 (Ror)
 ILLEGAL_OP1 (Rnor)
 ILLEGAL_OP1 (Rxor)
 ILLEGAL_OP1 (Rxnor)
CNode_CVECTOR (CVector &vec)
 Short cut for creating VCONSTANT node with a given vector value.
CNode_INT32 (INT32 i)
 Short cut for creating VCONSTANT node with a given integer value.
CNode_REAL (double number)
 Short cut for creating RCONSTANT node with a given double value.
CNode_ELINK (CNode *n1, CNode *n2)
 Link together two nodes with an ELIST operator.
CNode_ABS (CNode *a)
 Short cut for creating an subtree that calculates the absolute value of an expression.
CNode_ABSDIFF (CNode *a, CNode *b)
 Short cut for creating an subtree that calculates the absolute difference between two expressions.
CNode_LINK (CNode *n1, CNode *n2)
 Short cut for linking together to nodes with a LIST operator.
CNode_MAX (CNode *n1, CNode *n2)
 Short cut for creating a expression tree that calculates the maximum of two expressions.
template<class T >
void ArgList2Vector (CNode *n, NodeOp_t op, int argNumber, vector< T > &v)
 Walks a list of nodes and collects the specified augments of a given node type.
void EList2VectorExclude (CNode *n, const set< NodeOp_t > &excludeOps, vector< CNode * > &v)
 Walks an expression list of nodes and collects the subtrees that don't match the given node types.
CNodeVector2EList (vector< CNode * > &v)
 Converts a vector array of CNode* into a linked ELIST of the elements.
int ListCount (CNode *n, NodeOp_t op)
 Walks a list/elist of nodes and counts the number of node with the specified operation.
int ListCount (CNode *n)
 Walks a list/elist of nodes and counts the number of non-list nodes.
double s2d (char *s)
 Convert char string to double.
CNodeRebalanceRight (CNode *n)
void MeasureDepth (CNode *n, int *count, int *depth)
CNode_pr _LINK (CNode_pr pr1, CNode *n2)
CNode_MAX_N (CNode *first,...)
CNode_ADD_N (CNode *first,...)
CNode_MUL_N (CNode *first,...)
CNode_ABSDIFFPLUS1_N (CNode *first,...)
int _MAX (int a1, int a2)
int _MAX (int a1, int a2, int a3)
int _ADD (int a1, int a2)
int _MUL (int a1, int a2)
int _ABSDIFFPLUS1 (int a1, int a2)

Define Documentation

#define DEFINE_CONSTRUCTOR
#define DEFINE_ENUM
#define ILLEGAL_OP1 ( op   ) 
Value:
inline void op( double*, double* )\
{ fatal( NULL, #op " is illegal for reals" ); }
#define ILLEGAL_OP2 ( op   ) 
Value:
inline void op( double*, double*, double* )\
{ fatal( NULL, #op " is illegal for reals" ); }

Typedef Documentation

typedef CBlock CScope

Enumeration Type Documentation

Timing mode values.

Enumerator:
eMIN_DELAY 
eTYP_DELAY 
eMAX_DELAY 
enum Edge_t

Edge values.

Enumerator:
eEDGE01 
eEDGE10 
eEDGE0x 
eEDGEx1 
eEDGE1x 
eEDGEx0 
enum Strength_t

Strength values.

Enumerator:
eUNDEFINED 
eSUPPLY 
eSTRONG 
ePULL 
eLARGE 
eWEAK 
eMEDIUM 
eSMALL 
eHIGHZ 

Function Documentation

CNode* _ABS ( CNode a  )  [inline]

Short cut for creating an subtree that calculates the absolute value of an expression.

Parameters:
a expression
Returns:
pointer to absolute value subtree
CNode* _ABSDIFF ( CNode a,
CNode b 
) [inline]

Short cut for creating an subtree that calculates the absolute difference between two expressions.

Parameters:
a expression 1
b expression 2
Returns:
pointer to absolute value subtree
int _ABSDIFFPLUS1 ( int  a1,
int  a2 
) [inline]
CNode* _ABSDIFFPLUS1_N ( CNode first,
  ... 
) [inline]
int _ADD ( int  a1,
int  a2 
) [inline]
CNode* _ADD_N ( CNode first,
  ... 
) [inline]
CNode* _CVECTOR ( CVector vec  )  [inline]

Short cut for creating VCONSTANT node with a given vector value.

Parameters:
vec vector to copy
Returns:
pointer to subtree
CNode* _ELINK ( CNode n1,
CNode n2 
) [inline]

Link together two nodes with an ELIST operator.

If one is NULL do not create a new node, but return the non-null argument.

Parameters:
n1 subtree 1
n2 subtree 2
Returns:
pointer to combined subtree
CNode* _INT32 ( INT32  i  )  [inline]

Short cut for creating VCONSTANT node with a given integer value.

Parameters:
i integer to copy
Returns:
pointer to subtree
CNode_pr _LINK ( CNode_pr  pr1,
CNode n2 
) [inline]
CNode* _LINK ( CNode n1,
CNode n2 
) [inline]

Short cut for linking together to nodes with a LIST operator.

A new node is created only if both operands are not NULL.

Parameters:
n1 expression 1
n2 expression 2
Returns:
pointer to resultant subtree
int _MAX ( int  a1,
int  a2,
int  a3 
) [inline]
int _MAX ( int  a1,
int  a2 
) [inline]
CNode* _MAX ( CNode n1,
CNode n2 
) [inline]

Short cut for creating a expression tree that calculates the maximum of two expressions.

Parameters:
n1 expression 1
n2 expression 1
Returns:
pointer to absolute value subtree
CNode* _MAX_N ( CNode first,
  ... 
) [inline]
int _MUL ( int  a1,
int  a2 
) [inline]
CNode* _MUL_N ( CNode first,
  ... 
) [inline]
CNode* _REAL ( double  number  )  [inline]

Short cut for creating RCONSTANT node with a given double value.

Parameters:
number double to copy
Returns:
pointer to subtree
void Add ( double *  r,
double *  a,
double *  b 
) [inline]
void Div ( double *  r,
double *  a,
double *  b 
) [inline]
int Equivalent ( CNode a,
CNode b 
)
ILLEGAL_OP1 ( Rxnor   ) 
ILLEGAL_OP1 ( Rxor   ) 
ILLEGAL_OP1 ( Rnor   ) 
ILLEGAL_OP1 ( Ror   ) 
ILLEGAL_OP1 ( Rnand   ) 
ILLEGAL_OP1 ( Rand   ) 
ILLEGAL_OP1 ( Com   ) 
ILLEGAL_OP2 ( Land   ) 
ILLEGAL_OP2 ( Lor   ) 
ILLEGAL_OP2 ( Or   ) 
ILLEGAL_OP2 ( Xnor   ) 
ILLEGAL_OP2 ( Xor   ) 
ILLEGAL_OP2 ( And   ) 
ILLEGAL_OP2 ( Mod   ) 
ILLEGAL_OP2 ( Rep   ) 
ILLEGAL_OP2 ( Lsh   ) 
ILLEGAL_OP2 ( Rsh   ) 
void MeasureDepth ( CNode n,
int *  count,
int *  depth 
) [inline]
void Mul ( double *  r,
double *  a,
double *  b 
) [inline]
void Neg ( double *  r,
double *  a 
) [inline]
void Pow ( double *  r,
double *  a,
double *  b 
) [inline]
CNode* RebalanceRight ( CNode n  )  [inline]
void Sub ( double *  r,
double *  a,
double *  b 
) [inline]

Generated on 16 Oct 2009 for vrq by  doxygen 1.6.1