// generated by gen-nodes from `cdfggen-chunk.t'.  Do not edit.

#ifndef CDFGGEN_H
#define CDFGGEN_H

#include <freehdl/tree-supp.h>
#include <string>
#include <vector>
typedef enum {to, downto} cdfgg_direction;
using namespace std;

extern tree_chunk_info cdfggen_chunk_info;
extern tree_ctype_info int_ctype_info;
extern tree_ctype_info double_ctype_info;
extern tree_ctype_info string_ctype_info;
extern tree_ctype_info cdfgg_direction_ctype_info;
extern tree_ctype_info cdfgg_char_p_ctype_info;
extern tree_ctype_info lint_ctype_info;
extern tree_ctype_info vector_pair_string_lint_ctype_info;
extern tree_ctype_info vector_int_ctype_info;
struct CDFGG_Type;
typedef CDFGG_Type *pCDFGG_Type;
extern tree_kind_info CDFGG_TYPE_kind_info;
#define CDFGG_TYPE (&CDFGG_TYPE_kind_info)
struct CDFGG_ScalarType;
typedef CDFGG_ScalarType *pCDFGG_ScalarType;
extern tree_kind_info CDFGG_SCALAR_TYPE_kind_info;
#define CDFGG_SCALAR_TYPE (&CDFGG_SCALAR_TYPE_kind_info)
struct CDFGG_IntegerType;
typedef CDFGG_IntegerType *pCDFGG_IntegerType;
extern tree_kind_info CDFGG_INTEGER_TYPE_kind_info;
#define CDFGG_INTEGER_TYPE (&CDFGG_INTEGER_TYPE_kind_info)
struct CDFGG_RealType;
typedef CDFGG_RealType *pCDFGG_RealType;
extern tree_kind_info CDFGG_REAL_TYPE_kind_info;
#define CDFGG_REAL_TYPE (&CDFGG_REAL_TYPE_kind_info)
struct CDFGG_EnumerationType;
typedef CDFGG_EnumerationType *pCDFGG_EnumerationType;
extern tree_kind_info CDFGG_ENUMERATION_TYPE_kind_info;
#define CDFGG_ENUMERATION_TYPE (&CDFGG_ENUMERATION_TYPE_kind_info)
struct CDFGG_PhysicalType;
typedef CDFGG_PhysicalType *pCDFGG_PhysicalType;
extern tree_kind_info CDFGG_PHYSICAL_TYPE_kind_info;
#define CDFGG_PHYSICAL_TYPE (&CDFGG_PHYSICAL_TYPE_kind_info)
struct CDFGG_CompositeType;
typedef CDFGG_CompositeType *pCDFGG_CompositeType;
extern tree_kind_info CDFGG_COMPOSITE_TYPE_kind_info;
#define CDFGG_COMPOSITE_TYPE (&CDFGG_COMPOSITE_TYPE_kind_info)
struct CDFGG_ArrayType;
typedef CDFGG_ArrayType *pCDFGG_ArrayType;
extern tree_kind_info CDFGG_ARRAY_TYPE_kind_info;
#define CDFGG_ARRAY_TYPE (&CDFGG_ARRAY_TYPE_kind_info)
struct CDFGG_Edge;
typedef CDFGG_Edge *pCDFGG_Edge;
extern tree_kind_info CDFGG_EDGE_kind_info;
#define CDFGG_EDGE (&CDFGG_EDGE_kind_info)
struct CDFGG_DataEdge;
typedef CDFGG_DataEdge *pCDFGG_DataEdge;
extern tree_kind_info CDFGG_DATA_EDGE_kind_info;
#define CDFGG_DATA_EDGE (&CDFGG_DATA_EDGE_kind_info)
struct CDFGG_LiteralEdge;
typedef CDFGG_LiteralEdge *pCDFGG_LiteralEdge;
extern tree_kind_info CDFGG_LITERAL_EDGE_kind_info;
#define CDFGG_LITERAL_EDGE (&CDFGG_LITERAL_EDGE_kind_info)
struct CDFGG_StringLiteralEdge;
typedef CDFGG_StringLiteralEdge *pCDFGG_StringLiteralEdge;
extern tree_kind_info CDFGG_STRING_LITERAL_EDGE_kind_info;
#define CDFGG_STRING_LITERAL_EDGE (&CDFGG_STRING_LITERAL_EDGE_kind_info)
struct CDFGG_IntegerLiteralEdge;
typedef CDFGG_IntegerLiteralEdge *pCDFGG_IntegerLiteralEdge;
extern tree_kind_info CDFGG_INTEGER_LITERAL_EDGE_kind_info;
#define CDFGG_INTEGER_LITERAL_EDGE (&CDFGG_INTEGER_LITERAL_EDGE_kind_info)
struct CDFGG_RealLiteralEdge;
typedef CDFGG_RealLiteralEdge *pCDFGG_RealLiteralEdge;
extern tree_kind_info CDFGG_REAL_LITERAL_EDGE_kind_info;
#define CDFGG_REAL_LITERAL_EDGE (&CDFGG_REAL_LITERAL_EDGE_kind_info)
struct CDFGG_RangeLiteralEdge;
typedef CDFGG_RangeLiteralEdge *pCDFGG_RangeLiteralEdge;
extern tree_kind_info CDFGG_RANGE_LITERAL_EDGE_kind_info;
#define CDFGG_RANGE_LITERAL_EDGE (&CDFGG_RANGE_LITERAL_EDGE_kind_info)
struct CDFGG_Node;
typedef CDFGG_Node *pCDFGG_Node;
extern tree_kind_info CDFGG_NODE_kind_info;
#define CDFGG_NODE (&CDFGG_NODE_kind_info)

struct CDFGG_Type : tree_base_node {
  string instance_name;
  string type_name;
  pCDFGG_Type base_type;

  CDFGG_Type (string instance_name, string type_name, pCDFGG_Type base_type) 
  : instance_name (instance_name),
    type_name (type_name),
    base_type (base_type)
    { }

  tree_kind kind ();
};

struct CDFGG_ScalarType : CDFGG_Type {

  CDFGG_ScalarType (string instance_name, string type_name, pCDFGG_Type base_type) 
  : CDFGG_Type (instance_name, type_name, base_type)
    { }

  tree_kind kind ();
};

struct CDFGG_IntegerType : CDFGG_ScalarType {
  int left_bound;
  cdfgg_direction direction;
  int right_bound;

  CDFGG_IntegerType (string instance_name, string type_name, pCDFGG_Type base_type, int left_bound, cdfgg_direction direction, int right_bound) 
  : CDFGG_ScalarType (instance_name, type_name, base_type),
    left_bound (left_bound),
    direction (direction),
    right_bound (right_bound)
    { }

  tree_kind kind ();
};

struct CDFGG_RealType : CDFGG_ScalarType {
  double left_bound;
  cdfgg_direction direction;
  double right_bound;

  CDFGG_RealType (string instance_name, string type_name, pCDFGG_Type base_type, double left_bound, cdfgg_direction direction, double right_bound) 
  : CDFGG_ScalarType (instance_name, type_name, base_type),
    left_bound (left_bound),
    direction (direction),
    right_bound (right_bound)
    { }

  tree_kind kind ();
};

struct CDFGG_EnumerationType : CDFGG_ScalarType {
  int left_bound;
  int right_bound;

  CDFGG_EnumerationType (string instance_name, string type_name, pCDFGG_Type base_type, int left_bound, int right_bound) 
  : CDFGG_ScalarType (instance_name, type_name, base_type),
    left_bound (left_bound),
    right_bound (right_bound)
    { }

  tree_kind kind ();
};

struct CDFGG_PhysicalType : CDFGG_ScalarType {
  long long int left_bound;
  cdfgg_direction direction;
  long long int right_bound;
  vector<pair<string, long long int> > units;

  CDFGG_PhysicalType (string instance_name, string type_name, pCDFGG_Type base_type, long long int left_bound, cdfgg_direction direction, long long int right_bound, vector<pair<string, long long int> > units) 
  : CDFGG_ScalarType (instance_name, type_name, base_type),
    left_bound (left_bound),
    direction (direction),
    right_bound (right_bound),
    units (units)
    { }

  tree_kind kind ();
};

struct CDFGG_CompositeType : CDFGG_Type {

  CDFGG_CompositeType (string instance_name, string type_name, pCDFGG_Type base_type) 
  : CDFGG_Type (instance_name, type_name, base_type)
    { }

  tree_kind kind ();
};

struct CDFGG_ArrayType : CDFGG_CompositeType {
  long long int left_bound;
  cdfgg_direction direction;
  long long int right_bound;
  pCDFGG_Type index_type;
  pCDFGG_Type element_type;

  CDFGG_ArrayType (string instance_name, string type_name, pCDFGG_Type base_type, long long int left_bound, cdfgg_direction direction, long long int right_bound, pCDFGG_Type index_type, pCDFGG_Type element_type) 
  : CDFGG_CompositeType (instance_name, type_name, base_type),
    left_bound (left_bound),
    direction (direction),
    right_bound (right_bound),
    index_type (index_type),
    element_type (element_type)
    { }

  tree_kind kind ();
};

struct CDFGG_Edge : tree_base_node {
  int index;
  int in_node;
  int out_node;
  pCDFGG_Type type;

  CDFGG_Edge (int index, int in_node, int out_node, pCDFGG_Type type) 
  : index (index),
    in_node (in_node),
    out_node (out_node),
    type (type)
    { }

  tree_kind kind ();
};

struct CDFGG_DataEdge : CDFGG_Edge {

  CDFGG_DataEdge (int index, int in_node, int out_node, pCDFGG_Type type) 
  : CDFGG_Edge (index, in_node, out_node, type)
    { }

  tree_kind kind ();
};

struct CDFGG_LiteralEdge : CDFGG_Edge {

  CDFGG_LiteralEdge (int index, int in_node, int out_node, pCDFGG_Type type) 
  : CDFGG_Edge (index, in_node, out_node, type)
    { }

  tree_kind kind ();
};

struct CDFGG_StringLiteralEdge : CDFGG_LiteralEdge {
  char* edge_name;

  CDFGG_StringLiteralEdge (int index, int in_node, int out_node, pCDFGG_Type type, char* edge_name) 
  : CDFGG_LiteralEdge (index, in_node, out_node, type),
    edge_name (edge_name)
    { }

  tree_kind kind ();
};

struct CDFGG_IntegerLiteralEdge : CDFGG_LiteralEdge {
  int value;

  CDFGG_IntegerLiteralEdge (int index, int in_node, int out_node, pCDFGG_Type type, int value) 
  : CDFGG_LiteralEdge (index, in_node, out_node, type),
    value (value)
    { }

  tree_kind kind ();
};

struct CDFGG_RealLiteralEdge : CDFGG_LiteralEdge {
  double value;

  CDFGG_RealLiteralEdge (int index, int in_node, int out_node, pCDFGG_Type type, double value) 
  : CDFGG_LiteralEdge (index, in_node, out_node, type),
    value (value)
    { }

  tree_kind kind ();
};

struct CDFGG_RangeLiteralEdge : CDFGG_LiteralEdge {
  int left_bound;
  cdfgg_direction direction;
  int right_bound;

  CDFGG_RangeLiteralEdge (int index, int in_node, int out_node, pCDFGG_Type type, int left_bound, cdfgg_direction direction, int right_bound) 
  : CDFGG_LiteralEdge (index, in_node, out_node, type),
    left_bound (left_bound),
    direction (direction),
    right_bound (right_bound)
    { }

  tree_kind kind ();
};

struct CDFGG_Node : tree_base_node {
  int index;
  string type;
  vector<int> incoming_edges;
  vector<int> outgoing_edges;

  CDFGG_Node (int index, string type, vector<int> incoming_edges, vector<int> outgoing_edges) 
  : index (index),
    type (type),
    incoming_edges (incoming_edges),
    outgoing_edges (outgoing_edges)
    { }

  tree_kind kind ();
};

void init_cdfggen_chunk ();

#endif
