CodesIOKernelTypes.h 1.94 KB
Newer Older
Philip Carns's avatar
Philip Carns committed
1 2 3 4 5 6
/*
 * Copyright (C) 2013 University of Chicago.
 * See COPYRIGHT notice in top-level directory.
 *
 */

7 8 9
#ifndef CODES_H
#define CODES_H

10
#include "CodesIOKernelContext.h"
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72

typedef enum { typeCon, typeId, typeOpr } nodeEnum;

/* constants */
typedef struct {
    int64_t value;                  /* value of constant */
} conNodeType;

/* identifiers */
typedef struct {
    int i;                      /* subscript to sym array */
} idNodeType;

/* operators */
typedef struct {
    int oper;                   /* operator */
    int nops;                   /* number of operands */
    struct nodeTypeTag *op[1];  /* operands (expandable) */
} oprNodeType;

typedef struct nodeTypeTag {
    nodeEnum type;              /* type of node */

    /* union must be last entry in nodeType */
    /* because operNodeType may dynamically increase */
    union {
        conNodeType con;        /* constants */
        idNodeType id;          /* identifiers */
        oprNodeType opr;        /* operators */
    };
} nodeType;

#ifndef YY_TYPEDEF_YY_SCANNER_T
#define YY_TYPEDEF_YY_SCANNER_T
typedef void* yyscan_t;
#endif

typedef union codesYYType {
    int64_t iValue;                 /* integer value */
    int sIndex;              /* symbol table index */
    nodeType *nPtr;             /* node pointer */
} codesYYType;
#define YYSTYPE codesYYType 

typedef struct codesParserParam
{
        yyscan_t scanner;
        void * nPtr;
}codesParserParam;

// the parameter name (of the reentrant 'yyparse' function)
// data is a pointer to a 'codesParserParam' structure
//#define YYPARSE_PARAM data

// the argument for the 'yylex' function
//#define YYLEX_PARAM   ((codesParserParam *)data)->scanner

extern int64_t * sym;
extern int64_t * var;
extern int * inst_ready;
extern int * group_rank;
extern int * group_size;
73
int temp_group_rank;
74
int temp_group_size;
75
#endif
Philip Carns's avatar
Philip Carns committed
76 77 78 79 80 81 82 83 84

/*
 * Local variables:
 *  c-indent-level: 4
 *  c-basic-offset: 4
 * End:
 *
 * vim: ts=8 sts=4 sw=4 expandtab
 */