Newer
Older
test_yacc_lex / node.h
@ApricotSavor ApricotSavor on 13 Jan 2017 497 bytes adder test
#ifndef TESTL0_H
#define TESTL0_H

enum node_type {
  NODE_FLOAT
};

#define NODE_HEADER enum node_type type

typedef struct {
  NODE_HEADER;
} node;

typedef struct {
  NODE_HEADER;
  int len;
  int max;
  node** data;
} node_nodes;

typedef struct {
  NODE_HEADER;
  double value;
} node_float;

typedef struct node_string {
  int len;
  char buf[0];
} *node_string;

typedef struct {
  NODE_HEADER;
  node_string op;
  node* lhs;
  node* rhs;
} node_op;


node* node_float_new(double);

#endif