Commit ea97b39a authored by Alexandre Julliard's avatar Alexandre Julliard

Avoid dependencies on y.tab.h.

parent 60067579
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "parser.h" #include "parser.h"
#include "header.h" #include "header.h"
#include "proxy.h" #include "proxy.h"
#include "y.tab.h"
static int indentation = 0; static int indentation = 0;
...@@ -177,7 +176,7 @@ void write_typedef(type_t *type, var_t *names) ...@@ -177,7 +176,7 @@ void write_typedef(type_t *type, var_t *names)
int is_object(attr_t *a) int is_object(attr_t *a)
{ {
while (a) { while (a) {
if (a->type == tOBJECT) return 1; if (a->type == ATTR_OBJECT) return 1;
a = NEXT_LINK(a); a = NEXT_LINK(a);
} }
return 0; return 0;
...@@ -186,7 +185,7 @@ int is_object(attr_t *a) ...@@ -186,7 +185,7 @@ int is_object(attr_t *a)
int is_local(attr_t *a) int is_local(attr_t *a)
{ {
while (a) { while (a) {
if (a->type == tLOCAL) return 1; if (a->type == ATTR_LOCAL) return 1;
a = NEXT_LINK(a); a = NEXT_LINK(a);
} }
return 0; return 0;
...@@ -195,7 +194,7 @@ int is_local(attr_t *a) ...@@ -195,7 +194,7 @@ int is_local(attr_t *a)
var_t *is_callas(attr_t *a) var_t *is_callas(attr_t *a)
{ {
while (a) { while (a) {
if (a->type == tCALLAS) return a->u.pval; if (a->type == ATTR_CALLAS) return a->u.pval;
a = NEXT_LINK(a); a = NEXT_LINK(a);
} }
return NULL; return NULL;
......
...@@ -61,9 +61,9 @@ ...@@ -61,9 +61,9 @@
# endif # endif
#endif #endif
static attr_t *make_attr(int type); static attr_t *make_attr(enum attr_type type);
static attr_t *make_attrv(int type, DWORD val); static attr_t *make_attrv(enum attr_type type, DWORD val);
static attr_t *make_attrp(int type, void *val); static attr_t *make_attrp(enum attr_type type, void *val);
static type_t *make_type(BYTE type, type_t *ref); static type_t *make_type(BYTE type, type_t *ref);
static typeref_t *make_tref(char *name, type_t *ref); static typeref_t *make_tref(char *name, type_t *ref);
static typeref_t *uniq_tref(typeref_t *ref); static typeref_t *uniq_tref(typeref_t *ref);
...@@ -253,30 +253,30 @@ attrib_list: attribute ...@@ -253,30 +253,30 @@ attrib_list: attribute
; ;
attribute: attribute:
tASYNC { $$ = make_attr(tASYNC); } tASYNC { $$ = make_attr(ATTR_ASYNC); }
| tCALLAS '(' ident ')' { $$ = make_attrp(tCALLAS, $3); } | tCALLAS '(' ident ')' { $$ = make_attrp(ATTR_CALLAS, $3); }
| tCASE '(' expr_list ')' { $$ = NULL; } | tCASE '(' expr_list ')' { $$ = NULL; }
| tCONTEXTHANDLE { $$ = NULL; } | tCONTEXTHANDLE { $$ = NULL; }
| tCONTEXTHANDLENOSERIALIZE { $$ = NULL; } | tCONTEXTHANDLENOSERIALIZE { $$ = NULL; }
| tCONTEXTHANDLESERIALIZE { $$ = NULL; } | tCONTEXTHANDLESERIALIZE { $$ = NULL; }
| tDEFAULT { $$ = make_attr(tDEFAULT); } | tDEFAULT { $$ = make_attr(ATTR_DEFAULT); }
| tIIDIS '(' ident ')' { $$ = make_attrp(tIIDIS, $3); } | tIIDIS '(' ident ')' { $$ = make_attrp(ATTR_IIDIS, $3); }
| tIN { $$ = make_attr(tIN); } | tIN { $$ = make_attr(ATTR_IN); }
| tLENGTHIS '(' aexprs ')' { $$ = NULL; } | tLENGTHIS '(' aexprs ')' { $$ = NULL; }
| tLOCAL { $$ = make_attr(tLOCAL); } | tLOCAL { $$ = make_attr(ATTR_LOCAL); }
| tOBJECT { $$ = make_attr(tOBJECT); } | tOBJECT { $$ = make_attr(ATTR_OBJECT); }
| tOLEAUTOMATION { $$ = make_attr(tOLEAUTOMATION); } | tOLEAUTOMATION { $$ = make_attr(ATTR_OLEAUTOMATION); }
| tOUT { $$ = make_attr(tOUT); } | tOUT { $$ = make_attr(ATTR_OUT); }
| tPOINTERDEFAULT '(' pointer_type ')' { $$ = make_attrv(tPOINTERDEFAULT, $3); } | tPOINTERDEFAULT '(' pointer_type ')' { $$ = make_attrv(ATTR_POINTERDEFAULT, $3); }
| tSIZEIS '(' aexprs ')' { $$ = NULL; } | tSIZEIS '(' aexprs ')' { $$ = NULL; }
| tSTRING { $$ = make_attr(tSTRING); } | tSTRING { $$ = make_attr(ATTR_STRING); }
| tSWITCHIS '(' aexpr ')' { $$ = NULL; } | tSWITCHIS '(' aexpr ')' { $$ = NULL; }
| tSWITCHTYPE '(' type ')' { $$ = NULL; } | tSWITCHTYPE '(' type ')' { $$ = NULL; }
| tUUID '(' aUUID ')' { $$ = NULL; } | tUUID '(' aUUID ')' { $$ = NULL; }
| tV1ENUM { $$ = make_attr(tV1ENUM); } | tV1ENUM { $$ = make_attr(ATTR_V1ENUM); }
| tVERSION '(' version ')' { $$ = NULL; } | tVERSION '(' version ')' { $$ = NULL; }
| tWIREMARSHAL '(' type ')' { $$ = make_attrp(tWIREMARSHAL, type_ref($3)); } | tWIREMARSHAL '(' type ')' { $$ = make_attrp(ATTR_WIREMARSHAL, type_ref($3)); }
| pointer_type { $$ = make_attrv(tPOINTERTYPE, $1); } | pointer_type { $$ = make_attrv(ATTR_POINTERTYPE, $1); }
; ;
callconv: callconv:
...@@ -464,7 +464,7 @@ version: ...@@ -464,7 +464,7 @@ version:
%% %%
static attr_t *make_attr(int type) static attr_t *make_attr(enum attr_type type)
{ {
attr_t *a = xmalloc(sizeof(attr_t)); attr_t *a = xmalloc(sizeof(attr_t));
a->type = type; a->type = type;
...@@ -472,7 +472,7 @@ static attr_t *make_attr(int type) ...@@ -472,7 +472,7 @@ static attr_t *make_attr(int type)
return a; return a;
} }
static attr_t *make_attrv(int type, DWORD val) static attr_t *make_attrv(enum attr_type type, DWORD val)
{ {
attr_t *a = xmalloc(sizeof(attr_t)); attr_t *a = xmalloc(sizeof(attr_t));
a->type = type; a->type = type;
...@@ -480,7 +480,7 @@ static attr_t *make_attrv(int type, DWORD val) ...@@ -480,7 +480,7 @@ static attr_t *make_attrv(int type, DWORD val)
return a; return a;
} }
static attr_t *make_attrp(int type, void *val) static attr_t *make_attrp(enum attr_type type, void *val)
{ {
attr_t *a = xmalloc(sizeof(attr_t)); attr_t *a = xmalloc(sizeof(attr_t));
a->type = type; a->type = type;
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "utils.h" #include "utils.h"
#include "parser.h" #include "parser.h"
#include "header.h" #include "header.h"
#include "y.tab.h"
/* FIXME: support generation of stubless proxies */ /* FIXME: support generation of stubless proxies */
......
...@@ -43,8 +43,26 @@ typedef struct _func_t func_t; ...@@ -43,8 +43,26 @@ typedef struct _func_t func_t;
#define NEXT_LINK(x) ((x)->l_next) #define NEXT_LINK(x) ((x)->l_next)
#define PREV_LINK(x) ((x)->l_prev) #define PREV_LINK(x) ((x)->l_prev)
enum attr_type
{
ATTR_ASYNC,
ATTR_CALLAS,
ATTR_DEFAULT,
ATTR_IIDIS,
ATTR_IN,
ATTR_LOCAL,
ATTR_OBJECT,
ATTR_OLEAUTOMATION,
ATTR_OUT,
ATTR_POINTERDEFAULT,
ATTR_POINTERTYPE,
ATTR_STRING,
ATTR_V1ENUM,
ATTR_WIREMARSHAL,
};
struct _attr_t { struct _attr_t {
int type; enum attr_type type;
union { union {
DWORD ival; DWORD ival;
void *pval; void *pval;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment