dcc/include/IdentType.h
2012-07-19 19:37:30 +02:00

31 lines
1.0 KiB
C++

#pragma once
#include "ast.h"
#include "types.h"
#include "machine_x86.h"
struct GlobalVariable;
struct AstIdent;
struct IDENTTYPE
{
friend struct GlobalVariable;
friend struct Constant;
friend struct AstIdent;
protected:
condId idType;
public:
condId type() {return idType;}
void type(condId t) {idType=t;}
union _idNode {
int localIdx; /* idx into localId, LOCAL_VAR */
int paramIdx; /* idx into args symtab, PARAMS */
uint32_t strIdx; /* idx into image, for STRING */
int longIdx; /* idx into LOCAL_ID table, LONG_VAR*/
struct { /* for OTHER; tmp struct */
eReg seg; /* segment */
eReg regi; /* index mode */
int16_t off; /* offset */
} other;
} idNode;
IDENTTYPE() : idType(UNDEF)
{}
};