diff --git a/reactos/tools/widl/ChangeLog b/reactos/tools/widl/ChangeLog index 5b2dda1c4dd..44da20de7f2 100644 --- a/reactos/tools/widl/ChangeLog +++ b/reactos/tools/widl/ChangeLog @@ -1,5 +1,13 @@ ChangeLog +2006-07-30 ekohl + +- Synchronized with WINE widl 20060729. + + The only difference is one call to wpp_find_include in parser.l. + We'll need to fix this issue! + + 2006-02-27 ekohl tools/widl/client.c diff --git a/reactos/tools/widl/Makefile.in b/reactos/tools/widl/Makefile.in index 3cfcfe17015..e2bd0cc887f 100644 --- a/reactos/tools/widl/Makefile.in +++ b/reactos/tools/widl/Makefile.in @@ -2,11 +2,10 @@ TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ -LEXOPT = -Cf #-w -b -YACCOPT = #-v EXEEXT = @EXEEXT@ PROGRAMS = widl$(EXEEXT) +MANPAGES = widl.man MODULE = none C_SRCS = \ @@ -15,39 +14,40 @@ C_SRCS = \ header.c \ proxy.c \ server.c \ + typegen.c \ typelib.c \ utils.c \ widl.c \ write_msft.c EXTRA_SRCS = parser.y parser.l -EXTRA_OBJS = y.tab.o @LEX_OUTPUT_ROOT@.o +EXTRA_OBJS = parser.tab.o @LEX_OUTPUT_ROOT@.o -all: $(PROGRAMS) +all: $(PROGRAMS) $(MANPAGES) @MAKE_RULES@ -widl$(EXEEXT): $(OBJS) $(LIBDIR)/wpp/libwpp.a - $(CC) $(CFLAGS) -o $@ $(OBJS) -L$(LIBDIR) -lwpp -lwine_port $(LEXLIB) $(LDFLAGS) +widl$(EXEEXT): $(OBJS) $(LIBWPP) + $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBWPP) $(LIBPORT) $(LEXLIB) $(LDFLAGS) -y.tab.c y.tab.h: parser.y - $(YACC) $(YACCOPT) -d -t $(SRCDIR)/parser.y +parser.tab.c parser.tab.h: parser.y + $(BISON) -d -t $(SRCDIR)/parser.y -o parser.tab.c # hack to allow parallel make -y.tab.h: y.tab.c -y.tab.o: y.tab.h +parser.tab.h: parser.tab.c +parser.tab.o: parser.tab.h @LEX_OUTPUT_ROOT@.c: parser.l - $(LEX) $(LEXOPT) -d -8 $(SRCDIR)/parser.l + $(LEX) $(SRCDIR)/parser.l -@LEX_OUTPUT_ROOT@.o: y.tab.h +@LEX_OUTPUT_ROOT@.o: parser.tab.h -install:: $(PROGRAMS) - $(MKINSTALLDIRS) $(bindir) $(mandir)/man$(prog_manext) - $(INSTALL_PROGRAM) widl$(EXEEXT) $(bindir)/widl$(EXEEXT) - $(INSTALL_DATA) $(SRCDIR)/widl.man $(mandir)/man$(prog_manext)/widl.$(prog_manext) +install:: $(PROGRAMS) $(MANPAGES) + $(MKINSTALLDIRS) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man$(prog_manext) + $(INSTALL_PROGRAM) widl$(EXEEXT) $(DESTDIR)$(bindir)/widl$(EXEEXT) + $(INSTALL_DATA) widl.man $(DESTDIR)$(mandir)/man$(prog_manext)/widl.$(prog_manext) uninstall:: - $(RM) $(bindir)/widl$(EXEEXT) $(mandir)/man$(prog_manext)/widl.$(prog_manext) + $(RM) $(DESTDIR)$(bindir)/widl$(EXEEXT) $(DESTDIR)$(mandir)/man$(prog_manext)/widl.$(prog_manext) ### Dependencies: diff --git a/reactos/tools/widl/client.c b/reactos/tools/widl/client.c index 616d376e2df..6f8773e3957 100644 --- a/reactos/tools/widl/client.c +++ b/reactos/tools/widl/client.c @@ -1,7 +1,7 @@ /* * IDL Compiler * - * Copyright 2005 Eric Kohl + * Copyright 2005-2006 Eric Kohl * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -15,9 +15,12 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + #include #include #include @@ -26,18 +29,17 @@ #include #include +#include "windef.h" + #include "widl.h" #include "utils.h" #include "parser.h" #include "header.h" -#define END_OF_LIST(list) \ - do { \ - if (list) { \ - while (NEXT_LINK(list)) \ - list = NEXT_LINK(list); \ - } \ - } while(0) +#include "widltypes.h" +#include "typelib.h" +#include "typelib_struct.h" +#include "typegen.h" static FILE* client; static int indent = 0; @@ -56,1482 +58,31 @@ static int print_client( const char *format, ... ) } -static unsigned int -get_var_stack_offset_32(func_t *func, char *name) +static void print_message_buffer_size(const func_t *func) { - unsigned int offset = 0; - var_t *var; + unsigned int total_size = 0; - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - if (!strcmp(var->name, name)) - return offset; - - if (var->type->type == RPC_FC_DOUBLE || - var->type->type == RPC_FC_HYPER) - offset += 8; - else - offset += 4; - - var = PREV_LINK(var); - } - - return 0; -} - - -static unsigned int -get_var_stack_offset_64(func_t *func, char *name) -{ - unsigned int offset = 0; - var_t *var; - - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - if (!strcmp(var->name, name)) - return offset; - - offset += 8; - - var = PREV_LINK(var); - } - - return 0; -} - - -static unsigned int -get_var_proc_offset(var_t *var) -{ - if (var->ptr_level == 0 && is_base_type(var->type)) - return 2; - - return 4; -} - - -static unsigned int -get_var_type_offset(var_t *var) -{ - unsigned int toffset = 0; - void *sizeis_attr; - int string_attr; - type_t *type; - - type = var->type; - - if (var->ptr_level == 0) - { - if (type->type == RPC_FC_RP) - { - int tsize = 9; - - while (type->ref) - type = type->ref; - - if (type->type == RPC_FC_STRUCT) - { - var_t *field = type->fields; - - while (NEXT_LINK(field)) field = NEXT_LINK(field); - while (field) - { - tsize++; - field = PREV_LINK(field); - } - if (tsize % 2) - tsize++; - - toffset += tsize; - } - } - } - else if (var->ptr_level == 1) - { - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - string_attr = is_attr(var->attrs, ATTR_STRING); - - if (sizeis_attr) - { - if (string_attr) - { - if (type->type == RPC_FC_BYTE || - type->type == RPC_FC_CHAR || - type->type == RPC_FC_WCHAR) - toffset += 10; - } - else - { - if (is_base_type(type)) - toffset += 14; - } - } - else - { - if (is_base_type(type)) - toffset += 4; - } - } - - return toffset; -} - - -static type_t *get_type_by_name(func_t *func, char *name) -{ - var_t *var; - - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - if (!strcmp(var->name, name)) - return var->type; - - var = PREV_LINK(var); - } - - return NULL; -} - - -static unsigned char -get_base_type(unsigned char type) -{ - - switch (type) - { - case RPC_FC_USHORT: - type = RPC_FC_SHORT; - break; - - case RPC_FC_ULONG: - type = RPC_FC_LONG; - break; - } - - return type; -} - - -static int get_type_size(type_t *type, int alignment) -{ - int size; - var_t *field; - - switch(type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - size = 1; - size = ((size + alignment - 1) & ~(alignment -1)); - break; - - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - size = 2; - size = ((size + alignment - 1) & ~(alignment -1)); - break; - - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - size = ((size + alignment - 1) & ~(alignment -1)); - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - size = ((size + alignment - 1) & ~(alignment -1)); - break; - - case RPC_FC_IGNORE: - size = 0; - break; - - case RPC_FC_STRUCT: - field = type->fields; - size = 0; - while (NEXT_LINK(field)) field = NEXT_LINK(field); - while (field) - { - size += get_type_size(field->type, alignment); - field = PREV_LINK(field); - } - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, type->type); - return 0; - } - - return size; -} - - -static int get_type_alignment(type_t *type) -{ - int size; - - switch(type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - size = 1; - break; - - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - size = 2; - break; - - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, type->type); - return 0; - } - - return size; -} - - -static void write_procformatstring(type_t *iface) -{ - func_t *func = iface->funcs; - var_t *var; - unsigned int type_offset = 2; - int in_attr, out_attr; - - print_client("static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =\n"); - print_client("{\n"); - indent++; - print_client("0,\n"); - print_client("{\n"); - indent++; - - while (NEXT_LINK(func)) func = NEXT_LINK(func); - while (func) - { - /* emit argument data */ - if (func->args) - { - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - out_attr = is_attr(var->attrs, ATTR_OUT); - in_attr = is_attr(var->attrs, ATTR_IN); - - /* set 'in' attribute if neither 'in' nor 'out' is set */ - if (!out_attr && !in_attr) - in_attr = 1; - - if (var->ptr_level == 0) - { - if (is_base_type(var->type)) - { - print_client("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); - print_client("0x%02x, /* FC_ */\n", - get_base_type(var->type->type)); - } - else if (var->type->type == RPC_FC_RP) - { - if (in_attr & !out_attr) - print_client("0x4d, /* FC_IN_PARAM */\n"); - else if (!in_attr & out_attr) - print_client("0x51, /* FC_OUT_PARAM */\n"); - else if (in_attr & out_attr) - print_client("0x50, /* FC_IN_OUT_PARAM */\n"); - fprintf(client, "#ifndef _ALPHA_\n"); - print_client("0x01,\n"); - fprintf(client, "#else\n"); - print_client("0x02,\n"); - fprintf(client, "#endif\n"); - print_client("NdrFcShort(0x%x),\n", type_offset); - } - else - { - print_client("0x4d, /* FC_IN_PARAM */\n"); - - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, var->type->type); - return; - } - } - else if (var->ptr_level == 1) - { - if (in_attr & !out_attr) - print_client("0x4d, /* FC_IN_PARAM */\n"); - else if (!in_attr & out_attr) - print_client("0x51, /* FC_OUT_PARAM */\n"); - else if (in_attr & out_attr) - print_client("0x50, /* FC_IN_OUT_PARAM */\n"); - fprintf(client, "#ifndef _ALPHA_\n"); - print_client("0x01,\n"); - fprintf(client, "#else\n"); - print_client("0x02,\n"); - fprintf(client, "#endif\n"); - print_client("NdrFcShort(0x%x),\n", type_offset); - } - else - { - error("%s:%d Pointer level %d is not supported!\n", - __FILE__,__LINE__, var->ptr_level); - return; - } - - type_offset += get_var_type_offset(var); - - var = PREV_LINK(var); - } - } - - /* emit return value data */ - var = func->def; - if (is_void(var->type, NULL)) - { - print_client("0x5b, /* FC_END */\n"); - print_client("0x5c, /* FC_PAD */\n"); - } - else if (is_base_type(var->type)) - { - print_client("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); - print_client("0x%02x, /* FC_ */\n", get_base_type(var->type->type)); - } - else - { - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, var->type->type); - return; - } - - func = PREV_LINK(func); - } - - print_client("0x0\n"); - indent--; - print_client("}\n"); - indent--; - print_client("};\n"); - print_client("\n"); -} - - -static void write_typeformatstring(type_t *iface) -{ - func_t *func = iface->funcs; - var_t *var; - type_t *type; - int in_attr, out_attr; - int string_attr; - int ptr_attr, ref_attr, unique_attr; - void *sizeis_attr; - - print_client("static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =\n"); - print_client("{\n"); - indent++; - print_client("0,\n"); - print_client("{\n"); - indent++; - print_client("NdrFcShort(0x00),\n"); - - while (NEXT_LINK(func)) func = NEXT_LINK(func); - while (func) - { - if (func->args) - { - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - in_attr = is_attr(var->attrs, ATTR_IN); - out_attr = is_attr(var->attrs, ATTR_OUT); - string_attr = is_attr(var->attrs, ATTR_STRING); - - if (var->ptr_level > 1) - { - error("Function '%s' argument '%s': Pointer level %d not supported!\n", - func->def->name, var->name, var->ptr_level); - return; - } - - type = var->type; - if (var->ptr_level == 0) - { - if (!is_base_type(type)) - { - if (type->type == RPC_FC_RP) - { - var_t *field; - int tsize = 9; - unsigned char flags = 0; - - if (!in_attr && out_attr) - flags |= RPC_FC_P_ONSTACK; - - while (type->ref) - type = type->ref; - - print_client("0x11, 0x%02X, /* FC_RP, [flags] */\n", flags); - print_client("NdrFcShort(0x%02X),\n", 0x02); - print_client("0x%02X,\n", type->type); - print_client("0x%02X,\n", 3); /* alignment - 1 */ - print_client("NdrFcShort(0x%02X),\n", get_type_size(type, 4)); - - field = type->fields; - while (NEXT_LINK(field)) field = NEXT_LINK(field); - while (field) - { - print_client("0x%02X,\n", get_base_type(field->type->type)); - tsize++; - field = PREV_LINK(field); - } - if (tsize % 2) - { - print_client("0x5c, /* FC_PAD */\n"); - tsize++; - } - print_client("0x5b, /* FC_END */\n"); - } - else - { - - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, type->type); - return; - } - } - } - else if (var->ptr_level == 1) - { - ptr_attr = is_attr(var->attrs, ATTR_PTR); - ref_attr = is_attr(var->attrs, ATTR_REF); - unique_attr = is_attr(var->attrs, ATTR_UNIQUE); - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - - if (ptr_attr + ref_attr + unique_attr == 0) - ref_attr = 1; - - if (sizeis_attr) - { - unsigned char type_type = 0; - - type = get_type_by_name(func, ((var_t *)sizeis_attr)->name); - if (type != NULL) - type_type = type->type; - - if (ref_attr) - print_client("0x11, 0x00, /* FC_RP */\n"); - else if (unique_attr) - print_client("0x12, 0x00, /* FC_UP */\n"); - else if (ptr_attr) - print_client("0x14, 0x00, /* FC_FP */\n"); - - print_client("NdrFcShort(0x02),\n"); - - if (string_attr) - { - if (var->type->type == RPC_FC_WCHAR) - print_client("0x25, /* FC_C_WSTRING */\n"); - else - print_client("0x22, /* FC_C_CSTRING */\n"); - print_client("0x44, /* FC_STRING_SIZED */\n"); - print_client("0x%02x,\n", 0x20 + type_type); - print_client("0x00,\n"); - - fprintf(client, "#ifndef _ALPHA_\n"); - print_client("NdrFcShort(0x%02X),\n", - get_var_stack_offset_32(func, ((var_t *)sizeis_attr)->name)); - fprintf(client, "#else\n"); - print_client("NdrFcShort(0x%02X),\n", - get_var_stack_offset_64(func, ((var_t *)sizeis_attr)->name)); - fprintf(client, "#endif\n"); - } - else - { - print_client("0x1b, /* FC_CARRAY */\n"); - print_client("0x%02x,\n", get_type_alignment(var->type) - 1); - print_client("NdrFcShort(0x%02x),\n", get_type_size(var->type, 1)); - print_client("0x%02x,\n", 0x20 + type_type); - if (out_attr) - print_client("0x54, /* FC_DEREFERENCE */\n"); - else - print_client("0x00, /* */\n"); - - fprintf(client, "#ifndef _ALPHA_\n"); - print_client("NdrFcShort(0x%02X),\n", - get_var_stack_offset_32(func, ((var_t *)sizeis_attr)->name)); - fprintf(client, "#else\n"); - print_client("NdrFcShort(0x%02X),\n", - get_var_stack_offset_64(func, ((var_t *)sizeis_attr)->name)); - fprintf(client, "#endif\n"); - print_client("0x%02x,\n", get_base_type(var->type->type)); - print_client("0x5b, /* FC_END */\n"); - } - } - else if (is_base_type(type)) - { - if (out_attr && !in_attr) - { - if (ref_attr) - print_client("0x11, 0x0c, /* FC_RP [allocated_on_stack] [simple_pointer] */\n"); - else if (unique_attr) - print_client("0x12, 0x0c, /* FC_UP [allocated_on_stack] [simple_pointer] */\n"); - else if (ptr_attr) - print_client("0x14, 0x0c, /* FC_FP [allocated_on_stack] [simple_pointer] */\n"); - } - else - { - if (ref_attr) - print_client("0x11, 0x08, /* FC_RP [simple_pointer] */\n"); - else if (unique_attr) - print_client("0x12, 0x08, /* FC_UP [simple_pointer] */\n"); - else if (ptr_attr) - print_client("0x14, 0x08, /* FC_FP [simple_pointer] */\n"); - } - - if (string_attr) - { - if (type->type == RPC_FC_CHAR) - print_client("0x%02x, /* FC_C_CSTRING */\n", RPC_FC_C_CSTRING); - else if (type->type == RPC_FC_WCHAR) - print_client("0x%02x, /* FC_C_WSTRING */\n", RPC_FC_C_WSTRING); - else - { - error("%s:%d Invalid type!\n", __FILE__, __LINE__); - return; - } - } - else - print_client("0x%02x, /* FC_ */\n", get_base_type(var->type->type)); - print_client("0x5c, /* FC_PAD */\n"); - } - } - - var = PREV_LINK(var); - } - } - - func = PREV_LINK(func); - } - - print_client("0x0\n"); - indent--; - print_client("}\n"); - indent--; - print_client("};\n"); - print_client("\n"); -} - - -static void print_message_buffer_size(func_t *func, unsigned int *type_offset) -{ - unsigned int local_type_offset = *type_offset; - unsigned int alignment = 0; - int size = 0; - int last_size = -1; - int in_attr; - int out_attr; - int string_attr; - int nothing_printed = 1; - int ptr_attr, ref_attr, unique_attr; - int padding = 0, first_padding = 0; - void *sizeis_attr; - var_t *var; - type_t *type; - - print_client("_StubMsg.BufferLength ="); if (func->args) { - var = func->args; + const var_t *var = func->args; while (NEXT_LINK(var)) var = NEXT_LINK(var); - for (; var; var = PREV_LINK(var)) + while (var) { - out_attr = is_attr(var->attrs, ATTR_OUT); - in_attr = is_attr(var->attrs, ATTR_IN); + unsigned int alignment; - /* set 'in' attribute if neither 'in' nor 'out' is found */ - if (!out_attr && !in_attr) - in_attr = 1; + total_size += get_required_buffer_size(var, &alignment, PASS_IN); + total_size += alignment; - ptr_attr = is_attr(var->attrs, ATTR_PTR); - ref_attr = is_attr(var->attrs, ATTR_REF); - unique_attr = is_attr(var->attrs, ATTR_UNIQUE); - - /* default to 'ref' attribute */ - if (ptr_attr + ref_attr + unique_attr == 0) - ref_attr = 1; - - if (!in_attr) - continue; - - string_attr = is_attr(var->attrs, ATTR_STRING); - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - - type = var->type; - - if (var->ptr_level == 1) - { - if (string_attr && !sizeis_attr) - { - /* non-sized conformant string */ - if (type->type == RPC_FC_CHAR || type->type == RPC_FC_WCHAR) - { - size = (unique_attr) ? 16 : 12; - alignment = 0; - } - } - else if (sizeis_attr && !string_attr) - { - /* conformant arrays */ - size = 4; - alignment = 0; - if (padding != 0) - padding = 1; - } - else if (!sizeis_attr && !string_attr) - { - /* simple pointers */ - if (is_base_type(type)) - { - alignment = 0; - switch (type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - size = 1; - alignment = 0; - break; - - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - size = 2; - if (last_size > 0 && last_size < 2) - alignment += (2 - last_size); - break; - - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - if (last_size > 0 && last_size < 4) - alignment += (4 - last_size); - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - if (last_size > 0 && last_size < 4) - alignment += (4 - last_size); - break; - - case RPC_FC_IGNORE: - size = 0; - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, var->type->type); - return; - } - - if (unique_attr) - size += 4; - } - else - { - /* simple pointer to a struct */ - size = 8; - alignment = 0; - } - } - } - else - { - alignment = 0; - switch (type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - size = 1; - alignment = 0; - break; - - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - size = 2; - if (last_size > 0 && last_size < 2) - alignment += (2 - last_size); - break; - - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - if (last_size > 0 && last_size < 4) - alignment += (4 - last_size); - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - if (last_size > 0 && last_size < 4) - alignment += (4 - last_size); - break; - - case RPC_FC_IGNORE: - size = 0; - break; - - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_FP: - size = 0; - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, var->type->type); - return; - } - } - - if (last_size != -1) - fprintf(client, " +"); - fprintf(client, " %dU", (size == 0) ? 0 : size + alignment + first_padding + padding); - nothing_printed = 0; - if (first_padding != 0) - first_padding = 0; - - /* set paddings */ - if (var->ptr_level == 1) - { - if (string_attr && !sizeis_attr) - { - /* non-sized conformant string */ - if (type->type == RPC_FC_CHAR || type->type == RPC_FC_WCHAR) - { - first_padding = 3; - padding = 3; - } - } - else if (sizeis_attr && !string_attr) - { - /* conformant arrays */ - first_padding = 4; - padding = 3; - } - } - - last_size = size; + var = PREV_LINK(var); } } - - if (nothing_printed) - { - fprintf(client, " 0U"); - } - fprintf(client, ";\n"); - - /* get string size */ - if (func->args) - { - nothing_printed = 0; - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - for (; var; var = PREV_LINK(var)) - { - out_attr = is_attr(var->attrs, ATTR_OUT); - in_attr = is_attr(var->attrs, ATTR_IN); - - /* default to 'in' attribute */ - if (!out_attr && !in_attr) - in_attr = 1; - - ptr_attr = is_attr(var->attrs, ATTR_PTR); - ref_attr = is_attr(var->attrs, ATTR_REF); - unique_attr = is_attr(var->attrs, ATTR_UNIQUE); - - /* default to 'ref' attribute */ - if (ptr_attr + ref_attr + unique_attr == 0) - ref_attr = 1; - - string_attr = is_attr(var->attrs, ATTR_STRING); - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - - type = var->type; - - if (in_attr) - { - if (var->ptr_level == 0) - { - if (type->type == RPC_FC_RP) - { - while (type->ref) - type = type->ref; - - if (type->type == RPC_FC_STRUCT) - { - print_client("NdrSimpleStructBufferSize(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset + 4); - nothing_printed = 1; - indent--; - } - } - } - else if (var->ptr_level == 1) - { - if (string_attr) - { - if ((type->type == RPC_FC_CHAR || - type->type == RPC_FC_WCHAR)) - { - if (ref_attr) - { - print_client("NdrConformantStringBufferSize(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset + 2); - nothing_printed = 1; - indent--; - } - else if (unique_attr) - { - print_client("NdrPointerBufferSize(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset); - nothing_printed = 1; - indent--; - } - else if (ptr_attr) - { - /* FIXME: not supported yet */ - } - } - } - else - { - if (sizeis_attr) - { - fprintf(client, "\n"); - print_client("_StubMsg.MaxCount = %s;\n", - ((var_t *)sizeis_attr)->name); - fprintf(client, "\n"); - - if (ref_attr) - { - print_client("NdrConformantArrayBufferSize(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset + 4); - indent--; - nothing_printed = 1; - } - else if (unique_attr) - { - print_client("NdrPointerBufferSize(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset); - nothing_printed = 1; - indent--; - } - else if (ptr_attr) - { - /* FIXME: not supported yet */ - } - } - } - } - } - - /* calculate the next type offset */ - local_type_offset += get_var_type_offset(var); - } - - if (nothing_printed) - fprintf(client, "\n"); - } + fprintf(client, " %u", total_size); } - -static void marshall_in_arguments(func_t *func, unsigned int *type_offset) -{ - unsigned int local_type_offset = *type_offset; - unsigned int alignment; - unsigned int size; - unsigned int last_size = 0; - int in_attr; - int out_attr; - int string_attr; - int ptr_attr, ref_attr, unique_attr; - void *sizeis_attr; - var_t *var; - int default_align = 0; - type_t *type; - - if (!func->args) - return; - - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - for (; var; var = PREV_LINK(var)) - { - out_attr = is_attr(var->attrs, ATTR_OUT); - in_attr = is_attr(var->attrs, ATTR_IN); - - /* set 'in' attribute if neither 'in' nor 'out' is set */ - if (!out_attr && !in_attr) - in_attr = 1; - - type = var->type; - - if (in_attr) - { - if (var->ptr_level > 1) - { - error("Function '%s' argument '%s': Pointer level %d not supported!\n", - func->def->name, var->name, var->ptr_level); - return; - } - - if (var->ptr_level == 1) - { - ptr_attr = is_attr(var->attrs, ATTR_PTR); - ref_attr = is_attr(var->attrs, ATTR_REF); - unique_attr = is_attr(var->attrs, ATTR_UNIQUE); - if (ptr_attr + ref_attr + unique_attr == 0) - ref_attr = 1; - - string_attr = is_attr(var->attrs, ATTR_STRING); - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - - if (ref_attr) - { - if (sizeis_attr) - { - print_client("_StubMsg.MaxCount = %s;\n", - ((var_t *)sizeis_attr)->name); - fprintf(client, "\n"); - - print_client("NdrConformantArrayMarshall(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset + 4); - indent--; - fprintf(client, "\n"); - default_align = 1; - } - else - if (string_attr && - (type->type == RPC_FC_CHAR || type->type == RPC_FC_WCHAR)) - { - print_client("NdrConformantStringMarshall(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset + 2); - indent--; - fprintf(client, "\n"); - default_align = 1; - } - else - { - alignment = 0; - switch (type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - size = 1; - alignment = 0; - break; - - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - size = 2; - if (last_size > 0 && last_size < 2) - alignment = (2 - last_size); - break; - - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - if (last_size > 0 && last_size < 4) - alignment = (4 - last_size); - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - if (last_size > 0 && last_size < 4) - alignment = (4 - last_size); - break; - - case RPC_FC_IGNORE: - size = 0; - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, var->type->type); - return; - } - - if (size != 0) - { - if (default_align) - { - print_client("_StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~0x3);\n"); - fprintf(client, "\n"); - default_align = 0; - } - else - if (alignment != 0) - print_client("_StubMsg.Buffer += %u;\n", alignment); - - print_client("*(("); - write_type(client, var->type, NULL, var->tname); - fprintf(client, " __RPC_FAR*)_StubMsg.Buffer) = "); - if (var->ptr_level == 1) - fprintf(client, "*"); - write_name(client, var); - fprintf(client, ";\n"); - print_client("_StubMsg.Buffer += sizeof("); - write_type(client, var->type, NULL, var->tname); - fprintf(client, ");\n"); - fprintf(client, "\n"); - - last_size = size; - } - } - } - else if (unique_attr) - { - if (sizeis_attr) - { - print_client("_StubMsg.MaxCount = %s;\n", - ((var_t *)sizeis_attr)->name); - fprintf(client, "\n"); - } - - print_client("NdrPointerMarshall(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset); - indent--; - fprintf(client, "\n"); - default_align = 1; - } - } - else - { - if (is_base_type(type)) - { - alignment = 0; - switch (type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - size = 1; - alignment = 0; - break; - - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - size = 2; - if (last_size > 0 && last_size < 2) - alignment = (2 - last_size); - break; - - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - if (last_size > 0 && last_size < 4) - alignment = (4 - last_size); - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - if (last_size > 0 && last_size < 4) - alignment = (4 - last_size); - break; - - case RPC_FC_IGNORE: - size = 0; - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, var->type->type); - return; - } - - if (size != 0) - { - if (default_align) - { - fprintf(client, "\n"); - print_client("_StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~0x3);\n"); - fprintf(client, "\n"); - default_align = 0; - } - else - if (alignment != 0) - print_client("_StubMsg.Buffer += %u;\n", alignment); - - print_client("*(("); - write_type(client, var->type, NULL, var->tname); - fprintf(client, " __RPC_FAR*)_StubMsg.Buffer) = "); - if (var->ptr_level == 1) - fprintf(client, "*"); - write_name(client, var); - fprintf(client, ";\n"); - print_client("_StubMsg.Buffer += sizeof("); - write_type(client, var->type, NULL, var->tname); - fprintf(client, ");\n"); - fprintf(client, "\n"); - - last_size = size; - } - } - else if (type->type == RPC_FC_RP) - { - while (type->ref) - type = type->ref; - - if (type->type == RPC_FC_STRUCT) - { - print_client("NdrSimpleStructMarshall(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset + 4); - indent--; - fprintf(client, "\n"); - default_align = 1; - } - } - } - } - - /* calculate the next type offset */ - local_type_offset += get_var_type_offset(var); - } -} - - -static void unmarshall_out_arguments(func_t *func, unsigned int *type_offset) -{ - unsigned int alignment; - unsigned int size; - unsigned int last_size = 0; - int out_attr; - int string_attr; - int ptr_attr, ref_attr, unique_attr; - void *sizeis_attr; - var_t *var; - var_t *def; - unsigned int local_type_offset = *type_offset; - int default_align = 0; - type_t *type; - - def = func->def; - - /* unmarshall the out arguments */ - if (func->args) - { - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - for (; var; var = PREV_LINK(var)) - { - out_attr = is_attr(var->attrs, ATTR_OUT); - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - string_attr = is_attr(var->attrs, ATTR_STRING); - - ptr_attr = is_attr(var->attrs, ATTR_PTR); - ref_attr = is_attr(var->attrs, ATTR_REF); - unique_attr = is_attr(var->attrs, ATTR_UNIQUE); - if (ptr_attr + ref_attr + unique_attr == 0) - ref_attr = 1; - - type = var->type; - - if (out_attr) - { - if (var->ptr_level > 1) - { - error("Function '%s' argument '%s': Pointer level %d not supported!\n", - func->def->name, var->name, var->ptr_level); - return; - } - - if (sizeis_attr != NULL) - { - if (string_attr) - { - fprintf(client, "\n"); - print_client("NdrConformantStringUnmarshall(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR * __RPC_FAR *)&%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u],\n", - local_type_offset + 4); - print_client("(unsigned char)0);\n"); - indent--; - fprintf(client, "\n"); - default_align = 1; - } - else - { - fprintf(client, "\n"); - print_client("NdrConformantArrayUnmarshall(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR * __RPC_FAR *)&%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u],\n", - local_type_offset + 4); - print_client("(unsigned char)0);\n"); - indent--; - fprintf(client, "\n"); - default_align = 1; - } - } - else if (is_base_type(type)) - { - alignment = 0; - switch (type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - size = 1; - alignment = 0; - break; - - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - size = 2; - if (last_size > 0 && last_size < 2) - alignment = (2 - last_size); - break; - - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - if (last_size > 0 && last_size < 4) - alignment = (4 - last_size); - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - if (last_size > 0 && last_size < 4) - alignment = (4 - last_size); - break; - - case RPC_FC_IGNORE: - size = 0; - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, type->type); - return; - } - - if (size != 0) - { - if (var->ptr_level == 1) - { - if (unique_attr) - { - fprintf(client, "\n"); - print_client("NdrPointerUnmarshall(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR * __RPC_FAR *)&%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u],\n", - local_type_offset); - print_client("(unsigned char)0);\n"); - indent--; - fprintf(client, "\n"); - default_align = 1; - } - else - { - fprintf(client, "\n"); - if (default_align) - { - print_client("_StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~0x3);\n"); - fprintf(client, "\n"); - default_align = 0; - } - else - if (alignment != 0) - print_client("_StubMsg.Buffer += %u;\n", alignment); - - - print_client("*"); - write_name(client, var); - fprintf(client, " = *(("); - write_type(client, var->type, NULL, var->tname); - fprintf(client, " __RPC_FAR *)_StubMsg.Buffer);\n"); - - print_client("_StubMsg.Buffer += sizeof("); - write_type(client, var->type, NULL, var->tname); - fprintf(client, ");\n"); - } - } - - last_size = size; - } - } - else if (type->type == RPC_FC_RP) - { - while (type->ref) - type = type->ref; - - if (type->type == RPC_FC_STRUCT) - { - fprintf(client, "\n"); - print_client("NdrSimpleStructUnmarshall(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR * __RPC_FAR *)&%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u],\n", - local_type_offset + 4); - print_client("(unsigned char)0);\n"); - indent--; - fprintf(client, "\n"); - default_align = 1; - } - } - else - { - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, type->type); - return; - } - } - - /* calculate the next type offset */ - local_type_offset += get_var_type_offset(var); - } - } - - /* unmarshall return value */ - if (!is_void(def->type, NULL)) - { - alignment = 0; - switch (def->type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - if (last_size > 0 && last_size < 4) - alignment = (4 - last_size); - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - if (last_size > 0 && last_size < 4) - alignment = (4 - last_size); - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, def->type->type); - return; - } - - fprintf(client, "\n"); - if (default_align) - { - print_client("_StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~0x3);\n"); - fprintf(client, "\n"); - default_align = 0; - } - else - if (alignment != 0) - print_client("_StubMsg.Buffer += %u;\n", alignment); - print_client("_RetVal = *(("); - write_type(client, def->type, def, def->tname); - fprintf(client, " __RPC_FAR *)_StubMsg.Buffer);\n"); - - print_client("_StubMsg.Buffer += sizeof("); - write_type(client, def->type, def, def->tname); - fprintf(client, ");\n"); - } -} - - -static void check_pointers(func_t *func) +static void check_pointers(const func_t *func) { var_t *var; - int ptr_attr; - int ref_attr; - int unique_attr; + int pointer_type; if (!func->args) return; @@ -1540,49 +91,20 @@ static void check_pointers(func_t *func) while (NEXT_LINK(var)) var = NEXT_LINK(var); while (var) { - ptr_attr = is_attr(var->attrs, ATTR_PTR); - ref_attr = is_attr(var->attrs, ATTR_REF); - unique_attr = is_attr(var->attrs, ATTR_UNIQUE); + pointer_type = get_attrv(var->attrs, ATTR_POINTERTYPE); + if (!pointer_type) + pointer_type = RPC_FC_RP; - if (var->ptr_level == 0) + if (pointer_type == RPC_FC_RP) { - if (ptr_attr + ref_attr + unique_attr != 0) + if (var->ptr_level >= 1) { - error("The attributes [ptr], [ref] and [unique] can only be used for pointers!\n"); - return; - } - } - else - { - /* default to 'ref' attribute */ - if (ptr_attr + ref_attr + unique_attr == 0) - { - ref_attr = 1; - } - - if (ptr_attr + ref_attr + unique_attr > 1) - { - error("The attributes [ptr], [ref] and [unique] are mutually exclusive!\n"); - return; - } - - if (var->ptr_level == 1) - { - if (ref_attr) - { - print_client("if (!%s)\n", var->name); - print_client("{\n"); - indent++; - print_client("RpcRaiseException(RPC_X_NULL_REF_POINTER);\n"); - indent--; - print_client("}\n"); - fprintf(client, "\n"); - } - } - else if (var->ptr_level > 1) - { - error("Pointer level %d not supported!\n", var->ptr_level); - return; + print_client("if (!%s)\n", var->name); + print_client("{\n"); + indent++; + print_client("RpcRaiseException(RPC_X_NULL_REF_POINTER);\n"); + indent--; + print_client("}\n\n"); } } @@ -1590,46 +112,20 @@ static void check_pointers(func_t *func) } } - -static int use_return_buffer(func_t *func) +static void write_function_stubs(type_t *iface, unsigned int *proc_offset, unsigned int *type_offset) { - var_t *var; - - if (!is_void(func->def->type, NULL)) - return 1; - - if (!func->args) - return 0; - - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - if (is_attr(var->attrs, ATTR_OUT)) - return 1; - - var = PREV_LINK(var); - } - - return 0; -} - - -static void write_function_stubs(type_t *iface) -{ - char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); + const func_t *func = iface->funcs; + const char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); int explicit_handle = is_attr(iface->attrs, ATTR_EXPLICIT_HANDLE); - func_t *func = iface->funcs; - var_t* var; - var_t* explicit_handle_var; + var_t *var; int method_count = 0; - unsigned int proc_offset = 0; - unsigned int type_offset = 2; while (NEXT_LINK(func)) func = NEXT_LINK(func); while (func) { - var_t *def = func->def; + const var_t *def = func->def; + const var_t* explicit_handle_var; + unsigned int type_offset_func; /* check for a defined binding handle */ explicit_handle_var = get_explicit_handle_var(func); @@ -1641,7 +137,7 @@ static void write_function_stubs(type_t *iface) return; } } - else + else if (implicit_handle) { if (explicit_handle_var) { @@ -1655,7 +151,10 @@ static void write_function_stubs(type_t *iface) write_name(client, def); fprintf(client, "(\n"); indent++; - write_args(client, func->args, iface->name, 0, TRUE); + if (func->args) + write_args(client, func->args, iface->name, 0, TRUE); + else + print_client("void"); fprintf(client, ")\n"); indent--; @@ -1671,8 +170,9 @@ static void write_function_stubs(type_t *iface) fprintf(client, " _RetVal;\n"); } - if (implicit_handle || explicit_handle) + if (implicit_handle || explicit_handle_var) print_client("RPC_BINDING_HANDLE _Handle = 0;\n"); + print_client("RPC_MESSAGE _RpcMessage;\n"); print_client("MIDL_STUB_MESSAGE _StubMsg;\n"); fprintf(client, "\n"); @@ -1698,64 +198,71 @@ static void write_function_stubs(type_t *iface) print_client("_Handle = %s;\n", implicit_handle); fprintf(client, "\n"); } - else if (explicit_handle) + else if (explicit_handle_var) { print_client("_Handle = %s;\n", explicit_handle_var->name); fprintf(client, "\n"); } /* emit the message buffer size */ - print_message_buffer_size(func, &type_offset); + print_client("_StubMsg.BufferLength ="); + print_message_buffer_size(func); + fprintf(client, ";\n"); + + type_offset_func = *type_offset; + write_remoting_arguments(client, indent, func, &type_offset_func, PASS_IN, PHASE_BUFFERSIZE); print_client("NdrGetBuffer(\n"); indent++; print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); print_client("_StubMsg.BufferLength,\n"); - if (implicit_handle || explicit_handle) + if (implicit_handle || explicit_handle_var) print_client("_Handle);\n"); else print_client("%s__MIDL_AutoBindHandle);\n", iface->name); indent--; fprintf(client, "\n"); - /* marshal in arguments */ - marshall_in_arguments(func, &type_offset); - /* send/recieve message */ + /* make a copy so we don't increment the type offset twice */ + type_offset_func = *type_offset; + + /* marshal arguments */ + write_remoting_arguments(client, indent, func, &type_offset_func, PASS_IN, PHASE_MARSHAL); + + /* send/receive message */ + /* print_client("NdrNsSendReceive(\n"); */ + /* print_client("(unsigned char *)_StubMsg.Buffer,\n"); */ + /* print_client("(RPC_BINDING_HANDLE *) &%s__MIDL_AutoBindHandle);\n", iface->name); */ print_client("NdrSendReceive(\n"); indent++; print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR *)_StubMsg.Buffer);\n"); + print_client("(unsigned char *)_StubMsg.Buffer);\n\n"); indent--; - if (use_return_buffer(func)) + print_client("_StubMsg.BufferStart = (unsigned char *)_RpcMessage.Buffer;\n"); + print_client("_StubMsg.BufferEnd = _StubMsg.BufferStart + _RpcMessage.BufferLength;\n"); + + if (has_out_arg_or_return(func)) { - /* convert data representation */ fprintf(client, "\n"); + print_client("if ((_RpcMessage.DataRepresentation & 0x0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION)\n"); indent++; print_client("NdrConvert(\n"); indent++; print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(PFORMAT_STRING)&__MIDL_ProcFormatString.Format[%u]);\n", proc_offset); + print_client("(PFORMAT_STRING)&__MIDL_ProcFormatString.Format[%u]);\n", *proc_offset); indent -= 2; - - /* unmarshal out arguments */ - unmarshall_out_arguments(func, &type_offset); } - /* update type_offset */ - if (func->args) - { - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - type_offset += get_var_type_offset(var); + /* unmarshall arguments */ + fprintf(client, "\n"); + write_remoting_arguments(client, indent, func, type_offset, PASS_OUT, PHASE_UNMARSHAL); - var = PREV_LINK(var); - } - } + /* unmarshal return value */ + if (!is_void(def->type, NULL)) + print_phase_basetype(client, indent, PHASE_UNMARSHAL, PASS_RETURN, def, "_RetVal"); /* update proc_offset */ if (func->args) @@ -1764,12 +271,14 @@ static void write_function_stubs(type_t *iface) while (NEXT_LINK(var)) var = NEXT_LINK(var); while (var) { - proc_offset += get_var_proc_offset(var); - + *proc_offset += get_size_procformatstring_var(var); var = PREV_LINK(var); } } - proc_offset += 2; /* FIXME */ + if (!is_void(def->type, NULL)) + *proc_offset += get_size_procformatstring_var(def); + else + *proc_offset += 2; /* FC_END and FC_PAD */ indent--; print_client("}\n"); @@ -1806,11 +315,8 @@ static void write_function_stubs(type_t *iface) static void write_bindinghandledecl(type_t *iface) { - if (!get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE)) - { - print_client("static RPC_BINDING_HANDLE %s__MIDL_AutoBindHandle;\n", iface->name); - fprintf(client, "\n"); - } + print_client("static RPC_BINDING_HANDLE %s__MIDL_AutoBindHandle;\n", iface->name); + fprintf(client, "\n"); } @@ -1821,23 +327,30 @@ static void write_stubdescdecl(type_t *iface) } -static void write_stubdescriptor(type_t *iface) +static void write_stubdescriptor(type_t *iface, int expr_eval_routines) { - char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); + const char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); print_client("static const MIDL_STUB_DESC %s_StubDesc =\n", iface->name); print_client("{\n"); indent++; - print_client("(void __RPC_FAR *)& %s___RpcClientInterface,\n", iface->name); + print_client("(void *)& %s___RpcClientInterface,\n", iface->name); print_client("MIDL_user_allocate,\n"); print_client("MIDL_user_free,\n"); + print_client("{\n"); + indent++; if (implicit_handle) - print_client("{&%s},\n", implicit_handle); + print_client("&%s,\n", implicit_handle); else - print_client("{&%s__MIDL_AutoBindHandle},\n", iface->name); - print_client("0,\n"); + print_client("&%s__MIDL_AutoBindHandle,\n", iface->name); + indent--; + print_client("},\n"); print_client("0,\n"); print_client("0,\n"); + if (expr_eval_routines) + print_client("ExprEvalRoutines,\n"); + else + print_client("0,\n"); print_client("0,\n"); print_client("__MIDL_TypeFormatString.Format,\n"); print_client("1, /* -error bounds_check flag */\n"); @@ -1860,7 +373,7 @@ static void write_stubdescriptor(type_t *iface) static void write_clientinterfacedecl(type_t *iface) { unsigned long ver = get_attrv(iface->attrs, ATTR_VERSION); - UUID *uuid = get_attrp(iface->attrs, ATTR_UUID); + const UUID *uuid = get_attrp(iface->attrs, ATTR_UUID); print_client("static const RPC_CLIENT_INTERFACE %s___RpcClientInterface =\n", iface->name ); print_client("{\n"); @@ -1880,11 +393,11 @@ static void write_clientinterfacedecl(type_t *iface) indent--; print_client("};\n"); if (old_names) - print_client("RPC_IF_HANDLE %s_ClientIfHandle = (RPC_IF_HANDLE)& %s___RpcClientInterface;\n", - iface->name, iface->name); + print_client("RPC_IF_HANDLE %s_ClientIfHandle = (RPC_IF_HANDLE)& %s___RpcClientInterface;\n", + iface->name, iface->name); else - print_client("RPC_IF_HANDLE %s_v%d_%d_c_ifspec = (RPC_IF_HANDLE)& %s___RpcClientInterface;\n", - iface->name, LOWORD(ver), HIWORD(ver), iface->name); + print_client("RPC_IF_HANDLE %s_v%d_%d_c_ifspec = (RPC_IF_HANDLE)& %s___RpcClientInterface;\n", + iface->name, LOWORD(ver), HIWORD(ver), iface->name); fprintf(client, "\n"); } @@ -1902,76 +415,13 @@ static void write_formatdesc( const char *str ) } -static int get_type_format_string_size(type_t *iface) -{ - int size = 3; - func_t *func; - var_t *var; - - /* determine the type format string size */ - func = iface->funcs; - while (NEXT_LINK(func)) func = NEXT_LINK(func); - while (func) - { - /* argument list size */ - if (func->args) - { - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - size += get_var_type_offset(var); - var = PREV_LINK(var); - } - } - - func = PREV_LINK(func); - } - - return size; -} - - -static int get_proc_format_string_size(type_t *iface) -{ - int size = 1; - func_t *func; - var_t *var; - - /* determine the proc format string size */ - func = iface->funcs; - while (NEXT_LINK(func)) func = NEXT_LINK(func); - while (func) - { - /* argument list size */ - if (func->args) - { - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - size += get_var_proc_offset(var); - - var = PREV_LINK(var); - } - } - - /* return value size */ - size += 2; - func = PREV_LINK(func); - } - - return size; -} - - -static void write_formatstringsdecl(type_t *iface) +static void write_formatstringsdecl(ifref_t *ifaces) { print_client("#define TYPE_FORMAT_STRING_SIZE %d\n", - get_type_format_string_size(iface)); + get_size_typeformatstring(ifaces)); print_client("#define PROC_FORMAT_STRING_SIZE %d\n", - get_proc_format_string_size(iface)); + get_size_procformatstring(ifaces)); fprintf(client, "\n"); write_formatdesc("TYPE"); @@ -1985,7 +435,7 @@ static void write_formatstringsdecl(type_t *iface) static void write_implicithandledecl(type_t *iface) { - char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); + const char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); if (implicit_handle) { @@ -2014,6 +464,8 @@ static void init_client(void) void write_client(ifref_t *ifaces) { + unsigned int proc_offset = 0; + unsigned int type_offset = 2; ifref_t *iface = ifaces; if (!do_client) @@ -2026,35 +478,47 @@ void write_client(ifref_t *ifaces) if (!client) return; - while (iface) + write_formatstringsdecl(ifaces); + + for (; iface; iface = PREV_LINK(iface)) { + if (is_object(iface->iface->attrs) || is_local(iface->iface->attrs)) + continue; + fprintf(client, "/*****************************************************************************\n"); fprintf(client, " * %s interface\n", iface->iface->name); fprintf(client, " */\n"); fprintf(client, "\n"); - write_formatstringsdecl(iface->iface); - write_implicithandledecl(iface->iface); + if (iface->iface->funcs) + { + int expr_eval_routines; - write_clientinterfacedecl(iface->iface); - write_stubdescdecl(iface->iface); - write_bindinghandledecl(iface->iface); + write_implicithandledecl(iface->iface); + + write_clientinterfacedecl(iface->iface); + write_stubdescdecl(iface->iface); + write_bindinghandledecl(iface->iface); + + write_function_stubs(iface->iface, &proc_offset, &type_offset); - write_function_stubs(iface->iface); - write_stubdescriptor(iface->iface); + print_client("#if !defined(__RPC_WIN32__)\n"); + print_client("#error Invalid build platform for this stub.\n"); + print_client("#endif\n"); - print_client("#if !defined(__RPC_WIN32__)\n"); - print_client("#error Invalid build platform for this stub.\n"); - print_client("#endif\n"); - fprintf(client, "\n"); + fprintf(client, "\n"); - write_procformatstring(iface->iface); - write_typeformatstring(iface->iface); - - fprintf(client, "\n"); - - iface = PREV_LINK(iface); + expr_eval_routines = write_expr_eval_routines(client, iface->iface->name); + if (expr_eval_routines) + write_expr_eval_routine_list(client, iface->iface->name); + write_stubdescriptor(iface->iface, expr_eval_routines); + } } + fprintf(client, "\n"); + + write_procformatstring(client, ifaces); + write_typeformatstring(client, ifaces); + fclose(client); } diff --git a/reactos/tools/widl/hash.c b/reactos/tools/widl/hash.c index 8ee30982248..d67cb6b16a0 100644 --- a/reactos/tools/widl/hash.c +++ b/reactos/tools/widl/hash.c @@ -16,12 +16,15 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include -#include "widltypes.h" +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "hash.h" static const unsigned char Lookup_16[128 * 3] = { @@ -511,7 +514,7 @@ unsigned long lhash_val_of_name_sys( syskind_t skind, LCID lcid, LPCSTR lpStr) switch (PRIMARYLANGID(LANGIDFROMLCID(lcid))) { default: - fprintf(stderr, "Unknown lcid %lx, treating as latin-based, please report\n", (long)lcid); + fprintf(stderr, "Unknown lcid %lx, treating as latin-based, please report\n", lcid); /* .. Fall Through .. */ case LANG_AFRIKAANS: case LANG_ALBANIAN: case LANG_ARMENIAN: case LANG_ASSAMESE: case LANG_AZERI: case LANG_BASQUE: @@ -533,8 +536,8 @@ unsigned long lhash_val_of_name_sys( syskind_t skind, LCID lcid, LPCSTR lpStr) case LANG_TATAR: case LANG_TELUGU: case LANG_THAI: case LANG_UKRAINIAN: case LANG_URDU: case LANG_UZBEK: case LANG_VIETNAMESE: case LANG_GAELIC: case LANG_MALTESE: - case LANG_MAORI: case LANG_RHAETO_ROMANCE: - case LANG_SAAMI: case LANG_SORBIAN: case LANG_SUTU: + case LANG_TAJIK: case LANG_ROMANSH: case LANG_IRISH: + case LANG_SAMI: case LANG_UPPER_SORBIAN: case LANG_SUTU: case LANG_TSONGA: case LANG_TSWANA: case LANG_VENDA: case LANG_XHOSA: case LANG_ZULU: case LANG_ESPERANTO: case LANG_WALON: case LANG_CORNISH: case LANG_WELSH: diff --git a/reactos/tools/widl/hash.h b/reactos/tools/widl/hash.h index de91849ebc6..bb787abab83 100644 --- a/reactos/tools/widl/hash.h +++ b/reactos/tools/widl/hash.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ diff --git a/reactos/tools/widl/header.c b/reactos/tools/widl/header.c index 4bc67dab052..c807691c594 100644 --- a/reactos/tools/widl/header.c +++ b/reactos/tools/widl/header.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" @@ -30,6 +30,7 @@ #include #include +#include "windef.h" #include "widl.h" #include "utils.h" #include "parser.h" @@ -37,27 +38,15 @@ static int indentation = 0; -static void indent(int delta) +static void indent(FILE *h, int delta) { int c; if (delta < 0) indentation += delta; - for (c=0; c 0) indentation += delta; } -int is_base_type(type_t *t) -{ - return (t->type == RPC_FC_BYTE || t->type == RPC_FC_CHAR || - t->type == RPC_FC_SMALL || t->type == RPC_FC_USMALL || - t->type == RPC_FC_WCHAR || t->type == RPC_FC_SHORT || - t->type == RPC_FC_USHORT || t->type == RPC_FC_LONG || - t->type == RPC_FC_ULONG || t->type == RPC_FC_FLOAT || - t->type == RPC_FC_HYPER || t->type == RPC_FC_DOUBLE || - t->type == RPC_FC_ENUM16 || t->type == RPC_FC_ENUM32 || - t->type == RPC_FC_IGNORE); -} - -int is_attr(attr_t *a, enum attr_type t) +int is_attr(const attr_t *a, enum attr_type t) { while (a) { if (a->type == t) return 1; @@ -66,7 +55,7 @@ int is_attr(attr_t *a, enum attr_type t) return 0; } -void *get_attrp(attr_t *a, enum attr_type t) +void *get_attrp(const attr_t *a, enum attr_type t) { while (a) { if (a->type == t) return a->u.pval; @@ -75,7 +64,7 @@ void *get_attrp(attr_t *a, enum attr_type t) return NULL; } -unsigned long get_attrv(attr_t *a, enum attr_type t) +unsigned long get_attrv(const attr_t *a, enum attr_type t) { while (a) { if (a->type == t) return a->u.ival; @@ -84,14 +73,24 @@ unsigned long get_attrv(attr_t *a, enum attr_type t) return 0; } -int is_void(type_t *t, var_t *v) +int is_void(const type_t *t, const var_t *v) { if (v && v->ptr_level) return 0; if (!t->type && !t->ref) return 1; return 0; } -static void write_pident(FILE *h, var_t *v) +static void write_guid(const char *guid_prefix, const char *name, const UUID *uuid) +{ + if (!uuid) return; + fprintf(header, "DEFINE_GUID(%s_%s, 0x%08lx, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x," + "0x%02x,0x%02x,0x%02x,0x%02x,0x%02x);\n", + guid_prefix, name, uuid->Data1, uuid->Data2, uuid->Data3, uuid->Data4[0], + uuid->Data4[1], uuid->Data4[2], uuid->Data4[3], uuid->Data4[4], uuid->Data4[5], + uuid->Data4[6], uuid->Data4[7]); +} + +static void write_pident(FILE *h, const var_t *v) { int c; for (c=0; cptr_level; c++) { @@ -100,21 +99,23 @@ static void write_pident(FILE *h, var_t *v) if (v->name) fprintf(h, "%s", v->name); } -void write_name(FILE *h, var_t *v) +void write_name(FILE *h, const var_t *v) { if (is_attr( v->attrs, ATTR_PROPGET )) fprintf(h, "get_" ); else if (is_attr( v->attrs, ATTR_PROPPUT )) fprintf(h, "put_" ); + else if (is_attr( v->attrs, ATTR_PROPPUTREF )) + fprintf(h, "putref_" ); fprintf(h, "%s", v->name); } -char* get_name(var_t *v) +const char* get_name(const var_t *v) { return v->name; } -static void write_array(FILE *h, expr_t *v, int field) +void write_array(FILE *h, const expr_t *v, int field) { if (!v) return; while (NEXT_LINK(v)) v = NEXT_LINK(v); @@ -135,7 +136,7 @@ static void write_field(FILE *h, var_t *v) { if (!v) return; if (v->type) { - indent(0); + indent(h, 0); write_type(h, v->type, NULL, v->tname); if (get_name(v)) { fprintf(h, " "); @@ -184,11 +185,11 @@ static void write_enums(FILE *h, var_t *v) while (NEXT_LINK(v)) v = NEXT_LINK(v); while (v) { if (get_name(v)) { - indent(0); + indent(h, 0); write_name(h, v); if (v->eval) { fprintf(h, " = "); - write_expr(h, v->eval); + write_expr(h, v->eval, 0); } } if (PREV_LINK(v)) @@ -198,7 +199,7 @@ static void write_enums(FILE *h, var_t *v) fprintf(h, "\n"); } -void write_type(FILE *h, type_t *t, var_t *v, char *n) +void write_type(FILE *h, type_t *t, const var_t *v, const char *n) { int c; @@ -218,7 +219,12 @@ void write_type(FILE *h, type_t *t, var_t *v, char *n) else fprintf(h, "char"); break; case RPC_FC_WCHAR: - fprintf(h, "wchar_t"); + fprintf(h, "WCHAR"); + break; + case RPC_FC_USMALL: + case RPC_FC_SMALL: + if (t->ref) fprintf(h, t->ref->name); + else fprintf(h, "small"); break; case RPC_FC_USHORT: case RPC_FC_SHORT: @@ -242,13 +248,13 @@ void write_type(FILE *h, type_t *t, var_t *v, char *n) break; case RPC_FC_ENUM16: case RPC_FC_ENUM32: - if (t->defined && !t->written) { + if (t->defined && !t->written && !t->ignore) { if (t->name) fprintf(h, "enum %s {\n", t->name); else fprintf(h, "enum {\n"); t->written = TRUE; indentation++; write_enums(h, t->fields); - indent(-1); + indent(h, -1); fprintf(h, "}"); } else fprintf(h, "enum %s", t->name); @@ -257,7 +263,7 @@ void write_type(FILE *h, type_t *t, var_t *v, char *n) if (t->ref) fprintf(h, t->ref->name); else fprintf(h, "error_status_t"); break; - case RPC_FC_IGNORE: + case RPC_FC_BIND_PRIMITIVE: if (t->ref) fprintf(h, t->ref->name); else fprintf(h, "handle_t"); break; @@ -268,29 +274,33 @@ void write_type(FILE *h, type_t *t, var_t *v, char *n) case RPC_FC_PSTRUCT: case RPC_FC_BOGUS_STRUCT: case RPC_FC_ENCAPSULATED_UNION: - if (t->defined && !t->written) { + if (t->defined && !t->written && !t->ignore) { if (t->name) fprintf(h, "struct %s {\n", t->name); else fprintf(h, "struct {\n"); t->written = TRUE; indentation++; write_fields(h, t->fields); - indent(-1); + indent(h, -1); fprintf(h, "}"); } else fprintf(h, "struct %s", t->name); break; case RPC_FC_NON_ENCAPSULATED_UNION: - if (t->defined && !t->written) { + if (t->defined && !t->written && !t->ignore) { if (t->name) fprintf(h, "union %s {\n", t->name); else fprintf(h, "union {\n"); t->written = TRUE; indentation++; write_fields(h, t->fields); - indent(-1); + indent(h, -1); fprintf(h, "}"); } else fprintf(h, "union %s", t->name); break; + case RPC_FC_FP: + if (t->ref) write_type(h, t->ref, NULL, t->name); + fprintf(h, "*"); + break; default: fprintf(h, "(unknown-type:%d)", t->type); } @@ -309,10 +319,76 @@ void write_type(FILE *h, type_t *t, var_t *v, char *n) } } -void write_typedef(type_t *type, var_t *names) + +struct user_type { - char *tname = names->tname; - var_t *lname; + struct user_type *next; + char name[1]; +}; + +static struct user_type *user_type_list; + +static int user_type_registered(const char *name) +{ + struct user_type *ut; + for (ut = user_type_list; ut; ut = ut->next) + if (!strcmp(name, ut->name)) + return 1; + return 0; +} + +static void check_for_user_types(const var_t *v) +{ + while (v) { + type_t *type = v->type; + const char *name = v->tname; + for (type = v->type; type; type = type->ref) { + if (type->user_types_registered) continue; + type->user_types_registered = 1; + if (is_attr(type->attrs, ATTR_WIREMARSHAL)) { + if (!user_type_registered(name)) + { + struct user_type *ut = xmalloc(sizeof(struct user_type) + strlen(name)); + strcpy(ut->name, name); + ut->next = user_type_list; + user_type_list = ut; + } + /* don't carry on parsing fields within this type as we are already + * using a wire marshaled type */ + break; + } + else if (type->fields) + { + const var_t *fields = type->fields; + while (NEXT_LINK(fields)) fields = NEXT_LINK(fields); + check_for_user_types(fields); + } + /* the wire_marshal attribute is always at least one reference away + * from the name of the type, so update it after the rest of the + * processing above */ + if (type->name) name = type->name; + } + v = PREV_LINK(v); + } +} + +void write_user_types(void) +{ + struct user_type *ut; + for (ut = user_type_list; ut; ut = ut->next) + { + const char *name = ut->name; + fprintf(header, "unsigned long __RPC_USER %s_UserSize (unsigned long *, unsigned long, %s *);\n", name, name); + fprintf(header, "unsigned char * __RPC_USER %s_UserMarshal (unsigned long *, unsigned char *, %s *);\n", name, name); + fprintf(header, "unsigned char * __RPC_USER %s_UserUnmarshal(unsigned long *, unsigned char *, %s *);\n", name, name); + fprintf(header, "void __RPC_USER %s_UserFree (unsigned long *, %s *);\n", name, name); + } +} + +void write_typedef(type_t *type, const var_t *names) +{ + const char *tname = names->tname; + const var_t *lname; while (NEXT_LINK(names)) names = NEXT_LINK(names); lname = names; fprintf(header, "typedef "); @@ -325,25 +401,9 @@ void write_typedef(type_t *type, var_t *names) names = PREV_LINK(names); } fprintf(header, ";\n"); - - if (get_attrp(type->attrs, ATTR_WIREMARSHAL)) { - names = lname; - while (names) { - char *name = get_name(names); - fprintf(header, "unsigned long __RPC_USER %s_UserSize (unsigned long *, unsigned long, %s *);\n", name, name); - fprintf(header, "unsigned char * __RPC_USER %s_UserMarshal (unsigned long *, unsigned char *, %s *);\n", name, name); - fprintf(header, "unsigned char * __RPC_USER %s_UserUnmarshal(unsigned long *, unsigned char *, %s *);\n", name, name); - fprintf(header, "void __RPC_USER %s_UserFree (unsigned long *, %s *);\n", name, name); - if (PREV_LINK(names)) - fprintf(header, ", "); - names = PREV_LINK(names); - } - } - - fprintf(header, "\n"); } -static void do_write_expr(FILE *h, expr_t *e, int p) +void write_expr(FILE *h, const expr_t *e, int brackets) { switch (e->type) { case EXPR_VOID: @@ -354,26 +414,32 @@ static void do_write_expr(FILE *h, expr_t *e, int p) case EXPR_HEXNUM: fprintf(h, "0x%lx", e->u.lval); break; + case EXPR_TRUEFALSE: + if (e->u.lval == 0) + fprintf(h, "FALSE"); + else + fprintf(h, "TRUE"); + break; case EXPR_IDENTIFIER: fprintf(h, "%s", e->u.sval); break; case EXPR_NEG: fprintf(h, "-"); - do_write_expr(h, e->ref, 1); + write_expr(h, e->ref, 1); break; case EXPR_NOT: fprintf(h, "~"); - do_write_expr(h, e->ref, 1); + write_expr(h, e->ref, 1); break; case EXPR_PPTR: fprintf(h, "*"); - do_write_expr(h, e->ref, 1); + write_expr(h, e->ref, 1); break; case EXPR_CAST: fprintf(h, "("); write_type(h, e->u.tref->ref, NULL, e->u.tref->name); fprintf(h, ")"); - do_write_expr(h, e->ref, 1); + write_expr(h, e->ref, 1); break; case EXPR_SIZEOF: fprintf(h, "sizeof("); @@ -388,8 +454,8 @@ static void do_write_expr(FILE *h, expr_t *e, int p) case EXPR_SUB: case EXPR_AND: case EXPR_OR: - if (p) fprintf(h, "("); - do_write_expr(h, e->ref, 1); + if (brackets) fprintf(h, "("); + write_expr(h, e->ref, 1); switch (e->type) { case EXPR_SHL: fprintf(h, " << "); break; case EXPR_SHR: fprintf(h, " >> "); break; @@ -401,34 +467,29 @@ static void do_write_expr(FILE *h, expr_t *e, int p) case EXPR_OR: fprintf(h, " | "); break; default: break; } - do_write_expr(h, e->u.ext, 1); - if (p) fprintf(h, ")"); + write_expr(h, e->u.ext, 1); + if (brackets) fprintf(h, ")"); break; case EXPR_COND: - if (p) fprintf(h, "("); - do_write_expr(h, e->ref, 1); + if (brackets) fprintf(h, "("); + write_expr(h, e->ref, 1); fprintf(h, " ? "); - do_write_expr(h, e->u.ext, 1); + write_expr(h, e->u.ext, 1); fprintf(h, " : "); - do_write_expr(h, e->ext2, 1); - if (p) fprintf(h, ")"); + write_expr(h, e->ext2, 1); + if (brackets) fprintf(h, ")"); break; } } -void write_expr(FILE *h, expr_t *e) -{ - do_write_expr(h, e, 0); -} - -void write_constdef(var_t *v) +void write_constdef(const var_t *v) { fprintf(header, "#define %s (", get_name(v)); - write_expr(header, v->eval); + write_expr(header, v->eval, 0); fprintf(header, ")\n\n"); } -void write_externdef(var_t *v) +void write_externdef(const var_t *v) { fprintf(header, "extern const "); write_type(header, v->type, NULL, v->tname); @@ -439,10 +500,17 @@ void write_externdef(var_t *v) fprintf(header, ";\n\n"); } +void write_library(const char *name, const attr_t *attr) { + const UUID *uuid = get_attrp(attr, ATTR_UUID); + fprintf(header, "\n"); + write_guid("LIBID", name, uuid); + fprintf(header, "\n"); +} -var_t* get_explicit_handle_var(func_t* func) + +const var_t* get_explicit_handle_var(const func_t* func) { - var_t* var; + const var_t* var; if (!func->args) return NULL; @@ -451,7 +519,7 @@ var_t* get_explicit_handle_var(func_t* func) while (NEXT_LINK(var)) var = NEXT_LINK(var); while (var) { - if (var->type->type == RPC_FC_IGNORE) + if (var->type->type == RPC_FC_BIND_PRIMITIVE) return var; var = PREV_LINK(var); @@ -460,10 +528,32 @@ var_t* get_explicit_handle_var(func_t* func) return NULL; } +int has_out_arg_or_return(const func_t *func) +{ + var_t *var; + + if (!is_void(func->def->type, NULL)) + return 1; + + if (!func->args) + return 0; + + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + if (is_attr(var->attrs, ATTR_OUT)) + return 1; + + var = PREV_LINK(var); + } + return 0; +} + /********** INTERFACES **********/ -int is_object(attr_t *a) +int is_object(const attr_t *a) { while (a) { if (a->type == ATTR_OBJECT || a->type == ATTR_ODL) return 1; @@ -472,17 +562,17 @@ int is_object(attr_t *a) return 0; } -int is_local(attr_t *a) +int is_local(const attr_t *a) { return is_attr(a, ATTR_LOCAL); } -var_t *is_callas(attr_t *a) +const var_t *is_callas(const attr_t *a) { return get_attrp(a, ATTR_CALLAS); } -static int write_method_macro(type_t *iface, char *name) +static int write_method_macro(const type_t *iface, const char *name) { int idx; func_t *cur = iface->funcs; @@ -527,7 +617,7 @@ static int write_method_macro(type_t *iface, char *name) return idx; } -void write_args(FILE *h, var_t *arg, char *name, int method, int do_indent) +void write_args(FILE *h, var_t *arg, const char *name, int method, int do_indent) { int count = 0; if (arg) { @@ -536,26 +626,19 @@ void write_args(FILE *h, var_t *arg, char *name, int method, int do_indent) } if (do_indent) { - if (h == header) { - indentation++; - indent(0); - } else fprintf(h, " "); + indentation++; + indent(h, 0); } if (method == 1) { fprintf(h, "%s* This", name); count++; } - if (arg == NULL && method == 0) { - fprintf(h, "void"); - return; - } while (arg) { if (count) { if (do_indent) { fprintf(h, ",\n"); - if (h == header) indent(0); - else fprintf(h, " "); + indent(h, 0); } else fprintf(h, ","); } @@ -577,10 +660,10 @@ void write_args(FILE *h, var_t *arg, char *name, int method, int do_indent) arg = PREV_LINK(arg); count++; } - if (do_indent && h == header) indentation--; + if (do_indent) indentation--; } -static void write_cpp_method_def(type_t *iface) +static void write_cpp_method_def(const type_t *iface) { func_t *cur = iface->funcs; @@ -589,7 +672,7 @@ static void write_cpp_method_def(type_t *iface) while (cur) { var_t *def = cur->def; if (!is_callas(def->attrs)) { - indent(0); + indent(header, 0); fprintf(header, "virtual "); write_type(header, def->type, def, def->tname); fprintf(header, " STDMETHODCALLTYPE "); @@ -603,20 +686,20 @@ static void write_cpp_method_def(type_t *iface) } } -static void do_write_c_method_def(type_t *iface, char *name) +static void do_write_c_method_def(const type_t *iface, const char *name) { - func_t *cur = iface->funcs; + const func_t *cur = iface->funcs; if (iface->ref) do_write_c_method_def(iface->ref, name); if (!cur) return; while (NEXT_LINK(cur)) cur = NEXT_LINK(cur); - indent(0); + indent(header, 0); fprintf(header, "/*** %s methods ***/\n", iface->name); while (cur) { - var_t *def = cur->def; + const var_t *def = cur->def; if (!is_callas(def->attrs)) { - indent(0); + indent(header, 0); write_type(header, def->type, def, def->tname); fprintf(header, " (STDMETHODCALLTYPE *"); write_name(header, def); @@ -629,25 +712,26 @@ static void do_write_c_method_def(type_t *iface, char *name) } } -static void write_c_method_def(type_t *iface) +static void write_c_method_def(const type_t *iface) { do_write_c_method_def(iface, iface->name); } -static void write_c_disp_method_def(type_t *iface) +static void write_c_disp_method_def(const type_t *iface) { do_write_c_method_def(iface->ref, iface->name); } -static void write_method_proto(type_t *iface) +static void write_method_proto(const type_t *iface) { - func_t *cur = iface->funcs; + const func_t *cur = iface->funcs; if (!cur) return; while (NEXT_LINK(cur)) cur = NEXT_LINK(cur); while (cur) { - var_t *def = cur->def; - var_t *cas = is_callas(def->attrs); + const var_t *def = cur->def; + const var_t *cas = is_callas(def->attrs); + const var_t *args; if (!is_local(def->attrs)) { /* proxy prototype */ write_type(header, def->type, def, def->tname); @@ -660,17 +744,24 @@ static void write_method_proto(type_t *iface) fprintf(header, "void __RPC_STUB %s_", iface->name); write_name(header,def); fprintf(header, "_Stub(\n"); - fprintf(header, " struct IRpcStubBuffer* This,\n"); - fprintf(header, " struct IRpcChannelBuffer* pRpcChannelBuffer,\n"); + fprintf(header, " IRpcStubBuffer* This,\n"); + fprintf(header, " IRpcChannelBuffer* pRpcChannelBuffer,\n"); fprintf(header, " PRPC_MESSAGE pRpcMessage,\n"); fprintf(header, " DWORD* pdwStubPhase);\n"); + + args = cur->args; + if (args) { + while (NEXT_LINK(args)) + args = NEXT_LINK(args); + } + check_for_user_types(args); } if (cas) { - func_t *m = iface->funcs; + const func_t *m = iface->funcs; while (m && strcmp(get_name(m->def), cas->name)) m = NEXT_LINK(m); if (m) { - var_t *mdef = m->def; + const var_t *mdef = m->def; /* proxy prototype - use local prototype */ write_type(header, mdef->type, mdef, mdef->tname); fprintf(header, " CALLBACK %s_", iface->name); @@ -695,10 +786,11 @@ static void write_method_proto(type_t *iface) } } -static void write_function_proto(type_t *iface) +static void write_function_proto(const type_t *iface) { + const char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); int explicit_handle = is_attr(iface->attrs, ATTR_EXPLICIT_HANDLE); - var_t* explicit_handle_var; + const var_t* explicit_handle_var; func_t *cur = iface->funcs; while (NEXT_LINK(cur)) cur = NEXT_LINK(cur); @@ -712,7 +804,7 @@ static void write_function_proto(type_t *iface) error("%s() does not define an explicit binding handle!\n", def->name); return; } - } else { + } else if (implicit_handle) { if (explicit_handle_var) { error("%s() must not define a binding handle!\n", def->name); return; @@ -724,7 +816,10 @@ static void write_function_proto(type_t *iface) fprintf(header, " "); write_name(header, def); fprintf(header, "(\n"); - write_args(header, cur->args, iface->name, 0, TRUE); + if (cur->args) + write_args(header, cur->args, iface->name, 0, TRUE); + else + fprintf(header, " void"); fprintf(header, ");\n"); cur = PREV_LINK(cur); @@ -740,37 +835,29 @@ void write_forward(type_t *iface) * interface, since non-object interfaces shouldn't need forwards */ if ((!iface->defined || is_object(iface->attrs) || is_attr(iface->attrs, ATTR_DISPINTERFACE)) && !iface->written) { - fprintf(header,"#ifndef __%s_FWD_DEFINED__\n", iface->name); - fprintf(header,"#define __%s_FWD_DEFINED__\n", iface->name); - fprintf(header, "typedef struct %s %s;\n", iface->name, iface->name); + fprintf(header, "#ifndef __%s_FWD_DEFINED__\n", iface->name); + fprintf(header, "#define __%s_FWD_DEFINED__\n", iface->name); + fprintf(header, "typedef interface %s %s;\n", iface->name, iface->name); fprintf(header, "#endif\n\n" ); iface->written = TRUE; } } -static void write_guid(const char *guid_prefix, const char *name, UUID *uuid) +static void write_iface_guid(const type_t *iface) { - if (!uuid) return; - fprintf(header, "DEFINE_GUID(%s_%s, 0x%08lx, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x);\n", - guid_prefix, name, uuid->Data1, uuid->Data2, uuid->Data3, uuid->Data4[0], uuid->Data4[1], - uuid->Data4[2], uuid->Data4[3], uuid->Data4[4], uuid->Data4[5], uuid->Data4[6], uuid->Data4[7]); -} - -static void write_iface_guid(type_t *iface) -{ - UUID *uuid = get_attrp(iface->attrs, ATTR_UUID); + const UUID *uuid = get_attrp(iface->attrs, ATTR_UUID); write_guid("IID", iface->name, uuid); } -static void write_dispiface_guid(type_t *iface) +static void write_dispiface_guid(const type_t *iface) { - UUID *uuid = get_attrp(iface->attrs, ATTR_UUID); + const UUID *uuid = get_attrp(iface->attrs, ATTR_UUID); write_guid("DIID", iface->name, uuid); } -static void write_coclass_guid(class_t *cocl) +static void write_coclass_guid(type_t *cocl) { - UUID *uuid = get_attrp(cocl->attrs, ATTR_UUID); + const UUID *uuid = get_attrp(cocl->attrs, ATTR_UUID); write_guid("CLSID", cocl->name, uuid); } @@ -792,7 +879,7 @@ static void write_com_interface(type_t *iface) fprintf(header, "#if defined(__cplusplus) && !defined(CINTERFACE)\n"); if (iface->ref) { - fprintf(header, "struct %s : public %s\n", iface->name, iface->ref->name); + fprintf(header, "interface %s : public %s\n", iface->name, iface->ref->name); fprintf(header, "{\n"); indentation++; write_cpp_method_def(iface); @@ -801,7 +888,7 @@ static void write_com_interface(type_t *iface) } else { - fprintf(header, "struct %s\n", iface->name); + fprintf(header, "interface %s\n", iface->name); fprintf(header, "{\n"); fprintf(header, " BEGIN_INTERFACE\n"); fprintf(header, "\n"); @@ -813,17 +900,16 @@ static void write_com_interface(type_t *iface) } fprintf(header, "#else\n"); /* C interface */ - fprintf(header, "typedef struct %sVtbl %sVtbl;\n", iface->name, iface->name); - fprintf(header, "struct %s {\n", iface->name); - fprintf(header, " const %sVtbl* lpVtbl;\n", iface->name); - fprintf(header, "};\n"); - fprintf(header, "struct %sVtbl {\n", iface->name); + fprintf(header, "typedef struct %sVtbl {\n", iface->name); indentation++; fprintf(header, " BEGIN_INTERFACE\n"); fprintf(header, "\n"); write_c_method_def(iface); indentation--; fprintf(header, " END_INTERFACE\n"); + fprintf(header, "} %sVtbl;\n", iface->name); + fprintf(header, "interface %s {\n", iface->name); + fprintf(header, " const %sVtbl* lpVtbl;\n", iface->name); fprintf(header, "};\n"); fprintf(header, "\n"); fprintf(header, "#ifdef COBJMACROS\n"); @@ -836,33 +922,41 @@ static void write_com_interface(type_t *iface) fprintf(header,"\n#endif /* __%s_INTERFACE_DEFINED__ */\n\n", iface->name); } -static void write_rpc_interface(type_t *iface) +static void write_rpc_interface(const type_t *iface) { unsigned long ver = get_attrv(iface->attrs, ATTR_VERSION); - char *var = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); + const char *var = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); + static int allocate_written = 0; - if (!iface->funcs) return; + if (!allocate_written) + { + allocate_written = 1; + fprintf(header, "void * __RPC_USER MIDL_user_allocate(size_t);\n"); + fprintf(header, "void __RPC_USER MIDL_user_free(void *);\n\n"); + } fprintf(header, "/*****************************************************************************\n"); fprintf(header, " * %s interface (v%d.%d)\n", iface->name, LOWORD(ver), HIWORD(ver)); fprintf(header, " */\n"); - write_iface_guid(iface); - if (var) + fprintf(header,"#ifndef __%s_INTERFACE_DEFINED__\n", iface->name); + fprintf(header,"#define __%s_INTERFACE_DEFINED__\n\n", iface->name); + if (iface->funcs) { - fprintf(header, "extern handle_t %s;\n", var); + write_iface_guid(iface); + if (var) fprintf(header, "extern handle_t %s;\n", var); + if (old_names) + { + fprintf(header, "extern RPC_IF_HANDLE %s_ClientIfHandle;\n", iface->name); + fprintf(header, "extern RPC_IF_HANDLE %s_ServerIfHandle;\n", iface->name); + } + else + { + fprintf(header, "extern RPC_IF_HANDLE %s_v%d_%d_c_ifspec;\n", iface->name, LOWORD(ver), HIWORD(ver)); + fprintf(header, "extern RPC_IF_HANDLE %s_v%d_%d_s_ifspec;\n", iface->name, LOWORD(ver), HIWORD(ver)); + } + write_function_proto(iface); } - if (old_names) - { - fprintf(header, "extern RPC_IF_HANDLE %s_ClientIfHandle;\n", iface->name); - fprintf(header, "extern RPC_IF_HANDLE %s_ServerIfHandle;\n", iface->name); - } - else - { - fprintf(header, "extern RPC_IF_HANDLE %s_v%d_%d_c_ifspec;\n", iface->name, LOWORD(ver), HIWORD(ver)); - fprintf(header, "extern RPC_IF_HANDLE %s_v%d_%d_s_ifspec;\n", iface->name, LOWORD(ver), HIWORD(ver)); - } - write_function_proto(iface); - fprintf(header, "\n"); + fprintf(header,"\n#endif /* __%s_INTERFACE_DEFINED__ */\n\n", iface->name); /* FIXME: server/client code */ } @@ -886,22 +980,21 @@ void write_dispinterface(type_t *iface) write_forward(iface); /* C++ interface */ fprintf(header, "#if defined(__cplusplus) && !defined(CINTERFACE)\n"); - fprintf(header, "struct %s : public %s\n", iface->name, iface->ref->name); + fprintf(header, "interface %s : public %s\n", iface->name, iface->ref->name); fprintf(header, "{\n"); fprintf(header, "};\n"); fprintf(header, "#else\n"); /* C interface */ - fprintf(header, "typedef struct %sVtbl %sVtbl;\n", iface->name, iface->name); - fprintf(header, "struct %s {\n", iface->name); - fprintf(header, " const %sVtbl* lpVtbl;\n", iface->name); - fprintf(header, "};\n"); - fprintf(header, "struct %sVtbl {\n", iface->name); + fprintf(header, "typedef struct %sVtbl {\n", iface->name); indentation++; fprintf(header, " BEGIN_INTERFACE\n"); fprintf(header, "\n"); write_c_disp_method_def(iface); indentation--; fprintf(header, " END_INTERFACE\n"); + fprintf(header, "} %sVtbl;\n", iface->name); + fprintf(header, "interface %s {\n", iface->name); + fprintf(header, " const %sVtbl* lpVtbl;\n", iface->name); fprintf(header, "};\n"); fprintf(header, "\n"); fprintf(header, "#ifdef COBJMACROS\n"); @@ -913,7 +1006,7 @@ void write_dispinterface(type_t *iface) fprintf(header,"#endif /* __%s_DISPINTERFACE_DEFINED__ */\n\n", iface->name); } -void write_coclass(class_t *cocl) +void write_coclass(type_t *cocl) { fprintf(header, "/*****************************************************************************\n"); fprintf(header, " * %s coclass\n", cocl->name); @@ -921,3 +1014,11 @@ void write_coclass(class_t *cocl) write_coclass_guid(cocl); fprintf(header, "\n"); } + +void write_coclass_forward(type_t *cocl) +{ + fprintf(header, "#ifndef __%s_FWD_DEFINED__\n", cocl->name); + fprintf(header, "#define __%s_FWD_DEFINED__\n", cocl->name); + fprintf(header, "typedef struct %s %s;\n", cocl->name, cocl->name); + fprintf(header, "#endif /* defined __%s_FWD_DEFINED__ */\n\n", cocl->name ); +} diff --git a/reactos/tools/widl/header.h b/reactos/tools/widl/header.h index 42243ff9c48..5863f3b0eff 100644 --- a/reactos/tools/widl/header.h +++ b/reactos/tools/widl/header.h @@ -15,31 +15,48 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WIDL_HEADER_H #define __WIDL_HEADER_H -extern int is_base_type(type_t *t); -extern int is_attr(attr_t *a, enum attr_type t); -extern void *get_attrp(attr_t *a, enum attr_type t); -extern unsigned long get_attrv(attr_t *a, enum attr_type t); -extern int is_void(type_t *t, var_t *v); -extern void write_name(FILE *h, var_t *v); -extern char* get_name(var_t *v); -extern void write_type(FILE *h, type_t *t, var_t *v, char *n); -extern int is_object(attr_t *a); -extern int is_local(attr_t *a); -extern var_t *is_callas(attr_t *a); -extern void write_args(FILE *h, var_t *arg, char *name, int obj, int do_indent); +extern int is_attr(const attr_t *a, enum attr_type t); +extern void *get_attrp(const attr_t *a, enum attr_type t); +extern unsigned long get_attrv(const attr_t *a, enum attr_type t); +extern int is_void(const type_t *t, const var_t *v); +extern void write_name(FILE *h, const var_t *v); +extern const char* get_name(const var_t *v); +extern void write_type(FILE *h, type_t *t, const var_t *v, const char *n); +extern int is_object(const attr_t *a); +extern int is_local(const attr_t *a); +extern const var_t *is_callas(const attr_t *a); +extern void write_args(FILE *h, var_t *arg, const char *name, int obj, int do_indent); +extern void write_array(FILE *h, const expr_t *v, int field); extern void write_forward(type_t *iface); extern void write_interface(type_t *iface); extern void write_dispinterface(type_t *iface); -extern void write_coclass(class_t *iface); -extern void write_typedef(type_t *type, var_t *names); -extern void write_expr(FILE *h, expr_t *e); -extern void write_constdef(var_t *v); -extern void write_externdef(var_t *v); -extern var_t* get_explicit_handle_var(func_t* func); +extern void write_coclass(type_t *cocl); +extern void write_coclass_forward(type_t *cocl); +extern void write_typedef(type_t *type, const var_t *names); +extern void write_expr(FILE *h, const expr_t *e, int brackets); +extern void write_constdef(const var_t *v); +extern void write_externdef(const var_t *v); +extern void write_library(const char *name, const attr_t *attr); +extern void write_user_types(void); +extern const var_t* get_explicit_handle_var(const func_t* func); +extern int has_out_arg_or_return(const func_t *func); + +static inline int is_string_type(const attr_t *attrs, int ptr_level, const expr_t *array) +{ + return (is_attr(attrs, ATTR_STRING) && + ((ptr_level == 1 && !array) || (ptr_level == 0 && array))); +} + +static inline int is_array_type(const attr_t *attrs, int ptr_level, const expr_t *array) +{ + return ((ptr_level == 1 && !array && is_attr(attrs, ATTR_SIZEIS)) || + (ptr_level == 0 && array)); +} + #endif diff --git a/reactos/tools/widl/lex.yy.c b/reactos/tools/widl/lex.yy.c index ab475b53348..25e254f4033 100644 --- a/reactos/tools/widl/lex.yy.c +++ b/reactos/tools/widl/lex.yy.c @@ -1,3 +1,4 @@ +#line 2 "lex.yy.c" /* A lexical scanner generated by flex */ /* Scanner skeleton version: @@ -9,7 +10,6 @@ #define YY_FLEX_MINOR_VERSION 5 #include -#include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ @@ -23,6 +23,7 @@ #ifdef __cplusplus #include +#include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS @@ -313,7 +314,7 @@ static yyconst short yy_nxt[][256] = 13, 13, 13, 13, 13, 13, 13, 13, 8, 8, 14, 8, 15, 8, 8, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 18, 17, 17, 17, 17, 17, 17, 17, 8, 8, 8, 8, 17, 8, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, @@ -336,16 +337,16 @@ static yyconst short yy_nxt[][256] = }, { - 7, 8, 8, 8, 8, 8, 8, 8, 8, 18, - 10, 8, 18, 18, 8, 8, 8, 8, 8, 8, + 7, 8, 8, 8, 8, 8, 8, 8, 8, 19, + 10, 8, 19, 19, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 18, 8, 11, 19, 8, 8, 8, 8, + 8, 8, 19, 8, 11, 20, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 8, 8, 14, 8, 15, 8, 8, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 18, 17, 17, 17, 17, 17, 17, 17, 8, 8, 8, 8, 17, 8, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, @@ -367,130 +368,130 @@ static yyconst short yy_nxt[][256] = }, { - 7, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 7, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 22, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 23, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 23, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 24, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20 + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21 }, { - 7, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 22, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 7, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 23, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 23, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 24, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20 + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21 }, { - 7, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 21, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 7, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 22, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24 + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25 }, { - 7, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 21, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 7, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 22, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24 + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25 }, { @@ -656,16 +657,16 @@ static yyconst short yy_nxt[][256] = -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, -12, -12, - -12, -12, -12, -12, -12, 26, 26, 26, 26, 26, - 26, -12, -12, -12, -12, -12, -12, -12, -12, -12, + -12, -12, -12, -12, -12, -12, -12, -12, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, -12, -12, + -12, -12, -12, -12, -12, 27, 27, 27, 27, 27, + 27, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, 26, 26, 26, - 26, 26, 26, -12, -12, -12, -12, -12, -12, -12, + -12, -12, -12, -12, -12, -12, -12, 27, 27, 27, + 27, 27, 27, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - 27, -12, -12, -12, -12, -12, -12, -12, -12, -12, + 28, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, @@ -688,13 +689,13 @@ static yyconst short yy_nxt[][256] = -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, -13, -13, - -13, -13, -13, -13, -13, 26, 26, 26, 26, 26, - 26, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, -13, -13, + -13, -13, -13, -13, -13, 27, 27, 27, 27, 27, + 27, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, 26, 26, 26, - 26, 26, 26, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, 27, 27, 27, + 27, 27, 27, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, @@ -722,7 +723,7 @@ static yyconst short yy_nxt[][256] = -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - 28, -14, -14, -14, -14, -14, -14, -14, -14, -14, + 29, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, @@ -753,7 +754,7 @@ static yyconst short yy_nxt[][256] = -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, 29, -15, -15, -15, -15, -15, -15, -15, + -15, -15, 30, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, @@ -783,15 +784,15 @@ static yyconst short yy_nxt[][256] = -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, -16, -16, - -16, -16, -16, -16, -16, 30, 30, 30, 30, 30, - 30, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, -16, -16, -16, -16, 31, -16, 30, 30, 30, - 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, 31, 31, + 31, 31, 31, 31, 31, 31, 31, 31, -16, -16, + -16, -16, -16, -16, -16, 31, 31, 31, 31, 31, + 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -16, -16, -16, -16, 32, -16, 31, 31, 31, + 31, 31, 31, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, @@ -814,16 +815,16 @@ static yyconst short yy_nxt[][256] = -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, -17, -17, - -17, -17, -17, -17, -17, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, + -17, -17, -17, -17, -17, -17, -17, -17, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, -17, -17, + -17, -17, -17, -17, -17, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, -17, -17, -17, -17, 31, -17, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, -17, -17, -17, -17, -17, -17, -17, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -17, -17, -17, -17, 32, -17, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, @@ -841,22 +842,22 @@ static yyconst short yy_nxt[][256] = }, { - 7, -18, -18, -18, -18, -18, -18, -18, -18, 32, - -18, -18, 32, 32, -18, -18, -18, -18, -18, -18, - - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, 32, -18, -18, 33, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + 7, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, -18, -18, + -18, -18, -18, -18, -18, 33, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -18, -18, -18, -18, 32, -18, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + + 32, 32, 32, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, @@ -876,7 +877,7 @@ static yyconst short yy_nxt[][256] = 7, -19, -19, -19, -19, -19, -19, -19, -19, 34, -19, -19, 34, 34, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, 34, -19, -19, -19, -19, -19, -19, -19, + -19, -19, 34, -19, -19, 35, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, @@ -905,10 +906,10 @@ static yyconst short yy_nxt[][256] = }, { - 7, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + 7, -20, -20, -20, -20, -20, -20, -20, -20, 36, + -20, -20, 36, 36, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, 36, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, @@ -999,98 +1000,98 @@ static yyconst short yy_nxt[][256] = }, { - 7, 35, 35, 35, 35, 35, 35, 35, 35, 35, - -23, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 7, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 36, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 37, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35 + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23 }, { - 7, 38, 38, 38, 38, 38, 38, 38, 38, 38, - -24, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 7, 37, 37, 37, 37, 37, 37, 37, 37, 37, + -24, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 38, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 39, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38 + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37 }, { - 7, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, -25, -25, - -25, -25, -25, -25, -25, 40, 40, 40, 40, 40, - 40, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, 40, 40, 40, + 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, + -25, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25 + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40 }, { @@ -1099,13 +1100,13 @@ static yyconst short yy_nxt[][256] = -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, -26, -26, - -26, -26, -26, -26, -26, 40, 40, 40, 40, 40, - 40, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, -26, -26, + -26, -26, -26, -26, -26, 42, 42, 42, 42, 42, + 42, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, 40, 40, 40, - 40, 40, 40, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, 42, 42, 42, + 42, 42, 42, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, @@ -1130,14 +1131,14 @@ static yyconst short yy_nxt[][256] = -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, - -27, -27, -27, -27, -27, -27, -27, -27, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, -27, -27, - -27, -27, -27, -27, -27, 41, 41, 41, 41, 41, - 41, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, -27, -27, + -27, -27, -27, -27, -27, 42, 42, 42, 42, 42, + 42, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, - -27, -27, -27, -27, -27, -27, -27, 41, 41, 41, - 41, 41, 41, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, 42, 42, 42, + 42, 42, 42, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, @@ -1162,13 +1163,13 @@ static yyconst short yy_nxt[][256] = -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, -28, -28, + -28, -28, -28, -28, -28, 43, 43, 43, 43, 43, + 43, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, 43, 43, 43, + 43, 43, 43, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, @@ -1225,16 +1226,16 @@ static yyconst short yy_nxt[][256] = -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, -30, -30, - -30, -30, -30, -30, -30, 42, 42, 42, 42, 42, - 42, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, -30, -30, -30, -30, 31, -30, 42, 42, 42, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - 42, 42, 42, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, @@ -1257,15 +1258,15 @@ static yyconst short yy_nxt[][256] = -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, -31, -31, - -31, -31, -31, -31, -31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, -31, -31, -31, -31, 31, -31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, 44, 44, + 44, 44, 44, 44, 44, 44, 44, 44, -31, -31, + -31, -31, -31, -31, -31, 44, 44, 44, 44, 44, + 44, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -31, -31, -31, -31, 32, -31, 44, 44, 44, + 44, 44, 44, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, @@ -1284,20 +1285,20 @@ static yyconst short yy_nxt[][256] = }, { - 7, -32, -32, -32, -32, -32, -32, -32, -32, 32, - -32, -32, 32, 32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, 32, -32, -32, 33, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + 7, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, -32, -32, + -32, -32, -32, -32, -32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -32, -32, -32, -32, 32, -32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, @@ -1315,22 +1316,22 @@ static yyconst short yy_nxt[][256] = }, { - 7, -33, -33, -33, -33, -33, -33, -33, -33, 34, - -33, -33, 34, 34, -33, -33, -33, -33, -33, -33, - - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, 34, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + 7, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, -33, -33, + -33, -33, -33, -33, -33, 32, 32, 32, 32, 32, + 45, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -33, -33, -33, -33, 32, -33, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + + 32, 32, 32, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, @@ -1350,7 +1351,7 @@ static yyconst short yy_nxt[][256] = 7, -34, -34, -34, -34, -34, -34, -34, -34, 34, -34, -34, 34, 34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, 34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, 34, -34, -34, 35, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, @@ -1379,10 +1380,10 @@ static yyconst short yy_nxt[][256] = }, { - 7, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + 7, -35, -35, -35, -35, -35, -35, -35, -35, 36, + -35, -35, 36, 36, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, 36, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, @@ -1410,10 +1411,10 @@ static yyconst short yy_nxt[][256] = }, { - 7, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + 7, -36, -36, -36, -36, -36, -36, -36, -36, 36, + -36, -36, 36, 36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, 36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, @@ -1473,35 +1474,35 @@ static yyconst short yy_nxt[][256] = }, { - 7, 38, 38, 38, 38, 38, 38, 38, 38, 38, - -38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 7, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38 + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38 }, { @@ -1509,14 +1510,14 @@ static yyconst short yy_nxt[][256] = -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, -39, -39, - - -39, -39, -39, -39, -39, 44, 44, 44, 44, 44, - 44, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, 44, 44, 44, - 44, 44, 44, -39, -39, -39, -39, -39, -39, -39, + -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, + + -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, + -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, + -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, + -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, + -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, @@ -1537,34 +1538,34 @@ static yyconst short yy_nxt[][256] = }, { - 7, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, -40, -40, - -40, -40, -40, -40, -40, 44, 44, 44, 44, 44, - 44, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, 44, 44, 44, + 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, + -40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 44, 44, 44, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40 + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40 }, { @@ -1573,13 +1574,13 @@ static yyconst short yy_nxt[][256] = -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, -41, -41, - -41, -41, -41, -41, -41, 41, 41, 41, 41, 41, - 41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, -41, -41, + -41, -41, -41, -41, -41, 47, 47, 47, 47, 47, + 47, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, 41, 41, 41, - 41, 41, 41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, 47, 47, 47, + 47, 47, 47, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, @@ -1604,16 +1605,16 @@ static yyconst short yy_nxt[][256] = -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, -42, -42, - -42, -42, -42, -42, -42, 45, 45, 45, 45, 45, - 45, 31, 31, 31, 31, 31, 31, 31, 31, 31, + -42, -42, -42, -42, -42, -42, -42, -42, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, -42, -42, + -42, -42, -42, -42, -42, 47, 47, 47, 47, 47, + 47, -42, -42, -42, -42, -42, -42, -42, -42, -42, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, -42, -42, -42, -42, 31, -42, 45, 45, 45, - 45, 45, 45, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, 47, 47, 47, + 47, 47, 47, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, @@ -1636,13 +1637,13 @@ static yyconst short yy_nxt[][256] = -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, -43, -43, - -43, -43, -43, -43, -43, 47, 47, 47, 47, 47, - 47, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, -43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, -43, -43, + -43, -43, -43, -43, -43, 43, 43, 43, 43, 43, + 43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, 47, 47, 47, - 47, 47, 47, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, 43, 43, 43, + 43, 43, 43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, @@ -1667,16 +1668,16 @@ static yyconst short yy_nxt[][256] = -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, -44, -44, + -44, -44, -44, -44, -44, -44, -44, -44, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, -44, -44, - -44, -44, -44, -44, -44, 47, 47, 47, 47, 47, - 47, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, 47, 47, 47, - 47, 47, 47, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, -44, -44, 48, 48, 48, 48, 48, + 48, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -44, -44, -44, -44, 32, -44, 48, 48, 48, + 48, 48, 48, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, @@ -1699,16 +1700,16 @@ static yyconst short yy_nxt[][256] = -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, -45, -45, - -45, -45, -45, -45, -45, 48, 48, 48, 48, 48, - 48, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, -45, -45, -45, -45, 31, -45, 48, 48, 48, + -45, -45, -45, -45, -45, -45, -45, -45, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, -45, -45, + -45, -45, -45, -45, -45, 32, 32, 32, 32, 49, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -45, -45, -45, -45, 32, -45, 32, 32, 32, - 48, 48, 48, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, -45, -45, -45, -45, -45, -45, -45, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, @@ -1731,13 +1732,13 @@ static yyconst short yy_nxt[][256] = -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, - -46, -46, -46, -46, -46, -46, -46, -46, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, -46, -46, - -46, -46, -46, -46, -46, 50, 50, 50, 50, 50, - 50, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, -46, -46, + -46, -46, -46, -46, -46, 51, 51, 51, 51, 51, + 51, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, - -46, -46, -46, -46, -46, -46, -46, 50, 50, 50, - 50, 50, 50, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, 51, 51, 51, + 51, 51, 51, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, @@ -1762,14 +1763,14 @@ static yyconst short yy_nxt[][256] = -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, -47, -47, - -47, -47, -47, -47, -47, 50, 50, 50, 50, 50, - 50, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, -47, -47, + -47, -47, -47, -47, -47, 51, 51, 51, 51, 51, + 51, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, 50, 50, 50, - 50, 50, 50, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, 51, 51, 51, + 51, 51, 51, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, @@ -1794,16 +1795,16 @@ static yyconst short yy_nxt[][256] = -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, -48, -48, - -48, -48, -48, -48, -48, 51, 51, 51, 51, 51, - 51, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, -48, -48, -48, -48, 31, -48, 51, 51, 51, - 51, 51, 51, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, + -48, -48, -48, -48, -48, -48, -48, -48, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, -48, -48, + -48, -48, -48, -48, -48, 52, 52, 52, 52, 52, + 52, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -48, -48, -48, -48, 32, -48, 52, 52, 52, + 52, 52, 52, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 31, 31, 31, -48, -48, -48, -48, -48, -48, -48, + 32, 32, 32, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, @@ -1825,16 +1826,16 @@ static yyconst short yy_nxt[][256] = -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, 52, 52, - 52, 52, 52, 52, 52, 52, 52, 52, -49, -49, + -49, -49, -49, -49, -49, -49, -49, -49, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, -49, -49, - -49, -49, -49, -49, -49, 53, 53, 53, 53, 53, - 53, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, 53, 53, 53, - 53, 53, 53, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, + -49, -49, -49, -49, -49, 53, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -49, -49, -49, -49, 32, -49, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, @@ -1857,14 +1858,14 @@ static yyconst short yy_nxt[][256] = -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, -50, -50, - -50, -50, -50, -50, -50, 53, 53, 53, 53, 53, - 53, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, 54, 54, + 54, 54, 54, 54, 54, 54, 54, 54, -50, -50, + -50, -50, -50, -50, -50, 55, 55, 55, 55, 55, + 55, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, 53, 53, 53, + -50, -50, -50, -50, -50, -50, -50, 55, 55, 55, - 53, 53, 53, -50, -50, -50, -50, -50, -50, -50, + 55, 55, 55, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, @@ -1889,15 +1890,15 @@ static yyconst short yy_nxt[][256] = -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, 54, 54, - 54, 54, 54, 54, 54, 54, 54, 54, -51, -51, - -51, -51, -51, -51, -51, 54, 54, 54, 54, 54, - 54, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, -51, -51, -51, -51, 31, -51, 54, 54, 54, - 54, 54, 54, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, -51, -51, + -51, -51, -51, -51, -51, 55, 55, 55, 55, 55, + 55, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, 55, 55, 55, + 55, 55, 55, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, @@ -1920,16 +1921,16 @@ static yyconst short yy_nxt[][256] = -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, -52, -52, -52, -52, -52, -52, -52, 56, 56, 56, 56, 56, - 56, -52, -52, -52, -52, -52, -52, -52, -52, -52, + 56, 32, 32, 32, 32, 32, 32, 32, 32, 32, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, 56, 56, 56, - 56, 56, 56, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -52, -52, -52, -52, 32, -52, 56, 56, 56, + 56, 56, 56, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, @@ -1952,16 +1953,16 @@ static yyconst short yy_nxt[][256] = -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, -53, -53, - -53, -53, -53, -53, -53, 56, 56, 56, 56, 56, - 56, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, 56, 56, 56, - 56, 56, 56, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, -53, -53, + -53, -53, -53, -53, -53, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 57, 32, 32, 32, 32, 32, 32, 32, + 32, -53, -53, -53, -53, 32, -53, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + 32, 32, 32, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, @@ -1983,16 +1984,16 @@ static yyconst short yy_nxt[][256] = -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, -54, -54, - -54, -54, -54, -54, -54, 57, 57, 57, 57, 57, - 57, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, -54, -54, -54, -54, 31, -54, 57, 57, 57, - 57, 57, 57, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, 59, 59, 59, 59, 59, + 59, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, 59, 59, 59, + 59, 59, 59, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, @@ -2015,14 +2016,14 @@ static yyconst short yy_nxt[][256] = -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, 58, -55, -55, 59, 59, + -55, -55, -55, -55, -55, -55, -55, -55, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, -55, -55, + -55, -55, -55, -55, -55, 59, 59, 59, 59, 59, + 59, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, 59, 59, 59, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + 59, 59, 59, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, @@ -2047,15 +2048,15 @@ static yyconst short yy_nxt[][256] = -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, 58, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, -56, -56, + -56, -56, -56, -56, -56, 60, 60, 60, 60, 60, + 60, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -56, -56, -56, -56, 32, -56, 60, 60, 60, + 60, 60, 60, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, @@ -2078,16 +2079,16 @@ static yyconst short yy_nxt[][256] = -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, 58, -57, -57, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, -57, -57, - -57, -57, -57, -57, -57, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, + -57, -57, -57, -57, -57, -57, -57, -57, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, -57, -57, + -57, -57, -57, -57, -57, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, -57, -57, -57, -57, 31, -57, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, -57, -57, -57, -57, -57, -57, -57, + 32, 32, 61, 32, 32, 32, 32, 32, 32, 32, + 32, -57, -57, -57, -57, 32, -57, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, @@ -2110,13 +2111,13 @@ static yyconst short yy_nxt[][256] = -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, -58, -58, - -58, -58, -58, -58, -58, 60, 60, 60, 60, 60, - 60, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, -58, -58, + -58, -58, -58, -58, -58, 63, 63, 63, 63, 63, + 63, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, 60, 60, 60, - 60, 60, 60, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, 63, 63, 63, + 63, 63, 63, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, @@ -2141,14 +2142,14 @@ static yyconst short yy_nxt[][256] = -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, 59, 59, - 59, 59, 59, 59, 59, 59, 59, 59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, -59, -59, + -59, -59, -59, -59, -59, 63, 63, 63, 63, 63, + 63, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, 63, 63, 63, + 63, 63, 63, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, @@ -2173,16 +2174,16 @@ static yyconst short yy_nxt[][256] = -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, -60, -60, - -60, -60, -60, -60, -60, 61, 61, 61, 61, 61, - 61, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, 61, 61, 61, + -60, -60, -60, -60, -60, -60, -60, -60, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, -60, -60, + -60, -60, -60, -60, -60, 64, 64, 64, 64, 64, + 64, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -60, -60, -60, -60, 32, -60, 64, 64, 64, - 61, 61, 61, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + 64, 64, 64, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, @@ -2205,15 +2206,15 @@ static yyconst short yy_nxt[][256] = -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, 62, 62, - 62, 62, 62, 62, 62, 62, 62, 62, -61, -61, - -61, -61, -61, -61, -61, 62, 62, 62, 62, 62, - 62, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, 62, 62, 62, - 62, 62, 62, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, -61, -61, + -61, -61, -61, -61, -61, 65, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -61, -61, -61, -61, 32, -61, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, @@ -2236,14 +2237,14 @@ static yyconst short yy_nxt[][256] = -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, -62, -62, - -62, -62, -62, -62, -62, 63, 63, 63, 63, 63, - 63, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, 66, -62, -62, 67, 67, + 67, 67, 67, 67, 67, 67, 67, 67, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, 63, 63, 63, - 63, 63, 63, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, @@ -2268,7 +2269,7 @@ static yyconst short yy_nxt[][256] = -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, 64, -63, -63, -63, -63, + -63, -63, -63, -63, -63, 66, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, @@ -2299,16 +2300,16 @@ static yyconst short yy_nxt[][256] = -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, -64, -64, + -64, -64, -64, -64, -64, 66, -64, -64, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, -64, -64, - -64, -64, -64, -64, -64, 65, 65, 65, 65, 65, - 65, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, 65, 65, 65, - 65, 65, 65, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -64, -64, -64, -64, 32, -64, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, @@ -2331,16 +2332,16 @@ static yyconst short yy_nxt[][256] = -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, -65, -65, - -65, -65, -65, -65, -65, 66, 66, 66, 66, 66, - 66, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, 66, 66, 66, + -65, -65, -65, -65, -65, -65, -65, -65, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, -65, -65, + -65, -65, -65, -65, -65, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 68, + 32, -65, -65, -65, -65, 32, -65, 32, 32, 32, - 66, 66, 66, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, @@ -2363,13 +2364,13 @@ static yyconst short yy_nxt[][256] = -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, -66, -66, - -66, -66, -66, -66, -66, 67, 67, 67, 67, 67, - 67, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 69, -66, -66, + -66, -66, -66, -66, -66, 69, 69, 69, 69, 69, + 69, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, 67, 67, 67, - 67, 67, 67, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, 69, 69, 69, + 69, 69, 69, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, @@ -2394,14 +2395,14 @@ static yyconst short yy_nxt[][256] = -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, -67, -67, - -67, -67, -67, -67, -67, 68, 68, 68, 68, 68, - 68, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, 67, 67, + 67, 67, 67, 67, 67, 67, 67, 67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, 68, 68, 68, - 68, 68, 68, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, @@ -2421,21 +2422,21 @@ static yyconst short yy_nxt[][256] = }, { - 7, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + 7, -68, -68, -68, -68, -68, -68, -68, -68, 70, + -68, -68, 70, 70, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, 69, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, 70, -68, -68, -68, -68, -68, -68, -68, + 71, -68, -68, -68, -68, -68, -68, -68, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, -68, -68, + -68, -68, -68, -68, -68, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, -68, -68, -68, -68, 32, -68, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + 32, 32, 32, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, @@ -2457,14 +2458,14 @@ static yyconst short yy_nxt[][256] = -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, -69, -69, - -69, -69, -69, -69, -69, 70, 70, 70, 70, 70, - 70, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, 72, 72, 72, 72, 72, + 72, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, 70, 70, 70, - 70, 70, 70, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, 72, 72, 72, + 72, 72, 72, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, @@ -2485,18 +2486,18 @@ static yyconst short yy_nxt[][256] = }, { - 7, -70, -70, -70, -70, -70, -70, -70, -70, -70, + 7, -70, -70, -70, -70, -70, -70, -70, -70, 70, + -70, -70, 70, 70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, -70, -70, - -70, -70, -70, -70, -70, 71, 71, 71, 71, 71, + -70, -70, 70, -70, -70, -70, -70, -70, -70, -70, 71, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, 71, 71, 71, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - 71, 71, 71, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, @@ -2521,13 +2522,13 @@ static yyconst short yy_nxt[][256] = -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, -71, -71, - -71, -71, -71, -71, -71, 72, 72, 72, 72, 72, - 72, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, 72, 72, 72, - 72, 72, 72, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, @@ -2584,13 +2585,13 @@ static yyconst short yy_nxt[][256] = -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, 74, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, -73, -73, + -73, -73, -73, -73, -73, 74, 74, 74, 74, 74, + 74, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, 74, 74, 74, + 74, 74, 74, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, @@ -2615,14 +2616,14 @@ static yyconst short yy_nxt[][256] = -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, -74, -74, - - -74, -74, -74, -74, -74, 75, 75, 75, 75, 75, - 75, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, 75, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, 75, 75, 75, - 75, 75, 75, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, @@ -2773,14 +2774,14 @@ static yyconst short yy_nxt[][256] = -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, -79, -79, - - -79, -79, -79, -79, -79, 80, 80, 80, 80, 80, - 80, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, 80, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, 80, 80, 80, - 80, 80, 80, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, @@ -2931,14 +2932,14 @@ static yyconst short yy_nxt[][256] = -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, -84, -84, - - -84, -84, -84, -84, -84, 85, 85, 85, 85, 85, - 85, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, 85, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, 85, 85, 85, - 85, 85, 85, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, @@ -2995,13 +2996,13 @@ static yyconst short yy_nxt[][256] = -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, -86, -86, + -86, -86, -86, -86, -86, 87, 87, 87, 87, 87, + 87, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, 87, 87, 87, + 87, 87, 87, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, @@ -3021,6 +3022,353 @@ static yyconst short yy_nxt[][256] = -86, -86, -86, -86, -86, -86 }, + { + 7, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, -87, -87, + -87, -87, -87, -87, -87, 88, 88, 88, 88, 88, + 88, -87, -87, -87, -87, -87, -87, -87, -87, -87, + + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, 88, 88, 88, + 88, 88, 88, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87 + }, + + { + 7, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, -88, -88, + -88, -88, -88, -88, -88, 89, 89, 89, 89, 89, + 89, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, 89, 89, 89, + 89, 89, 89, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88 + }, + + { + 7, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, -89, -89, + + -89, -89, -89, -89, -89, 90, 90, 90, 90, 90, + 90, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, 90, 90, 90, + 90, 90, 90, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89 + + }, + + { + 7, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, -90, -90, + -90, -90, -90, -90, -90, 91, 91, 91, 91, 91, + 91, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, 91, 91, 91, + + 91, 91, 91, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90 + }, + + { + 7, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + + -91, -91, -91, -91, -91, -91, -91, -91, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, -91, -91, + -91, -91, -91, -91, -91, 92, 92, 92, 92, 92, + 92, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, 92, 92, 92, + 92, 92, 92, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91 + }, + + { + 7, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, 93, 93, + 93, 93, 93, 93, 93, 93, 93, 93, -92, -92, + -92, -92, -92, -92, -92, 93, 93, 93, 93, 93, + 93, -92, -92, -92, -92, -92, -92, -92, -92, -92, + + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, 93, 93, 93, + 93, 93, 93, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92 + }, + + { + 7, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, -93, -93, + -93, -93, -93, -93, -93, 94, 94, 94, 94, 94, + 94, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, 94, 94, 94, + 94, 94, 94, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93 + }, + + { + 7, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, -94, -94, + + -94, -94, -94, -94, -94, 95, 95, 95, 95, 95, + 95, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, 95, 95, 95, + 95, 95, 95, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94 + + }, + + { + 7, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, -95, -95, + -95, -95, -95, -95, -95, 96, 96, 96, 96, 96, + 96, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, 96, 96, 96, + + 96, 96, 96, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95 + }, + + { + 7, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + + -96, -96, -96, -96, -96, -96, -96, -96, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, -96, -96, + -96, -96, -96, -96, -96, 97, 97, 97, 97, 97, + 97, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, 97, 97, 97, + 97, 97, 97, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96 + }, + + { + 7, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97 + }, + } ; @@ -3039,44 +3387,48 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 18 -#define YY_END_OF_BUFFER 19 -static yyconst short int yy_accept[87] = +#define YY_NUM_RULES 19 +#define YY_END_OF_BUFFER 20 +static yyconst short int yy_accept[98] = { 0, - 0, 0, 0, 0, 2, 2, 19, 17, 14, 13, - 3, 11, 11, 17, 17, 12, 12, 14, 1, 8, - 18, 4, 8, 2, 11, 0, 0, 15, 16, 12, - 12, 0, 1, 1, 7, 6, 5, 2, 11, 0, - 10, 12, 11, 0, 12, 11, 0, 12, 11, 0, - 12, 11, 0, 12, 11, 0, 12, 0, 11, 0, + 0, 0, 0, 0, 2, 2, 20, 18, 15, 14, + 3, 11, 11, 18, 18, 13, 13, 13, 15, 1, + 8, 19, 4, 8, 2, 11, 0, 0, 16, 17, + 13, 13, 13, 0, 1, 1, 7, 6, 5, 2, + 11, 0, 10, 13, 13, 11, 0, 13, 13, 11, + 0, 13, 13, 11, 0, 13, 13, 11, 0, 13, + 13, 11, 0, 13, 13, 0, 11, 13, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 9 + 0, 0, 0, 0, 0, 0, 9 + } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; -static yyconst yy_state_type yy_NUL_trans[87] = +static yyconst yy_state_type yy_NUL_trans[98] = { 0, - 8, 8, 20, 20, 24, 24, 0, 0, 0, 0, + 8, 8, 21, 21, 25, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 35, 38, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, + 0, 0, 0, 37, 40, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0 + } ; extern int yy_flex_debug; int yy_flex_debug = 1; -static yyconst short int yy_rule_linenum[18] = +static yyconst short int yy_rule_linenum[19] = { 0, - 109, 110, 129, 130, 135, 136, 137, 138, 139, 143, - 147, 151, 152, 153, 154, 155, 156 + 106, 107, 126, 127, 132, 133, 134, 135, 136, 140, + 144, 148, 149, 150, 151, 152, 153, 154 } ; /* The intent behind this definition is that it'll catch @@ -3089,7 +3441,7 @@ static yyconst short int yy_rule_linenum[18] = char *yytext; #line 1 "parser.l" #define INITIAL 0 -/* +/* -*-C-*- * IDL Compiler * * Copyright 2002 Ove Kaaven @@ -3106,15 +3458,17 @@ char *yytext; * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #define YY_STACK_USED 1 +#define YY_NO_UNPUT 1 +#define YY_NO_TOP_STATE 1 #define YY_NEVER_INTERACTIVE 1 #define QUOTE 1 #define pp_line 2 -#line 36 "parser.l" +#line 37 "parser.l" #include "config.h" @@ -3132,11 +3486,7 @@ char *yytext; #include "parser.h" #include "wine/wpp.h" -#include "y.tab.h" - -#define YY_USE_PROTOS -#define YY_NO_UNPUT -#define YY_NO_TOP_STATE +#include "parser.tab.h" extern char *temp_name; @@ -3185,7 +3535,7 @@ static UUID* parse_uuid(const char*u) * The flexer starts here ************************************************************************** */ -#line 3189 "lex.yy.c" +#line 3539 "lex.yy.c" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -3336,12 +3686,12 @@ YY_MALLOC_DECL YY_DECL { register yy_state_type yy_current_state; - register char *yy_cp = NULL, *yy_bp = NULL; + register char *yy_cp, *yy_bp; register int yy_act; -#line 108 "parser.l" +#line 105 "parser.l" -#line 3345 "lex.yy.c" +#line 3695 "lex.yy.c" if ( yy_init ) { @@ -3407,13 +3757,13 @@ do_action: /* This label is used only to access EOF actions. */ { if ( yy_act == 0 ) fprintf( stderr, "--scanner backing up\n" ); - else if ( yy_act < 18 ) + else if ( yy_act < 19 ) fprintf( stderr, "--accepting rule at line %d (\"%s\")\n", yy_rule_linenum[yy_act], yytext ); - else if ( yy_act == 18 ) + else if ( yy_act == 19 ) fprintf( stderr, "--accepting default rule (\"%s\")\n", yytext ); - else if ( yy_act == 19 ) + else if ( yy_act == 20 ) fprintf( stderr, "--(end of buffer or a NUL)\n" ); else fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); @@ -3430,12 +3780,12 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 109 "parser.l" +#line 106 "parser.l" yy_push_state(pp_line); YY_BREAK case 2: YY_RULE_SETUP -#line 110 "parser.l" +#line 107 "parser.l" { int lineno; char *cptr, *fname; @@ -3458,12 +3808,12 @@ YY_RULE_SETUP YY_BREAK case 3: YY_RULE_SETUP -#line 129 "parser.l" +#line 126 "parser.l" yy_push_state(QUOTE); cbufidx = 0; YY_BREAK case 4: YY_RULE_SETUP -#line 130 "parser.l" +#line 127 "parser.l" { yy_pop_state(); yylval.str = get_buffered_cstring(); @@ -3471,25 +3821,25 @@ YY_RULE_SETUP } YY_BREAK case 5: -#line 136 "parser.l" +#line 133 "parser.l" case 6: YY_RULE_SETUP -#line 136 "parser.l" +#line 133 "parser.l" addcchar(yytext[1]); YY_BREAK case 7: YY_RULE_SETUP -#line 137 "parser.l" +#line 134 "parser.l" addcchar('\\'); addcchar(yytext[1]); YY_BREAK case 8: YY_RULE_SETUP -#line 138 "parser.l" +#line 135 "parser.l" addcchar(yytext[0]); YY_BREAK case 9: YY_RULE_SETUP -#line 139 "parser.l" +#line 136 "parser.l" { yylval.uuid = parse_uuid(yytext); return aUUID; @@ -3497,7 +3847,7 @@ YY_RULE_SETUP YY_BREAK case 10: YY_RULE_SETUP -#line 143 "parser.l" +#line 140 "parser.l" { yylval.num = strtoul(yytext, NULL, 0); return aHEXNUM; @@ -3505,46 +3855,54 @@ YY_RULE_SETUP YY_BREAK case 11: YY_RULE_SETUP -#line 147 "parser.l" +#line 144 "parser.l" { yylval.num = strtoul(yytext, NULL, 0); return aNUM; } YY_BREAK case 12: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 151 "parser.l" -return kw_token(yytext); +#line 148 "parser.l" +return tSAFEARRAY; YY_BREAK case 13: YY_RULE_SETUP -#line 152 "parser.l" -line_number++; +#line 149 "parser.l" +return kw_token(yytext); YY_BREAK case 14: YY_RULE_SETUP -#line 153 "parser.l" - +#line 150 "parser.l" +line_number++; YY_BREAK case 15: YY_RULE_SETUP -#line 154 "parser.l" -return SHL; +#line 151 "parser.l" + YY_BREAK case 16: YY_RULE_SETUP -#line 155 "parser.l" -return SHR; +#line 152 "parser.l" +return SHL; YY_BREAK case 17: YY_RULE_SETUP -#line 156 "parser.l" +#line 153 "parser.l" +return SHR; + YY_BREAK +case 18: +YY_RULE_SETUP +#line 154 "parser.l" return yytext[0]; YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(QUOTE): case YY_STATE_EOF(pp_line): -#line 157 "parser.l" +#line 155 "parser.l" { if (import_stack_ptr) { pop_import(); @@ -3553,12 +3911,12 @@ case YY_STATE_EOF(pp_line): else yyterminate(); } YY_BREAK -case 18: +case 19: YY_RULE_SETUP -#line 164 "parser.l" +#line 162 "parser.l" ECHO; YY_BREAK -#line 3562 "lex.yy.c" +#line 3920 "lex.yy.c" case YY_END_OF_BUFFER: { @@ -3934,7 +4292,6 @@ register char *yy_bp; #endif /* ifndef YY_NO_UNPUT */ -#ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput() #else @@ -4007,7 +4364,7 @@ static int input() return c; } -#endif /* YY_NO_INPUT */ + #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) @@ -4118,6 +4475,11 @@ YY_BUFFER_STATE b; } +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) @@ -4435,7 +4797,7 @@ int main() return 0; } #endif -#line 164 "parser.l" +#line 162 "parser.l" #ifndef yywrap @@ -4450,6 +4812,8 @@ static struct keyword { int token; int val; } keywords[] = { + {"FALSE", tFALSE}, + {"TRUE", tTRUE}, {"__cdecl", tCDECL}, {"__int64", tINT64}, {"__stdcall", tSTDCALL}, @@ -4457,7 +4821,6 @@ static struct keyword { {"aggregatable", tAGGREGATABLE}, {"allocate", tALLOCATE}, {"appobject", tAPPOBJECT}, - {"arrays", tARRAYS}, {"async", tASYNC}, {"async_uuid", tASYNCUUID}, {"auto_handle", tAUTOHANDLE}, @@ -4481,50 +4844,45 @@ static struct keyword { {"cpp_quote", tCPPQUOTE}, /* ... */ {"default", tDEFAULT}, + {"defaultcollelem", tDEFAULTCOLLELEM}, {"defaultvalue", tDEFAULTVALUE}, -/* ... */ + {"defaultvtable", tDEFAULTVTABLE}, {"dispinterface", tDISPINTERFACE}, -/* ... */ + {"displaybind", tDISPLAYBIND}, {"dllname", tDLLNAME}, {"double", tDOUBLE}, {"dual", tDUAL}, -/* ... */ {"endpoint", tENDPOINT}, {"entry", tENTRY}, {"enum", tENUM}, {"error_status_t", tERRORSTATUST}, {"explicit_handle", tEXPLICITHANDLE}, {"extern", tEXTERN}, -/* ... */ {"float", tFLOAT}, -/* ... */ {"handle", tHANDLE}, {"handle_t", tHANDLET}, -/* ... */ {"helpcontext", tHELPCONTEXT}, {"helpfile", tHELPFILE}, {"helpstring", tHELPSTRING}, {"helpstringcontext", tHELPSTRINGCONTEXT}, {"helpstringdll", tHELPSTRINGDLL}, -/* ... */ - {"hidden", tHIDDEN}, + {"hidden", tHIDDEN}, {"hyper", tHYPER}, {"id", tID}, {"idempotent", tIDEMPOTENT}, /* ... */ {"iid_is", tIIDIS}, -/* ... */ + {"immediatebind", tIMMEDIATEBIND}, {"implicit_handle", tIMPLICITHANDLE}, {"import", tIMPORT}, {"importlib", tIMPORTLIB}, {"in", tIN}, - {"include", tINCLUDE}, {"in_line", tINLINE}, {"input_sync", tINPUTSYNC}, {"int", tINT}, /* ... */ {"interface", tINTERFACE}, -/* ... */ + {"lcid", tLCID}, {"length_is", tLENGTHIS}, {"library", tLIBRARY}, /* ... */ @@ -4535,7 +4893,9 @@ static struct keyword { /* ... */ {"module", tMODULE}, /* ... */ + {"nonbrowsable", tNONBROWSABLE}, {"noncreatable", tNONCREATABLE}, + {"nonextensible", tNONEXTENSIBLE}, {"object", tOBJECT}, {"odl", tODL}, {"oleautomation", tOLEAUTOMATION}, @@ -4549,14 +4909,15 @@ static struct keyword { {"propget", tPROPGET}, {"propput", tPROPPUT}, {"propputref", tPROPPUTREF}, + {"ptr", tPTR}, /* ... */ - {"ptr", tPTR}, {"public", tPUBLIC}, + {"range", tRANGE}, /* ... */ {"readonly", tREADONLY}, {"ref", tREF}, -/* ... */ - {"restricted", tRESTRICTED}, + {"requestedit", tREQUESTEDIT}, + {"restricted", tRESTRICTED}, {"retval", tRETVAL}, /* ... */ {"short", tSHORT}, @@ -4564,10 +4925,10 @@ static struct keyword { {"single", tSINGLE}, {"size_is", tSIZEIS}, {"sizeof", tSIZEOF}, + {"small", tSMALL}, /* ... */ - {"small", tSMALL}, {"source", tSOURCE}, -/* ... */ +/* ... */ {"string", tSTRING}, {"struct", tSTRUCT}, {"switch", tSWITCH}, @@ -4576,8 +4937,8 @@ static struct keyword { /* ... */ {"transmit_as", tTRANSMITAS}, {"typedef", tTYPEDEF}, -/* ... */ {"union", tUNION}, +/* ... */ {"unique", tUNIQUE}, {"unsigned", tUNSIGNED}, /* ... */ @@ -4588,7 +4949,7 @@ static struct keyword { {"version", tVERSION}, {"void", tVOID}, {"wchar_t", tWCHAR}, - {"wire_marshal", tWIREMARSHAL} + {"wire_marshal", tWIREMARSHAL}, }; #define NKEYWORDS (sizeof(keywords)/sizeof(keywords[0])) #define KWP(p) ((const struct keyword *)(p)) diff --git a/reactos/tools/widl/parser.h b/reactos/tools/widl/parser.h index 20a7e2af474..2217dbfaa7a 100644 --- a/reactos/tools/widl/parser.h +++ b/reactos/tools/widl/parser.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WIDL_PARSER_H diff --git a/reactos/tools/widl/parser.l b/reactos/tools/widl/parser.l index 5ea0ed792d1..028b67fe033 100644 --- a/reactos/tools/widl/parser.l +++ b/reactos/tools/widl/parser.l @@ -1,4 +1,4 @@ -/* +/* -*-C-*- * IDL Compiler * * Copyright 2002 Ove Kaaven @@ -15,11 +15,12 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ %option stack -%option never-interactive +%option nounput noyy_top_state +%option 8bit never-interactive nl \r?\n ws [ \f\t\r] @@ -50,11 +51,7 @@ uuid {hexd}{8}-{hexd}{4}-{hexd}{4}-{hexd}{4}-{hexd}{12} #include "parser.h" #include "wine/wpp.h" -#include "y.tab.h" - -#define YY_USE_PROTOS -#define YY_NO_UNPUT -#define YY_NO_TOP_STATE +#include "parser.tab.h" extern char *temp_name; @@ -148,6 +145,7 @@ static UUID* parse_uuid(const char*u) yylval.num = strtoul(yytext, NULL, 0); return aNUM; } +SAFEARRAY{ws}*/\( return tSAFEARRAY; {cident} return kw_token(yytext); \n line_number++; {ws} @@ -175,6 +173,8 @@ static struct keyword { int token; int val; } keywords[] = { + {"FALSE", tFALSE}, + {"TRUE", tTRUE}, {"__cdecl", tCDECL}, {"__int64", tINT64}, {"__stdcall", tSTDCALL}, @@ -182,7 +182,6 @@ static struct keyword { {"aggregatable", tAGGREGATABLE}, {"allocate", tALLOCATE}, {"appobject", tAPPOBJECT}, - {"arrays", tARRAYS}, {"async", tASYNC}, {"async_uuid", tASYNCUUID}, {"auto_handle", tAUTOHANDLE}, @@ -206,50 +205,45 @@ static struct keyword { {"cpp_quote", tCPPQUOTE}, /* ... */ {"default", tDEFAULT}, + {"defaultcollelem", tDEFAULTCOLLELEM}, {"defaultvalue", tDEFAULTVALUE}, -/* ... */ + {"defaultvtable", tDEFAULTVTABLE}, {"dispinterface", tDISPINTERFACE}, -/* ... */ + {"displaybind", tDISPLAYBIND}, {"dllname", tDLLNAME}, {"double", tDOUBLE}, {"dual", tDUAL}, -/* ... */ {"endpoint", tENDPOINT}, {"entry", tENTRY}, {"enum", tENUM}, {"error_status_t", tERRORSTATUST}, {"explicit_handle", tEXPLICITHANDLE}, {"extern", tEXTERN}, -/* ... */ {"float", tFLOAT}, -/* ... */ {"handle", tHANDLE}, {"handle_t", tHANDLET}, -/* ... */ {"helpcontext", tHELPCONTEXT}, {"helpfile", tHELPFILE}, {"helpstring", tHELPSTRING}, {"helpstringcontext", tHELPSTRINGCONTEXT}, {"helpstringdll", tHELPSTRINGDLL}, -/* ... */ - {"hidden", tHIDDEN}, + {"hidden", tHIDDEN}, {"hyper", tHYPER}, {"id", tID}, {"idempotent", tIDEMPOTENT}, /* ... */ {"iid_is", tIIDIS}, -/* ... */ + {"immediatebind", tIMMEDIATEBIND}, {"implicit_handle", tIMPLICITHANDLE}, {"import", tIMPORT}, {"importlib", tIMPORTLIB}, {"in", tIN}, - {"include", tINCLUDE}, {"in_line", tINLINE}, {"input_sync", tINPUTSYNC}, {"int", tINT}, /* ... */ {"interface", tINTERFACE}, -/* ... */ + {"lcid", tLCID}, {"length_is", tLENGTHIS}, {"library", tLIBRARY}, /* ... */ @@ -260,7 +254,9 @@ static struct keyword { /* ... */ {"module", tMODULE}, /* ... */ + {"nonbrowsable", tNONBROWSABLE}, {"noncreatable", tNONCREATABLE}, + {"nonextensible", tNONEXTENSIBLE}, {"object", tOBJECT}, {"odl", tODL}, {"oleautomation", tOLEAUTOMATION}, @@ -274,14 +270,15 @@ static struct keyword { {"propget", tPROPGET}, {"propput", tPROPPUT}, {"propputref", tPROPPUTREF}, + {"ptr", tPTR}, /* ... */ - {"ptr", tPTR}, {"public", tPUBLIC}, + {"range", tRANGE}, /* ... */ {"readonly", tREADONLY}, {"ref", tREF}, -/* ... */ - {"restricted", tRESTRICTED}, + {"requestedit", tREQUESTEDIT}, + {"restricted", tRESTRICTED}, {"retval", tRETVAL}, /* ... */ {"short", tSHORT}, @@ -289,10 +286,10 @@ static struct keyword { {"single", tSINGLE}, {"size_is", tSIZEIS}, {"sizeof", tSIZEOF}, + {"small", tSMALL}, /* ... */ - {"small", tSMALL}, {"source", tSOURCE}, -/* ... */ +/* ... */ {"string", tSTRING}, {"struct", tSTRUCT}, {"switch", tSWITCH}, @@ -301,8 +298,8 @@ static struct keyword { /* ... */ {"transmit_as", tTRANSMITAS}, {"typedef", tTYPEDEF}, -/* ... */ {"union", tUNION}, +/* ... */ {"unique", tUNIQUE}, {"unsigned", tUNSIGNED}, /* ... */ @@ -313,7 +310,7 @@ static struct keyword { {"version", tVERSION}, {"void", tVOID}, {"wchar_t", tWCHAR}, - {"wire_marshal", tWIREMARSHAL} + {"wire_marshal", tWIREMARSHAL}, }; #define NKEYWORDS (sizeof(keywords)/sizeof(keywords[0])) #define KWP(p) ((const struct keyword *)(p)) diff --git a/reactos/tools/widl/y.tab.c b/reactos/tools/widl/parser.tab.c similarity index 55% rename from reactos/tools/widl/y.tab.c rename to reactos/tools/widl/parser.tab.c index 298767083cc..c4b73a2ea0c 100644 --- a/reactos/tools/widl/y.tab.c +++ b/reactos/tools/widl/parser.tab.c @@ -65,117 +65,125 @@ tAGGREGATABLE = 267, tALLOCATE = 268, tAPPOBJECT = 269, - tARRAYS = 270, - tASYNC = 271, - tASYNCUUID = 272, - tAUTOHANDLE = 273, - tBINDABLE = 274, - tBOOLEAN = 275, - tBROADCAST = 276, - tBYTE = 277, - tBYTECOUNT = 278, - tCALLAS = 279, - tCALLBACK = 280, - tCASE = 281, - tCDECL = 282, - tCHAR = 283, - tCOCLASS = 284, - tCODE = 285, - tCOMMSTATUS = 286, - tCONST = 287, - tCONTEXTHANDLE = 288, - tCONTEXTHANDLENOSERIALIZE = 289, - tCONTEXTHANDLESERIALIZE = 290, - tCONTROL = 291, - tCPPQUOTE = 292, - tDEFAULT = 293, + tASYNC = 270, + tASYNCUUID = 271, + tAUTOHANDLE = 272, + tBINDABLE = 273, + tBOOLEAN = 274, + tBROADCAST = 275, + tBYTE = 276, + tBYTECOUNT = 277, + tCALLAS = 278, + tCALLBACK = 279, + tCASE = 280, + tCDECL = 281, + tCHAR = 282, + tCOCLASS = 283, + tCODE = 284, + tCOMMSTATUS = 285, + tCONST = 286, + tCONTEXTHANDLE = 287, + tCONTEXTHANDLENOSERIALIZE = 288, + tCONTEXTHANDLESERIALIZE = 289, + tCONTROL = 290, + tCPPQUOTE = 291, + tDEFAULT = 292, + tDEFAULTCOLLELEM = 293, tDEFAULTVALUE = 294, - tDISPINTERFACE = 295, - tDLLNAME = 296, - tDOUBLE = 297, - tDUAL = 298, - tENDPOINT = 299, - tENTRY = 300, - tENUM = 301, - tERRORSTATUST = 302, - tEXPLICITHANDLE = 303, - tEXTERN = 304, - tFLOAT = 305, - tHANDLE = 306, - tHANDLET = 307, - tHELPCONTEXT = 308, - tHELPFILE = 309, - tHELPSTRING = 310, - tHELPSTRINGCONTEXT = 311, - tHELPSTRINGDLL = 312, - tHIDDEN = 313, - tHYPER = 314, - tID = 315, - tIDEMPOTENT = 316, - tIIDIS = 317, - tIMPLICITHANDLE = 318, - tIMPORT = 319, - tIMPORTLIB = 320, - tIN = 321, - tINCLUDE = 322, - tINLINE = 323, - tINPUTSYNC = 324, - tINT = 325, - tINT64 = 326, - tINTERFACE = 327, - tLENGTHIS = 328, - tLIBRARY = 329, - tLOCAL = 330, - tLONG = 331, - tMETHODS = 332, - tMODULE = 333, - tNONCREATABLE = 334, - tOBJECT = 335, - tODL = 336, - tOLEAUTOMATION = 337, - tOPTIONAL = 338, - tOUT = 339, - tPOINTERDEFAULT = 340, - tPROPERTIES = 341, - tPROPGET = 342, - tPROPPUT = 343, - tPROPPUTREF = 344, - tPTR = 345, - tPUBLIC = 346, - tREADONLY = 347, - tREF = 348, - tRESTRICTED = 349, - tRETVAL = 350, - tSHORT = 351, - tSIGNED = 352, - tSINGLE = 353, - tSIZEIS = 354, - tSIZEOF = 355, - tSMALL = 356, - tSOURCE = 357, - tSTDCALL = 358, - tSTRING = 359, - tSTRUCT = 360, - tSWITCH = 361, - tSWITCHIS = 362, - tSWITCHTYPE = 363, - tTRANSMITAS = 364, - tTYPEDEF = 365, - tUNION = 366, - tUNIQUE = 367, - tUNSIGNED = 368, - tUUID = 369, - tV1ENUM = 370, - tVARARG = 371, - tVERSION = 372, - tVOID = 373, - tWCHAR = 374, - tWIREMARSHAL = 375, - tPOINTERTYPE = 376, - COND = 377, - CAST = 378, - PPTR = 379, - NEG = 380 + tDEFAULTVTABLE = 295, + tDISPLAYBIND = 296, + tDISPINTERFACE = 297, + tDLLNAME = 298, + tDOUBLE = 299, + tDUAL = 300, + tENDPOINT = 301, + tENTRY = 302, + tENUM = 303, + tERRORSTATUST = 304, + tEXPLICITHANDLE = 305, + tEXTERN = 306, + tFALSE = 307, + tFLOAT = 308, + tHANDLE = 309, + tHANDLET = 310, + tHELPCONTEXT = 311, + tHELPFILE = 312, + tHELPSTRING = 313, + tHELPSTRINGCONTEXT = 314, + tHELPSTRINGDLL = 315, + tHIDDEN = 316, + tHYPER = 317, + tID = 318, + tIDEMPOTENT = 319, + tIIDIS = 320, + tIMMEDIATEBIND = 321, + tIMPLICITHANDLE = 322, + tIMPORT = 323, + tIMPORTLIB = 324, + tIN = 325, + tINLINE = 326, + tINPUTSYNC = 327, + tINT = 328, + tINT64 = 329, + tINTERFACE = 330, + tLCID = 331, + tLENGTHIS = 332, + tLIBRARY = 333, + tLOCAL = 334, + tLONG = 335, + tMETHODS = 336, + tMODULE = 337, + tNONBROWSABLE = 338, + tNONCREATABLE = 339, + tNONEXTENSIBLE = 340, + tOBJECT = 341, + tODL = 342, + tOLEAUTOMATION = 343, + tOPTIONAL = 344, + tOUT = 345, + tPOINTERDEFAULT = 346, + tPROPERTIES = 347, + tPROPGET = 348, + tPROPPUT = 349, + tPROPPUTREF = 350, + tPTR = 351, + tPUBLIC = 352, + tRANGE = 353, + tREADONLY = 354, + tREF = 355, + tREQUESTEDIT = 356, + tRESTRICTED = 357, + tRETVAL = 358, + tSAFEARRAY = 359, + tSHORT = 360, + tSIGNED = 361, + tSINGLE = 362, + tSIZEIS = 363, + tSIZEOF = 364, + tSMALL = 365, + tSOURCE = 366, + tSTDCALL = 367, + tSTRING = 368, + tSTRUCT = 369, + tSWITCH = 370, + tSWITCHIS = 371, + tSWITCHTYPE = 372, + tTRANSMITAS = 373, + tTRUE = 374, + tTYPEDEF = 375, + tUNION = 376, + tUNIQUE = 377, + tUNSIGNED = 378, + tUUID = 379, + tV1ENUM = 380, + tVARARG = 381, + tVERSION = 382, + tVOID = 383, + tWCHAR = 384, + tWIREMARSHAL = 385, + CAST = 386, + PPTR = 387, + NEG = 388 }; #endif #define aIDENTIFIER 258 @@ -190,117 +198,125 @@ #define tAGGREGATABLE 267 #define tALLOCATE 268 #define tAPPOBJECT 269 -#define tARRAYS 270 -#define tASYNC 271 -#define tASYNCUUID 272 -#define tAUTOHANDLE 273 -#define tBINDABLE 274 -#define tBOOLEAN 275 -#define tBROADCAST 276 -#define tBYTE 277 -#define tBYTECOUNT 278 -#define tCALLAS 279 -#define tCALLBACK 280 -#define tCASE 281 -#define tCDECL 282 -#define tCHAR 283 -#define tCOCLASS 284 -#define tCODE 285 -#define tCOMMSTATUS 286 -#define tCONST 287 -#define tCONTEXTHANDLE 288 -#define tCONTEXTHANDLENOSERIALIZE 289 -#define tCONTEXTHANDLESERIALIZE 290 -#define tCONTROL 291 -#define tCPPQUOTE 292 -#define tDEFAULT 293 +#define tASYNC 270 +#define tASYNCUUID 271 +#define tAUTOHANDLE 272 +#define tBINDABLE 273 +#define tBOOLEAN 274 +#define tBROADCAST 275 +#define tBYTE 276 +#define tBYTECOUNT 277 +#define tCALLAS 278 +#define tCALLBACK 279 +#define tCASE 280 +#define tCDECL 281 +#define tCHAR 282 +#define tCOCLASS 283 +#define tCODE 284 +#define tCOMMSTATUS 285 +#define tCONST 286 +#define tCONTEXTHANDLE 287 +#define tCONTEXTHANDLENOSERIALIZE 288 +#define tCONTEXTHANDLESERIALIZE 289 +#define tCONTROL 290 +#define tCPPQUOTE 291 +#define tDEFAULT 292 +#define tDEFAULTCOLLELEM 293 #define tDEFAULTVALUE 294 -#define tDISPINTERFACE 295 -#define tDLLNAME 296 -#define tDOUBLE 297 -#define tDUAL 298 -#define tENDPOINT 299 -#define tENTRY 300 -#define tENUM 301 -#define tERRORSTATUST 302 -#define tEXPLICITHANDLE 303 -#define tEXTERN 304 -#define tFLOAT 305 -#define tHANDLE 306 -#define tHANDLET 307 -#define tHELPCONTEXT 308 -#define tHELPFILE 309 -#define tHELPSTRING 310 -#define tHELPSTRINGCONTEXT 311 -#define tHELPSTRINGDLL 312 -#define tHIDDEN 313 -#define tHYPER 314 -#define tID 315 -#define tIDEMPOTENT 316 -#define tIIDIS 317 -#define tIMPLICITHANDLE 318 -#define tIMPORT 319 -#define tIMPORTLIB 320 -#define tIN 321 -#define tINCLUDE 322 -#define tINLINE 323 -#define tINPUTSYNC 324 -#define tINT 325 -#define tINT64 326 -#define tINTERFACE 327 -#define tLENGTHIS 328 -#define tLIBRARY 329 -#define tLOCAL 330 -#define tLONG 331 -#define tMETHODS 332 -#define tMODULE 333 -#define tNONCREATABLE 334 -#define tOBJECT 335 -#define tODL 336 -#define tOLEAUTOMATION 337 -#define tOPTIONAL 338 -#define tOUT 339 -#define tPOINTERDEFAULT 340 -#define tPROPERTIES 341 -#define tPROPGET 342 -#define tPROPPUT 343 -#define tPROPPUTREF 344 -#define tPTR 345 -#define tPUBLIC 346 -#define tREADONLY 347 -#define tREF 348 -#define tRESTRICTED 349 -#define tRETVAL 350 -#define tSHORT 351 -#define tSIGNED 352 -#define tSINGLE 353 -#define tSIZEIS 354 -#define tSIZEOF 355 -#define tSMALL 356 -#define tSOURCE 357 -#define tSTDCALL 358 -#define tSTRING 359 -#define tSTRUCT 360 -#define tSWITCH 361 -#define tSWITCHIS 362 -#define tSWITCHTYPE 363 -#define tTRANSMITAS 364 -#define tTYPEDEF 365 -#define tUNION 366 -#define tUNIQUE 367 -#define tUNSIGNED 368 -#define tUUID 369 -#define tV1ENUM 370 -#define tVARARG 371 -#define tVERSION 372 -#define tVOID 373 -#define tWCHAR 374 -#define tWIREMARSHAL 375 -#define tPOINTERTYPE 376 -#define COND 377 -#define CAST 378 -#define PPTR 379 -#define NEG 380 +#define tDEFAULTVTABLE 295 +#define tDISPLAYBIND 296 +#define tDISPINTERFACE 297 +#define tDLLNAME 298 +#define tDOUBLE 299 +#define tDUAL 300 +#define tENDPOINT 301 +#define tENTRY 302 +#define tENUM 303 +#define tERRORSTATUST 304 +#define tEXPLICITHANDLE 305 +#define tEXTERN 306 +#define tFALSE 307 +#define tFLOAT 308 +#define tHANDLE 309 +#define tHANDLET 310 +#define tHELPCONTEXT 311 +#define tHELPFILE 312 +#define tHELPSTRING 313 +#define tHELPSTRINGCONTEXT 314 +#define tHELPSTRINGDLL 315 +#define tHIDDEN 316 +#define tHYPER 317 +#define tID 318 +#define tIDEMPOTENT 319 +#define tIIDIS 320 +#define tIMMEDIATEBIND 321 +#define tIMPLICITHANDLE 322 +#define tIMPORT 323 +#define tIMPORTLIB 324 +#define tIN 325 +#define tINLINE 326 +#define tINPUTSYNC 327 +#define tINT 328 +#define tINT64 329 +#define tINTERFACE 330 +#define tLCID 331 +#define tLENGTHIS 332 +#define tLIBRARY 333 +#define tLOCAL 334 +#define tLONG 335 +#define tMETHODS 336 +#define tMODULE 337 +#define tNONBROWSABLE 338 +#define tNONCREATABLE 339 +#define tNONEXTENSIBLE 340 +#define tOBJECT 341 +#define tODL 342 +#define tOLEAUTOMATION 343 +#define tOPTIONAL 344 +#define tOUT 345 +#define tPOINTERDEFAULT 346 +#define tPROPERTIES 347 +#define tPROPGET 348 +#define tPROPPUT 349 +#define tPROPPUTREF 350 +#define tPTR 351 +#define tPUBLIC 352 +#define tRANGE 353 +#define tREADONLY 354 +#define tREF 355 +#define tREQUESTEDIT 356 +#define tRESTRICTED 357 +#define tRETVAL 358 +#define tSAFEARRAY 359 +#define tSHORT 360 +#define tSIGNED 361 +#define tSINGLE 362 +#define tSIZEIS 363 +#define tSIZEOF 364 +#define tSMALL 365 +#define tSOURCE 366 +#define tSTDCALL 367 +#define tSTRING 368 +#define tSTRUCT 369 +#define tSWITCH 370 +#define tSWITCHIS 371 +#define tSWITCHTYPE 372 +#define tTRANSMITAS 373 +#define tTRUE 374 +#define tTYPEDEF 375 +#define tUNION 376 +#define tUNIQUE 377 +#define tUNSIGNED 378 +#define tUUID 379 +#define tV1ENUM 380 +#define tVARARG 381 +#define tVERSION 382 +#define tVOID 383 +#define tWCHAR 384 +#define tWIREMARSHAL 385 +#define CAST 386 +#define PPTR 387 +#define NEG 388 @@ -325,7 +341,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" @@ -340,6 +356,8 @@ #include #endif +#include "windef.h" + #include "widl.h" #include "utils.h" #include "parser.h" @@ -389,11 +407,12 @@ static void set_type(var_t *v, typeref_t *ref, expr_t *arr); static ifref_t *make_ifref(type_t *iface); static var_t *make_var(char *name); static func_t *make_func(var_t *def, var_t *args); -static class_t *make_class(char *name); +static type_t *make_class(char *name); +static type_t *make_safearray(void); -static type_t *reg_type(type_t *type, char *name, int t); +static type_t *reg_type(type_t *type, const char *name, int t); static type_t *reg_types(type_t *type, var_t *names, int t); -static type_t *find_type(char *name, int t); +static type_t *find_type(const char *name, int t); static type_t *find_type2(char *name, int t); static type_t *get_type(unsigned char type, char *name, int t); static type_t *get_typev(unsigned char type, var_t *name, int t); @@ -415,7 +434,7 @@ static type_t std_uhyper = { "MIDL_uhyper" }; /* Enabling traces. */ #ifndef YYDEBUG -# define YYDEBUG 0 +# define YYDEBUG 1 #endif /* Enabling verbose error messages. */ @@ -427,7 +446,7 @@ static type_t std_uhyper = { "MIDL_uhyper" }; #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 106 "parser.y" +#line 109 "parser.y" typedef union YYSTYPE { attr_t *attr; expr_t *expr; @@ -436,13 +455,12 @@ typedef union YYSTYPE { var_t *var; func_t *func; ifref_t *ifref; - class_t *clas; char *str; UUID *uuid; unsigned int num; } YYSTYPE; /* Line 191 of yacc.c. */ -#line 445 "y.tab.c" +#line 463 "parser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -454,7 +472,7 @@ typedef union YYSTYPE { /* Line 214 of yacc.c. */ -#line 457 "y.tab.c" +#line 475 "parser.tab.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE @@ -553,20 +571,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 934 +#define YYLAST 1059 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 145 +#define YYNTOKENS 153 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 72 +#define YYNNTS 74 /* YYNRULES -- Number of rules. */ -#define YYNRULES 249 +#define YYNRULES 272 /* YYNRULES -- Number of states. */ -#define YYNSTATES 461 +#define YYNSTATES 496 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 380 +#define YYMAXUTOK 388 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -577,16 +595,16 @@ static const unsigned char yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 125, 2, - 135, 136, 128, 127, 122, 126, 144, 129, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 141, 134, - 2, 142, 2, 143, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 135, 2, + 145, 146, 138, 137, 131, 136, 152, 139, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 133, 144, + 2, 151, 2, 132, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 139, 2, 140, 2, 2, 2, 2, 2, 2, + 2, 149, 2, 150, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 137, 124, 138, 130, 2, 2, 2, + 2, 2, 2, 147, 134, 148, 140, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -611,8 +629,8 @@ static const unsigned char yytranslate[] = 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 123, 131, 132, - 133 + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 141, 142, 143 }; #if YYDEBUG @@ -620,144 +638,156 @@ static const unsigned char yytranslate[] = YYRHS. */ static const unsigned short yyprhs[] = { - 0, 0, 3, 5, 6, 9, 12, 15, 18, 21, - 24, 25, 28, 31, 34, 37, 40, 41, 45, 48, - 50, 53, 55, 58, 61, 63, 66, 69, 72, 77, - 81, 85, 88, 92, 96, 97, 99, 101, 103, 107, - 109, 114, 118, 125, 131, 132, 136, 140, 142, 146, - 151, 152, 154, 158, 160, 164, 169, 171, 173, 178, - 183, 185, 187, 189, 191, 193, 198, 203, 208, 210, - 215, 220, 225, 227, 229, 234, 239, 244, 249, 254, - 256, 261, 263, 268, 274, 276, 278, 283, 285, 287, - 289, 291, 293, 295, 297, 302, 304, 306, 308, 310, - 312, 314, 316, 318, 320, 325, 327, 329, 334, 339, - 344, 346, 351, 353, 355, 360, 365, 367, 368, 370, - 371, 374, 379, 383, 389, 390, 393, 395, 397, 401, - 405, 407, 413, 414, 416, 418, 420, 422, 428, 432, - 436, 440, 444, 448, 452, 456, 460, 463, 466, 469, - 474, 479, 483, 485, 489, 491, 496, 497, 500, 503, - 507, 510, 512, 517, 525, 526, 528, 529, 531, 533, - 535, 537, 539, 541, 543, 545, 547, 549, 551, 554, - 557, 559, 561, 563, 565, 567, 569, 571, 572, 574, - 576, 579, 582, 585, 588, 590, 592, 595, 598, 601, - 606, 607, 610, 613, 616, 619, 622, 625, 629, 632, - 636, 642, 643, 646, 649, 652, 655, 661, 669, 671, - 674, 677, 680, 683, 686, 691, 694, 697, 699, 701, - 705, 707, 711, 713, 715, 721, 723, 725, 727, 730, - 732, 735, 737, 740, 742, 745, 750, 756, 767, 769 + 0, 0, 3, 5, 6, 9, 12, 16, 19, 22, + 25, 28, 29, 32, 35, 39, 42, 45, 48, 51, + 52, 56, 59, 61, 64, 66, 69, 72, 74, 77, + 80, 83, 88, 92, 96, 101, 104, 108, 112, 113, + 115, 117, 119, 123, 125, 130, 134, 141, 147, 148, + 152, 156, 158, 162, 167, 168, 170, 174, 176, 180, + 185, 186, 188, 190, 192, 194, 196, 201, 206, 208, + 210, 212, 214, 216, 218, 223, 228, 230, 232, 237, + 239, 244, 249, 254, 256, 258, 263, 268, 273, 278, + 283, 285, 290, 292, 297, 299, 305, 307, 309, 314, + 316, 318, 320, 322, 324, 326, 328, 330, 332, 337, + 339, 341, 343, 345, 352, 354, 356, 358, 360, 365, + 367, 369, 374, 379, 384, 389, 391, 393, 398, 403, + 405, 406, 408, 409, 412, 417, 421, 427, 428, 431, + 433, 435, 439, 443, 445, 451, 453, 457, 458, 460, + 462, 464, 466, 468, 470, 476, 480, 484, 488, 492, + 496, 500, 504, 508, 511, 514, 517, 522, 527, 531, + 533, 537, 539, 544, 545, 548, 551, 555, 558, 560, + 565, 573, 574, 576, 577, 579, 581, 583, 585, 587, + 589, 591, 593, 595, 597, 599, 601, 603, 605, 607, + 610, 613, 615, 617, 619, 621, 623, 625, 627, 628, + 630, 632, 635, 637, 640, 643, 645, 647, 650, 653, + 656, 661, 662, 665, 668, 671, 674, 677, 680, 684, + 687, 691, 697, 698, 701, 704, 707, 710, 716, 724, + 726, 729, 732, 735, 738, 741, 746, 749, 752, 754, + 756, 760, 762, 766, 768, 770, 772, 778, 780, 782, + 784, 787, 789, 792, 794, 797, 799, 802, 807, 812, + 818, 829, 831 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const short yyrhs[] = { - 146, 0, -1, 147, -1, -1, 147, 204, -1, 147, - 203, -1, 147, 192, -1, 147, 207, -1, 147, 156, - -1, 147, 150, -1, -1, 148, 204, -1, 148, 203, - -1, 148, 192, -1, 148, 207, -1, 148, 150, -1, - -1, 149, 183, 134, -1, 149, 150, -1, 134, -1, - 170, 134, -1, 151, -1, 174, 134, -1, 179, 134, - -1, 153, -1, 212, 134, -1, 214, 134, -1, 215, - 134, -1, 37, 135, 7, 136, -1, 64, 7, 134, - -1, 152, 148, 9, -1, 74, 3, -1, 164, 154, - 137, -1, 155, 148, 138, -1, -1, 159, -1, 118, - -1, 160, -1, 159, 122, 160, -1, 158, -1, 164, - 213, 209, 161, -1, 213, 209, 161, -1, 164, 213, - 209, 135, 157, 136, -1, 213, 209, 135, 157, 136, - -1, -1, 139, 162, 140, -1, 139, 128, 140, -1, - 175, -1, 162, 122, 176, -1, 162, 140, 139, 176, - -1, -1, 164, -1, 139, 165, 140, -1, 166, -1, - 165, 122, 166, -1, 165, 140, 139, 166, -1, 16, - -1, 18, -1, 24, 135, 186, 136, -1, 26, 135, - 177, 136, -1, 33, -1, 34, -1, 35, -1, 36, - -1, 38, -1, 39, 135, 178, 136, -1, 39, 135, - 7, 136, -1, 41, 135, 7, 136, -1, 43, -1, - 44, 135, 7, 136, -1, 45, 135, 7, 136, -1, - 45, 135, 178, 136, -1, 48, -1, 51, -1, 53, - 135, 178, 136, -1, 54, 135, 7, 136, -1, 55, - 135, 7, 136, -1, 56, 135, 178, 136, -1, 57, - 135, 7, 136, -1, 58, -1, 60, 135, 178, 136, - -1, 61, -1, 62, 135, 186, 136, -1, 63, 135, - 52, 3, 136, -1, 66, -1, 69, -1, 73, 135, - 210, 136, -1, 75, -1, 79, -1, 80, -1, 81, - -1, 82, -1, 83, -1, 84, -1, 85, 135, 211, - 136, -1, 87, -1, 88, -1, 89, -1, 90, -1, - 91, -1, 92, -1, 93, -1, 94, -1, 95, -1, - 99, 135, 210, 136, -1, 102, -1, 104, -1, 107, - 135, 176, 136, -1, 108, 135, 213, 136, -1, 109, - 135, 213, 136, -1, 112, -1, 114, 135, 8, 136, - -1, 115, -1, 116, -1, 117, 135, 216, 136, -1, - 120, 135, 213, 136, -1, 211, -1, -1, 103, -1, - -1, 168, 169, -1, 26, 176, 141, 181, -1, 38, - 141, 181, -1, 32, 213, 186, 142, 178, -1, -1, - 172, 122, -1, 172, -1, 173, -1, 172, 122, 173, - -1, 186, 142, 178, -1, 186, -1, 46, 185, 137, - 171, 138, -1, -1, 176, -1, 5, -1, 6, -1, - 3, -1, 176, 143, 176, 141, 176, -1, 176, 124, - 176, -1, 176, 125, 176, -1, 176, 127, 176, -1, - 176, 126, 176, -1, 176, 128, 176, -1, 176, 129, - 176, -1, 176, 10, 176, -1, 176, 11, 176, -1, - 130, 176, -1, 126, 176, -1, 128, 176, -1, 135, - 213, 136, 176, -1, 100, 135, 213, 136, -1, 135, - 176, 136, -1, 178, -1, 177, 122, 178, -1, 176, - -1, 49, 32, 213, 186, -1, -1, 180, 181, -1, - 182, 134, -1, 163, 215, 134, -1, 164, 134, -1, - 134, -1, 163, 213, 209, 161, -1, 163, 213, 167, - 209, 135, 157, 136, -1, -1, 186, -1, -1, 3, - -1, 4, -1, 3, -1, 4, -1, 16, -1, 60, - -1, 95, -1, 117, -1, 22, -1, 119, -1, 189, - -1, 97, 189, -1, 113, 189, -1, 113, -1, 50, - -1, 98, -1, 42, -1, 20, -1, 47, -1, 52, - -1, -1, 70, -1, 70, -1, 101, 188, -1, 96, - 188, -1, 76, 188, -1, 59, 188, -1, 71, -1, - 28, -1, 29, 3, -1, 29, 4, -1, 164, 190, - -1, 191, 137, 193, 138, -1, -1, 193, 194, -1, - 163, 204, -1, 40, 3, -1, 40, 4, -1, 164, - 195, -1, 86, 141, -1, 197, 182, 134, -1, 77, - 141, -1, 198, 183, 134, -1, 196, 137, 197, 198, - 138, -1, -1, 141, 4, -1, 72, 3, -1, 72, - 4, -1, 164, 201, -1, 202, 200, 137, 149, 138, - -1, 202, 141, 3, 137, 153, 149, 138, -1, 199, - -1, 201, 134, -1, 195, 134, -1, 78, 3, -1, - 78, 4, -1, 164, 205, -1, 206, 137, 149, 138, - -1, 128, 209, -1, 32, 208, -1, 186, -1, 208, - -1, 135, 209, 136, -1, 209, -1, 210, 122, 209, - -1, 93, -1, 112, -1, 105, 185, 137, 180, 138, - -1, 118, -1, 4, -1, 187, -1, 32, 213, -1, - 174, -1, 46, 3, -1, 212, -1, 105, 3, -1, - 215, -1, 111, 3, -1, 110, 163, 213, 210, -1, - 111, 185, 137, 180, 138, -1, 111, 185, 106, 135, - 182, 136, 184, 137, 168, 138, -1, 5, -1, 5, - 144, 5, -1 + 154, 0, -1, 155, -1, -1, 155, 214, -1, 155, + 213, -1, 155, 200, 144, -1, 155, 202, -1, 155, + 217, -1, 155, 165, -1, 155, 158, -1, -1, 156, + 214, -1, 156, 213, -1, 156, 200, 144, -1, 156, + 202, -1, 156, 217, -1, 156, 158, -1, 156, 162, + -1, -1, 157, 193, 144, -1, 157, 158, -1, 144, + -1, 179, 144, -1, 159, -1, 183, 144, -1, 189, + 144, -1, 161, -1, 222, 144, -1, 224, 144, -1, + 225, 144, -1, 36, 145, 7, 146, -1, 68, 7, + 144, -1, 160, 156, 9, -1, 69, 145, 7, 146, + -1, 78, 3, -1, 173, 163, 147, -1, 164, 156, + 148, -1, -1, 168, -1, 128, -1, 169, -1, 168, + 131, 169, -1, 167, -1, 173, 223, 219, 170, -1, + 223, 219, 170, -1, 173, 223, 219, 145, 166, 146, + -1, 223, 219, 145, 166, 146, -1, -1, 149, 171, + 150, -1, 149, 138, 150, -1, 185, -1, 171, 131, + 186, -1, 171, 150, 149, 186, -1, -1, 173, -1, + 149, 174, 150, -1, 175, -1, 174, 131, 175, -1, + 174, 150, 149, 175, -1, -1, 12, -1, 14, -1, + 15, -1, 17, -1, 18, -1, 23, 145, 196, 146, + -1, 25, 145, 187, 146, -1, 32, -1, 33, -1, + 34, -1, 35, -1, 37, -1, 38, -1, 39, 145, + 188, 146, -1, 39, 145, 7, 146, -1, 40, -1, + 41, -1, 43, 145, 7, 146, -1, 45, -1, 46, + 145, 7, 146, -1, 47, 145, 7, 146, -1, 47, + 145, 188, 146, -1, 50, -1, 54, -1, 56, 145, + 188, 146, -1, 57, 145, 7, 146, -1, 58, 145, + 7, 146, -1, 59, 145, 188, 146, -1, 60, 145, + 7, 146, -1, 61, -1, 63, 145, 188, 146, -1, + 64, -1, 65, 145, 196, 146, -1, 66, -1, 67, + 145, 55, 3, 146, -1, 70, -1, 72, -1, 77, + 145, 184, 146, -1, 79, -1, 83, -1, 84, -1, + 85, -1, 86, -1, 87, -1, 88, -1, 89, -1, + 90, -1, 91, 145, 221, 146, -1, 93, -1, 94, + -1, 95, -1, 97, -1, 98, 145, 188, 131, 188, + 146, -1, 99, -1, 101, -1, 102, -1, 103, -1, + 108, 145, 184, 146, -1, 111, -1, 113, -1, 116, + 145, 186, 146, -1, 117, 145, 223, 146, -1, 118, + 145, 223, 146, -1, 124, 145, 8, 146, -1, 125, + -1, 126, -1, 127, 145, 226, 146, -1, 130, 145, + 223, 146, -1, 221, -1, -1, 112, -1, -1, 177, + 178, -1, 25, 186, 133, 191, -1, 37, 133, 191, + -1, 31, 223, 196, 151, 188, -1, -1, 181, 131, + -1, 181, -1, 182, -1, 181, 131, 182, -1, 196, + 151, 188, -1, 196, -1, 48, 195, 147, 180, 148, + -1, 185, -1, 184, 131, 185, -1, -1, 186, -1, + 5, -1, 6, -1, 52, -1, 119, -1, 3, -1, + 186, 132, 186, 133, 186, -1, 186, 134, 186, -1, + 186, 135, 186, -1, 186, 137, 186, -1, 186, 136, + 186, -1, 186, 138, 186, -1, 186, 139, 186, -1, + 186, 10, 186, -1, 186, 11, 186, -1, 140, 186, + -1, 136, 186, -1, 138, 186, -1, 145, 223, 146, + 186, -1, 109, 145, 223, 146, -1, 145, 186, 146, + -1, 188, -1, 187, 131, 188, -1, 186, -1, 51, + 31, 223, 196, -1, -1, 190, 191, -1, 192, 144, + -1, 172, 225, 144, -1, 173, 144, -1, 144, -1, + 172, 223, 219, 170, -1, 172, 223, 176, 219, 145, + 166, 146, -1, -1, 196, -1, -1, 3, -1, 4, + -1, 3, -1, 4, -1, 15, -1, 63, -1, 76, + -1, 86, -1, 98, -1, 103, -1, 124, -1, 127, + -1, 21, -1, 129, -1, 199, -1, 106, 199, -1, + 123, 199, -1, 123, -1, 53, -1, 107, -1, 44, + -1, 19, -1, 49, -1, 55, -1, -1, 73, -1, + 73, -1, 105, 198, -1, 110, -1, 80, 198, -1, + 62, 198, -1, 74, -1, 27, -1, 28, 3, -1, + 28, 4, -1, 173, 200, -1, 201, 147, 203, 148, + -1, -1, 203, 204, -1, 172, 214, -1, 42, 3, + -1, 42, 4, -1, 173, 205, -1, 92, 133, -1, + 207, 192, 144, -1, 81, 133, -1, 208, 193, 144, + -1, 206, 147, 207, 208, 148, -1, -1, 133, 4, + -1, 75, 3, -1, 75, 4, -1, 173, 211, -1, + 212, 210, 147, 157, 148, -1, 212, 133, 3, 147, + 161, 157, 148, -1, 209, -1, 211, 144, -1, 205, + 144, -1, 82, 3, -1, 82, 4, -1, 173, 215, + -1, 216, 147, 157, 148, -1, 138, 219, -1, 31, + 218, -1, 196, -1, 218, -1, 145, 219, 146, -1, + 219, -1, 220, 131, 219, -1, 100, -1, 122, -1, + 96, -1, 114, 195, 147, 190, 148, -1, 128, -1, + 4, -1, 197, -1, 31, 223, -1, 183, -1, 48, + 3, -1, 222, -1, 114, 3, -1, 225, -1, 121, + 3, -1, 104, 145, 223, 146, -1, 120, 172, 223, + 220, -1, 121, 195, 147, 190, 148, -1, 121, 195, + 115, 145, 192, 146, 194, 147, 177, 148, -1, 5, + -1, 5, 152, 5, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short yyrline[] = { - 0, 228, 228, 231, 232, 233, 234, 235, 236, 237, - 240, 241, 242, 243, 244, 245, 248, 249, 250, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 264, 266, - 269, 272, 274, 276, 279, 280, 283, 286, 287, 288, - 292, 296, 299, 305, 312, 313, 314, 317, 318, 319, - 322, 323, 327, 330, 331, 332, 336, 337, 338, 339, - 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, - 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 393, 394, 395, 396, 399, 400, 403, - 404, 409, 413, 419, 426, 427, 428, 431, 432, 438, - 443, 449, 471, 472, 475, 476, 477, 478, 479, 480, - 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 495, 496, 499, 505, 510, 511, 516, 517, - 518, 519, 522, 526, 536, 537, 540, 541, 542, 545, - 547, 548, 549, 550, 551, 554, 555, 556, 557, 558, - 570, 571, 572, 573, 574, 575, 576, 579, 580, 583, - 584, 585, 586, 587, 588, 589, 592, 593, 596, 603, - 608, 609, 613, 616, 617, 620, 632, 633, 636, 637, - 640, 655, 656, 659, 660, 663, 671, 679, 686, 690, - 691, 694, 695, 698, 703, 709, 710, 713, 714, 715, - 719, 720, 724, 725, 728, 738, 739, 740, 741, 742, - 743, 744, 745, 746, 747, 750, 763, 767, 781, 782 + 0, 239, 239, 242, 243, 244, 245, 249, 253, 254, + 255, 258, 259, 260, 261, 262, 265, 266, 267, 270, + 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 286, 288, 291, 294, 297, 299, 302, 305, 306, + 309, 312, 313, 314, 318, 322, 325, 331, 338, 339, + 340, 343, 344, 345, 348, 349, 353, 359, 360, 363, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 440, 441, 444, 445, 450, 454, 460, 466, 467, 468, + 471, 474, 480, 484, 489, 497, 498, 511, 512, 515, + 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, + 526, 527, 528, 529, 530, 531, 532, 533, 534, 537, + 538, 541, 547, 552, 553, 558, 559, 560, 561, 564, + 568, 578, 579, 582, 583, 584, 587, 589, 590, 591, + 592, 593, 594, 595, 596, 597, 600, 601, 602, 603, + 604, 616, 617, 618, 619, 620, 621, 622, 625, 626, + 629, 630, 631, 632, 633, 634, 635, 638, 639, 645, + 652, 657, 658, 662, 665, 666, 669, 682, 683, 686, + 687, 690, 705, 706, 709, 710, 713, 721, 729, 736, + 740, 741, 744, 745, 748, 753, 759, 760, 763, 764, + 765, 769, 770, 774, 775, 776, 779, 789, 790, 791, + 792, 793, 794, 795, 796, 797, 798, 799, 802, 815, + 819, 833, 834 }; #endif @@ -768,35 +798,37 @@ static const char *const yytname[] = { "$end", "error", "$undefined", "aIDENTIFIER", "aKNOWNTYPE", "aNUM", "aHEXNUM", "aSTRING", "aUUID", "aEOF", "SHL", "SHR", "tAGGREGATABLE", - "tALLOCATE", "tAPPOBJECT", "tARRAYS", "tASYNC", "tASYNCUUID", - "tAUTOHANDLE", "tBINDABLE", "tBOOLEAN", "tBROADCAST", "tBYTE", - "tBYTECOUNT", "tCALLAS", "tCALLBACK", "tCASE", "tCDECL", "tCHAR", - "tCOCLASS", "tCODE", "tCOMMSTATUS", "tCONST", "tCONTEXTHANDLE", - "tCONTEXTHANDLENOSERIALIZE", "tCONTEXTHANDLESERIALIZE", "tCONTROL", - "tCPPQUOTE", "tDEFAULT", "tDEFAULTVALUE", "tDISPINTERFACE", "tDLLNAME", - "tDOUBLE", "tDUAL", "tENDPOINT", "tENTRY", "tENUM", "tERRORSTATUST", - "tEXPLICITHANDLE", "tEXTERN", "tFLOAT", "tHANDLE", "tHANDLET", - "tHELPCONTEXT", "tHELPFILE", "tHELPSTRING", "tHELPSTRINGCONTEXT", - "tHELPSTRINGDLL", "tHIDDEN", "tHYPER", "tID", "tIDEMPOTENT", "tIIDIS", - "tIMPLICITHANDLE", "tIMPORT", "tIMPORTLIB", "tIN", "tINCLUDE", - "tINLINE", "tINPUTSYNC", "tINT", "tINT64", "tINTERFACE", "tLENGTHIS", - "tLIBRARY", "tLOCAL", "tLONG", "tMETHODS", "tMODULE", "tNONCREATABLE", - "tOBJECT", "tODL", "tOLEAUTOMATION", "tOPTIONAL", "tOUT", - "tPOINTERDEFAULT", "tPROPERTIES", "tPROPGET", "tPROPPUT", "tPROPPUTREF", - "tPTR", "tPUBLIC", "tREADONLY", "tREF", "tRESTRICTED", "tRETVAL", + "tALLOCATE", "tAPPOBJECT", "tASYNC", "tASYNCUUID", "tAUTOHANDLE", + "tBINDABLE", "tBOOLEAN", "tBROADCAST", "tBYTE", "tBYTECOUNT", "tCALLAS", + "tCALLBACK", "tCASE", "tCDECL", "tCHAR", "tCOCLASS", "tCODE", + "tCOMMSTATUS", "tCONST", "tCONTEXTHANDLE", "tCONTEXTHANDLENOSERIALIZE", + "tCONTEXTHANDLESERIALIZE", "tCONTROL", "tCPPQUOTE", "tDEFAULT", + "tDEFAULTCOLLELEM", "tDEFAULTVALUE", "tDEFAULTVTABLE", "tDISPLAYBIND", + "tDISPINTERFACE", "tDLLNAME", "tDOUBLE", "tDUAL", "tENDPOINT", "tENTRY", + "tENUM", "tERRORSTATUST", "tEXPLICITHANDLE", "tEXTERN", "tFALSE", + "tFLOAT", "tHANDLE", "tHANDLET", "tHELPCONTEXT", "tHELPFILE", + "tHELPSTRING", "tHELPSTRINGCONTEXT", "tHELPSTRINGDLL", "tHIDDEN", + "tHYPER", "tID", "tIDEMPOTENT", "tIIDIS", "tIMMEDIATEBIND", + "tIMPLICITHANDLE", "tIMPORT", "tIMPORTLIB", "tIN", "tINLINE", + "tINPUTSYNC", "tINT", "tINT64", "tINTERFACE", "tLCID", "tLENGTHIS", + "tLIBRARY", "tLOCAL", "tLONG", "tMETHODS", "tMODULE", "tNONBROWSABLE", + "tNONCREATABLE", "tNONEXTENSIBLE", "tOBJECT", "tODL", "tOLEAUTOMATION", + "tOPTIONAL", "tOUT", "tPOINTERDEFAULT", "tPROPERTIES", "tPROPGET", + "tPROPPUT", "tPROPPUTREF", "tPTR", "tPUBLIC", "tRANGE", "tREADONLY", + "tREF", "tREQUESTEDIT", "tRESTRICTED", "tRETVAL", "tSAFEARRAY", "tSHORT", "tSIGNED", "tSINGLE", "tSIZEIS", "tSIZEOF", "tSMALL", "tSOURCE", "tSTDCALL", "tSTRING", "tSTRUCT", "tSWITCH", "tSWITCHIS", - "tSWITCHTYPE", "tTRANSMITAS", "tTYPEDEF", "tUNION", "tUNIQUE", + "tSWITCHTYPE", "tTRANSMITAS", "tTRUE", "tTYPEDEF", "tUNION", "tUNIQUE", "tUNSIGNED", "tUUID", "tV1ENUM", "tVARARG", "tVERSION", "tVOID", - "tWCHAR", "tWIREMARSHAL", "tPOINTERTYPE", "','", "COND", "'|'", "'&'", - "'-'", "'+'", "'*'", "'/'", "'~'", "CAST", "PPTR", "NEG", "';'", "'('", - "')'", "'{'", "'}'", "'['", "']'", "':'", "'='", "'?'", "'.'", - "$accept", "input", "gbl_statements", "imp_statements", - "int_statements", "statement", "cppquote", "import_start", "import", - "libraryhdr", "library_start", "librarydef", "m_args", "no_args", - "args", "arg", "array", "array_list", "m_attributes", "attributes", - "attrib_list", "attribute", "callconv", "cases", "case", "constdef", - "enums", "enum_list", "enum", "enumdef", "m_expr", "expr", + "tWCHAR", "tWIREMARSHAL", "','", "'?'", "':'", "'|'", "'&'", "'-'", + "'+'", "'*'", "'/'", "'~'", "CAST", "PPTR", "NEG", "';'", "'('", "')'", + "'{'", "'}'", "'['", "']'", "'='", "'.'", "$accept", "input", + "gbl_statements", "imp_statements", "int_statements", "statement", + "cppquote", "import_start", "import", "importlib", "libraryhdr", + "library_start", "librarydef", "m_args", "no_args", "args", "arg", + "array", "array_list", "m_attributes", "attributes", "attrib_list", + "attribute", "callconv", "cases", "case", "constdef", "enums", + "enum_list", "enum", "enumdef", "m_exprs", "m_expr", "expr", "expr_list_const", "expr_const", "externdef", "fields", "field", "s_field", "funcdef", "m_ident", "t_ident", "ident", "base_type", "m_int", "int_std", "coclass", "coclasshdr", "coclassdef", @@ -825,458 +857,498 @@ static const unsigned short yytoknum[] = 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 44, 377, 124, 38, 45, 43, 42, 47, - 126, 378, 379, 380, 59, 40, 41, 123, 125, 91, - 93, 58, 61, 63, 46 + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 44, 63, 58, 124, 38, 45, 43, 42, 47, + 126, 386, 387, 388, 59, 40, 41, 123, 125, 91, + 93, 61, 46 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { - 0, 145, 146, 147, 147, 147, 147, 147, 147, 147, - 148, 148, 148, 148, 148, 148, 149, 149, 149, 150, - 150, 150, 150, 150, 150, 150, 150, 150, 151, 152, - 153, 154, 155, 156, 157, 157, 158, 159, 159, 159, - 160, 160, 160, 160, 161, 161, 161, 162, 162, 162, - 163, 163, 164, 165, 165, 165, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 167, 167, 168, - 168, 169, 169, 170, 171, 171, 171, 172, 172, 173, - 173, 174, 175, 175, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 177, 177, 178, 179, 180, 180, 181, 181, - 181, 181, 182, 183, 184, 184, 185, 185, 185, 186, - 186, 186, 186, 186, 186, 187, 187, 187, 187, 187, - 187, 187, 187, 187, 187, 187, 187, 188, 188, 189, - 189, 189, 189, 189, 189, 189, 190, 190, 191, 192, - 193, 193, 194, 195, 195, 196, 197, 197, 198, 198, - 199, 200, 200, 201, 201, 202, 203, 203, 203, 204, - 204, 205, 205, 206, 207, 208, 208, 209, 209, 209, - 210, 210, 211, 211, 212, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 214, 215, 215, 216, 216 + 0, 153, 154, 155, 155, 155, 155, 155, 155, 155, + 155, 156, 156, 156, 156, 156, 156, 156, 156, 157, + 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 166, + 167, 168, 168, 168, 169, 169, 169, 169, 170, 170, + 170, 171, 171, 171, 172, 172, 173, 174, 174, 174, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 176, 176, 177, 177, 178, 178, 179, 180, 180, 180, + 181, 181, 182, 182, 183, 184, 184, 185, 185, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 187, + 187, 188, 189, 190, 190, 191, 191, 191, 191, 192, + 193, 194, 194, 195, 195, 195, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 196, 197, 197, 197, 197, + 197, 197, 197, 197, 197, 197, 197, 197, 198, 198, + 199, 199, 199, 199, 199, 199, 199, 200, 200, 201, + 202, 203, 203, 204, 205, 205, 206, 207, 207, 208, + 208, 209, 210, 210, 211, 211, 212, 213, 213, 213, + 214, 214, 215, 215, 216, 217, 218, 218, 219, 219, + 219, 220, 220, 221, 221, 221, 222, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 224, 225, + 225, 226, 226 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { - 0, 2, 1, 0, 2, 2, 2, 2, 2, 2, - 0, 2, 2, 2, 2, 2, 0, 3, 2, 1, - 2, 1, 2, 2, 1, 2, 2, 2, 4, 3, - 3, 2, 3, 3, 0, 1, 1, 1, 3, 1, - 4, 3, 6, 5, 0, 3, 3, 1, 3, 4, - 0, 1, 3, 1, 3, 4, 1, 1, 4, 4, - 1, 1, 1, 1, 1, 4, 4, 4, 1, 4, - 4, 4, 1, 1, 4, 4, 4, 4, 4, 1, - 4, 1, 4, 5, 1, 1, 4, 1, 1, 1, - 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 4, 1, 1, 4, 4, 4, - 1, 4, 1, 1, 4, 4, 1, 0, 1, 0, - 2, 4, 3, 5, 0, 2, 1, 1, 3, 3, - 1, 5, 0, 1, 1, 1, 1, 5, 3, 3, - 3, 3, 3, 3, 3, 3, 2, 2, 2, 4, - 4, 3, 1, 3, 1, 4, 0, 2, 2, 3, - 2, 1, 4, 7, 0, 1, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, - 2, 2, 2, 2, 1, 1, 2, 2, 2, 4, - 0, 2, 2, 2, 2, 2, 2, 3, 2, 3, - 5, 0, 2, 2, 2, 2, 5, 7, 1, 2, - 2, 2, 2, 2, 4, 2, 2, 1, 1, 3, - 1, 3, 1, 1, 5, 1, 1, 1, 2, 1, - 2, 1, 2, 1, 2, 4, 5, 10, 1, 3 + 0, 2, 1, 0, 2, 2, 3, 2, 2, 2, + 2, 0, 2, 2, 3, 2, 2, 2, 2, 0, + 3, 2, 1, 2, 1, 2, 2, 1, 2, 2, + 2, 4, 3, 3, 4, 2, 3, 3, 0, 1, + 1, 1, 3, 1, 4, 3, 6, 5, 0, 3, + 3, 1, 3, 4, 0, 1, 3, 1, 3, 4, + 0, 1, 1, 1, 1, 1, 4, 4, 1, 1, + 1, 1, 1, 1, 4, 4, 1, 1, 4, 1, + 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, + 1, 4, 1, 4, 1, 5, 1, 1, 4, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, + 1, 1, 1, 6, 1, 1, 1, 1, 4, 1, + 1, 4, 4, 4, 4, 1, 1, 4, 4, 1, + 0, 1, 0, 2, 4, 3, 5, 0, 2, 1, + 1, 3, 3, 1, 5, 1, 3, 0, 1, 1, + 1, 1, 1, 1, 5, 3, 3, 3, 3, 3, + 3, 3, 3, 2, 2, 2, 4, 4, 3, 1, + 3, 1, 4, 0, 2, 2, 3, 2, 1, 4, + 7, 0, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 1, 1, 1, 1, 1, 1, 1, 0, 1, + 1, 2, 1, 2, 2, 1, 1, 2, 2, 2, + 4, 0, 2, 2, 2, 2, 2, 2, 3, 2, + 3, 5, 0, 2, 2, 2, 2, 5, 7, 1, + 2, 2, 2, 2, 2, 4, 2, 2, 1, 1, + 3, 1, 3, 1, 1, 1, 5, 1, 1, 1, + 2, 1, 2, 1, 2, 1, 2, 4, 4, 5, + 10, 1, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const unsigned char yydefact[] = +static const unsigned short yydefact[] = { - 3, 0, 2, 1, 0, 0, 0, 166, 0, 0, - 0, 166, 50, 166, 19, 0, 9, 21, 10, 24, - 10, 8, 0, 0, 0, 0, 0, 6, 0, 0, - 218, 0, 211, 5, 4, 0, 7, 0, 0, 0, - 236, 184, 175, 195, 0, 183, 166, 185, 181, 186, - 187, 189, 194, 187, 187, 0, 182, 187, 166, 166, - 180, 235, 176, 239, 237, 177, 241, 0, 243, 0, - 203, 204, 167, 168, 0, 0, 0, 213, 214, 0, - 0, 51, 0, 56, 57, 0, 0, 60, 61, 62, - 63, 64, 0, 0, 68, 0, 0, 72, 73, 0, - 0, 0, 0, 0, 79, 0, 81, 0, 0, 84, - 85, 0, 87, 88, 89, 90, 91, 92, 93, 0, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 0, - 105, 106, 0, 0, 0, 110, 0, 112, 113, 0, - 0, 0, 53, 116, 0, 0, 0, 0, 0, 0, - 198, 205, 215, 223, 20, 22, 23, 200, 220, 0, - 219, 0, 0, 16, 25, 26, 27, 238, 240, 188, - 193, 192, 191, 178, 190, 242, 244, 179, 169, 170, - 171, 172, 173, 174, 0, 0, 124, 0, 29, 156, - 0, 0, 156, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 2, 1, 0, 0, 0, 0, 183, 0, + 0, 0, 183, 54, 183, 22, 60, 10, 24, 11, + 27, 11, 9, 0, 0, 0, 0, 0, 0, 7, + 0, 0, 239, 0, 232, 5, 4, 0, 8, 0, + 0, 0, 217, 218, 258, 205, 196, 216, 0, 204, + 183, 206, 202, 207, 208, 210, 215, 208, 0, 208, + 0, 203, 212, 183, 183, 201, 257, 197, 261, 259, + 198, 263, 0, 265, 0, 224, 225, 184, 185, 0, + 0, 0, 234, 235, 0, 0, 55, 0, 61, 62, + 63, 64, 65, 0, 0, 68, 69, 70, 71, 72, + 73, 0, 76, 77, 0, 79, 0, 0, 83, 84, + 0, 0, 0, 0, 0, 90, 0, 92, 0, 94, + 0, 96, 97, 0, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 0, 109, 110, 111, 255, 112, 0, + 114, 253, 115, 116, 117, 0, 119, 120, 0, 0, + 0, 254, 0, 125, 126, 0, 0, 0, 57, 129, + 0, 0, 0, 0, 0, 219, 226, 236, 244, 23, + 25, 26, 6, 221, 241, 0, 240, 0, 0, 19, + 28, 29, 30, 260, 262, 209, 214, 213, 0, 211, + 199, 264, 266, 200, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 0, 0, 137, 0, 32, 173, + 0, 0, 173, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 147, 0, 0, + 147, 0, 0, 0, 0, 0, 0, 60, 56, 33, + 0, 17, 18, 0, 0, 15, 13, 12, 16, 37, + 35, 242, 243, 36, 54, 0, 54, 0, 233, 19, + 54, 0, 0, 31, 0, 139, 140, 143, 172, 54, + 0, 0, 0, 248, 249, 251, 268, 54, 54, 0, + 153, 149, 150, 151, 0, 152, 0, 0, 0, 0, + 171, 0, 169, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 145, 148, + 0, 0, 0, 0, 0, 0, 0, 271, 0, 0, + 58, 60, 0, 14, 220, 0, 222, 227, 0, 0, + 0, 54, 0, 54, 245, 21, 0, 0, 267, 136, + 144, 138, 0, 178, 256, 0, 55, 174, 0, 247, + 246, 0, 0, 0, 269, 66, 0, 164, 165, 163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 52, 30, 15, - 0, 13, 12, 11, 14, 33, 196, 197, 31, 221, - 222, 32, 50, 0, 50, 0, 212, 16, 50, 0, - 28, 0, 126, 127, 130, 155, 50, 0, 0, 0, - 227, 228, 230, 245, 50, 50, 0, 136, 134, 135, - 0, 0, 0, 0, 0, 154, 0, 152, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 232, 233, 0, 0, 0, 0, 0, - 0, 248, 0, 0, 54, 0, 199, 0, 201, 206, - 0, 0, 0, 50, 0, 50, 224, 18, 0, 0, - 123, 131, 125, 0, 161, 234, 0, 51, 157, 0, - 226, 225, 0, 0, 0, 246, 58, 0, 147, 148, - 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 59, 66, 65, 67, 69, 70, 71, - 74, 75, 76, 77, 78, 80, 82, 0, 86, 94, - 104, 107, 108, 109, 111, 0, 114, 115, 55, 202, - 208, 0, 207, 210, 0, 16, 216, 117, 17, 128, - 129, 243, 160, 158, 229, 231, 164, 0, 151, 0, - 144, 145, 138, 139, 141, 140, 142, 143, 0, 153, - 83, 249, 44, 209, 50, 118, 0, 159, 0, 165, - 150, 149, 0, 132, 162, 217, 0, 119, 137, 0, - 0, 47, 133, 34, 0, 46, 0, 45, 235, 0, - 39, 35, 37, 0, 0, 0, 0, 247, 120, 48, - 0, 163, 0, 0, 44, 0, 50, 49, 38, 44, - 34, 41, 50, 122, 34, 40, 0, 121, 0, 43, - 42 + 0, 0, 67, 75, 74, 78, 80, 81, 82, 85, + 86, 87, 88, 89, 91, 93, 0, 147, 98, 108, + 0, 118, 121, 122, 123, 124, 0, 127, 128, 59, + 0, 223, 229, 0, 228, 231, 0, 19, 237, 130, + 20, 141, 142, 265, 177, 175, 250, 252, 181, 0, + 168, 0, 161, 162, 0, 155, 156, 158, 157, 159, + 160, 170, 95, 146, 0, 272, 34, 48, 230, 54, + 131, 0, 176, 0, 182, 167, 166, 0, 113, 147, + 179, 238, 0, 132, 154, 0, 0, 51, 38, 0, + 50, 0, 49, 257, 0, 43, 39, 41, 0, 0, + 0, 0, 270, 133, 52, 0, 180, 0, 0, 48, + 0, 54, 53, 42, 48, 38, 45, 54, 135, 38, + 44, 0, 134, 0, 47, 46 }; /* YYDEFGOTO[NTERM-NUM]. */ static const short yydefgoto[] = { - -1, 1, 2, 144, 238, 307, 17, 18, 19, 149, - 20, 21, 429, 430, 431, 432, 414, 420, 308, 81, - 141, 142, 406, 424, 438, 23, 241, 242, 243, 63, - 421, 265, 266, 267, 25, 246, 318, 319, 309, 408, - 74, 250, 64, 170, 65, 150, 26, 221, 232, 298, - 28, 29, 234, 303, 30, 162, 31, 32, 222, 223, - 153, 35, 224, 251, 252, 253, 143, 66, 434, 38, - 68, 292 + -1, 1, 2, 160, 260, 335, 18, 19, 20, 242, + 164, 21, 22, 464, 465, 466, 467, 450, 456, 336, + 86, 157, 158, 441, 459, 473, 24, 264, 265, 266, + 68, 307, 308, 290, 291, 292, 26, 269, 347, 348, + 337, 443, 79, 273, 69, 186, 70, 165, 28, 245, + 254, 326, 30, 31, 256, 331, 32, 178, 33, 34, + 246, 247, 168, 37, 248, 274, 275, 276, 159, 71, + 469, 40, 73, 318 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -395 +#define YYPACT_NINF -447 static const short yypact[] = { - -395, 59, 631, -395, 603, -65, 119, 134, 46, 88, - 136, 134, -34, 134, -395, 814, -395, -395, -395, -395, - -395, -395, 16, -27, 10, 34, 35, -395, 63, 38, - -395, 68, 69, -395, -395, 76, -395, 86, 93, 98, - -395, -395, -395, -395, 603, -395, 176, -395, -395, -395, - 62, -395, -395, 62, 62, -5, -395, 62, 185, 187, - -5, -395, -395, -395, -395, -395, -395, 13, -395, 127, - -395, -395, -395, -395, 87, 603, 102, -395, -395, 101, - 603, -395, -82, -395, -395, 15, 104, -395, -395, -395, - -395, -395, 116, 120, -395, 121, 123, -395, -395, 124, - 125, 128, 129, 130, -395, 131, -395, 132, 135, -395, - -395, 137, -395, -395, -395, -395, -395, -395, -395, 138, - -395, -395, -395, -395, -395, -395, -395, -395, -395, 139, - -395, -395, 140, 141, 142, -395, 143, -395, -395, 144, - 145, -79, -395, -395, 504, 620, 189, 251, 192, 146, - -395, -395, -395, -395, -395, -395, -395, -395, -395, 195, - -395, 196, 162, -395, -395, -395, -395, -395, 164, -395, - -395, -395, -395, -395, -395, 164, -70, -395, -395, -395, - -395, -395, -395, -395, 158, 166, 13, 13, -395, -395, - 485, 173, -395, 13, 470, 279, 264, 304, 458, 470, - 305, 308, 470, 309, 470, 13, 265, 485, -55, 485, - 470, 603, 603, 312, 317, 603, 814, 184, -395, -395, - 20, -395, -395, -395, -395, -395, -395, -395, -395, -395, - -395, -395, 66, 188, -57, 191, -395, -395, 656, 470, - -395, 194, 203, -395, 200, -395, -25, -22, 485, 485, - -395, -395, -395, 208, -34, -19, 197, -395, -395, -395, - 199, 470, 470, 470, 464, 239, -85, -395, 207, 212, - 214, 217, 219, 220, 221, 223, 224, 225, 226, 235, - 236, 341, -83, -395, -395, 237, -72, 58, 238, 240, - 241, 234, 244, 245, -395, 814, -395, 8, -395, -395, - 206, 603, 254, 92, 325, 686, -395, -395, 603, 256, - -395, -395, 13, 470, -395, -395, 603, 257, -395, 259, - -395, -395, 262, 485, 263, -395, -395, 603, 249, 249, - 249, 90, 266, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, -395, -395, -395, -395, -395, -395, -395, - -395, -395, -395, -395, -395, -395, -395, 267, -395, -395, - -395, -395, -395, -395, -395, 389, -395, -395, -395, -395, - -395, 485, -395, -395, 281, -395, -395, 313, -395, -395, - -395, 285, -395, -395, -395, -395, 13, 284, -395, 470, - 249, 249, 258, 167, 100, 100, 23, 23, 163, -395, - -395, -395, 283, -395, 707, -395, 485, -395, 286, -395, - -395, 249, 470, 516, -395, -395, 289, -395, 239, 41, - -59, -395, 239, 299, -7, -395, 470, 287, -33, 292, - -395, 303, -395, 603, 485, 470, 290, -395, -395, 239, - 470, -395, 407, 485, -23, 211, -37, 239, -395, -11, - 299, -395, -37, -395, 299, -395, 296, -395, 297, -395, - -395 + -447, 43, 696, -447, 65, 655, -111, 97, 109, 35, + 78, 118, 109, -46, 109, -447, 809, -447, -447, -447, + -447, -447, -447, 66, -30, 2, 13, 16, -5, -447, + 26, 40, -447, 38, 76, -447, -447, 50, -447, 67, + 69, 71, -447, -447, -447, -447, -447, -447, 655, -447, + 129, -447, -447, -447, 161, -447, -447, 161, 91, 161, + 10, -447, -447, 182, 191, 10, -447, -447, -447, -447, + -447, -447, 587, -447, 235, -447, -447, -447, -447, 96, + 655, 102, -447, -447, 103, 655, -447, -94, -447, -447, + -447, -447, -447, 108, 110, -447, -447, -447, -447, -447, + -447, 112, -447, -447, 114, -447, 121, 127, -447, -447, + 130, 135, 136, 137, 138, -447, 142, -447, 144, -447, + 146, -447, -447, 147, -447, -447, -447, -447, -447, -447, + -447, -447, -447, 148, -447, -447, -447, -447, -447, 149, + -447, -447, -447, -447, -447, 152, -447, -447, 156, 158, + 159, -447, 160, -447, -447, 165, 166, -100, -447, -447, + 528, 665, 271, 201, 167, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, 214, -447, 203, 168, -447, + -447, -447, -447, -447, 169, -447, -447, -447, 655, -447, + -447, 169, -82, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, 172, 173, 587, 587, -447, -447, + 223, 175, -447, 587, 246, 9, 305, 320, 99, 246, + 321, 323, 246, 326, 246, 587, 280, 246, -68, 246, + 246, 246, 655, 655, 329, 334, 655, 809, 195, -447, + 200, -447, -447, 220, 196, -447, -447, -447, -447, -447, + -447, -447, -447, -447, 72, 218, -61, 206, -447, -447, + 892, 208, 246, -447, 209, 225, -447, 207, -447, -25, + -21, 223, 223, -447, -447, -447, 228, -46, -19, 216, + -447, -447, -447, -447, 215, -447, 246, 246, 246, 500, + 532, -84, -447, 217, 221, 224, 226, 231, 239, 241, + 242, 243, 247, 248, 249, 250, 361, -79, -447, 532, + 254, 238, -76, 267, 261, 262, 263, 219, 264, 265, + -447, 809, 359, -447, -447, -16, -447, -447, 279, 655, + 270, 92, 347, 901, -447, -447, 655, 272, -447, -447, + -447, 587, 246, -447, -447, 655, 273, -447, 275, -447, + -447, 274, 223, 277, -447, -447, 655, -447, -447, -447, + 297, 278, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, 282, 246, -447, -447, + 246, -447, -447, -447, -447, -447, 416, -447, -447, -447, + 284, -447, -447, 223, -447, -447, 281, -447, -447, 314, + -447, -447, -447, 294, -447, -447, -447, -447, 587, 295, + -447, 246, -447, -447, 449, 64, 53, 14, 14, 212, + 212, -447, -447, -447, 300, -447, -447, 298, -447, 910, + -447, 223, -447, 301, -447, -447, -447, 246, -447, 375, + -447, -447, 306, -447, 532, 74, -93, -447, 269, -8, + -447, 246, 303, -60, 304, -447, 322, -447, 655, 223, + 246, 324, -447, -447, 532, 246, -447, 418, 223, -18, + 519, -71, 532, -447, -11, 269, -447, -71, -447, 269, + -447, 308, -447, 309, -447, -447 }; /* YYPGOTO[NTERM-NUM]. */ static const short yypgoto[] = { - -395, -395, -395, 414, -211, 7, -395, -395, 147, -395, - -395, -395, -325, -395, -395, -6, -370, -395, -9, -2, - -395, -202, -395, -395, -395, -395, -395, -395, 133, 4, - -395, -178, -395, -177, -395, 250, -394, -219, 152, -395, - 17, -60, -395, 64, 44, -395, -395, 439, -395, -395, - -17, -395, -395, -395, -395, -395, -14, -395, 444, 0, - -395, -395, 445, 209, -236, -167, 252, 9, -3, -395, - 2, -395 + -447, -447, -447, 437, -251, 7, -447, -447, 131, -447, + -447, -447, -447, -350, -447, -447, -7, -397, -447, -9, + -2, -447, -214, -447, -447, -447, -447, -447, -447, 120, + 3, 244, -357, -191, -447, -173, -447, 253, -446, -229, + 145, -447, 46, -70, -447, 34, 51, 20, -447, 466, + -447, -447, -12, -447, -447, -447, -447, -447, -10, -447, + 467, 4, -447, -447, 475, 211, -253, -447, 258, 5, + -4, -447, 1, -447 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -168 +#define YYTABLE_NINF -185 static const short yytable[] = { - 22, 67, 34, 80, 39, 151, 24, 184, 152, 16, - 247, 37, 321, 322, 294, 302, 178, 179, 269, 435, - 300, 273, 274, 43, 191, 277, 305, 279, 79, 180, - 82, 436, 287, 333, 334, 324, -167, 342, 283, 323, - 282, 167, 286, 216, 257, 146, 258, 259, 6, 146, - 323, 343, 453, 358, 50, 192, 6, 284, 457, 3, - 6, 217, 310, 426, 360, 51, 52, -167, 333, 334, - 69, 53, 187, 181, 451, 79, 82, 190, 75, 455, - 10, 427, 15, 328, 329, 330, 331, 385, 10, -36, - 147, 54, 10, 368, 148, 76, 57, 314, 148, 173, - 333, 334, 15, -36, 177, 15, 248, 154, 182, 314, - 333, 334, 450, 315, 15, 314, 413, 171, 172, 325, - 15, 174, 70, 71, 454, 456, 244, 245, 413, 458, - 183, 437, 169, 256, 185, 402, 380, 72, 73, 77, - 78, 260, 220, 220, 155, 280, 39, 39, 24, 24, - 193, 219, 219, 37, 37, 390, 391, 392, 393, 394, - 395, 396, 397, 398, 404, 399, 341, 261, 156, 262, - 416, 263, 157, 333, 334, 159, 264, 333, 334, 168, - 73, 425, 335, 336, 337, 338, 339, 340, 175, 73, - 176, 73, 226, 227, 361, 229, 230, 158, 444, 235, - 236, 341, 160, 151, 296, 15, 152, 449, 288, 289, - 161, 411, 293, 163, 335, 336, 337, 338, 339, 340, - 164, 333, 334, 297, 186, 301, 388, 165, 339, 340, - 373, 15, 166, 341, 418, 422, 188, 316, 189, 194, - 39, 329, 24, 341, 317, 301, 316, 37, 439, 333, - 334, 195, 244, 317, 228, 196, 197, 445, 198, 199, - 200, 332, 447, 201, 202, 203, 204, 205, 333, 334, - 206, 270, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 233, 257, 231, 258, 259, 268, 335, 336, 337, - 338, 339, 340, 337, 338, 339, 340, 369, 371, 237, - 239, -167, 240, 40, 412, 377, 341, 39, 254, 24, - 341, 271, 275, 371, 37, 276, 278, 281, 381, 41, - 290, 42, 291, 295, 387, 312, 409, 43, 304, 299, - 323, 44, 311, 326, 327, 335, 336, 337, 338, 339, - 340, 45, 313, 344, 357, 46, 47, 370, 345, 48, - 346, 49, 452, 347, 341, 348, 349, 350, 50, 351, - 352, 353, 354, 335, 336, 337, 338, 339, 340, 51, - 52, 355, 356, 359, 362, 53, 363, 364, 365, 260, - 366, 367, 341, 336, 337, 338, 339, 340, 372, 9, - 378, 382, 341, 383, 401, 54, 55, 56, 384, 386, - 57, 341, 389, 400, 58, 261, 39, 262, 24, 263, - 59, 40, 60, 37, 264, 403, 405, 428, 62, 407, - 410, 433, 413, 417, 423, 442, 440, 41, 441, 42, - 443, 446, 459, 460, 145, 43, 448, 316, 15, 44, - 433, 27, 255, 316, 317, 379, 33, 36, 433, 45, - 317, 375, 433, 46, 47, 374, 320, 48, 0, 49, - 285, 257, 0, 258, 259, 272, 50, 257, 40, 258, - 259, 0, 0, 257, 0, 258, 259, 51, 52, 0, - 0, 0, 0, 53, 41, 0, 42, 0, 178, 179, - 0, 0, 43, 0, 0, 0, 44, 0, 0, 0, - 0, 180, 0, 54, 55, 56, 45, 0, 57, 0, - 46, 47, 58, 218, 48, 0, 49, 247, 59, 257, - 60, 258, 259, 50, 0, 61, 62, 0, 0, 0, - 0, 0, 0, 0, 51, 52, 4, 0, 0, 0, - 53, 5, 0, 0, 6, 181, 15, 0, 0, 0, - 7, 0, 0, 8, 0, 0, 0, 0, 260, 0, - 54, 55, 56, 0, 260, 57, 0, 0, 9, 58, - 260, 0, 0, 0, 0, 59, 10, 60, 0, 0, - 182, 0, 61, 62, 261, 0, 262, 0, 263, 0, - 261, 0, 262, 264, 263, 0, 261, 0, 262, 264, - 263, 0, 183, 0, 0, 264, 0, 40, 0, 11, - 0, 0, 0, 248, 12, 13, 260, 0, 0, 0, - 249, 0, 0, 41, 0, 42, 0, 0, 0, 0, - 0, 43, 0, 0, 0, 44, 0, 0, 14, 0, - 0, 0, 261, 15, 419, 45, 263, 0, 0, 46, - 47, 264, 4, 48, 0, 49, 0, 5, 0, 0, - 6, 0, 50, 4, 0, 0, 7, 0, 5, 8, - 0, 6, 0, 51, 52, 0, 0, 7, 0, 53, - 8, 0, 0, 0, 9, 0, 0, 0, 4, 0, - 0, 0, 10, 5, 0, 9, 0, 0, 0, 54, - 55, 56, 7, 10, 57, 8, 0, 0, 58, 0, - 0, 0, 0, 0, 59, 0, 60, 0, 4, 0, - 9, 61, 62, 5, 0, 11, 0, 0, 0, 0, - 12, 13, 7, 0, 0, 8, 11, 0, 0, 4, - 0, 12, 13, 0, 5, 0, 0, 0, 0, 0, - 9, 0, 0, 7, 14, 0, 8, 0, 225, 15, - 0, 11, 0, 0, 0, 14, 12, 13, 0, 0, - 15, 9, 0, 0, 0, 0, 0, 0, 0, 0, + 23, 72, 204, 41, 85, 25, 36, 39, 333, 17, + 270, 166, 280, 167, 281, 282, 293, 470, 350, 351, + 328, 211, 27, 320, 362, 363, 7, 330, 137, 471, + 433, 237, 141, -184, 74, 488, 309, 47, 461, 309, + 313, 492, 294, 3, 183, 298, 299, 371, 353, 302, + 238, 304, 387, 212, 151, 387, 311, 462, 84, 11, + 87, 283, 372, 362, 363, -184, 80, 388, 42, 43, + 391, -40, 54, 343, 362, 363, 207, 280, 16, 281, + 282, 210, 486, 55, 56, 81, -40, 490, 16, 339, + 57, 187, 457, 189, 4, 357, 358, 359, 360, 417, + 75, 76, 280, 16, 281, 282, 297, 399, 7, 84, + 87, 190, 77, 78, 169, 59, 193, 271, 284, 343, + 62, 82, 83, 344, 16, 343, 283, 485, 285, 354, + 16, 449, 184, 78, 489, 491, 267, 268, 449, 493, + 472, 11, 173, 279, 162, 286, 170, 287, 163, 288, + 437, 283, 369, 370, 289, 305, 439, 171, 243, 243, + 172, 41, 41, 25, 25, 39, 39, 241, 241, 412, + 174, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 244, 244, 176, 284, 261, 191, 78, 175, 452, 367, + 368, 369, 370, 285, 192, 78, 309, 179, 431, 366, + 367, 368, 369, 370, 251, 252, 257, 258, 284, 177, + 286, 180, 287, 181, 288, 182, 479, 434, 285, 289, + 324, 16, 362, 363, 460, 484, 194, 195, 314, 315, + 446, 166, 319, 167, 185, 286, 188, 287, 196, 288, + 405, 16, 205, 206, 289, 325, 208, 329, 4, 280, + 209, 281, 282, 213, 270, 214, 454, 215, 309, 216, + 345, 41, 7, 25, 358, 39, 217, 346, 329, 345, + 474, 267, 218, 44, 250, 219, 346, 362, 363, 480, + 220, 221, 222, 223, 482, 361, 197, 224, 45, 225, + 46, 226, 227, 228, 229, 11, 47, 230, 283, 198, + 48, 231, 163, 232, 233, 234, 255, 362, 363, 199, + 235, 236, 295, 49, 253, 259, -184, 50, 51, 263, + 277, 200, 52, 262, 53, 403, 201, 296, 300, 401, + 301, 54, 409, 303, 41, 306, 25, 316, 39, 317, + 323, 403, 55, 56, 321, 322, 413, 202, 444, 57, + 203, 327, 419, 332, 338, 284, 341, 340, 342, 352, + 356, 271, 355, 373, 386, 285, 400, 374, 272, 390, + 375, 396, 376, 58, 59, 60, 61, 377, 280, 62, + 281, 282, 286, 63, 287, 378, 288, 379, 380, 381, + 64, 289, 65, 382, 383, 384, 385, 463, 67, 364, + 389, 365, 366, 367, 368, 369, 370, 393, 394, 395, + 397, 398, 402, 392, 404, 10, 410, 414, 16, 415, + 416, 435, 44, 418, 421, 438, 440, 283, 432, 364, + 436, 365, 366, 367, 368, 369, 370, 45, 442, 46, + 41, 445, 25, 420, 39, 47, 448, 449, 453, 48, + 476, 458, 475, 477, 494, 495, 468, 481, 161, 362, + 363, 411, 49, 407, 478, 278, 50, 51, 29, 35, + 483, 52, 345, 53, 312, 468, 406, 38, 345, 346, + 54, 349, 0, 468, 284, 346, 310, 468, 0, 0, + 0, 55, 56, 0, 285, 0, 0, 0, 57, 0, + 0, 0, 0, 280, 44, 281, 282, 0, 0, 0, + 0, 286, 0, 455, 0, 288, 0, 0, 0, 45, + 289, 46, 58, 59, 60, 61, 0, 47, 62, 362, + 363, 48, 63, 0, 0, 0, 0, 239, 0, 64, + 0, 65, 362, 363, 49, 0, 66, 67, 50, 51, + 0, 0, 283, 52, 0, 53, 4, 0, 0, 5, + 0, 0, 54, 0, 6, 0, 0, 16, 0, 0, + 7, 0, 0, 55, 56, 0, 8, 0, 0, 9, + 57, 364, 447, 365, 366, 367, 368, 369, 370, 0, + 194, 195, 0, 0, 0, 0, 10, 240, 0, 0, + 0, 0, 196, 11, 58, 59, 60, 61, 0, 284, + 62, 0, 0, 0, 63, 0, 0, 0, 0, 285, + 0, 64, 0, 65, 0, 0, 0, 0, 66, 67, + 0, 0, 0, 0, 0, 0, 286, 0, 287, 0, + 288, 0, 12, 0, 0, 289, 0, 0, 13, 14, + 197, 364, 487, 365, 366, 367, 368, 369, 370, 44, + 0, 0, 0, 198, 364, 0, 365, 366, 367, 368, + 369, 370, 15, 199, 45, 0, 46, 16, 0, 0, + 0, 0, 47, 0, 0, 200, 48, 0, 0, 0, + 201, 0, 0, 4, 0, 0, 5, 0, 0, 49, + 0, 6, 0, 50, 51, 0, 0, 7, 52, 0, + 53, 202, 0, 8, 203, 0, 9, 54, 0, 0, + 0, 0, 0, 0, 4, 0, 0, 5, 55, 56, + 0, 0, 6, 10, 240, 57, 0, 0, 7, 0, + 11, 0, 0, 0, 8, 0, 0, 9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, + 59, 60, 61, 0, 10, 62, 0, 0, 0, 63, + 0, 11, 0, 0, 0, 0, 64, 0, 65, 12, + 0, 0, 0, 66, 67, 13, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 14, 11, 0, 0, 306, 15, 12, 13, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, + 12, 0, 0, 249, 16, 0, 13, 14, 0, 0, + 0, 88, 0, 89, 90, 0, 91, 92, 0, 0, + 0, 0, 93, 0, 94, 0, 0, 0, 0, 0, + 15, 95, 96, 97, 98, 16, 99, 100, 101, 102, + 103, 0, 104, 0, 105, 106, 107, 0, 0, 108, + 0, 0, 0, 109, 0, 110, 111, 112, 113, 114, + 115, 0, 116, 117, 118, 119, 120, 0, 0, 121, + 0, 122, 0, 0, 0, 0, 123, 0, 124, 0, + 0, 0, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 0, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 0, 0, 0, 0, 145, 0, 0, + 146, 0, 147, 5, 0, 148, 149, 150, 6, 0, + 0, 151, 5, 152, 153, 154, 155, 6, 0, 156, + 8, 5, 0, 9, 0, 0, 6, 0, 0, 8, + 0, 0, 9, 0, 0, 0, 0, 0, 8, 0, + 10, 9, 0, 0, 0, 0, 0, 0, 0, 10, + 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 11, 0, 0, 0, 0, 12, 13, 0, - 14, 0, 0, 0, 376, 15, 0, 0, 0, 0, - 83, 0, 84, 0, 0, 0, 0, 0, 85, 0, - 86, 14, 0, 0, 0, 415, 15, 87, 88, 89, - 90, 0, 91, 92, 0, 93, 0, 94, 95, 96, - 0, 0, 97, 0, 0, 98, 0, 99, 100, 101, - 102, 103, 104, 0, 105, 106, 107, 108, 0, 0, - 109, 0, 0, 110, 0, 0, 0, 111, 0, 112, - 0, 0, 0, 113, 114, 115, 116, 117, 118, 119, - 0, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 0, 0, 0, 129, 0, 0, 130, 0, 131, 0, - 0, 132, 133, 134, 0, 0, 135, 0, 136, 137, - 138, 139, 0, 0, 140 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 13, 14, 0, 12, 0, 0, 0, 0, + 0, 13, 14, 0, 12, 0, 0, 0, 0, 0, + 13, 14, 0, 0, 0, 0, 15, 0, 0, 0, + 334, 16, 0, 0, 0, 15, 0, 0, 0, 408, + 16, 0, 0, 0, 15, 0, 0, 0, 451, 16 }; static const short yycheck[] = { - 2, 4, 2, 12, 2, 22, 2, 67, 22, 2, - 32, 2, 248, 249, 216, 234, 3, 4, 195, 26, - 77, 198, 199, 28, 106, 202, 237, 204, 11, 16, - 13, 38, 210, 10, 11, 254, 106, 122, 93, 122, - 207, 44, 209, 122, 3, 29, 5, 6, 40, 29, - 122, 136, 446, 136, 59, 137, 40, 112, 452, 0, - 40, 140, 239, 122, 136, 70, 71, 137, 10, 11, - 135, 76, 75, 60, 444, 58, 59, 80, 32, 449, - 72, 140, 139, 261, 262, 263, 264, 323, 72, 122, - 74, 96, 72, 295, 78, 7, 101, 134, 78, 55, - 10, 11, 139, 136, 60, 139, 128, 134, 95, 134, - 10, 11, 135, 138, 139, 134, 139, 53, 54, 138, - 139, 57, 3, 4, 135, 450, 186, 187, 139, 454, - 117, 138, 70, 193, 7, 371, 313, 3, 4, 3, - 4, 100, 144, 145, 134, 205, 144, 145, 144, 145, - 135, 144, 145, 144, 145, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 375, 342, 143, 126, 134, 128, - 406, 130, 137, 10, 11, 137, 135, 10, 11, 3, - 4, 140, 124, 125, 126, 127, 128, 129, 3, 4, - 3, 4, 3, 4, 136, 3, 4, 134, 434, 3, - 4, 143, 134, 220, 138, 139, 220, 443, 211, 212, - 141, 389, 215, 137, 124, 125, 126, 127, 128, 129, - 134, 10, 11, 232, 137, 234, 136, 134, 128, 129, - 138, 139, 134, 143, 412, 413, 134, 246, 137, 135, - 238, 419, 238, 143, 246, 254, 255, 238, 426, 10, - 11, 135, 312, 255, 3, 135, 135, 435, 135, 135, - 135, 264, 440, 135, 135, 135, 135, 135, 10, 11, - 135, 7, 135, 135, 135, 135, 135, 135, 135, 135, - 135, 86, 3, 137, 5, 6, 7, 124, 125, 126, - 127, 128, 129, 126, 127, 128, 129, 297, 301, 137, - 142, 137, 136, 4, 141, 308, 143, 305, 135, 305, - 143, 7, 7, 316, 305, 7, 7, 52, 316, 20, - 8, 22, 5, 139, 327, 122, 386, 28, 137, 141, - 122, 32, 138, 136, 135, 124, 125, 126, 127, 128, - 129, 42, 142, 136, 3, 46, 47, 141, 136, 50, - 136, 52, 141, 136, 143, 136, 136, 136, 59, 136, - 136, 136, 136, 124, 125, 126, 127, 128, 129, 70, - 71, 136, 136, 136, 136, 76, 136, 136, 144, 100, - 136, 136, 143, 125, 126, 127, 128, 129, 134, 64, - 134, 134, 143, 134, 5, 96, 97, 98, 136, 136, - 101, 143, 136, 136, 105, 126, 404, 128, 404, 130, - 111, 4, 113, 404, 135, 134, 103, 118, 119, 134, - 136, 423, 139, 137, 135, 122, 139, 20, 136, 22, - 433, 141, 136, 136, 20, 28, 442, 446, 139, 32, - 442, 2, 192, 452, 446, 312, 2, 2, 450, 42, - 452, 304, 454, 46, 47, 303, 247, 50, -1, 52, - 208, 3, -1, 5, 6, 7, 59, 3, 4, 5, - 6, -1, -1, 3, -1, 5, 6, 70, 71, -1, - -1, -1, -1, 76, 20, -1, 22, -1, 3, 4, - -1, -1, 28, -1, -1, -1, 32, -1, -1, -1, - -1, 16, -1, 96, 97, 98, 42, -1, 101, -1, - 46, 47, 105, 9, 50, -1, 52, 32, 111, 3, - 113, 5, 6, 59, -1, 118, 119, -1, -1, -1, - -1, -1, -1, -1, 70, 71, 32, -1, -1, -1, - 76, 37, -1, -1, 40, 60, 139, -1, -1, -1, - 46, -1, -1, 49, -1, -1, -1, -1, 100, -1, - 96, 97, 98, -1, 100, 101, -1, -1, 64, 105, - 100, -1, -1, -1, -1, 111, 72, 113, -1, -1, - 95, -1, 118, 119, 126, -1, 128, -1, 130, -1, - 126, -1, 128, 135, 130, -1, 126, -1, 128, 135, - 130, -1, 117, -1, -1, 135, -1, 4, -1, 105, - -1, -1, -1, 128, 110, 111, 100, -1, -1, -1, - 135, -1, -1, 20, -1, 22, -1, -1, -1, -1, - -1, 28, -1, -1, -1, 32, -1, -1, 134, -1, - -1, -1, 126, 139, 128, 42, 130, -1, -1, 46, - 47, 135, 32, 50, -1, 52, -1, 37, -1, -1, - 40, -1, 59, 32, -1, -1, 46, -1, 37, 49, - -1, 40, -1, 70, 71, -1, -1, 46, -1, 76, - 49, -1, -1, -1, 64, -1, -1, -1, 32, -1, - -1, -1, 72, 37, -1, 64, -1, -1, -1, 96, - 97, 98, 46, 72, 101, 49, -1, -1, 105, -1, - -1, -1, -1, -1, 111, -1, 113, -1, 32, -1, - 64, 118, 119, 37, -1, 105, -1, -1, -1, -1, - 110, 111, 46, -1, -1, 49, 105, -1, -1, 32, - -1, 110, 111, -1, 37, -1, -1, -1, -1, -1, - 64, -1, -1, 46, 134, -1, 49, -1, 138, 139, - -1, 105, -1, -1, -1, 134, 110, 111, -1, -1, - 139, 64, -1, -1, -1, -1, -1, -1, -1, -1, + 2, 5, 72, 2, 13, 2, 2, 2, 259, 2, + 31, 23, 3, 23, 5, 6, 7, 25, 271, 272, + 81, 115, 2, 237, 10, 11, 42, 256, 96, 37, + 387, 131, 100, 115, 145, 481, 227, 27, 131, 230, + 231, 487, 215, 0, 48, 218, 219, 131, 277, 222, + 150, 224, 131, 147, 122, 131, 229, 150, 12, 75, + 14, 52, 146, 10, 11, 147, 31, 146, 3, 4, + 146, 131, 62, 144, 10, 11, 80, 3, 149, 5, + 6, 85, 479, 73, 74, 7, 146, 484, 149, 262, + 80, 57, 449, 59, 28, 286, 287, 288, 289, 352, + 3, 4, 3, 149, 5, 6, 7, 321, 42, 63, + 64, 60, 3, 4, 144, 105, 65, 138, 109, 144, + 110, 3, 4, 148, 149, 144, 52, 145, 119, 148, + 149, 149, 3, 4, 145, 485, 206, 207, 149, 489, + 148, 75, 147, 213, 78, 136, 144, 138, 82, 140, + 403, 52, 138, 139, 145, 225, 407, 144, 160, 161, + 144, 160, 161, 160, 161, 160, 161, 160, 161, 342, + 144, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 160, 161, 144, 109, 188, 3, 4, 147, 441, 136, + 137, 138, 139, 119, 3, 4, 387, 147, 371, 135, + 136, 137, 138, 139, 3, 4, 3, 4, 109, 133, + 136, 144, 138, 144, 140, 144, 469, 390, 119, 145, + 148, 149, 10, 11, 150, 478, 3, 4, 232, 233, + 421, 243, 236, 243, 73, 136, 145, 138, 15, 140, + 148, 149, 7, 147, 145, 254, 144, 256, 28, 3, + 147, 5, 6, 145, 31, 145, 447, 145, 449, 145, + 269, 260, 42, 260, 455, 260, 145, 269, 277, 278, + 461, 341, 145, 4, 3, 145, 278, 10, 11, 470, + 145, 145, 145, 145, 475, 289, 63, 145, 19, 145, + 21, 145, 145, 145, 145, 75, 27, 145, 52, 76, + 31, 145, 82, 145, 145, 145, 92, 10, 11, 86, + 145, 145, 7, 44, 147, 147, 147, 48, 49, 146, + 145, 98, 53, 151, 55, 329, 103, 7, 7, 325, + 7, 62, 336, 7, 333, 55, 333, 8, 333, 5, + 144, 345, 73, 74, 149, 145, 345, 124, 418, 80, + 127, 133, 356, 147, 146, 109, 131, 148, 151, 131, + 145, 138, 146, 146, 3, 119, 7, 146, 145, 131, + 146, 152, 146, 104, 105, 106, 107, 146, 3, 110, + 5, 6, 136, 114, 138, 146, 140, 146, 146, 146, + 121, 145, 123, 146, 146, 146, 146, 128, 129, 132, + 146, 134, 135, 136, 137, 138, 139, 146, 146, 146, + 146, 146, 133, 146, 144, 68, 144, 144, 149, 144, + 146, 5, 4, 146, 146, 144, 112, 52, 146, 132, + 146, 134, 135, 136, 137, 138, 139, 19, 144, 21, + 439, 146, 439, 146, 439, 27, 146, 149, 147, 31, + 146, 145, 149, 131, 146, 146, 458, 133, 21, 10, + 11, 341, 44, 332, 468, 212, 48, 49, 2, 2, + 477, 53, 481, 55, 230, 477, 331, 2, 487, 481, + 62, 270, -1, 485, 109, 487, 228, 489, -1, -1, + -1, 73, 74, -1, 119, -1, -1, -1, 80, -1, + -1, -1, -1, 3, 4, 5, 6, -1, -1, -1, + -1, 136, -1, 138, -1, 140, -1, -1, -1, 19, + 145, 21, 104, 105, 106, 107, -1, 27, 110, 10, + 11, 31, 114, -1, -1, -1, -1, 9, -1, 121, + -1, 123, 10, 11, 44, -1, 128, 129, 48, 49, + -1, -1, 52, 53, -1, 55, 28, -1, -1, 31, + -1, -1, 62, -1, 36, -1, -1, 149, -1, -1, + 42, -1, -1, 73, 74, -1, 48, -1, -1, 51, + 80, 132, 133, 134, 135, 136, 137, 138, 139, -1, + 3, 4, -1, -1, -1, -1, 68, 69, -1, -1, + -1, -1, 15, 75, 104, 105, 106, 107, -1, 109, + 110, -1, -1, -1, 114, -1, -1, -1, -1, 119, + -1, 121, -1, 123, -1, -1, -1, -1, 128, 129, + -1, -1, -1, -1, -1, -1, 136, -1, 138, -1, + 140, -1, 114, -1, -1, 145, -1, -1, 120, 121, + 63, 132, 133, 134, 135, 136, 137, 138, 139, 4, + -1, -1, -1, 76, 132, -1, 134, 135, 136, 137, + 138, 139, 144, 86, 19, -1, 21, 149, -1, -1, + -1, -1, 27, -1, -1, 98, 31, -1, -1, -1, + 103, -1, -1, 28, -1, -1, 31, -1, -1, 44, + -1, 36, -1, 48, 49, -1, -1, 42, 53, -1, + 55, 124, -1, 48, 127, -1, 51, 62, -1, -1, + -1, -1, -1, -1, 28, -1, -1, 31, 73, 74, + -1, -1, 36, 68, 69, 80, -1, -1, 42, -1, + 75, -1, -1, -1, 48, -1, -1, 51, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, + 105, 106, 107, -1, 68, 110, -1, -1, -1, 114, + -1, 75, -1, -1, -1, -1, 121, -1, 123, 114, + -1, -1, -1, 128, 129, 120, 121, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 134, 105, -1, -1, 138, 139, 110, 111, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 144, + 114, -1, -1, 148, 149, -1, 120, 121, -1, -1, + -1, 12, -1, 14, 15, -1, 17, 18, -1, -1, + -1, -1, 23, -1, 25, -1, -1, -1, -1, -1, + 144, 32, 33, 34, 35, 149, 37, 38, 39, 40, + 41, -1, 43, -1, 45, 46, 47, -1, -1, 50, + -1, -1, -1, 54, -1, 56, 57, 58, 59, 60, + 61, -1, 63, 64, 65, 66, 67, -1, -1, 70, + -1, 72, -1, -1, -1, -1, 77, -1, 79, -1, + -1, -1, 83, 84, 85, 86, 87, 88, 89, 90, + 91, -1, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, -1, -1, -1, -1, 108, -1, -1, + 111, -1, 113, 31, -1, 116, 117, 118, 36, -1, + -1, 122, 31, 124, 125, 126, 127, 36, -1, 130, + 48, 31, -1, 51, -1, -1, 36, -1, -1, 48, + -1, -1, 51, -1, -1, -1, -1, -1, 48, -1, + 68, 51, -1, -1, -1, -1, -1, -1, -1, 68, + -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 105, -1, -1, -1, -1, 110, 111, -1, - 134, -1, -1, -1, 138, 139, -1, -1, -1, -1, - 16, -1, 18, -1, -1, -1, -1, -1, 24, -1, - 26, 134, -1, -1, -1, 138, 139, 33, 34, 35, - 36, -1, 38, 39, -1, 41, -1, 43, 44, 45, - -1, -1, 48, -1, -1, 51, -1, 53, 54, 55, - 56, 57, 58, -1, 60, 61, 62, 63, -1, -1, - 66, -1, -1, 69, -1, -1, -1, 73, -1, 75, - -1, -1, -1, 79, 80, 81, 82, 83, 84, 85, - -1, 87, 88, 89, 90, 91, 92, 93, 94, 95, - -1, -1, -1, 99, -1, -1, 102, -1, 104, -1, - -1, 107, 108, 109, -1, -1, 112, -1, 114, 115, - 116, 117, -1, -1, 120 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 114, -1, -1, -1, + -1, -1, 120, 121, -1, 114, -1, -1, -1, -1, + -1, 120, 121, -1, 114, -1, -1, -1, -1, -1, + 120, 121, -1, -1, -1, -1, 144, -1, -1, -1, + 148, 149, -1, -1, -1, 144, -1, -1, -1, 148, + 149, -1, -1, -1, 144, -1, -1, -1, 148, 149 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { - 0, 146, 147, 0, 32, 37, 40, 46, 49, 64, - 72, 105, 110, 111, 134, 139, 150, 151, 152, 153, - 155, 156, 164, 170, 174, 179, 191, 192, 195, 196, - 199, 201, 202, 203, 204, 206, 207, 212, 214, 215, - 4, 20, 22, 28, 32, 42, 46, 47, 50, 52, - 59, 70, 71, 76, 96, 97, 98, 101, 105, 111, - 113, 118, 119, 174, 187, 189, 212, 213, 215, 135, - 3, 4, 3, 4, 185, 32, 7, 3, 4, 185, - 163, 164, 185, 16, 18, 24, 26, 33, 34, 35, - 36, 38, 39, 41, 43, 44, 45, 48, 51, 53, - 54, 55, 56, 57, 58, 60, 61, 62, 63, 66, - 69, 73, 75, 79, 80, 81, 82, 83, 84, 85, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 99, - 102, 104, 107, 108, 109, 112, 114, 115, 116, 117, - 120, 165, 166, 211, 148, 148, 29, 74, 78, 154, - 190, 195, 201, 205, 134, 134, 134, 137, 134, 137, - 134, 141, 200, 137, 134, 134, 134, 213, 3, 70, - 188, 188, 188, 189, 188, 3, 3, 189, 3, 4, - 16, 60, 95, 117, 186, 7, 137, 213, 134, 137, - 213, 106, 137, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 135, 135, 122, 140, 9, 150, - 164, 192, 203, 204, 207, 138, 3, 4, 3, 3, - 4, 137, 193, 86, 197, 3, 4, 137, 149, 142, - 136, 171, 172, 173, 186, 186, 180, 32, 128, 135, - 186, 208, 209, 210, 135, 180, 186, 3, 5, 6, - 100, 126, 128, 130, 135, 176, 177, 178, 7, 178, - 7, 7, 7, 178, 178, 7, 7, 178, 7, 178, - 186, 52, 210, 93, 112, 211, 210, 176, 213, 213, - 8, 5, 216, 213, 166, 139, 138, 163, 194, 141, - 77, 163, 182, 198, 137, 149, 138, 150, 163, 183, - 178, 138, 122, 142, 134, 138, 163, 164, 181, 182, - 208, 209, 209, 122, 182, 138, 136, 135, 176, 176, - 176, 176, 213, 10, 11, 124, 125, 126, 127, 128, - 129, 143, 122, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 3, 136, 136, - 136, 136, 136, 136, 136, 144, 136, 136, 166, 204, - 141, 213, 134, 138, 183, 153, 138, 213, 134, 173, - 178, 215, 134, 134, 136, 209, 136, 213, 136, 136, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 178, - 136, 5, 209, 134, 149, 103, 167, 134, 184, 186, - 136, 176, 141, 139, 161, 138, 209, 137, 176, 128, - 162, 175, 176, 135, 168, 140, 122, 140, 118, 157, - 158, 159, 160, 164, 213, 26, 38, 138, 169, 176, - 139, 136, 122, 213, 209, 176, 141, 176, 160, 209, - 135, 161, 141, 181, 135, 161, 157, 181, 157, 136, - 136 + 0, 154, 155, 0, 28, 31, 36, 42, 48, 51, + 68, 75, 114, 120, 121, 144, 149, 158, 159, 160, + 161, 164, 165, 173, 179, 183, 189, 200, 201, 202, + 205, 206, 209, 211, 212, 213, 214, 216, 217, 222, + 224, 225, 3, 4, 4, 19, 21, 27, 31, 44, + 48, 49, 53, 55, 62, 73, 74, 80, 104, 105, + 106, 107, 110, 114, 121, 123, 128, 129, 183, 197, + 199, 222, 223, 225, 145, 3, 4, 3, 4, 195, + 31, 7, 3, 4, 195, 172, 173, 195, 12, 14, + 15, 17, 18, 23, 25, 32, 33, 34, 35, 37, + 38, 39, 40, 41, 43, 45, 46, 47, 50, 54, + 56, 57, 58, 59, 60, 61, 63, 64, 65, 66, + 67, 70, 72, 77, 79, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 108, 111, 113, 116, 117, + 118, 122, 124, 125, 126, 127, 130, 174, 175, 221, + 156, 156, 78, 82, 163, 200, 205, 211, 215, 144, + 144, 144, 144, 147, 144, 147, 144, 133, 210, 147, + 144, 144, 144, 223, 3, 73, 198, 198, 145, 198, + 199, 3, 3, 199, 3, 4, 15, 63, 76, 86, + 98, 103, 124, 127, 196, 7, 147, 223, 144, 147, + 223, 115, 147, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 131, 150, 9, + 69, 158, 162, 173, 200, 202, 213, 214, 217, 148, + 3, 3, 4, 147, 203, 92, 207, 3, 4, 147, + 157, 223, 151, 146, 180, 181, 182, 196, 196, 190, + 31, 138, 145, 196, 218, 219, 220, 145, 190, 196, + 3, 5, 6, 52, 109, 119, 136, 138, 140, 145, + 186, 187, 188, 7, 188, 7, 7, 7, 188, 188, + 7, 7, 188, 7, 188, 196, 55, 184, 185, 186, + 221, 188, 184, 186, 223, 223, 8, 5, 226, 223, + 175, 149, 145, 144, 148, 172, 204, 133, 81, 172, + 192, 208, 147, 157, 148, 158, 172, 193, 146, 188, + 148, 131, 151, 144, 148, 172, 173, 191, 192, 218, + 219, 219, 131, 192, 148, 146, 145, 186, 186, 186, + 186, 223, 10, 11, 132, 134, 135, 136, 137, 138, + 139, 131, 146, 146, 146, 146, 146, 146, 146, 146, + 146, 146, 146, 146, 146, 146, 3, 131, 146, 146, + 131, 146, 146, 146, 146, 146, 152, 146, 146, 175, + 7, 214, 133, 223, 144, 148, 193, 161, 148, 223, + 144, 182, 188, 225, 144, 144, 146, 219, 146, 223, + 146, 146, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 188, 146, 185, 188, 5, 146, 219, 144, 157, + 112, 176, 144, 194, 196, 146, 186, 133, 146, 149, + 170, 148, 219, 147, 186, 138, 171, 185, 145, 177, + 150, 131, 150, 128, 166, 167, 168, 169, 173, 223, + 25, 37, 148, 178, 186, 149, 146, 131, 223, 219, + 186, 133, 186, 169, 219, 145, 170, 133, 191, 145, + 170, 166, 191, 166, 146, 146 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) @@ -1886,198 +1958,227 @@ yyreduce: switch (yyn) { case 2: -#line 228 "parser.y" +#line 239 "parser.y" { write_proxies(yyvsp[0].ifref); write_client(yyvsp[0].ifref); write_server(yyvsp[0].ifref); ;} break; case 3: -#line 231 "parser.y" +#line 242 "parser.y" { yyval.ifref = NULL; ;} break; case 4: -#line 232 "parser.y" +#line 243 "parser.y" { yyval.ifref = yyvsp[-1].ifref; ;} break; case 5: -#line 233 "parser.y" +#line 244 "parser.y" { yyval.ifref = make_ifref(yyvsp[0].type); LINK(yyval.ifref, yyvsp[-1].ifref); ;} break; case 6: -#line 234 "parser.y" - { yyval.ifref = yyvsp[-1].ifref; add_coclass(yyvsp[0].clas); ;} +#line 245 "parser.y" + { yyval.ifref = yyvsp[-2].ifref; + reg_type(yyvsp[-1].type, yyvsp[-1].type->name, 0); + if (!parse_only && do_header) write_coclass_forward(yyvsp[-1].type); + ;} break; case 7: -#line 235 "parser.y" - { yyval.ifref = yyvsp[-1].ifref; add_module(yyvsp[0].type); ;} +#line 249 "parser.y" + { yyval.ifref = yyvsp[-1].ifref; + add_coclass(yyvsp[0].type); + reg_type(yyvsp[0].type, yyvsp[0].type->name, 0); + ;} break; case 8: -#line 236 "parser.y" - { yyval.ifref = yyvsp[-1].ifref; ;} +#line 253 "parser.y" + { yyval.ifref = yyvsp[-1].ifref; add_module(yyvsp[0].type); ;} break; case 9: -#line 237 "parser.y" +#line 254 "parser.y" { yyval.ifref = yyvsp[-1].ifref; ;} break; case 10: -#line 240 "parser.y" - {;} +#line 255 "parser.y" + { yyval.ifref = yyvsp[-1].ifref; ;} break; case 11: -#line 241 "parser.y" - { if (!parse_only) add_interface(yyvsp[0].type); ;} - break; - - case 12: -#line 242 "parser.y" - { if (!parse_only) add_interface(yyvsp[0].type); ;} - break; - - case 13: -#line 243 "parser.y" - { if (!parse_only) add_coclass(yyvsp[0].clas); ;} - break; - - case 14: -#line 244 "parser.y" - { if (!parse_only) add_module(yyvsp[0].type); ;} - break; - - case 15: -#line 245 "parser.y" - {;} - break; - - case 16: -#line 248 "parser.y" - { yyval.func = NULL; ;} - break; - - case 17: -#line 249 "parser.y" - { yyval.func = yyvsp[-1].func; LINK(yyval.func, yyvsp[-2].func); ;} - break; - - case 18: -#line 250 "parser.y" - { yyval.func = yyvsp[-1].func; ;} - break; - - case 19: -#line 253 "parser.y" - {;} - break; - - case 20: -#line 254 "parser.y" - { if (!parse_only && do_header) { write_constdef(yyvsp[-1].var); } ;} - break; - - case 21: -#line 255 "parser.y" - {;} - break; - - case 22: -#line 256 "parser.y" - { if (!parse_only && do_header) { write_type(header, yyvsp[-1].type, NULL, NULL); fprintf(header, ";\n\n"); } ;} - break; - - case 23: -#line 257 "parser.y" - { if (!parse_only && do_header) { write_externdef(yyvsp[-1].var); } ;} - break; - - case 24: #line 258 "parser.y" {;} break; - case 25: + case 12: #line 259 "parser.y" + { if (!parse_only) add_interface(yyvsp[0].type); ;} + break; + + case 13: +#line 260 "parser.y" + { if (!parse_only) add_interface(yyvsp[0].type); ;} + break; + + case 14: +#line 261 "parser.y" + { reg_type(yyvsp[-1].type, yyvsp[-1].type->name, 0); if (!parse_only && do_header) write_coclass_forward(yyvsp[-1].type); ;} + break; + + case 15: +#line 262 "parser.y" + { if (!parse_only) add_coclass(yyvsp[0].type); + reg_type(yyvsp[0].type, yyvsp[0].type->name, 0); + ;} + break; + + case 16: +#line 265 "parser.y" + { if (!parse_only) add_module(yyvsp[0].type); ;} + break; + + case 17: +#line 266 "parser.y" + {;} + break; + + case 18: +#line 267 "parser.y" + {;} + break; + + case 19: +#line 270 "parser.y" + { yyval.func = NULL; ;} + break; + + case 20: +#line 271 "parser.y" + { yyval.func = yyvsp[-1].func; LINK(yyval.func, yyvsp[-2].func); ;} + break; + + case 21: +#line 272 "parser.y" + { yyval.func = yyvsp[-1].func; ;} + break; + + case 22: +#line 275 "parser.y" + {;} + break; + + case 23: +#line 276 "parser.y" + { if (!parse_only && do_header) { write_constdef(yyvsp[-1].var); } ;} + break; + + case 24: +#line 277 "parser.y" + {;} + break; + + case 25: +#line 278 "parser.y" { if (!parse_only && do_header) { write_type(header, yyvsp[-1].type, NULL, NULL); fprintf(header, ";\n\n"); } ;} break; case 26: -#line 260 "parser.y" - {;} +#line 279 "parser.y" + { if (!parse_only && do_header) { write_externdef(yyvsp[-1].var); } ;} break; case 27: -#line 261 "parser.y" - { if (!parse_only && do_header) { write_type(header, yyvsp[-1].type, NULL, NULL); fprintf(header, ";\n\n"); } ;} +#line 280 "parser.y" + {;} break; case 28: -#line 264 "parser.y" - { if (!parse_only && do_header) fprintf(header, "%s\n", yyvsp[-1].str); ;} +#line 281 "parser.y" + { if (!parse_only && do_header) { write_type(header, yyvsp[-1].type, NULL, NULL); fprintf(header, ";\n\n"); } ;} break; case 29: -#line 266 "parser.y" +#line 282 "parser.y" + {;} + break; + + case 30: +#line 283 "parser.y" + { if (!parse_only && do_header) { write_type(header, yyvsp[-1].type, NULL, NULL); fprintf(header, ";\n\n"); } ;} + break; + + case 31: +#line 286 "parser.y" + { if (!parse_only && do_header) fprintf(header, "%s\n", yyvsp[-1].str); ;} + break; + + case 32: +#line 288 "parser.y" { assert(yychar == YYEMPTY); if (!do_import(yyvsp[-1].str)) yychar = aEOF; ;} break; - case 30: -#line 269 "parser.y" + case 33: +#line 291 "parser.y" {;} break; - case 31: -#line 272 "parser.y" + case 34: +#line 294 "parser.y" + { if(!parse_only) add_importlib(yyvsp[-1].str); ;} + break; + + case 35: +#line 297 "parser.y" { yyval.str = yyvsp[0].str; ;} break; - case 32: -#line 274 "parser.y" - { start_typelib(yyvsp[-1].str, yyvsp[-2].attr); ;} + case 36: +#line 299 "parser.y" + { start_typelib(yyvsp[-1].str, yyvsp[-2].attr); + if (!parse_only && do_header) write_library(yyvsp[-1].str, yyvsp[-2].attr); ;} break; - case 33: -#line 276 "parser.y" + case 37: +#line 302 "parser.y" { end_typelib(); ;} break; - case 34: -#line 279 "parser.y" - { yyval.var = NULL; ;} - break; - - case 36: -#line 283 "parser.y" - { yyval.var = NULL; ;} - break; - case 38: -#line 287 "parser.y" - { LINK(yyvsp[0].var, yyvsp[-2].var); yyval.var = yyvsp[0].var; ;} +#line 305 "parser.y" + { yyval.var = NULL; ;} break; case 40: -#line 292 "parser.y" +#line 309 "parser.y" + { yyval.var = NULL; ;} + break; + + case 42: +#line 313 "parser.y" + { LINK(yyvsp[0].var, yyvsp[-2].var); yyval.var = yyvsp[0].var; ;} + break; + + case 44: +#line 318 "parser.y" { yyval.var = yyvsp[-1].var; set_type(yyval.var, yyvsp[-2].tref, yyvsp[0].expr); yyval.var->attrs = yyvsp[-3].attr; ;} break; - case 41: -#line 296 "parser.y" + case 45: +#line 322 "parser.y" { yyval.var = yyvsp[-1].var; set_type(yyval.var, yyvsp[-2].tref, yyvsp[0].expr); ;} break; - case 42: -#line 299 "parser.y" + case 46: +#line 325 "parser.y" { yyval.var = yyvsp[-3].var; yyval.var->ptr_level--; set_type(yyval.var, yyvsp[-4].tref, NULL); @@ -2086,8 +2187,8 @@ yyreduce: ;} break; - case 43: -#line 305 "parser.y" + case 47: +#line 331 "parser.y" { yyval.var = yyvsp[-3].var; yyval.var->ptr_level--; set_type(yyval.var, yyvsp[-4].tref, NULL); @@ -2095,671 +2196,762 @@ yyreduce: ;} break; - case 44: -#line 312 "parser.y" + case 48: +#line 338 "parser.y" { yyval.expr = NULL; ;} break; - case 45: -#line 313 "parser.y" + case 49: +#line 339 "parser.y" { yyval.expr = yyvsp[-1].expr; ;} break; - case 46: -#line 314 "parser.y" + case 50: +#line 340 "parser.y" { yyval.expr = make_expr(EXPR_VOID); ;} break; - case 48: -#line 318 "parser.y" + case 52: +#line 344 "parser.y" { LINK(yyvsp[0].expr, yyvsp[-2].expr); yyval.expr = yyvsp[0].expr; ;} break; - case 49: -#line 319 "parser.y" + case 53: +#line 345 "parser.y" { LINK(yyvsp[0].expr, yyvsp[-3].expr); yyval.expr = yyvsp[0].expr; ;} break; - case 50: -#line 322 "parser.y" + case 54: +#line 348 "parser.y" { yyval.attr = NULL; ;} break; - case 52: -#line 327 "parser.y" - { yyval.attr = yyvsp[-1].attr; ;} - break; - - case 54: -#line 331 "parser.y" - { LINK(yyvsp[0].attr, yyvsp[-2].attr); yyval.attr = yyvsp[0].attr; ;} - break; - - case 55: -#line 332 "parser.y" - { LINK(yyvsp[0].attr, yyvsp[-3].attr); yyval.attr = yyvsp[0].attr; ;} - break; - case 56: -#line 336 "parser.y" - { yyval.attr = make_attr(ATTR_ASYNC); ;} - break; - - case 57: -#line 337 "parser.y" - { yyval.attr = make_attr(ATTR_AUTO_HANDLE); ;} +#line 353 "parser.y" + { yyval.attr = yyvsp[-1].attr; + if (!yyval.attr) + yyerror("empty attribute lists unsupported"); + ;} break; case 58: -#line 338 "parser.y" - { yyval.attr = make_attrp(ATTR_CALLAS, yyvsp[-1].var); ;} +#line 360 "parser.y" + { if (yyvsp[0].attr) { LINK(yyvsp[0].attr, yyvsp[-2].attr); yyval.attr = yyvsp[0].attr; } + else { yyval.attr = yyvsp[-2].attr; } + ;} break; case 59: -#line 339 "parser.y" - { yyval.attr = make_attrp(ATTR_CASE, yyvsp[-1].expr); ;} +#line 363 "parser.y" + { if (yyvsp[0].attr) { LINK(yyvsp[0].attr, yyvsp[-3].attr); yyval.attr = yyvsp[0].attr; } + else { yyval.attr = yyvsp[-3].attr; } + ;} break; case 60: -#line 340 "parser.y" - { yyval.attr = make_attrv(ATTR_CONTEXTHANDLE, 0); ;} +#line 368 "parser.y" + { yyval.attr = NULL; ;} break; case 61: -#line 341 "parser.y" - { yyval.attr = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ ;} +#line 369 "parser.y" + { yyval.attr = make_attr(ATTR_AGGREGATABLE); ;} break; case 62: -#line 342 "parser.y" - { yyval.attr = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ ;} +#line 370 "parser.y" + { yyval.attr = make_attr(ATTR_APPOBJECT); ;} break; case 63: -#line 343 "parser.y" - { yyval.attr = make_attr(ATTR_CONTROL); ;} +#line 371 "parser.y" + { yyval.attr = make_attr(ATTR_ASYNC); ;} break; case 64: -#line 344 "parser.y" - { yyval.attr = make_attr(ATTR_DEFAULT); ;} +#line 372 "parser.y" + { yyval.attr = make_attr(ATTR_AUTO_HANDLE); ;} break; case 65: -#line 345 "parser.y" - { yyval.attr = make_attrp(ATTR_DEFAULTVALUE_EXPR, yyvsp[-1].expr); ;} +#line 373 "parser.y" + { yyval.attr = make_attr(ATTR_BINDABLE); ;} break; case 66: -#line 346 "parser.y" - { yyval.attr = make_attrp(ATTR_DEFAULTVALUE_STRING, yyvsp[-1].str); ;} +#line 374 "parser.y" + { yyval.attr = make_attrp(ATTR_CALLAS, yyvsp[-1].var); ;} break; case 67: -#line 347 "parser.y" - { yyval.attr = make_attrp(ATTR_DLLNAME, yyvsp[-1].str); ;} +#line 375 "parser.y" + { yyval.attr = make_attrp(ATTR_CASE, yyvsp[-1].expr); ;} break; case 68: -#line 348 "parser.y" - { yyval.attr = make_attr(ATTR_DUAL); ;} +#line 376 "parser.y" + { yyval.attr = make_attrv(ATTR_CONTEXTHANDLE, 0); ;} break; case 69: -#line 349 "parser.y" - { yyval.attr = make_attrp(ATTR_ENDPOINT, yyvsp[-1].str); ;} +#line 377 "parser.y" + { yyval.attr = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ ;} break; case 70: -#line 350 "parser.y" - { yyval.attr = make_attrp(ATTR_ENTRY_STRING, yyvsp[-1].str); ;} +#line 378 "parser.y" + { yyval.attr = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ ;} break; case 71: -#line 351 "parser.y" - { yyval.attr = make_attrp(ATTR_ENTRY_ORDINAL, yyvsp[-1].expr); ;} +#line 379 "parser.y" + { yyval.attr = make_attr(ATTR_CONTROL); ;} break; case 72: -#line 352 "parser.y" - { yyval.attr = make_attr(ATTR_EXPLICIT_HANDLE); ;} +#line 380 "parser.y" + { yyval.attr = make_attr(ATTR_DEFAULT); ;} break; case 73: -#line 353 "parser.y" - { yyval.attr = make_attr(ATTR_HANDLE); ;} +#line 381 "parser.y" + { yyval.attr = make_attr(ATTR_DEFAULTCOLLELEM); ;} break; case 74: -#line 354 "parser.y" - { yyval.attr = make_attrp(ATTR_HELPCONTEXT, yyvsp[-1].expr); ;} +#line 382 "parser.y" + { yyval.attr = make_attrp(ATTR_DEFAULTVALUE_EXPR, yyvsp[-1].expr); ;} break; case 75: -#line 355 "parser.y" - { yyval.attr = make_attrp(ATTR_HELPFILE, yyvsp[-1].str); ;} +#line 383 "parser.y" + { yyval.attr = make_attrp(ATTR_DEFAULTVALUE_STRING, yyvsp[-1].str); ;} break; case 76: -#line 356 "parser.y" - { yyval.attr = make_attrp(ATTR_HELPSTRING, yyvsp[-1].str); ;} +#line 384 "parser.y" + { yyval.attr = make_attr(ATTR_DEFAULTVTABLE); ;} break; case 77: -#line 357 "parser.y" - { yyval.attr = make_attrp(ATTR_HELPSTRINGCONTEXT, yyvsp[-1].expr); ;} +#line 385 "parser.y" + { yyval.attr = make_attr(ATTR_DISPLAYBIND); ;} break; case 78: -#line 358 "parser.y" - { yyval.attr = make_attrp(ATTR_HELPSTRINGDLL, yyvsp[-1].str); ;} +#line 386 "parser.y" + { yyval.attr = make_attrp(ATTR_DLLNAME, yyvsp[-1].str); ;} break; case 79: -#line 359 "parser.y" - { yyval.attr = make_attr(ATTR_HIDDEN); ;} +#line 387 "parser.y" + { yyval.attr = make_attr(ATTR_DUAL); ;} break; case 80: -#line 360 "parser.y" - { yyval.attr = make_attrp(ATTR_ID, yyvsp[-1].expr); ;} +#line 388 "parser.y" + { yyval.attr = make_attrp(ATTR_ENDPOINT, yyvsp[-1].str); ;} break; case 81: -#line 361 "parser.y" - { yyval.attr = make_attr(ATTR_IDEMPOTENT); ;} +#line 389 "parser.y" + { yyval.attr = make_attrp(ATTR_ENTRY_STRING, yyvsp[-1].str); ;} break; case 82: -#line 362 "parser.y" - { yyval.attr = make_attrp(ATTR_IIDIS, yyvsp[-1].var); ;} +#line 390 "parser.y" + { yyval.attr = make_attrp(ATTR_ENTRY_ORDINAL, yyvsp[-1].expr); ;} break; case 83: -#line 363 "parser.y" - { yyval.attr = make_attrp(ATTR_IMPLICIT_HANDLE, yyvsp[-1].str); ;} +#line 391 "parser.y" + { yyval.attr = make_attr(ATTR_EXPLICIT_HANDLE); ;} break; case 84: -#line 364 "parser.y" - { yyval.attr = make_attr(ATTR_IN); ;} +#line 392 "parser.y" + { yyval.attr = make_attr(ATTR_HANDLE); ;} break; case 85: -#line 365 "parser.y" - { yyval.attr = make_attr(ATTR_INPUTSYNC); ;} +#line 393 "parser.y" + { yyval.attr = make_attrp(ATTR_HELPCONTEXT, yyvsp[-1].expr); ;} break; case 86: -#line 366 "parser.y" - { yyval.attr = make_attrp(ATTR_LENGTHIS, yyvsp[-1].var); ;} +#line 394 "parser.y" + { yyval.attr = make_attrp(ATTR_HELPFILE, yyvsp[-1].str); ;} break; case 87: -#line 367 "parser.y" - { yyval.attr = make_attr(ATTR_LOCAL); ;} +#line 395 "parser.y" + { yyval.attr = make_attrp(ATTR_HELPSTRING, yyvsp[-1].str); ;} break; case 88: -#line 368 "parser.y" - { yyval.attr = make_attr(ATTR_NONCREATABLE); ;} +#line 396 "parser.y" + { yyval.attr = make_attrp(ATTR_HELPSTRINGCONTEXT, yyvsp[-1].expr); ;} break; case 89: -#line 369 "parser.y" - { yyval.attr = make_attr(ATTR_OBJECT); ;} +#line 397 "parser.y" + { yyval.attr = make_attrp(ATTR_HELPSTRINGDLL, yyvsp[-1].str); ;} break; case 90: -#line 370 "parser.y" - { yyval.attr = make_attr(ATTR_ODL); ;} +#line 398 "parser.y" + { yyval.attr = make_attr(ATTR_HIDDEN); ;} break; case 91: -#line 371 "parser.y" - { yyval.attr = make_attr(ATTR_OLEAUTOMATION); ;} +#line 399 "parser.y" + { yyval.attr = make_attrp(ATTR_ID, yyvsp[-1].expr); ;} break; case 92: -#line 372 "parser.y" - { yyval.attr = make_attr(ATTR_OPTIONAL); ;} +#line 400 "parser.y" + { yyval.attr = make_attr(ATTR_IDEMPOTENT); ;} break; case 93: -#line 373 "parser.y" - { yyval.attr = make_attr(ATTR_OUT); ;} +#line 401 "parser.y" + { yyval.attr = make_attrp(ATTR_IIDIS, yyvsp[-1].var); ;} break; case 94: -#line 374 "parser.y" - { yyval.attr = make_attrv(ATTR_POINTERDEFAULT, yyvsp[-1].num); ;} +#line 402 "parser.y" + { yyval.attr = make_attr(ATTR_IMMEDIATEBIND); ;} break; case 95: -#line 375 "parser.y" - { yyval.attr = make_attr(ATTR_PROPGET); ;} +#line 403 "parser.y" + { yyval.attr = make_attrp(ATTR_IMPLICIT_HANDLE, yyvsp[-1].str); ;} break; case 96: -#line 376 "parser.y" - { yyval.attr = make_attr(ATTR_PROPPUT); ;} +#line 404 "parser.y" + { yyval.attr = make_attr(ATTR_IN); ;} break; case 97: -#line 377 "parser.y" - { yyval.attr = make_attr(ATTR_PROPPUTREF); ;} +#line 405 "parser.y" + { yyval.attr = make_attr(ATTR_INPUTSYNC); ;} break; case 98: -#line 378 "parser.y" - { yyval.attr = make_attr(ATTR_PTR); ;} +#line 406 "parser.y" + { yyval.attr = make_attrp(ATTR_LENGTHIS, yyvsp[-1].expr); ;} break; case 99: -#line 379 "parser.y" - { yyval.attr = make_attr(ATTR_PUBLIC); ;} +#line 407 "parser.y" + { yyval.attr = make_attr(ATTR_LOCAL); ;} break; case 100: -#line 380 "parser.y" - { yyval.attr = make_attr(ATTR_READONLY); ;} +#line 408 "parser.y" + { yyval.attr = make_attr(ATTR_NONBROWSABLE); ;} break; case 101: -#line 381 "parser.y" - { yyval.attr = make_attr(ATTR_REF); ;} +#line 409 "parser.y" + { yyval.attr = make_attr(ATTR_NONCREATABLE); ;} break; case 102: -#line 382 "parser.y" - { yyval.attr = make_attr(ATTR_RESTRICTED); ;} +#line 410 "parser.y" + { yyval.attr = make_attr(ATTR_NONEXTENSIBLE); ;} break; case 103: -#line 383 "parser.y" - { yyval.attr = make_attr(ATTR_RETVAL); ;} +#line 411 "parser.y" + { yyval.attr = make_attr(ATTR_OBJECT); ;} break; case 104: -#line 384 "parser.y" - { yyval.attr = make_attrp(ATTR_SIZEIS, yyvsp[-1].var); ;} +#line 412 "parser.y" + { yyval.attr = make_attr(ATTR_ODL); ;} break; case 105: -#line 385 "parser.y" - { yyval.attr = make_attr(ATTR_SOURCE); ;} +#line 413 "parser.y" + { yyval.attr = make_attr(ATTR_OLEAUTOMATION); ;} break; case 106: -#line 386 "parser.y" - { yyval.attr = make_attr(ATTR_STRING); ;} +#line 414 "parser.y" + { yyval.attr = make_attr(ATTR_OPTIONAL); ;} break; case 107: -#line 387 "parser.y" - { yyval.attr = make_attrp(ATTR_SWITCHIS, yyvsp[-1].expr); ;} +#line 415 "parser.y" + { yyval.attr = make_attr(ATTR_OUT); ;} break; case 108: -#line 388 "parser.y" - { yyval.attr = make_attrp(ATTR_SWITCHTYPE, type_ref(yyvsp[-1].tref)); ;} +#line 416 "parser.y" + { yyval.attr = make_attrv(ATTR_POINTERDEFAULT, yyvsp[-1].num); ;} break; case 109: -#line 389 "parser.y" - { yyval.attr = make_attrp(ATTR_TRANSMITAS, type_ref(yyvsp[-1].tref)); ;} +#line 417 "parser.y" + { yyval.attr = make_attr(ATTR_PROPGET); ;} break; case 110: -#line 390 "parser.y" - { yyval.attr = make_attr(ATTR_UNIQUE); ;} +#line 418 "parser.y" + { yyval.attr = make_attr(ATTR_PROPPUT); ;} break; case 111: -#line 391 "parser.y" - { yyval.attr = make_attrp(ATTR_UUID, yyvsp[-1].uuid); ;} +#line 419 "parser.y" + { yyval.attr = make_attr(ATTR_PROPPUTREF); ;} break; case 112: -#line 392 "parser.y" - { yyval.attr = make_attr(ATTR_V1ENUM); ;} +#line 420 "parser.y" + { yyval.attr = make_attr(ATTR_PUBLIC); ;} break; case 113: -#line 393 "parser.y" - { yyval.attr = make_attr(ATTR_VARARG); ;} +#line 421 "parser.y" + { LINK(yyvsp[-1].expr, yyvsp[-3].expr); yyval.attr = make_attrp(ATTR_RANGE, yyvsp[-1].expr); ;} break; case 114: -#line 394 "parser.y" - { yyval.attr = make_attrv(ATTR_VERSION, yyvsp[-1].num); ;} +#line 422 "parser.y" + { yyval.attr = make_attr(ATTR_READONLY); ;} break; case 115: -#line 395 "parser.y" - { yyval.attr = make_attrp(ATTR_WIREMARSHAL, type_ref(yyvsp[-1].tref)); ;} +#line 423 "parser.y" + { yyval.attr = make_attr(ATTR_REQUESTEDIT); ;} break; case 116: -#line 396 "parser.y" - { yyval.attr = make_attrv(ATTR_POINTERTYPE, yyvsp[0].num); ;} +#line 424 "parser.y" + { yyval.attr = make_attr(ATTR_RESTRICTED); ;} + break; + + case 117: +#line 425 "parser.y" + { yyval.attr = make_attr(ATTR_RETVAL); ;} + break; + + case 118: +#line 426 "parser.y" + { yyval.attr = make_attrp(ATTR_SIZEIS, yyvsp[-1].expr); ;} break; case 119: -#line 403 "parser.y" - { yyval.var = NULL; ;} +#line 427 "parser.y" + { yyval.attr = make_attr(ATTR_SOURCE); ;} break; case 120: -#line 404 "parser.y" +#line 428 "parser.y" + { yyval.attr = make_attr(ATTR_STRING); ;} + break; + + case 121: +#line 429 "parser.y" + { yyval.attr = make_attrp(ATTR_SWITCHIS, yyvsp[-1].expr); ;} + break; + + case 122: +#line 430 "parser.y" + { yyval.attr = make_attrp(ATTR_SWITCHTYPE, type_ref(yyvsp[-1].tref)); ;} + break; + + case 123: +#line 431 "parser.y" + { yyval.attr = make_attrp(ATTR_TRANSMITAS, type_ref(yyvsp[-1].tref)); ;} + break; + + case 124: +#line 432 "parser.y" + { yyval.attr = make_attrp(ATTR_UUID, yyvsp[-1].uuid); ;} + break; + + case 125: +#line 433 "parser.y" + { yyval.attr = make_attr(ATTR_V1ENUM); ;} + break; + + case 126: +#line 434 "parser.y" + { yyval.attr = make_attr(ATTR_VARARG); ;} + break; + + case 127: +#line 435 "parser.y" + { yyval.attr = make_attrv(ATTR_VERSION, yyvsp[-1].num); ;} + break; + + case 128: +#line 436 "parser.y" + { yyval.attr = make_attrp(ATTR_WIREMARSHAL, type_ref(yyvsp[-1].tref)); ;} + break; + + case 129: +#line 437 "parser.y" + { yyval.attr = make_attrv(ATTR_POINTERTYPE, yyvsp[0].num); ;} + break; + + case 132: +#line 444 "parser.y" + { yyval.var = NULL; ;} + break; + + case 133: +#line 445 "parser.y" { if (yyvsp[0].var) { LINK(yyvsp[0].var, yyvsp[-1].var); yyval.var = yyvsp[0].var; } else { yyval.var = yyvsp[-1].var; } ;} break; - case 121: -#line 409 "parser.y" + case 134: +#line 450 "parser.y" { attr_t *a = make_attrp(ATTR_CASE, yyvsp[-2].expr); yyval.var = yyvsp[0].var; if (!yyval.var) yyval.var = make_var(NULL); LINK(a, yyval.var->attrs); yyval.var->attrs = a; ;} break; - case 122: -#line 413 "parser.y" + case 135: +#line 454 "parser.y" { attr_t *a = make_attr(ATTR_DEFAULT); yyval.var = yyvsp[0].var; if (!yyval.var) yyval.var = make_var(NULL); LINK(a, yyval.var->attrs); yyval.var->attrs = a; ;} break; - case 123: -#line 419 "parser.y" + case 136: +#line 460 "parser.y" { yyval.var = reg_const(yyvsp[-2].var); set_type(yyval.var, yyvsp[-3].tref, NULL); yyval.var->eval = yyvsp[0].expr; - yyval.var->lval = yyvsp[0].expr->cval; ;} break; - case 124: -#line 426 "parser.y" - { yyval.var = NULL; ;} - break; - - case 125: -#line 427 "parser.y" - { yyval.var = yyvsp[-1].var; ;} - break; - - case 128: -#line 432 "parser.y" - { LINK(yyvsp[0].var, yyvsp[-2].var); yyval.var = yyvsp[0].var; - if (yyvsp[-2].var && !yyvsp[0].var->eval) - yyvsp[0].var->lval = yyvsp[-2].var->lval + 1; - ;} - break; - - case 129: -#line 438 "parser.y" - { yyval.var = reg_const(yyvsp[-2].var); - yyval.var->eval = yyvsp[0].expr; - yyval.var->lval = yyvsp[0].expr->cval; - yyval.var->type = make_type(RPC_FC_LONG, &std_int); - ;} - break; - - case 130: -#line 443 "parser.y" - { yyval.var = reg_const(yyvsp[0].var); - yyval.var->lval = 0; /* default for first enum entry */ - yyval.var->type = make_type(RPC_FC_LONG, &std_int); - ;} - break; - - case 131: -#line 449 "parser.y" - { yyval.type = get_typev(RPC_FC_ENUM16, yyvsp[-3].var, tsENUM); - yyval.type->fields = yyvsp[-1].var; - yyval.type->defined = TRUE; - if(in_typelib) - add_enum(yyval.type); - ;} - break; - - case 132: -#line 471 "parser.y" - { yyval.expr = make_expr(EXPR_VOID); ;} - break; - - case 134: -#line 475 "parser.y" - { yyval.expr = make_exprl(EXPR_NUM, yyvsp[0].num); ;} - break; - - case 135: -#line 476 "parser.y" - { yyval.expr = make_exprl(EXPR_HEXNUM, yyvsp[0].num); ;} - break; - - case 136: -#line 477 "parser.y" - { yyval.expr = make_exprs(EXPR_IDENTIFIER, yyvsp[0].str); ;} - break; - case 137: -#line 478 "parser.y" - { yyval.expr = make_expr3(EXPR_COND, yyvsp[-4].expr, yyvsp[-2].expr, yyvsp[0].expr); ;} +#line 466 "parser.y" + { yyval.var = NULL; ;} break; case 138: -#line 479 "parser.y" - { yyval.expr = make_expr2(EXPR_OR , yyvsp[-2].expr, yyvsp[0].expr); ;} - break; - - case 139: -#line 480 "parser.y" - { yyval.expr = make_expr2(EXPR_AND, yyvsp[-2].expr, yyvsp[0].expr); ;} +#line 467 "parser.y" + { yyval.var = yyvsp[-1].var; ;} break; case 140: -#line 481 "parser.y" - { yyval.expr = make_expr2(EXPR_ADD, yyvsp[-2].expr, yyvsp[0].expr); ;} +#line 471 "parser.y" + { if (!yyval.var->eval) + yyval.var->eval = make_exprl(EXPR_NUM, 0 /* default for first enum entry */); + ;} break; case 141: -#line 482 "parser.y" - { yyval.expr = make_expr2(EXPR_SUB, yyvsp[-2].expr, yyvsp[0].expr); ;} +#line 474 "parser.y" + { LINK(yyvsp[0].var, yyvsp[-2].var); yyval.var = yyvsp[0].var; + if (!yyval.var->eval) + yyval.var->eval = make_exprl(EXPR_NUM, yyvsp[-2].var->eval->cval + 1); + ;} break; case 142: -#line 483 "parser.y" - { yyval.expr = make_expr2(EXPR_MUL, yyvsp[-2].expr, yyvsp[0].expr); ;} +#line 480 "parser.y" + { yyval.var = reg_const(yyvsp[-2].var); + yyval.var->eval = yyvsp[0].expr; + yyval.var->type = make_type(RPC_FC_LONG, &std_int); + ;} break; case 143: #line 484 "parser.y" - { yyval.expr = make_expr2(EXPR_DIV, yyvsp[-2].expr, yyvsp[0].expr); ;} - break; - - case 144: -#line 485 "parser.y" - { yyval.expr = make_expr2(EXPR_SHL, yyvsp[-2].expr, yyvsp[0].expr); ;} - break; - - case 145: -#line 486 "parser.y" - { yyval.expr = make_expr2(EXPR_SHR, yyvsp[-2].expr, yyvsp[0].expr); ;} - break; - - case 146: -#line 487 "parser.y" - { yyval.expr = make_expr1(EXPR_NOT, yyvsp[0].expr); ;} - break; - - case 147: -#line 488 "parser.y" - { yyval.expr = make_expr1(EXPR_NEG, yyvsp[0].expr); ;} - break; - - case 148: -#line 489 "parser.y" - { yyval.expr = make_expr1(EXPR_PPTR, yyvsp[0].expr); ;} - break; - - case 149: -#line 490 "parser.y" - { yyval.expr = make_exprt(EXPR_CAST, yyvsp[-2].tref, yyvsp[0].expr); ;} - break; - - case 150: -#line 491 "parser.y" - { yyval.expr = make_exprt(EXPR_SIZEOF, yyvsp[-1].tref, NULL); ;} - break; - - case 151: -#line 492 "parser.y" - { yyval.expr = yyvsp[-1].expr; ;} - break; - - case 153: -#line 496 "parser.y" - { LINK(yyvsp[0].expr, yyvsp[-2].expr); yyval.expr = yyvsp[0].expr; ;} - break; - - case 154: -#line 499 "parser.y" - { yyval.expr = yyvsp[0].expr; - if (!yyval.expr->is_const) - yyerror("expression is not constant\n"); + { yyval.var = reg_const(yyvsp[0].var); + yyval.var->type = make_type(RPC_FC_LONG, &std_int); ;} break; + case 144: +#line 489 "parser.y" + { yyval.type = get_typev(RPC_FC_ENUM16, yyvsp[-3].var, tsENUM); + yyval.type->fields = yyvsp[-1].var; + yyval.type->defined = TRUE; + if(in_typelib) + add_enum(yyval.type); + ;} + break; + + case 146: +#line 498 "parser.y" + { LINK(yyvsp[0].expr, yyvsp[-2].expr); yyval.expr = yyvsp[0].expr; ;} + break; + + case 147: +#line 511 "parser.y" + { yyval.expr = make_expr(EXPR_VOID); ;} + break; + + case 149: +#line 515 "parser.y" + { yyval.expr = make_exprl(EXPR_NUM, yyvsp[0].num); ;} + break; + + case 150: +#line 516 "parser.y" + { yyval.expr = make_exprl(EXPR_HEXNUM, yyvsp[0].num); ;} + break; + + case 151: +#line 517 "parser.y" + { yyval.expr = make_exprl(EXPR_TRUEFALSE, 0); ;} + break; + + case 152: +#line 518 "parser.y" + { yyval.expr = make_exprl(EXPR_TRUEFALSE, 1); ;} + break; + + case 153: +#line 519 "parser.y" + { yyval.expr = make_exprs(EXPR_IDENTIFIER, yyvsp[0].str); ;} + break; + + case 154: +#line 520 "parser.y" + { yyval.expr = make_expr3(EXPR_COND, yyvsp[-4].expr, yyvsp[-2].expr, yyvsp[0].expr); ;} + break; + case 155: -#line 505 "parser.y" +#line 521 "parser.y" + { yyval.expr = make_expr2(EXPR_OR , yyvsp[-2].expr, yyvsp[0].expr); ;} + break; + + case 156: +#line 522 "parser.y" + { yyval.expr = make_expr2(EXPR_AND, yyvsp[-2].expr, yyvsp[0].expr); ;} + break; + + case 157: +#line 523 "parser.y" + { yyval.expr = make_expr2(EXPR_ADD, yyvsp[-2].expr, yyvsp[0].expr); ;} + break; + + case 158: +#line 524 "parser.y" + { yyval.expr = make_expr2(EXPR_SUB, yyvsp[-2].expr, yyvsp[0].expr); ;} + break; + + case 159: +#line 525 "parser.y" + { yyval.expr = make_expr2(EXPR_MUL, yyvsp[-2].expr, yyvsp[0].expr); ;} + break; + + case 160: +#line 526 "parser.y" + { yyval.expr = make_expr2(EXPR_DIV, yyvsp[-2].expr, yyvsp[0].expr); ;} + break; + + case 161: +#line 527 "parser.y" + { yyval.expr = make_expr2(EXPR_SHL, yyvsp[-2].expr, yyvsp[0].expr); ;} + break; + + case 162: +#line 528 "parser.y" + { yyval.expr = make_expr2(EXPR_SHR, yyvsp[-2].expr, yyvsp[0].expr); ;} + break; + + case 163: +#line 529 "parser.y" + { yyval.expr = make_expr1(EXPR_NOT, yyvsp[0].expr); ;} + break; + + case 164: +#line 530 "parser.y" + { yyval.expr = make_expr1(EXPR_NEG, yyvsp[0].expr); ;} + break; + + case 165: +#line 531 "parser.y" + { yyval.expr = make_expr1(EXPR_PPTR, yyvsp[0].expr); ;} + break; + + case 166: +#line 532 "parser.y" + { yyval.expr = make_exprt(EXPR_CAST, yyvsp[-2].tref, yyvsp[0].expr); ;} + break; + + case 167: +#line 533 "parser.y" + { yyval.expr = make_exprt(EXPR_SIZEOF, yyvsp[-1].tref, NULL); ;} + break; + + case 168: +#line 534 "parser.y" + { yyval.expr = yyvsp[-1].expr; ;} + break; + + case 170: +#line 538 "parser.y" + { LINK(yyvsp[0].expr, yyvsp[-2].expr); yyval.expr = yyvsp[0].expr; ;} + break; + + case 171: +#line 541 "parser.y" + { yyval.expr = yyvsp[0].expr; + if (!yyval.expr->is_const) + yyerror("expression is not constant"); + ;} + break; + + case 172: +#line 547 "parser.y" { yyval.var = yyvsp[0].var; set_type(yyval.var, yyvsp[-1].tref, NULL); ;} break; - case 156: -#line 510 "parser.y" + case 173: +#line 552 "parser.y" { yyval.var = NULL; ;} break; - case 157: -#line 511 "parser.y" + case 174: +#line 553 "parser.y" { if (yyvsp[0].var) { LINK(yyvsp[0].var, yyvsp[-1].var); yyval.var = yyvsp[0].var; } else { yyval.var = yyvsp[-1].var; } ;} break; - case 158: -#line 516 "parser.y" + case 175: +#line 558 "parser.y" { yyval.var = yyvsp[-1].var; ;} break; - case 159: -#line 517 "parser.y" + case 176: +#line 559 "parser.y" { yyval.var = make_var(NULL); yyval.var->type = yyvsp[-1].type; yyval.var->attrs = yyvsp[-2].attr; ;} break; - case 160: -#line 518 "parser.y" + case 177: +#line 560 "parser.y" { yyval.var = make_var(NULL); yyval.var->attrs = yyvsp[-1].attr; ;} break; - case 161: -#line 519 "parser.y" + case 178: +#line 561 "parser.y" { yyval.var = NULL; ;} break; - case 162: -#line 522 "parser.y" + case 179: +#line 564 "parser.y" { yyval.var = yyvsp[-1].var; set_type(yyval.var, yyvsp[-2].tref, yyvsp[0].expr); yyval.var->attrs = yyvsp[-3].attr; ;} break; - case 163: -#line 527 "parser.y" + case 180: +#line 569 "parser.y" { set_type(yyvsp[-3].var, yyvsp[-5].tref, NULL); yyvsp[-3].var->attrs = yyvsp[-6].attr; yyval.func = make_func(yyvsp[-3].var, yyvsp[-1].var); if (is_attr(yyvsp[-3].var->attrs, ATTR_IN)) { - yyerror("Inapplicable attribute"); + yyerror("inapplicable attribute [in] for function '%s'",yyval.func->def->name); } ;} break; - case 164: -#line 536 "parser.y" + case 181: +#line 578 "parser.y" { yyval.var = NULL; ;} break; - case 166: -#line 540 "parser.y" + case 183: +#line 582 "parser.y" { yyval.var = NULL; ;} break; - case 167: -#line 541 "parser.y" + case 184: +#line 583 "parser.y" { yyval.var = make_var(yyvsp[0].str); ;} break; - case 168: -#line 542 "parser.y" + case 185: +#line 584 "parser.y" { yyval.var = make_var(yyvsp[0].str); ;} break; - case 169: -#line 545 "parser.y" + case 186: +#line 587 "parser.y" { yyval.var = make_var(yyvsp[0].str); ;} break; - case 170: -#line 547 "parser.y" + case 187: +#line 589 "parser.y" { yyval.var = make_var(yyvsp[0].str); ;} break; - case 171: -#line 548 "parser.y" + case 188: +#line 590 "parser.y" { yyval.var = make_var(yyvsp[0].str); ;} break; - case 172: -#line 549 "parser.y" + case 189: +#line 591 "parser.y" { yyval.var = make_var(yyvsp[0].str); ;} break; - case 173: -#line 550 "parser.y" + case 190: +#line 592 "parser.y" { yyval.var = make_var(yyvsp[0].str); ;} break; - case 174: -#line 551 "parser.y" + case 191: +#line 593 "parser.y" { yyval.var = make_var(yyvsp[0].str); ;} break; - case 175: -#line 554 "parser.y" + case 192: +#line 594 "parser.y" + { yyval.var = make_var(yyvsp[0].str); ;} + break; + + case 193: +#line 595 "parser.y" + { yyval.var = make_var(yyvsp[0].str); ;} + break; + + case 194: +#line 596 "parser.y" + { yyval.var = make_var(yyvsp[0].str); ;} + break; + + case 195: +#line 597 "parser.y" + { yyval.var = make_var(yyvsp[0].str); ;} + break; + + case 196: +#line 600 "parser.y" { yyval.type = make_type(RPC_FC_BYTE, NULL); ;} break; - case 176: -#line 555 "parser.y" + case 197: +#line 601 "parser.y" { yyval.type = make_type(RPC_FC_WCHAR, NULL); ;} break; - case 178: -#line 557 "parser.y" + case 199: +#line 603 "parser.y" { yyval.type = yyvsp[0].type; yyval.type->sign = 1; ;} break; - case 179: -#line 558 "parser.y" + case 200: +#line 604 "parser.y" { yyval.type = yyvsp[0].type; yyval.type->sign = -1; switch (yyval.type->type) { - case RPC_FC_CHAR: break; + case RPC_FC_CHAR: break; case RPC_FC_SMALL: yyval.type->type = RPC_FC_USMALL; break; case RPC_FC_SHORT: yyval.type->type = RPC_FC_USHORT; break; case RPC_FC_LONG: yyval.type->type = RPC_FC_ULONG; break; @@ -2771,163 +2963,167 @@ yyreduce: ;} break; - case 180: -#line 570 "parser.y" + case 201: +#line 616 "parser.y" { yyval.type = make_type(RPC_FC_ULONG, &std_int); yyval.type->sign = -1; ;} break; - case 181: -#line 571 "parser.y" - { yyval.type = make_type(RPC_FC_FLOAT, NULL); ;} - break; - - case 182: -#line 572 "parser.y" - { yyval.type = make_type(RPC_FC_FLOAT, NULL); ;} - break; - - case 183: -#line 573 "parser.y" - { yyval.type = make_type(RPC_FC_DOUBLE, NULL); ;} - break; - - case 184: -#line 574 "parser.y" - { yyval.type = make_type(RPC_FC_SMALL, &std_bool); ;} - break; - - case 185: -#line 575 "parser.y" - { yyval.type = make_type(RPC_FC_ERROR_STATUS_T, NULL); ;} - break; - - case 186: -#line 576 "parser.y" - { yyval.type = make_type(RPC_FC_IGNORE, NULL); ;} - break; - - case 189: -#line 583 "parser.y" - { yyval.type = make_type(RPC_FC_LONG, &std_int); ;} - break; - - case 190: -#line 584 "parser.y" - { yyval.type = make_type(RPC_FC_SMALL, NULL); ;} - break; - - case 191: -#line 585 "parser.y" - { yyval.type = make_type(RPC_FC_SHORT, NULL); ;} - break; - - case 192: -#line 586 "parser.y" - { yyval.type = make_type(RPC_FC_LONG, NULL); ;} - break; - - case 193: -#line 587 "parser.y" - { yyval.type = make_type(RPC_FC_HYPER, NULL); ;} - break; - - case 194: -#line 588 "parser.y" - { yyval.type = make_type(RPC_FC_HYPER, &std_int64); ;} - break; - - case 195: -#line 589 "parser.y" - { yyval.type = make_type(RPC_FC_CHAR, NULL); ;} - break; - - case 196: -#line 592 "parser.y" - { yyval.clas = make_class(yyvsp[0].str); ;} - break; - - case 197: -#line 593 "parser.y" - { yyval.clas = make_class(yyvsp[0].str); ;} - break; - - case 198: -#line 596 "parser.y" - { yyval.clas = yyvsp[0].clas; - yyval.clas->attrs = yyvsp[-1].attr; - if (!parse_only && do_header) - write_coclass(yyval.clas); - ;} - break; - - case 199: -#line 603 "parser.y" - { yyval.clas = yyvsp[-3].clas; - yyval.clas->ifaces = yyvsp[-1].ifref; - ;} - break; - - case 200: -#line 608 "parser.y" - { yyval.ifref = NULL; ;} - break; - - case 201: -#line 609 "parser.y" - { LINK(yyvsp[0].ifref, yyvsp[-1].ifref); yyval.ifref = yyvsp[0].ifref; ;} - break; - case 202: -#line 613 "parser.y" - { yyval.ifref = make_ifref(yyvsp[0].type); yyval.ifref->attrs = yyvsp[-1].attr; ;} +#line 617 "parser.y" + { yyval.type = make_type(RPC_FC_FLOAT, NULL); ;} break; case 203: -#line 616 "parser.y" - { yyval.type = get_type(0, yyvsp[0].str, 0); ;} +#line 618 "parser.y" + { yyval.type = make_type(RPC_FC_FLOAT, NULL); ;} break; case 204: -#line 617 "parser.y" - { yyval.type = get_type(0, yyvsp[0].str, 0); ;} +#line 619 "parser.y" + { yyval.type = make_type(RPC_FC_DOUBLE, NULL); ;} break; case 205: #line 620 "parser.y" + { yyval.type = make_type(RPC_FC_BYTE, &std_bool); /* ? */ ;} + break; + + case 206: +#line 621 "parser.y" + { yyval.type = make_type(RPC_FC_ERROR_STATUS_T, NULL); ;} + break; + + case 207: +#line 622 "parser.y" + { yyval.type = make_type(RPC_FC_BIND_PRIMITIVE, NULL); /* ? */ ;} + break; + + case 210: +#line 629 "parser.y" + { yyval.type = make_type(RPC_FC_LONG, &std_int); ;} + break; + + case 211: +#line 630 "parser.y" + { yyval.type = make_type(RPC_FC_SHORT, NULL); ;} + break; + + case 212: +#line 631 "parser.y" + { yyval.type = make_type(RPC_FC_SMALL, NULL); ;} + break; + + case 213: +#line 632 "parser.y" + { yyval.type = make_type(RPC_FC_LONG, NULL); ;} + break; + + case 214: +#line 633 "parser.y" + { yyval.type = make_type(RPC_FC_HYPER, NULL); ;} + break; + + case 215: +#line 634 "parser.y" + { yyval.type = make_type(RPC_FC_HYPER, &std_int64); ;} + break; + + case 216: +#line 635 "parser.y" + { yyval.type = make_type(RPC_FC_CHAR, NULL); ;} + break; + + case 217: +#line 638 "parser.y" + { yyval.type = make_class(yyvsp[0].str); ;} + break; + + case 218: +#line 639 "parser.y" + { yyval.type = find_type(yyvsp[0].str, 0); + if (yyval.type->defined) yyerror("multiple definition error"); + if (yyval.type->kind != TKIND_COCLASS) yyerror("%s was not declared a coclass", yyvsp[0].str); + ;} + break; + + case 219: +#line 645 "parser.y" { yyval.type = yyvsp[0].type; - if (yyval.type->defined) yyerror("multiple definition error\n"); yyval.type->attrs = yyvsp[-1].attr; - yyval.type->attrs = make_attr(ATTR_DISPINTERFACE); - LINK(yyval.type->attrs, yyvsp[-1].attr); + if (!parse_only && do_header) + write_coclass(yyval.type); + ;} + break; + + case 220: +#line 652 "parser.y" + { yyval.type = yyvsp[-3].type; + yyval.type->ifaces = yyvsp[-1].ifref; + ;} + break; + + case 221: +#line 657 "parser.y" + { yyval.ifref = NULL; ;} + break; + + case 222: +#line 658 "parser.y" + { LINK(yyvsp[0].ifref, yyvsp[-1].ifref); yyval.ifref = yyvsp[0].ifref; ;} + break; + + case 223: +#line 662 "parser.y" + { yyval.ifref = make_ifref(yyvsp[0].type); yyval.ifref->attrs = yyvsp[-1].attr; ;} + break; + + case 224: +#line 665 "parser.y" + { yyval.type = get_type(0, yyvsp[0].str, 0); ;} + break; + + case 225: +#line 666 "parser.y" + { yyval.type = get_type(0, yyvsp[0].str, 0); ;} + break; + + case 226: +#line 669 "parser.y" + { attr_t *attrs; + yyval.type = yyvsp[0].type; + if (yyval.type->defined) yyerror("multiple definition error"); + attrs = make_attr(ATTR_DISPINTERFACE); + LINK(attrs, yyvsp[-1].attr); + yyval.type->attrs = attrs; yyval.type->ref = find_type("IDispatch", 0); - if (!yyval.type->ref) yyerror("IDispatch is undefined\n"); + if (!yyval.type->ref) yyerror("IDispatch is undefined"); yyval.type->defined = TRUE; if (!parse_only && do_header) write_forward(yyval.type); ;} break; - case 206: -#line 632 "parser.y" + case 227: +#line 682 "parser.y" { yyval.var = NULL; ;} break; - case 207: -#line 633 "parser.y" + case 228: +#line 683 "parser.y" { LINK(yyvsp[-1].var, yyvsp[-2].var); yyval.var = yyvsp[-1].var; ;} break; - case 208: -#line 636 "parser.y" + case 229: +#line 686 "parser.y" { yyval.func = NULL; ;} break; - case 209: -#line 637 "parser.y" + case 230: +#line 687 "parser.y" { LINK(yyvsp[-1].func, yyvsp[-2].func); yyval.func = yyvsp[-1].func; ;} break; - case 210: -#line 643 "parser.y" + case 231: +#line 693 "parser.y" { yyval.type = yyvsp[-4].type; yyval.type->fields = yyvsp[-2].var; yyval.type->funcs = yyvsp[-1].func; @@ -2935,38 +3131,38 @@ yyreduce: ;} break; - case 211: -#line 655 "parser.y" + case 232: +#line 705 "parser.y" { yyval.type = NULL; ;} break; - case 212: -#line 656 "parser.y" + case 233: +#line 706 "parser.y" { yyval.type = find_type2(yyvsp[0].str, 0); ;} break; - case 213: -#line 659 "parser.y" + case 234: +#line 709 "parser.y" { yyval.type = get_type(RPC_FC_IP, yyvsp[0].str, 0); ;} break; - case 214: -#line 660 "parser.y" + case 235: +#line 710 "parser.y" { yyval.type = get_type(RPC_FC_IP, yyvsp[0].str, 0); ;} break; - case 215: -#line 663 "parser.y" + case 236: +#line 713 "parser.y" { yyval.type = yyvsp[0].type; - if (yyval.type->defined) yyerror("multiple definition error\n"); + if (yyval.type->defined) yyerror("multiple definition error"); yyval.type->attrs = yyvsp[-1].attr; yyval.type->defined = TRUE; if (!parse_only && do_header) write_forward(yyval.type); ;} break; - case 216: -#line 672 "parser.y" + case 237: +#line 722 "parser.y" { yyval.type = yyvsp[-4].type; yyval.type->ref = yyvsp[-3].type; yyval.type->funcs = yyvsp[-1].func; @@ -2974,150 +3170,160 @@ yyreduce: ;} break; - case 217: -#line 680 "parser.y" + case 238: +#line 730 "parser.y" { yyval.type = yyvsp[-6].type; yyval.type->ref = find_type2(yyvsp[-4].str, 0); - if (!yyval.type->ref) yyerror("base class %s not found in import\n", yyvsp[-4].str); + if (!yyval.type->ref) yyerror("base class '%s' not found in import", yyvsp[-4].str); yyval.type->funcs = yyvsp[-1].func; if (!parse_only && do_header) write_interface(yyval.type); ;} break; - case 218: -#line 686 "parser.y" + case 239: +#line 736 "parser.y" { yyval.type = yyvsp[0].type; ;} break; - case 219: -#line 690 "parser.y" + case 240: +#line 740 "parser.y" { yyval.type = yyvsp[-1].type; if (!parse_only && do_header) write_forward(yyval.type); ;} break; - case 220: -#line 691 "parser.y" + case 241: +#line 741 "parser.y" { yyval.type = yyvsp[-1].type; if (!parse_only && do_header) write_forward(yyval.type); ;} break; - case 221: -#line 694 "parser.y" + case 242: +#line 744 "parser.y" { yyval.type = make_type(0, NULL); yyval.type->name = yyvsp[0].str; ;} break; - case 222: -#line 695 "parser.y" + case 243: +#line 745 "parser.y" { yyval.type = make_type(0, NULL); yyval.type->name = yyvsp[0].str; ;} break; - case 223: -#line 698 "parser.y" + case 244: +#line 748 "parser.y" { yyval.type = yyvsp[0].type; yyval.type->attrs = yyvsp[-1].attr; ;} break; - case 224: -#line 703 "parser.y" + case 245: +#line 753 "parser.y" { yyval.type = yyvsp[-3].type; yyval.type->funcs = yyvsp[-1].func; /* FIXME: if (!parse_only && do_header) write_module($$); */ ;} break; - case 225: -#line 709 "parser.y" + case 246: +#line 759 "parser.y" { yyval.var = yyvsp[0].var; yyval.var->ptr_level++; ;} break; - case 226: -#line 710 "parser.y" + case 247: +#line 760 "parser.y" { yyval.var = yyvsp[0].var; /* FIXME */ ;} break; - case 229: -#line 715 "parser.y" + case 250: +#line 765 "parser.y" { yyval.var = yyvsp[-1].var; ;} break; - case 231: -#line 720 "parser.y" + case 252: +#line 770 "parser.y" { LINK(yyvsp[0].var, yyvsp[-2].var); yyval.var = yyvsp[0].var; ;} break; - case 232: -#line 724 "parser.y" + case 253: +#line 774 "parser.y" { yyval.num = RPC_FC_RP; ;} break; - case 233: -#line 725 "parser.y" + case 254: +#line 775 "parser.y" { yyval.num = RPC_FC_UP; ;} break; - case 234: -#line 728 "parser.y" + case 255: +#line 776 "parser.y" + { yyval.num = RPC_FC_FP; ;} + break; + + case 256: +#line 779 "parser.y" { yyval.type = get_typev(RPC_FC_STRUCT, yyvsp[-3].var, tsSTRUCT); - /* overwrite RPC_FC_STRUCT with a more exact type */ + /* overwrite RPC_FC_STRUCT with a more exact type */ yyval.type->type = get_struct_type( yyvsp[-1].var ); yyval.type->fields = yyvsp[-1].var; yyval.type->defined = TRUE; - if(in_typelib) - add_struct(yyval.type); - ;} + if(in_typelib) + add_struct(yyval.type); + ;} break; - case 235: -#line 738 "parser.y" + case 257: +#line 789 "parser.y" { yyval.tref = make_tref(NULL, make_type(0, NULL)); ;} break; - case 236: -#line 739 "parser.y" + case 258: +#line 790 "parser.y" { yyval.tref = make_tref(yyvsp[0].str, find_type(yyvsp[0].str, 0)); ;} break; - case 237: -#line 740 "parser.y" + case 259: +#line 791 "parser.y" { yyval.tref = make_tref(NULL, yyvsp[0].type); ;} break; - case 238: -#line 741 "parser.y" + case 260: +#line 792 "parser.y" { yyval.tref = uniq_tref(yyvsp[0].tref); yyval.tref->ref->is_const = TRUE; ;} break; - case 239: -#line 742 "parser.y" + case 261: +#line 793 "parser.y" { yyval.tref = make_tref(NULL, yyvsp[0].type); ;} break; - case 240: -#line 743 "parser.y" + case 262: +#line 794 "parser.y" { yyval.tref = make_tref(NULL, find_type2(yyvsp[0].str, tsENUM)); ;} break; - case 241: -#line 744 "parser.y" + case 263: +#line 795 "parser.y" { yyval.tref = make_tref(NULL, yyvsp[0].type); ;} break; - case 242: -#line 745 "parser.y" + case 264: +#line 796 "parser.y" { yyval.tref = make_tref(NULL, get_type(RPC_FC_STRUCT, yyvsp[0].str, tsSTRUCT)); ;} break; - case 243: -#line 746 "parser.y" + case 265: +#line 797 "parser.y" { yyval.tref = make_tref(NULL, yyvsp[0].type); ;} break; - case 244: -#line 747 "parser.y" + case 266: +#line 798 "parser.y" { yyval.tref = make_tref(NULL, find_type2(yyvsp[0].str, tsUNION)); ;} break; - case 245: -#line 750 "parser.y" + case 267: +#line 799 "parser.y" + { yyval.tref = make_tref(NULL, make_safearray()); ;} + break; + + case 268: +#line 802 "parser.y" { typeref_t *tref = uniq_tref(yyvsp[-1].tref); yyvsp[0].var->tname = tref->name; tref->name = NULL; @@ -3131,16 +3337,16 @@ yyreduce: ;} break; - case 246: -#line 763 "parser.y" + case 269: +#line 815 "parser.y" { yyval.type = get_typev(RPC_FC_NON_ENCAPSULATED_UNION, yyvsp[-3].var, tsUNION); yyval.type->fields = yyvsp[-1].var; yyval.type->defined = TRUE; ;} break; - case 247: -#line 769 "parser.y" + case 270: +#line 821 "parser.y" { var_t *u = yyvsp[-3].var; yyval.type = get_typev(RPC_FC_ENCAPSULATED_UNION, yyvsp[-8].var, tsUNION); if (!u) u = make_var("tagged_union"); @@ -3152,13 +3358,13 @@ yyreduce: ;} break; - case 248: -#line 781 "parser.y" + case 271: +#line 833 "parser.y" { yyval.num = MAKELONG(yyvsp[0].num, 0); ;} break; - case 249: -#line 782 "parser.y" + case 272: +#line 834 "parser.y" { yyval.num = MAKELONG(yyvsp[-2].num, yyvsp[0].num); ;} break; @@ -3166,7 +3372,7 @@ yyreduce: } /* Line 991 of yacc.c. */ -#line 3169 "y.tab.c" +#line 3375 "parser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -3375,7 +3581,7 @@ yyreturn: } -#line 785 "parser.y" +#line 837 "parser.y" static attr_t *make_attr(enum attr_type type) @@ -3425,7 +3631,9 @@ static expr_t *make_exprl(enum expr_type type, long val) e->is_const = FALSE; INIT_LINK(e); /* check for numeric constant */ - if (type == EXPR_NUM || type == EXPR_HEXNUM) { + if (type == EXPR_NUM || type == EXPR_HEXNUM || type == EXPR_TRUEFALSE) { + /* make sure true/false value is valid */ + assert(type != EXPR_TRUEFALSE || val == 0 || val == 1); e->is_const = TRUE; e->cval = val; } @@ -3448,7 +3656,7 @@ static expr_t *make_exprs(enum expr_type type, char *val) e->u.sval = c->name; free(val); e->is_const = TRUE; - e->cval = c->lval; + e->cval = c->eval->cval; } } return e; @@ -3464,6 +3672,35 @@ static expr_t *make_exprt(enum expr_type type, typeref_t *tref, expr_t *expr) e->is_const = FALSE; INIT_LINK(e); /* check for cast of constant expression */ + if (type == EXPR_SIZEOF) { + switch (tref->ref->type) { + case RPC_FC_BYTE: + case RPC_FC_CHAR: + case RPC_FC_SMALL: + case RPC_FC_USMALL: + e->is_const = TRUE; + e->cval = 1; + break; + case RPC_FC_WCHAR: + case RPC_FC_USHORT: + case RPC_FC_SHORT: + e->is_const = TRUE; + e->cval = 2; + break; + case RPC_FC_LONG: + case RPC_FC_ULONG: + case RPC_FC_FLOAT: + case RPC_FC_ERROR_STATUS_T: + e->is_const = TRUE; + e->cval = 4; + break; + case RPC_FC_HYPER: + case RPC_FC_DOUBLE: + e->is_const = TRUE; + e->cval = 8; + break; + } + } if (type == EXPR_CAST && expr->is_const) { e->is_const = TRUE; e->cval = expr->cval; @@ -3572,12 +3809,13 @@ static type_t *make_type(unsigned char type, type_t *ref) { type_t *t = xmalloc(sizeof(type_t)); t->name = NULL; + t->kind = TKIND_PRIMITIVE; t->type = type; t->ref = ref; - t->rname = NULL; t->attrs = NULL; t->funcs = NULL; t->fields = NULL; + t->ifaces = NULL; t->ignore = parse_only; t->is_const = FALSE; t->sign = 0; @@ -3646,7 +3884,6 @@ static var_t *make_var(char *name) v->attrs = NULL; v->array = NULL; v->eval = NULL; - v->lval = 0; INIT_LINK(v); return v; } @@ -3662,16 +3899,20 @@ static func_t *make_func(var_t *def, var_t *args) return f; } -static class_t *make_class(char *name) +static type_t *make_class(char *name) { - class_t *c = xmalloc(sizeof(class_t)); + type_t *c = make_type(0, NULL); c->name = name; - c->attrs = NULL; - c->ifaces = NULL; + c->kind = TKIND_COCLASS; INIT_LINK(c); return c; } +static type_t *make_safearray(void) +{ + return make_type(RPC_FC_FP, find_type("SAFEARRAY", 0)); +} + #define HASHMAX 64 static int hash_ident(const char *name) @@ -3689,7 +3930,7 @@ static int hash_ident(const char *name) /***** type repository *****/ struct rtype { - char *name; + const char *name; type_t *type; int t; struct rtype *next; @@ -3697,12 +3938,12 @@ struct rtype { struct rtype *type_hash[HASHMAX]; -static type_t *reg_type(type_t *type, char *name, int t) +static type_t *reg_type(type_t *type, const char *name, int t) { struct rtype *nt; int hash; if (!name) { - yyerror("registering named type without name\n"); + yyerror("registering named type without name"); return type; } hash = hash_ident(name); @@ -3712,7 +3953,6 @@ static type_t *reg_type(type_t *type, char *name, int t) nt->t = t; nt->next = type_hash[hash]; type_hash[hash] = nt; - type->name = name; return type; } @@ -3735,14 +3975,7 @@ static unsigned char get_pointer_type( type_t *type ) } t = get_attrv( type->attrs, ATTR_POINTERTYPE ); if (t) return t; - - if(is_attr( type->attrs, ATTR_PTR )) - return RPC_FC_FP; - - if(is_attr( type->attrs, ATTR_UNIQUE )) - return RPC_FC_UP; - - return RPC_FC_RP; + return RPC_FC_FP; } static type_t *reg_types(type_t *type, var_t *names, int t) @@ -3775,13 +4008,13 @@ static type_t *reg_types(type_t *type, var_t *names, int t) return type; } -static type_t *find_type(char *name, int t) +static type_t *find_type(const char *name, int t) { struct rtype *cur = type_hash[hash_ident(name)]; while (cur && (cur->t != t || strcmp(cur->name, name))) cur = cur->next; if (!cur) { - yyerror("type %s not found\n", name); + yyerror("type '%s' not found", name); return NULL; } return cur->type; @@ -3835,10 +4068,10 @@ static type_t *get_typev(unsigned char type, var_t *name, int t) static int get_struct_type(var_t *field) { int has_pointer = 0; - int has_conformant_array = 0; - int has_conformant_string = 0; + int has_conformance = 0; + int has_variance = 0; - while (field) + for (; field; field = NEXT_LINK(field)) { type_t *t = field->type; @@ -3846,6 +4079,32 @@ static int get_struct_type(var_t *field) while( (t->type == 0) && t->ref ) t = t->ref; + if (field->ptr_level > 0) + { + has_pointer = 1; + continue; + } + + if (is_string_type(field->attrs, 0, field->array)) + { + has_conformance = 1; + has_variance = 1; + continue; + } + + if (is_array_type(field->attrs, 0, field->array)) + { + if (field->array && !field->array->is_const) + { + has_conformance = 1; + if (PREV_LINK(field)) + yyerror("field '%s' deriving from a conformant array must be the last field in the structure", + field->name); + } + if (is_attr(field->attrs, ATTR_LENGTHIS)) + has_variance = 1; + } + switch (t->type) { /* @@ -3879,11 +4138,15 @@ static int get_struct_type(var_t *field) has_pointer = 1; break; case RPC_FC_CARRAY: - has_conformant_array = 1; + has_conformance = 1; + if (PREV_LINK(field)) + yyerror("field '%s' deriving from a conformant array must be the last field in the structure", + field->name); break; case RPC_FC_C_CSTRING: case RPC_FC_C_WSTRING: - has_conformant_string = 1; + has_conformance = 1; + has_variance = 1; break; /* @@ -3891,17 +4154,24 @@ static int get_struct_type(var_t *field) * a struct should be at least as complex as its member */ case RPC_FC_CVSTRUCT: - has_conformant_string = 1; + has_conformance = 1; + has_variance = 1; has_pointer = 1; break; case RPC_FC_CPSTRUCT: - has_conformant_array = 1; + has_conformance = 1; + if (PREV_LINK(field)) + yyerror("field '%s' deriving from a conformant array must be the last field in the structure", + field->name); has_pointer = 1; break; case RPC_FC_CSTRUCT: - has_conformant_array = 1; + has_conformance = 1; + if (PREV_LINK(field)) + yyerror("field '%s' deriving from a conformant array must be the last field in the structure", + field->name); break; case RPC_FC_PSTRUCT: @@ -3924,14 +4194,13 @@ static int get_struct_type(var_t *field) case RPC_FC_BOGUS_STRUCT: return RPC_FC_BOGUS_STRUCT; } - field = NEXT_LINK(field); } - if( has_conformant_string && has_pointer ) + if( has_variance ) return RPC_FC_CVSTRUCT; - if( has_conformant_array && has_pointer ) + if( has_conformance && has_pointer ) return RPC_FC_CPSTRUCT; - if( has_conformant_array ) + if( has_conformance ) return RPC_FC_CSTRUCT; if( has_pointer ) return RPC_FC_PSTRUCT; @@ -3953,7 +4222,7 @@ static var_t *reg_const(var_t *var) struct rconst *nc; int hash; if (!var->name) { - yyerror("registering constant without name\n"); + yyerror("registering constant without name"); return var; } hash = hash_ident(var->name); @@ -3971,7 +4240,7 @@ static var_t *find_const(char *name, int f) while (cur && strcmp(cur->name, name)) cur = cur->next; if (!cur) { - if (f) yyerror("constant %s not found\n", name); + if (f) yyerror("constant '%s' not found", name); return NULL; } return cur->var; diff --git a/reactos/tools/widl/parser.tab.h b/reactos/tools/widl/parser.tab.h new file mode 100644 index 00000000000..8c33a70aa9f --- /dev/null +++ b/reactos/tools/widl/parser.tab.h @@ -0,0 +1,324 @@ +/* A Bison parser, made by GNU Bison 1.875. */ + +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + aIDENTIFIER = 258, + aKNOWNTYPE = 259, + aNUM = 260, + aHEXNUM = 261, + aSTRING = 262, + aUUID = 263, + aEOF = 264, + SHL = 265, + SHR = 266, + tAGGREGATABLE = 267, + tALLOCATE = 268, + tAPPOBJECT = 269, + tASYNC = 270, + tASYNCUUID = 271, + tAUTOHANDLE = 272, + tBINDABLE = 273, + tBOOLEAN = 274, + tBROADCAST = 275, + tBYTE = 276, + tBYTECOUNT = 277, + tCALLAS = 278, + tCALLBACK = 279, + tCASE = 280, + tCDECL = 281, + tCHAR = 282, + tCOCLASS = 283, + tCODE = 284, + tCOMMSTATUS = 285, + tCONST = 286, + tCONTEXTHANDLE = 287, + tCONTEXTHANDLENOSERIALIZE = 288, + tCONTEXTHANDLESERIALIZE = 289, + tCONTROL = 290, + tCPPQUOTE = 291, + tDEFAULT = 292, + tDEFAULTCOLLELEM = 293, + tDEFAULTVALUE = 294, + tDEFAULTVTABLE = 295, + tDISPLAYBIND = 296, + tDISPINTERFACE = 297, + tDLLNAME = 298, + tDOUBLE = 299, + tDUAL = 300, + tENDPOINT = 301, + tENTRY = 302, + tENUM = 303, + tERRORSTATUST = 304, + tEXPLICITHANDLE = 305, + tEXTERN = 306, + tFALSE = 307, + tFLOAT = 308, + tHANDLE = 309, + tHANDLET = 310, + tHELPCONTEXT = 311, + tHELPFILE = 312, + tHELPSTRING = 313, + tHELPSTRINGCONTEXT = 314, + tHELPSTRINGDLL = 315, + tHIDDEN = 316, + tHYPER = 317, + tID = 318, + tIDEMPOTENT = 319, + tIIDIS = 320, + tIMMEDIATEBIND = 321, + tIMPLICITHANDLE = 322, + tIMPORT = 323, + tIMPORTLIB = 324, + tIN = 325, + tINLINE = 326, + tINPUTSYNC = 327, + tINT = 328, + tINT64 = 329, + tINTERFACE = 330, + tLCID = 331, + tLENGTHIS = 332, + tLIBRARY = 333, + tLOCAL = 334, + tLONG = 335, + tMETHODS = 336, + tMODULE = 337, + tNONBROWSABLE = 338, + tNONCREATABLE = 339, + tNONEXTENSIBLE = 340, + tOBJECT = 341, + tODL = 342, + tOLEAUTOMATION = 343, + tOPTIONAL = 344, + tOUT = 345, + tPOINTERDEFAULT = 346, + tPROPERTIES = 347, + tPROPGET = 348, + tPROPPUT = 349, + tPROPPUTREF = 350, + tPTR = 351, + tPUBLIC = 352, + tRANGE = 353, + tREADONLY = 354, + tREF = 355, + tREQUESTEDIT = 356, + tRESTRICTED = 357, + tRETVAL = 358, + tSAFEARRAY = 359, + tSHORT = 360, + tSIGNED = 361, + tSINGLE = 362, + tSIZEIS = 363, + tSIZEOF = 364, + tSMALL = 365, + tSOURCE = 366, + tSTDCALL = 367, + tSTRING = 368, + tSTRUCT = 369, + tSWITCH = 370, + tSWITCHIS = 371, + tSWITCHTYPE = 372, + tTRANSMITAS = 373, + tTRUE = 374, + tTYPEDEF = 375, + tUNION = 376, + tUNIQUE = 377, + tUNSIGNED = 378, + tUUID = 379, + tV1ENUM = 380, + tVARARG = 381, + tVERSION = 382, + tVOID = 383, + tWCHAR = 384, + tWIREMARSHAL = 385, + CAST = 386, + PPTR = 387, + NEG = 388 + }; +#endif +#define aIDENTIFIER 258 +#define aKNOWNTYPE 259 +#define aNUM 260 +#define aHEXNUM 261 +#define aSTRING 262 +#define aUUID 263 +#define aEOF 264 +#define SHL 265 +#define SHR 266 +#define tAGGREGATABLE 267 +#define tALLOCATE 268 +#define tAPPOBJECT 269 +#define tASYNC 270 +#define tASYNCUUID 271 +#define tAUTOHANDLE 272 +#define tBINDABLE 273 +#define tBOOLEAN 274 +#define tBROADCAST 275 +#define tBYTE 276 +#define tBYTECOUNT 277 +#define tCALLAS 278 +#define tCALLBACK 279 +#define tCASE 280 +#define tCDECL 281 +#define tCHAR 282 +#define tCOCLASS 283 +#define tCODE 284 +#define tCOMMSTATUS 285 +#define tCONST 286 +#define tCONTEXTHANDLE 287 +#define tCONTEXTHANDLENOSERIALIZE 288 +#define tCONTEXTHANDLESERIALIZE 289 +#define tCONTROL 290 +#define tCPPQUOTE 291 +#define tDEFAULT 292 +#define tDEFAULTCOLLELEM 293 +#define tDEFAULTVALUE 294 +#define tDEFAULTVTABLE 295 +#define tDISPLAYBIND 296 +#define tDISPINTERFACE 297 +#define tDLLNAME 298 +#define tDOUBLE 299 +#define tDUAL 300 +#define tENDPOINT 301 +#define tENTRY 302 +#define tENUM 303 +#define tERRORSTATUST 304 +#define tEXPLICITHANDLE 305 +#define tEXTERN 306 +#define tFALSE 307 +#define tFLOAT 308 +#define tHANDLE 309 +#define tHANDLET 310 +#define tHELPCONTEXT 311 +#define tHELPFILE 312 +#define tHELPSTRING 313 +#define tHELPSTRINGCONTEXT 314 +#define tHELPSTRINGDLL 315 +#define tHIDDEN 316 +#define tHYPER 317 +#define tID 318 +#define tIDEMPOTENT 319 +#define tIIDIS 320 +#define tIMMEDIATEBIND 321 +#define tIMPLICITHANDLE 322 +#define tIMPORT 323 +#define tIMPORTLIB 324 +#define tIN 325 +#define tINLINE 326 +#define tINPUTSYNC 327 +#define tINT 328 +#define tINT64 329 +#define tINTERFACE 330 +#define tLCID 331 +#define tLENGTHIS 332 +#define tLIBRARY 333 +#define tLOCAL 334 +#define tLONG 335 +#define tMETHODS 336 +#define tMODULE 337 +#define tNONBROWSABLE 338 +#define tNONCREATABLE 339 +#define tNONEXTENSIBLE 340 +#define tOBJECT 341 +#define tODL 342 +#define tOLEAUTOMATION 343 +#define tOPTIONAL 344 +#define tOUT 345 +#define tPOINTERDEFAULT 346 +#define tPROPERTIES 347 +#define tPROPGET 348 +#define tPROPPUT 349 +#define tPROPPUTREF 350 +#define tPTR 351 +#define tPUBLIC 352 +#define tRANGE 353 +#define tREADONLY 354 +#define tREF 355 +#define tREQUESTEDIT 356 +#define tRESTRICTED 357 +#define tRETVAL 358 +#define tSAFEARRAY 359 +#define tSHORT 360 +#define tSIGNED 361 +#define tSINGLE 362 +#define tSIZEIS 363 +#define tSIZEOF 364 +#define tSMALL 365 +#define tSOURCE 366 +#define tSTDCALL 367 +#define tSTRING 368 +#define tSTRUCT 369 +#define tSWITCH 370 +#define tSWITCHIS 371 +#define tSWITCHTYPE 372 +#define tTRANSMITAS 373 +#define tTRUE 374 +#define tTYPEDEF 375 +#define tUNION 376 +#define tUNIQUE 377 +#define tUNSIGNED 378 +#define tUUID 379 +#define tV1ENUM 380 +#define tVARARG 381 +#define tVERSION 382 +#define tVOID 383 +#define tWCHAR 384 +#define tWIREMARSHAL 385 +#define CAST 386 +#define PPTR 387 +#define NEG 388 + + + + +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#line 109 "parser.y" +typedef union YYSTYPE { + attr_t *attr; + expr_t *expr; + type_t *type; + typeref_t *tref; + var_t *var; + func_t *func; + ifref_t *ifref; + char *str; + UUID *uuid; + unsigned int num; +} YYSTYPE; +/* Line 1248 of yacc.c. */ +#line 315 "parser.tab.h" +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + +extern YYSTYPE yylval; + + + diff --git a/reactos/tools/widl/parser.y b/reactos/tools/widl/parser.y index 01bed94a00b..b8e1c397a2d 100644 --- a/reactos/tools/widl/parser.y +++ b/reactos/tools/widl/parser.y @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" @@ -31,6 +31,8 @@ #include #endif +#include "windef.h" + #include "widl.h" #include "utils.h" #include "parser.h" @@ -80,11 +82,12 @@ static void set_type(var_t *v, typeref_t *ref, expr_t *arr); static ifref_t *make_ifref(type_t *iface); static var_t *make_var(char *name); static func_t *make_func(var_t *def, var_t *args); -static class_t *make_class(char *name); +static type_t *make_class(char *name); +static type_t *make_safearray(void); -static type_t *reg_type(type_t *type, char *name, int t); +static type_t *reg_type(type_t *type, const char *name, int t); static type_t *reg_types(type_t *type, var_t *names, int t); -static type_t *find_type(char *name, int t); +static type_t *find_type(const char *name, int t); static type_t *find_type2(char *name, int t); static type_t *get_type(unsigned char type, char *name, int t); static type_t *get_typev(unsigned char type, var_t *name, int t); @@ -111,7 +114,6 @@ static type_t std_uhyper = { "MIDL_uhyper" }; var_t *var; func_t *func; ifref_t *ifref; - class_t *clas; char *str; UUID *uuid; unsigned int num; @@ -124,18 +126,22 @@ static type_t std_uhyper = { "MIDL_uhyper" }; %token aUUID %token aEOF %token SHL SHR -%token tAGGREGATABLE tALLOCATE tAPPOBJECT tARRAYS tASYNC tASYNCUUID +%token tAGGREGATABLE tALLOCATE tAPPOBJECT tASYNC tASYNCUUID %token tAUTOHANDLE tBINDABLE tBOOLEAN tBROADCAST tBYTE tBYTECOUNT %token tCALLAS tCALLBACK tCASE tCDECL tCHAR tCOCLASS tCODE tCOMMSTATUS %token tCONST tCONTEXTHANDLE tCONTEXTHANDLENOSERIALIZE %token tCONTEXTHANDLESERIALIZE tCONTROL tCPPQUOTE %token tDEFAULT +%token tDEFAULTCOLLELEM %token tDEFAULTVALUE +%token tDEFAULTVTABLE +%token tDISPLAYBIND %token tDISPINTERFACE %token tDLLNAME tDOUBLE tDUAL %token tENDPOINT %token tENTRY tENUM tERRORSTATUST %token tEXPLICITHANDLE tEXTERN +%token tFALSE %token tFLOAT %token tHANDLE %token tHANDLET @@ -144,18 +150,22 @@ static type_t std_uhyper = { "MIDL_uhyper" }; %token tHIDDEN %token tHYPER tID tIDEMPOTENT %token tIIDIS +%token tIMMEDIATEBIND %token tIMPLICITHANDLE %token tIMPORT tIMPORTLIB -%token tIN tINCLUDE tINLINE +%token tIN tINLINE %token tINPUTSYNC %token tINT tINT64 %token tINTERFACE +%token tLCID %token tLENGTHIS tLIBRARY %token tLOCAL %token tLONG %token tMETHODS %token tMODULE +%token tNONBROWSABLE %token tNONCREATABLE +%token tNONEXTENSIBLE %token tOBJECT tODL tOLEAUTOMATION %token tOPTIONAL %token tOUT @@ -164,9 +174,12 @@ static type_t std_uhyper = { "MIDL_uhyper" }; %token tPROPGET tPROPPUT tPROPPUTREF %token tPTR %token tPUBLIC +%token tRANGE %token tREADONLY tREF +%token tREQUESTEDIT %token tRESTRICTED %token tRETVAL +%token tSAFEARRAY %token tSHORT %token tSIGNED %token tSINGLE @@ -177,6 +190,7 @@ static type_t std_uhyper = { "MIDL_uhyper" }; %token tSTRING tSTRUCT %token tSWITCH tSWITCHIS tSWITCHTYPE %token tTRANSMITAS +%token tTRUE %token tTYPEDEF %token tUNION %token tUNIQUE @@ -188,9 +202,6 @@ static type_t std_uhyper = { "MIDL_uhyper" }; %token tVOID %token tWCHAR tWIREMARSHAL -/* used in attr_t */ -%token tPOINTERTYPE - %type m_attributes attributes attrib_list attribute %type m_exprs /* exprs expr_list */ m_expr expr expr_list_const expr_const %type array array_list @@ -207,12 +218,12 @@ static type_t std_uhyper = { "MIDL_uhyper" }; %type dispint_props %type funcdef int_statements %type dispint_meths -%type coclass coclasshdr coclassdef +%type coclass coclasshdr coclassdef %type pointer_type version %type libraryhdr %left ',' -%right COND +%right '?' ':' %left '|' %left '&' %left '-' '+' @@ -225,13 +236,20 @@ static type_t std_uhyper = { "MIDL_uhyper" }; %% -input: gbl_statements { write_proxies($1); write_client($1); write_server($1); } +input: gbl_statements { write_proxies($1); write_client($1); write_server($1); } ; gbl_statements: { $$ = NULL; } | gbl_statements interfacedec { $$ = $1; } | gbl_statements interfacedef { $$ = make_ifref($2); LINK($$, $1); } - | gbl_statements coclassdef { $$ = $1; add_coclass($2); } + | gbl_statements coclass ';' { $$ = $1; + reg_type($2, $2->name, 0); + if (!parse_only && do_header) write_coclass_forward($2); + } + | gbl_statements coclassdef { $$ = $1; + add_coclass($2); + reg_type($2, $2->name, 0); + } | gbl_statements moduledef { $$ = $1; add_module($2); } | gbl_statements librarydef { $$ = $1; } | gbl_statements statement { $$ = $1; } @@ -240,9 +258,13 @@ gbl_statements: { $$ = NULL; } imp_statements: {} | imp_statements interfacedec { if (!parse_only) add_interface($2); } | imp_statements interfacedef { if (!parse_only) add_interface($2); } - | imp_statements coclassdef { if (!parse_only) add_coclass($2); } + | imp_statements coclass ';' { reg_type($2, $2->name, 0); if (!parse_only && do_header) write_coclass_forward($2); } + | imp_statements coclassdef { if (!parse_only) add_coclass($2); + reg_type($2, $2->name, 0); + } | imp_statements moduledef { if (!parse_only) add_module($2); } | imp_statements statement {} + | imp_statements importlib {} ; int_statements: { $$ = NULL; } @@ -269,9 +291,13 @@ import_start: tIMPORT aSTRING ';' { assert(yychar == YYEMPTY); import: import_start imp_statements aEOF {} ; +importlib: tIMPORTLIB '(' aSTRING ')' { if(!parse_only) add_importlib($3); } + ; + libraryhdr: tLIBRARY aIDENTIFIER { $$ = $2; } ; -library_start: attributes libraryhdr '{' { start_typelib($2, $1); } +library_start: attributes libraryhdr '{' { start_typelib($2, $1); + if (!parse_only && do_header) write_library($2, $1); } ; librarydef: library_start imp_statements '}' { end_typelib(); } ; @@ -324,17 +350,27 @@ m_attributes: { $$ = NULL; } ; attributes: - '[' attrib_list ']' { $$ = $2; } + '[' attrib_list ']' { $$ = $2; + if (!$$) + yyerror("empty attribute lists unsupported"); + } ; attrib_list: attribute - | attrib_list ',' attribute { LINK($3, $1); $$ = $3; } - | attrib_list ']' '[' attribute { LINK($4, $1); $$ = $4; } + | attrib_list ',' attribute { if ($3) { LINK($3, $1); $$ = $3; } + else { $$ = $1; } + } + | attrib_list ']' '[' attribute { if ($4) { LINK($4, $1); $$ = $4; } + else { $$ = $1; } + } ; -attribute: - tASYNC { $$ = make_attr(ATTR_ASYNC); } +attribute: { $$ = NULL; } + | tAGGREGATABLE { $$ = make_attr(ATTR_AGGREGATABLE); } + | tAPPOBJECT { $$ = make_attr(ATTR_APPOBJECT); } + | tASYNC { $$ = make_attr(ATTR_ASYNC); } | tAUTOHANDLE { $$ = make_attr(ATTR_AUTO_HANDLE); } + | tBINDABLE { $$ = make_attr(ATTR_BINDABLE); } | tCALLAS '(' ident ')' { $$ = make_attrp(ATTR_CALLAS, $3); } | tCASE '(' expr_list_const ')' { $$ = make_attrp(ATTR_CASE, $3); } | tCONTEXTHANDLE { $$ = make_attrv(ATTR_CONTEXTHANDLE, 0); } @@ -342,8 +378,11 @@ attribute: | tCONTEXTHANDLESERIALIZE { $$ = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ } | tCONTROL { $$ = make_attr(ATTR_CONTROL); } | tDEFAULT { $$ = make_attr(ATTR_DEFAULT); } + | tDEFAULTCOLLELEM { $$ = make_attr(ATTR_DEFAULTCOLLELEM); } | tDEFAULTVALUE '(' expr_const ')' { $$ = make_attrp(ATTR_DEFAULTVALUE_EXPR, $3); } | tDEFAULTVALUE '(' aSTRING ')' { $$ = make_attrp(ATTR_DEFAULTVALUE_STRING, $3); } + | tDEFAULTVTABLE { $$ = make_attr(ATTR_DEFAULTVTABLE); } + | tDISPLAYBIND { $$ = make_attr(ATTR_DISPLAYBIND); } | tDLLNAME '(' aSTRING ')' { $$ = make_attrp(ATTR_DLLNAME, $3); } | tDUAL { $$ = make_attr(ATTR_DUAL); } | tENDPOINT '(' aSTRING ')' { $$ = make_attrp(ATTR_ENDPOINT, $3); } @@ -360,34 +399,36 @@ attribute: | tID '(' expr_const ')' { $$ = make_attrp(ATTR_ID, $3); } | tIDEMPOTENT { $$ = make_attr(ATTR_IDEMPOTENT); } | tIIDIS '(' ident ')' { $$ = make_attrp(ATTR_IIDIS, $3); } + | tIMMEDIATEBIND { $$ = make_attr(ATTR_IMMEDIATEBIND); } | tIMPLICITHANDLE '(' tHANDLET aIDENTIFIER ')' { $$ = make_attrp(ATTR_IMPLICIT_HANDLE, $4); } | tIN { $$ = make_attr(ATTR_IN); } | tINPUTSYNC { $$ = make_attr(ATTR_INPUTSYNC); } - | tLENGTHIS '(' pident_list ')' { $$ = make_attrp(ATTR_LENGTHIS, $3); } + | tLENGTHIS '(' m_exprs ')' { $$ = make_attrp(ATTR_LENGTHIS, $3); } | tLOCAL { $$ = make_attr(ATTR_LOCAL); } + | tNONBROWSABLE { $$ = make_attr(ATTR_NONBROWSABLE); } | tNONCREATABLE { $$ = make_attr(ATTR_NONCREATABLE); } + | tNONEXTENSIBLE { $$ = make_attr(ATTR_NONEXTENSIBLE); } | tOBJECT { $$ = make_attr(ATTR_OBJECT); } | tODL { $$ = make_attr(ATTR_ODL); } | tOLEAUTOMATION { $$ = make_attr(ATTR_OLEAUTOMATION); } - | tOPTIONAL { $$ = make_attr(ATTR_OPTIONAL); } + | tOPTIONAL { $$ = make_attr(ATTR_OPTIONAL); } | tOUT { $$ = make_attr(ATTR_OUT); } | tPOINTERDEFAULT '(' pointer_type ')' { $$ = make_attrv(ATTR_POINTERDEFAULT, $3); } | tPROPGET { $$ = make_attr(ATTR_PROPGET); } | tPROPPUT { $$ = make_attr(ATTR_PROPPUT); } | tPROPPUTREF { $$ = make_attr(ATTR_PROPPUTREF); } - | tPTR { $$ = make_attr(ATTR_PTR); } | tPUBLIC { $$ = make_attr(ATTR_PUBLIC); } + | tRANGE '(' expr_const ',' expr_const ')' { LINK($5, $3); $$ = make_attrp(ATTR_RANGE, $5); } | tREADONLY { $$ = make_attr(ATTR_READONLY); } - | tREF { $$ = make_attr(ATTR_REF); } + | tREQUESTEDIT { $$ = make_attr(ATTR_REQUESTEDIT); } | tRESTRICTED { $$ = make_attr(ATTR_RESTRICTED); } | tRETVAL { $$ = make_attr(ATTR_RETVAL); } - | tSIZEIS '(' pident_list ')' { $$ = make_attrp(ATTR_SIZEIS, $3); } + | tSIZEIS '(' m_exprs ')' { $$ = make_attrp(ATTR_SIZEIS, $3); } | tSOURCE { $$ = make_attr(ATTR_SOURCE); } | tSTRING { $$ = make_attr(ATTR_STRING); } | tSWITCHIS '(' expr ')' { $$ = make_attrp(ATTR_SWITCHIS, $3); } | tSWITCHTYPE '(' type ')' { $$ = make_attrp(ATTR_SWITCHTYPE, type_ref($3)); } | tTRANSMITAS '(' type ')' { $$ = make_attrp(ATTR_TRANSMITAS, type_ref($3)); } - | tUNIQUE { $$ = make_attr(ATTR_UNIQUE); } | tUUID '(' aUUID ')' { $$ = make_attrp(ATTR_UUID, $3); } | tV1ENUM { $$ = make_attr(ATTR_V1ENUM); } | tVARARG { $$ = make_attr(ATTR_VARARG); } @@ -419,7 +460,6 @@ case: tCASE expr ':' field { attr_t *a = make_attrp(ATTR_CASE, $2); constdef: tCONST type ident '=' expr_const { $$ = reg_const($3); set_type($$, $2, NULL); $$->eval = $5; - $$->lval = $5->cval; } ; @@ -428,29 +468,29 @@ enums: { $$ = NULL; } | enum_list ; -enum_list: enum +enum_list: enum { if (!$$->eval) + $$->eval = make_exprl(EXPR_NUM, 0 /* default for first enum entry */); + } | enum_list ',' enum { LINK($3, $1); $$ = $3; - if ($1 && !$3->eval) - $3->lval = $1->lval + 1; + if (!$$->eval) + $$->eval = make_exprl(EXPR_NUM, $1->eval->cval + 1); } ; enum: ident '=' expr_const { $$ = reg_const($1); $$->eval = $3; - $$->lval = $3->cval; - $$->type = make_type(RPC_FC_LONG, &std_int); + $$->type = make_type(RPC_FC_LONG, &std_int); } | ident { $$ = reg_const($1); - $$->lval = 0; /* default for first enum entry */ - $$->type = make_type(RPC_FC_LONG, &std_int); + $$->type = make_type(RPC_FC_LONG, &std_int); } ; enumdef: tENUM t_ident '{' enums '}' { $$ = get_typev(RPC_FC_ENUM16, $2, tsENUM); $$->fields = $4; $$->defined = TRUE; - if(in_typelib) - add_enum($$); + if(in_typelib) + add_enum($$); } ; @@ -474,8 +514,10 @@ m_expr: { $$ = make_expr(EXPR_VOID); } expr: aNUM { $$ = make_exprl(EXPR_NUM, $1); } | aHEXNUM { $$ = make_exprl(EXPR_HEXNUM, $1); } + | tFALSE { $$ = make_exprl(EXPR_TRUEFALSE, 0); } + | tTRUE { $$ = make_exprl(EXPR_TRUEFALSE, 1); } | aIDENTIFIER { $$ = make_exprs(EXPR_IDENTIFIER, $1); } - | expr '?' expr ':' expr %prec COND { $$ = make_expr3(EXPR_COND, $1, $3, $5); } + | expr '?' expr ':' expr { $$ = make_expr3(EXPR_COND, $1, $3, $5); } | expr '|' expr { $$ = make_expr2(EXPR_OR , $1, $3); } | expr '&' expr { $$ = make_expr2(EXPR_AND, $1, $3); } | expr '+' expr { $$ = make_expr2(EXPR_ADD, $1, $3); } @@ -498,7 +540,7 @@ expr_list_const: expr_const expr_const: expr { $$ = $1; if (!$$->is_const) - yyerror("expression is not constant\n"); + yyerror("expression is not constant"); } ; @@ -528,7 +570,7 @@ funcdef: $4->attrs = $1; $$ = make_func($4, $6); if (is_attr($4->attrs, ATTR_IN)) { - yyerror("Inapplicable attribute"); + yyerror("inapplicable attribute [in] for function '%s'",$$->def->name); } } ; @@ -547,7 +589,11 @@ ident: aIDENTIFIER { $$ = make_var($1); } | aKNOWNTYPE { $$ = make_var($1); } | tASYNC { $$ = make_var($1); } | tID { $$ = make_var($1); } + | tLCID { $$ = make_var($1); } + | tOBJECT { $$ = make_var($1); } + | tRANGE { $$ = make_var($1); } | tRETVAL { $$ = make_var($1); } + | tUUID { $$ = make_var($1); } | tVERSION { $$ = make_var($1); } ; @@ -557,7 +603,7 @@ base_type: tBYTE { $$ = make_type(RPC_FC_BYTE, NULL); } | tSIGNED int_std { $$ = $2; $$->sign = 1; } | tUNSIGNED int_std { $$ = $2; $$->sign = -1; switch ($$->type) { - case RPC_FC_CHAR: break; + case RPC_FC_CHAR: break; case RPC_FC_SMALL: $$->type = RPC_FC_USMALL; break; case RPC_FC_SHORT: $$->type = RPC_FC_USHORT; break; case RPC_FC_LONG: $$->type = RPC_FC_ULONG; break; @@ -571,9 +617,9 @@ base_type: tBYTE { $$ = make_type(RPC_FC_BYTE, NULL); } | tFLOAT { $$ = make_type(RPC_FC_FLOAT, NULL); } | tSINGLE { $$ = make_type(RPC_FC_FLOAT, NULL); } | tDOUBLE { $$ = make_type(RPC_FC_DOUBLE, NULL); } - | tBOOLEAN { $$ = make_type(RPC_FC_SMALL, &std_bool); } + | tBOOLEAN { $$ = make_type(RPC_FC_BYTE, &std_bool); /* ? */ } | tERRORSTATUST { $$ = make_type(RPC_FC_ERROR_STATUS_T, NULL); } - | tHANDLET { $$ = make_type(RPC_FC_IGNORE, NULL); } + | tHANDLET { $$ = make_type(RPC_FC_BIND_PRIMITIVE, NULL); /* ? */ } ; m_int: @@ -581,8 +627,8 @@ m_int: ; int_std: tINT { $$ = make_type(RPC_FC_LONG, &std_int); } /* win32 only */ - | tSMALL m_int { $$ = make_type(RPC_FC_SMALL, NULL); } | tSHORT m_int { $$ = make_type(RPC_FC_SHORT, NULL); } + | tSMALL { $$ = make_type(RPC_FC_SMALL, NULL); } | tLONG m_int { $$ = make_type(RPC_FC_LONG, NULL); } | tHYPER m_int { $$ = make_type(RPC_FC_HYPER, NULL); } | tINT64 { $$ = make_type(RPC_FC_HYPER, &std_int64); } @@ -590,7 +636,10 @@ int_std: tINT { $$ = make_type(RPC_FC_LONG, &std_int); } /* win32 only */ ; coclass: tCOCLASS aIDENTIFIER { $$ = make_class($2); } - | tCOCLASS aKNOWNTYPE { $$ = make_class($2); } + | tCOCLASS aKNOWNTYPE { $$ = find_type($2, 0); + if ($$->defined) yyerror("multiple definition error"); + if ($$->kind != TKIND_COCLASS) yyerror("%s was not declared a coclass", $2); + } ; coclasshdr: attributes coclass { $$ = $2; @@ -617,13 +666,14 @@ dispinterface: tDISPINTERFACE aIDENTIFIER { $$ = get_type(0, $2, 0); } | tDISPINTERFACE aKNOWNTYPE { $$ = get_type(0, $2, 0); } ; -dispinterfacehdr: attributes dispinterface { $$ = $2; - if ($$->defined) yyerror("multiple definition error\n"); - $$->attrs = $1; - $$->attrs = make_attr(ATTR_DISPINTERFACE); - LINK($$->attrs, $1); +dispinterfacehdr: attributes dispinterface { attr_t *attrs; + $$ = $2; + if ($$->defined) yyerror("multiple definition error"); + attrs = make_attr(ATTR_DISPINTERFACE); + LINK(attrs, $1); + $$->attrs = attrs; $$->ref = find_type("IDispatch", 0); - if (!$$->ref) yyerror("IDispatch is undefined\n"); + if (!$$->ref) yyerror("IDispatch is undefined"); $$->defined = TRUE; if (!parse_only && do_header) write_forward($$); } @@ -661,7 +711,7 @@ interface: tINTERFACE aIDENTIFIER { $$ = get_type(RPC_FC_IP, $2, 0); } ; interfacehdr: attributes interface { $$ = $2; - if ($$->defined) yyerror("multiple definition error\n"); + if ($$->defined) yyerror("multiple definition error"); $$->attrs = $1; $$->defined = TRUE; if (!parse_only && do_header) write_forward($$); @@ -679,7 +729,7 @@ interfacedef: interfacehdr inherit | interfacehdr ':' aIDENTIFIER '{' import int_statements '}' { $$ = $1; $$->ref = find_type2($3, 0); - if (!$$->ref) yyerror("base class %s not found in import\n", $3); + if (!$$->ref) yyerror("base class '%s' not found in import", $3); $$->funcs = $6; if (!parse_only && do_header) write_interface($$); } @@ -723,16 +773,17 @@ pident_list: pointer_type: tREF { $$ = RPC_FC_RP; } | tUNIQUE { $$ = RPC_FC_UP; } + | tPTR { $$ = RPC_FC_FP; } ; structdef: tSTRUCT t_ident '{' fields '}' { $$ = get_typev(RPC_FC_STRUCT, $2, tsSTRUCT); - /* overwrite RPC_FC_STRUCT with a more exact type */ + /* overwrite RPC_FC_STRUCT with a more exact type */ $$->type = get_struct_type( $4 ); $$->fields = $4; $$->defined = TRUE; - if(in_typelib) - add_struct($$); - } + if(in_typelib) + add_struct($$); + } ; type: tVOID { $$ = make_tref(NULL, make_type(0, NULL)); } @@ -745,6 +796,7 @@ type: tVOID { $$ = make_tref(NULL, make_type(0, NULL)); } | tSTRUCT aIDENTIFIER { $$ = make_tref(NULL, get_type(RPC_FC_STRUCT, $2, tsSTRUCT)); } | uniondef { $$ = make_tref(NULL, $1); } | tUNION aIDENTIFIER { $$ = make_tref(NULL, find_type2($2, tsUNION)); } + | tSAFEARRAY '(' type ')' { $$ = make_tref(NULL, make_safearray()); } ; typedef: tTYPEDEF m_attributes type pident_list { typeref_t *tref = uniq_tref($3); @@ -831,7 +883,9 @@ static expr_t *make_exprl(enum expr_type type, long val) e->is_const = FALSE; INIT_LINK(e); /* check for numeric constant */ - if (type == EXPR_NUM || type == EXPR_HEXNUM) { + if (type == EXPR_NUM || type == EXPR_HEXNUM || type == EXPR_TRUEFALSE) { + /* make sure true/false value is valid */ + assert(type != EXPR_TRUEFALSE || val == 0 || val == 1); e->is_const = TRUE; e->cval = val; } @@ -854,7 +908,7 @@ static expr_t *make_exprs(enum expr_type type, char *val) e->u.sval = c->name; free(val); e->is_const = TRUE; - e->cval = c->lval; + e->cval = c->eval->cval; } } return e; @@ -870,6 +924,35 @@ static expr_t *make_exprt(enum expr_type type, typeref_t *tref, expr_t *expr) e->is_const = FALSE; INIT_LINK(e); /* check for cast of constant expression */ + if (type == EXPR_SIZEOF) { + switch (tref->ref->type) { + case RPC_FC_BYTE: + case RPC_FC_CHAR: + case RPC_FC_SMALL: + case RPC_FC_USMALL: + e->is_const = TRUE; + e->cval = 1; + break; + case RPC_FC_WCHAR: + case RPC_FC_USHORT: + case RPC_FC_SHORT: + e->is_const = TRUE; + e->cval = 2; + break; + case RPC_FC_LONG: + case RPC_FC_ULONG: + case RPC_FC_FLOAT: + case RPC_FC_ERROR_STATUS_T: + e->is_const = TRUE; + e->cval = 4; + break; + case RPC_FC_HYPER: + case RPC_FC_DOUBLE: + e->is_const = TRUE; + e->cval = 8; + break; + } + } if (type == EXPR_CAST && expr->is_const) { e->is_const = TRUE; e->cval = expr->cval; @@ -978,12 +1061,13 @@ static type_t *make_type(unsigned char type, type_t *ref) { type_t *t = xmalloc(sizeof(type_t)); t->name = NULL; + t->kind = TKIND_PRIMITIVE; t->type = type; t->ref = ref; - t->rname = NULL; t->attrs = NULL; t->funcs = NULL; t->fields = NULL; + t->ifaces = NULL; t->ignore = parse_only; t->is_const = FALSE; t->sign = 0; @@ -1052,7 +1136,6 @@ static var_t *make_var(char *name) v->attrs = NULL; v->array = NULL; v->eval = NULL; - v->lval = 0; INIT_LINK(v); return v; } @@ -1068,16 +1151,20 @@ static func_t *make_func(var_t *def, var_t *args) return f; } -static class_t *make_class(char *name) +static type_t *make_class(char *name) { - class_t *c = xmalloc(sizeof(class_t)); + type_t *c = make_type(0, NULL); c->name = name; - c->attrs = NULL; - c->ifaces = NULL; + c->kind = TKIND_COCLASS; INIT_LINK(c); return c; } +static type_t *make_safearray(void) +{ + return make_type(RPC_FC_FP, find_type("SAFEARRAY", 0)); +} + #define HASHMAX 64 static int hash_ident(const char *name) @@ -1095,7 +1182,7 @@ static int hash_ident(const char *name) /***** type repository *****/ struct rtype { - char *name; + const char *name; type_t *type; int t; struct rtype *next; @@ -1103,12 +1190,12 @@ struct rtype { struct rtype *type_hash[HASHMAX]; -static type_t *reg_type(type_t *type, char *name, int t) +static type_t *reg_type(type_t *type, const char *name, int t) { struct rtype *nt; int hash; if (!name) { - yyerror("registering named type without name\n"); + yyerror("registering named type without name"); return type; } hash = hash_ident(name); @@ -1118,7 +1205,6 @@ static type_t *reg_type(type_t *type, char *name, int t) nt->t = t; nt->next = type_hash[hash]; type_hash[hash] = nt; - type->name = name; return type; } @@ -1141,14 +1227,7 @@ static unsigned char get_pointer_type( type_t *type ) } t = get_attrv( type->attrs, ATTR_POINTERTYPE ); if (t) return t; - - if(is_attr( type->attrs, ATTR_PTR )) - return RPC_FC_FP; - - if(is_attr( type->attrs, ATTR_UNIQUE )) - return RPC_FC_UP; - - return RPC_FC_RP; + return RPC_FC_FP; } static type_t *reg_types(type_t *type, var_t *names, int t) @@ -1181,13 +1260,13 @@ static type_t *reg_types(type_t *type, var_t *names, int t) return type; } -static type_t *find_type(char *name, int t) +static type_t *find_type(const char *name, int t) { struct rtype *cur = type_hash[hash_ident(name)]; while (cur && (cur->t != t || strcmp(cur->name, name))) cur = cur->next; if (!cur) { - yyerror("type %s not found\n", name); + yyerror("type '%s' not found", name); return NULL; } return cur->type; @@ -1241,10 +1320,10 @@ static type_t *get_typev(unsigned char type, var_t *name, int t) static int get_struct_type(var_t *field) { int has_pointer = 0; - int has_conformant_array = 0; - int has_conformant_string = 0; + int has_conformance = 0; + int has_variance = 0; - while (field) + for (; field; field = NEXT_LINK(field)) { type_t *t = field->type; @@ -1252,6 +1331,32 @@ static int get_struct_type(var_t *field) while( (t->type == 0) && t->ref ) t = t->ref; + if (field->ptr_level > 0) + { + has_pointer = 1; + continue; + } + + if (is_string_type(field->attrs, 0, field->array)) + { + has_conformance = 1; + has_variance = 1; + continue; + } + + if (is_array_type(field->attrs, 0, field->array)) + { + if (field->array && !field->array->is_const) + { + has_conformance = 1; + if (PREV_LINK(field)) + yyerror("field '%s' deriving from a conformant array must be the last field in the structure", + field->name); + } + if (is_attr(field->attrs, ATTR_LENGTHIS)) + has_variance = 1; + } + switch (t->type) { /* @@ -1285,11 +1390,15 @@ static int get_struct_type(var_t *field) has_pointer = 1; break; case RPC_FC_CARRAY: - has_conformant_array = 1; + has_conformance = 1; + if (PREV_LINK(field)) + yyerror("field '%s' deriving from a conformant array must be the last field in the structure", + field->name); break; case RPC_FC_C_CSTRING: case RPC_FC_C_WSTRING: - has_conformant_string = 1; + has_conformance = 1; + has_variance = 1; break; /* @@ -1297,17 +1406,24 @@ static int get_struct_type(var_t *field) * a struct should be at least as complex as its member */ case RPC_FC_CVSTRUCT: - has_conformant_string = 1; + has_conformance = 1; + has_variance = 1; has_pointer = 1; break; case RPC_FC_CPSTRUCT: - has_conformant_array = 1; + has_conformance = 1; + if (PREV_LINK(field)) + yyerror("field '%s' deriving from a conformant array must be the last field in the structure", + field->name); has_pointer = 1; break; case RPC_FC_CSTRUCT: - has_conformant_array = 1; + has_conformance = 1; + if (PREV_LINK(field)) + yyerror("field '%s' deriving from a conformant array must be the last field in the structure", + field->name); break; case RPC_FC_PSTRUCT: @@ -1330,14 +1446,13 @@ static int get_struct_type(var_t *field) case RPC_FC_BOGUS_STRUCT: return RPC_FC_BOGUS_STRUCT; } - field = NEXT_LINK(field); } - if( has_conformant_string && has_pointer ) + if( has_variance ) return RPC_FC_CVSTRUCT; - if( has_conformant_array && has_pointer ) + if( has_conformance && has_pointer ) return RPC_FC_CPSTRUCT; - if( has_conformant_array ) + if( has_conformance ) return RPC_FC_CSTRUCT; if( has_pointer ) return RPC_FC_PSTRUCT; @@ -1359,7 +1474,7 @@ static var_t *reg_const(var_t *var) struct rconst *nc; int hash; if (!var->name) { - yyerror("registering constant without name\n"); + yyerror("registering constant without name"); return var; } hash = hash_ident(var->name); @@ -1377,7 +1492,7 @@ static var_t *find_const(char *name, int f) while (cur && strcmp(cur->name, name)) cur = cur->next; if (!cur) { - if (f) yyerror("constant %s not found\n", name); + if (f) yyerror("constant '%s' not found", name); return NULL; } return cur->var; diff --git a/reactos/tools/widl/proxy.c b/reactos/tools/widl/proxy.c index 0cdf394541c..1710cdcadb7 100644 --- a/reactos/tools/widl/proxy.c +++ b/reactos/tools/widl/proxy.c @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" +#include "wine/port.h" #include #include @@ -109,8 +110,8 @@ static void write_formatstringsdecl(void) write_formatdesc( "TYPE" ); write_formatdesc( "PROC" ); fprintf(proxy, "\n"); - print_proxy( "extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;\n"); - print_proxy( "extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;\n"); + print_proxy( "static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;\n"); + print_proxy( "static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;\n"); print_proxy( "\n"); } @@ -205,14 +206,14 @@ static void proxy_check_pointers( var_t *arg ) static void marshall_size_arg( var_t *arg ) { int index = 0; - type_t *type = get_base_type(arg); - var_t *var; + const type_t *type = get_base_type(arg); + expr_t *expr; - var = get_attrp( arg->attrs, ATTR_SIZEIS ); - if (var) + expr = get_attrp( arg->attrs, ATTR_SIZEIS ); + if (expr) { print_proxy( "_StubMsg.MaxCount = ", arg->name ); - write_name(proxy, var); + write_expr(proxy, expr, 0); fprintf(proxy, ";\n\n"); print_proxy( "NdrConformantArrayBufferSize( &_StubMsg, (unsigned char*)%s, ", arg->name ); fprintf(proxy, "&__MIDL_TypeFormatString.Format[%d]);\n", index ); @@ -238,7 +239,7 @@ static void marshall_size_arg( var_t *arg ) case RPC_FC_ENUM32: print_proxy( "_StubMsg.BufferLength += %d; /* %s */\n", 4, arg->name ); break; - + case RPC_FC_STRUCT: print_proxy( "NdrSimpleStructBufferSize(&_StubMsg, (unsigned char*)%s, ", arg->name ); fprintf(proxy, "&__MIDL_TypeFormatString.Format[%d] );\n", index ); @@ -285,7 +286,7 @@ static void proxy_gen_marshall_size( var_t *arg ) END_OF_LIST(arg); while (arg) { - if (is_attr(arg->attrs, ATTR_IN)) + if (is_attr(arg->attrs, ATTR_IN)) { marshall_size_arg( arg ); fprintf(proxy, "\n"); @@ -298,13 +299,13 @@ static void marshall_copy_arg( var_t *arg ) { int index = 0; type_t *type = get_base_type(arg); - var_t *var; + expr_t *expr; - var = get_attrp( arg->attrs, ATTR_SIZEIS ); - if (var) + expr = get_attrp( arg->attrs, ATTR_SIZEIS ); + if (expr) { print_proxy( "_StubMsg.MaxCount = ", arg->name ); - write_name(proxy, var); + write_expr(proxy, expr, 0); fprintf(proxy, ";\n\n"); print_proxy( "NdrConformantArrayMarshall( &_StubMsg, (unsigned char*)%s, ", arg->name ); fprintf(proxy, "&__MIDL_TypeFormatString.Format[%d]);\n", index ); @@ -322,11 +323,14 @@ static void marshall_copy_arg( var_t *arg ) case RPC_FC_LONG: case RPC_FC_ULONG: case RPC_FC_ENUM32: - print_proxy( "*(("); + print_proxy( "*("); write_type(proxy, arg->type, arg, arg->tname); - fprintf(proxy,"*)_StubMsg.Buffer)++ = %s;\n", arg->name ); + fprintf(proxy, " *)_StubMsg.Buffer = %s;\n", arg->name ); + print_proxy("_StubMsg.Buffer += sizeof("); + write_type(proxy, arg->type, arg, arg->tname); + fprintf(proxy, ");\n"); break; - + case RPC_FC_STRUCT: /* FIXME: add the format string, and set the index below */ print_proxy( "NdrSimpleStructMarshall(&_StubMsg, (unsigned char*)%s, ", arg->name ); @@ -370,7 +374,7 @@ static void gen_marshall_copydata( var_t *arg ) { END_OF_LIST(arg); while (arg) { - if (is_attr(arg->attrs, ATTR_IN)) + if (is_attr(arg->attrs, ATTR_IN)) { marshall_copy_arg( arg ); fprintf(proxy, "\n"); @@ -397,10 +401,10 @@ static void unmarshall_copy_arg( var_t *arg ) { int index = 0; type_t *type = get_base_type(arg); - var_t *var; + expr_t *expr; - var = get_attrp( arg->attrs, ATTR_SIZEIS ); - if (var) + expr = get_attrp( arg->attrs, ATTR_SIZEIS ); + if (expr) { print_proxy( "NdrConformantArrayUnmarshall( &_StubMsg, (unsigned char*)%s, ", arg->name ); fprintf(proxy, "&__MIDL_TypeFormatString.Format[%d]);\n", index ); @@ -418,11 +422,14 @@ static void unmarshall_copy_arg( var_t *arg ) case RPC_FC_LONG: case RPC_FC_ULONG: case RPC_FC_ENUM32: - print_proxy( "%s = *((", arg->name ); + print_proxy( "%s = *(", arg->name ); write_type(proxy, arg->type, arg, arg->tname); - fprintf(proxy,"*)_StubMsg.Buffer)++;\n"); + fprintf(proxy," *)_StubMsg.Buffer;\n"); + print_proxy("_StubMsg.Buffer += sizeof("); + write_type(proxy, arg->type, arg, arg->tname); + fprintf(proxy, ");\n"); break; - + case RPC_FC_STRUCT: print_proxy( "NdrSimpleStructUnmarshall(&_StubMsg, (unsigned char**)%s, ", arg->name ); fprintf(proxy, "&__MIDL_TypeFormatString.Format[%d], 0);\n", index ); @@ -467,7 +474,7 @@ static void gen_unmarshall( var_t *arg ) { END_OF_LIST(arg); while (arg) { - if (is_attr(arg->attrs, ATTR_OUT)) + if (is_attr(arg->attrs, ATTR_OUT)) { unmarshall_copy_arg( arg ); fprintf(proxy, "\n"); @@ -481,13 +488,13 @@ static void free_variable( var_t *arg ) var_t *constraint; int index = 0; /* FIXME */ type_t *type; - var_t *var; + expr_t *expr; - var = get_attrp( arg->attrs, ATTR_SIZEIS ); - if (var) + expr = get_attrp( arg->attrs, ATTR_SIZEIS ); + if (expr) { print_proxy( "_StubMsg.MaxCount = ", arg->name ); - write_name(proxy, var); + write_expr(proxy, expr, 0); fprintf(proxy, ";\n\n"); print_proxy( "NdrClearOutParameters( &_StubMsg, "); fprintf(proxy, "&__MIDL_TypeFormatString.Format[%d], ", index ); @@ -529,7 +536,7 @@ static void proxy_free_variables( var_t *arg ) { END_OF_LIST(arg); while (arg) { - if (is_attr(arg->attrs, ATTR_OUT)) + if (is_attr(arg->attrs, ATTR_OUT)) { free_variable( arg ); fprintf(proxy, "\n"); @@ -587,16 +594,19 @@ static void gen_proxy(type_t *iface, func_t *cur, int idx) gen_unmarshall( cur->args ); if (has_ret) { - /* + /* * FIXME: We only need to round the buffer up if it could be unaligned... * We should calculate how much buffer we used and output the following * line only if necessary. */ print_proxy( "_StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);\n"); - print_proxy( "_RetVal = *((" ); + print_proxy( "_RetVal = *(" ); write_type(proxy, def->type, def, def->tname); - fprintf(proxy, "*)_StubMsg.Buffer)++;\n"); + fprintf(proxy, " *)_StubMsg.Buffer;\n"); + print_proxy("_StubMsg.Buffer += sizeof("); + write_type(proxy, def->type, def, def->tname); + fprintf(proxy, ");\n"); } indent--; @@ -718,7 +728,7 @@ static void stub_genmarshall( var_t *args ) stub_gen_marshall_copydata( args ); } -static void gen_stub(type_t *iface, func_t *cur, char *cas) +static void gen_stub(type_t *iface, func_t *cur, const char *cas) { var_t *def = cur->def; var_t *arg; @@ -790,16 +800,19 @@ static void gen_stub(type_t *iface, func_t *cur, char *cas) fprintf(proxy, "\n"); if (has_ret) { - /* + /* * FIXME: We only need to round the buffer up if it could be unaligned... * We should calculate how much buffer we used and output the following * line only if necessary. */ print_proxy( "_StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);\n"); - print_proxy( "*((" ); + print_proxy( "*(" ); write_type(proxy, def->type, def, def->tname); - fprintf(proxy, "*)_StubMsg.Buffer)++ = _RetVal;\n"); + fprintf(proxy, " *)_StubMsg.Buffer = _RetVal;\n"); + print_proxy("_StubMsg.Buffer += sizeof("); + write_type(proxy, def->type, def, def->tname); + fprintf(proxy, ");\n"); } indent--; @@ -809,7 +822,7 @@ static void gen_stub(type_t *iface, func_t *cur, char *cas) print_proxy("}\n"); print_proxy("RpcEndFinally\n"); - print_proxy("_Msg->BufferLength = ((long)_StubMsg.Buffer - (long)_Msg->Buffer);\n"); + print_proxy("_Msg->BufferLength = _StubMsg.Buffer - (unsigned char *)_Msg->Buffer;\n"); indent--; print_proxy("}\n"); @@ -876,13 +889,13 @@ static void write_proxy(type_t *iface) fprintf(proxy, " * %s interface\n", iface->name); fprintf(proxy, " */\n"); while (cur) { - var_t *def = cur->def; + const var_t *def = cur->def; if (!is_local(def->attrs)) { - var_t *cas = is_callas(def->attrs); - char *cname = cas ? cas->name : NULL; + const var_t *cas = is_callas(def->attrs); + const char *cname = cas ? cas->name : NULL; int idx = cur->idx; if (cname) { - func_t *m = iface->funcs; + const func_t *m = iface->funcs; while (m && strcmp(get_name(m->def), cname)) m = NEXT_LINK(m); idx = m->idx; diff --git a/reactos/tools/widl/server.c b/reactos/tools/widl/server.c index 42e4bf59649..72d5ae700f2 100644 --- a/reactos/tools/widl/server.c +++ b/reactos/tools/widl/server.c @@ -1,7 +1,7 @@ /* * IDL Compiler * - * Copyright 2005 Eric Kohl + * Copyright 2005-2006 Eric Kohl * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -15,10 +15,11 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" +#include "wine/port.h" #include #include @@ -34,14 +35,12 @@ #include "utils.h" #include "parser.h" #include "header.h" +#include "windef.h" -#define END_OF_LIST(list) \ - do { \ - if (list) { \ - while (NEXT_LINK(list)) \ - list = NEXT_LINK(list); \ - } \ - } while(0) +#include "widl.h" +#include "typelib.h" +#include "typelib_struct.h" +#include "typegen.h" static FILE* server; static int indent = 0; @@ -61,899 +60,31 @@ static int print_server(const char *format, ...) } -static unsigned int -get_var_stack_offset_32(func_t *func, char *name) +static void write_parameters_init(const func_t *func) { - unsigned int offset = 0; - var_t *var; + const var_t *var; + + if (!func->args) + return; var = func->args; while (NEXT_LINK(var)) var = NEXT_LINK(var); while (var) { - if (!strcmp(var->name, name)) - return offset; - - if (var->type->type == RPC_FC_DOUBLE || - var->type->type == RPC_FC_HYPER) - offset += 8; - else - offset += 4; + if (var->type->type != RPC_FC_BIND_PRIMITIVE) + print_server("%s = 0;\n", var->name); var = PREV_LINK(var); } - - return 0; -} - - -static unsigned int -get_var_stack_offset_64(func_t *func, char *name) -{ - unsigned int offset = 0; - var_t *var; - - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - if (!strcmp(var->name, name)) - return offset; - - offset += 8; - - var = PREV_LINK(var); - } - - return 0; -} - - -static unsigned int -get_var_proc_offset(var_t *var) -{ - if (var->ptr_level == 0 && is_base_type(var->type)) - return 2; - - return 4; -} - - -static unsigned int -get_var_type_offset(var_t *var) -{ - unsigned int toffset = 0; - void *sizeis_attr; - int string_attr; - type_t *type; - - type = var->type; - - if (var->ptr_level == 0) - { - if (type->type == RPC_FC_RP) - { - int tsize = 9; - - while (type->ref) - type = type->ref; - - if (type->type == RPC_FC_STRUCT) - { - var_t *field = type->fields; - - while (NEXT_LINK(field)) field = NEXT_LINK(field); - while (field) - { - tsize++; - field = PREV_LINK(field); - } - if (tsize % 2) - tsize++; - - toffset += tsize; - } - } - } - else if (var->ptr_level == 1) - { - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - string_attr = is_attr(var->attrs, ATTR_STRING); - - if (sizeis_attr) - { - if (string_attr) - { - if (type->type == RPC_FC_BYTE || - type->type == RPC_FC_CHAR || - type->type == RPC_FC_WCHAR) - toffset += 10; - } - else - { - if (is_base_type(type)) - toffset += 14; - } - } - else - { - if (is_base_type(type)) - toffset += 4; - } - } - - return toffset; -} - - -static type_t *get_type_by_name(func_t *func, char *name) -{ - var_t *var; - - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - if (!strcmp(var->name, name)) - return var->type; - - var = PREV_LINK(var); - } - - return NULL; -} - - -static unsigned char -get_base_type(unsigned char type) -{ - - switch (type) - { - case RPC_FC_USHORT: - type = RPC_FC_SHORT; - break; - - case RPC_FC_ULONG: - type = RPC_FC_LONG; - break; - } - - return type; -} - - -static int get_type_size(type_t *type, int alignment) -{ - int size; - var_t *field; - - switch(type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - size = 1; - size = ((size + alignment - 1) & ~(alignment -1)); - break; - - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - size = 2; - size = ((size + alignment - 1) & ~(alignment -1)); - break; - - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - size = ((size + alignment - 1) & ~(alignment -1)); - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - size = ((size + alignment - 1) & ~(alignment -1)); - break; - - case RPC_FC_IGNORE: - size = 0; - break; - - case RPC_FC_STRUCT: - field = type->fields; - size = 0; - while (NEXT_LINK(field)) field = NEXT_LINK(field); - while (field) - { - size += get_type_size(field->type, alignment); - field = PREV_LINK(field); - } - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, type->type); - return 0; - } - - return size; -} - - -static int get_type_alignment(type_t *type) -{ - int size; - - switch(type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - size = 1; - break; - - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - size = 2; - break; - - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, type->type); - return 0; - } - - return size; -} - - -static void write_procformatstring(type_t *iface) -{ - func_t *func = iface->funcs; - var_t *var; - unsigned int type_offset = 2; - int in_attr, out_attr; - - print_server("static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =\n"); - print_server("{\n"); - indent++; - print_server("0,\n"); - print_server("{\n"); - indent++; - - while (NEXT_LINK(func)) func = NEXT_LINK(func); - while (func) - { - /* emit argument data */ - if (func->args) - { - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - out_attr = is_attr(var->attrs, ATTR_OUT); - in_attr = is_attr(var->attrs, ATTR_IN); - - /* set 'in' attribute if neither 'in' nor 'out' is set */ - if (!out_attr && !in_attr) - in_attr = 1; - - if (var->ptr_level == 0) - { - if (is_base_type(var->type)) - { - print_server("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); - print_server("0x%02x, /* FC_ */\n", - get_base_type(var->type->type)); - } - else if (var->type->type == RPC_FC_RP) - { - if (in_attr & !out_attr) - print_server("0x4d, /* FC_IN_PARAM */\n"); - else if (!in_attr & out_attr) - print_server("0x51, /* FC_OUT_PARAM */\n"); - else if (in_attr & out_attr) - print_server("0x50, /* FC_IN_OUT_PARAM */\n"); - fprintf(server, "#ifndef _ALPHA_\n"); - print_server("0x01,\n"); - fprintf(server, "#else\n"); - print_server("0x02,\n"); - fprintf(server, "#endif\n"); - print_server("NdrFcShort(0x%x),\n", type_offset); - } - else - { - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, var->type->type); - return; - } - } - else if (var->ptr_level == 1) - { - if (in_attr & !out_attr) - print_server("0x4d, /* FC_IN_PARAM */\n"); - else if (!in_attr & out_attr) - print_server("0x51, /* FC_OUT_PARAM */\n"); - else if (in_attr & out_attr) - print_server("0x50, /* FC_IN_OUT_PARAM */\n"); - fprintf(server, "#ifndef _ALPHA_\n"); - print_server("0x01,\n"); - fprintf(server, "#else\n"); - print_server("0x02,\n"); - fprintf(server, "#endif\n"); - print_server("NdrFcShort(0x%x),\n", type_offset); - } - - type_offset += get_var_type_offset(var); - - var = PREV_LINK(var); - } - } - - /* emit return value data */ - var = func->def; - if (is_void(var->type, NULL)) - { - print_server("0x5b, /* FC_END */\n"); - print_server("0x5c, /* FC_PAD */\n"); - } - else if (is_base_type(var->type)) - { - print_server("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); - print_server("0x%02x, /* FC_ */\n", get_base_type(var->type->type)); - } - else - { - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, var->type->type); - return; - } - - func = PREV_LINK(func); - } - - print_server("0x0\n"); - indent--; - print_server("}\n"); - indent--; - print_server("};\n"); - print_server("\n"); -} - - -static void write_typeformatstring(type_t *iface) -{ - func_t *func = iface->funcs; - var_t *var; - type_t *type; - int in_attr, out_attr; - int string_attr; - int ptr_attr, ref_attr, unique_attr; - void *sizeis_attr; - - print_server("static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =\n"); - print_server("{\n"); - indent++; - print_server("0,\n"); - print_server("{\n"); - indent++; - print_server("NdrFcShort(0x0),\n"); - - while (NEXT_LINK(func)) func = NEXT_LINK(func); - while (func) - { - if (func->args) - { - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - in_attr = is_attr(var->attrs, ATTR_IN); - out_attr = is_attr(var->attrs, ATTR_OUT); - string_attr = is_attr(var->attrs, ATTR_STRING); - - if (var->ptr_level > 1) - { - error("Function '%s' argument '%s': Pointer level %d not supported!\n", - func->def->name, var->name, var->ptr_level); - return; - } - - type = var->type; - if (var->ptr_level == 0) - { - if (!is_base_type(type)) - { - if (type->type == RPC_FC_RP) - { - var_t *field; - int tsize = 9; - unsigned char flags = 0; - - if (!in_attr & out_attr) - flags |= RPC_FC_P_ONSTACK; - - while (type->ref) - type = type->ref; - - print_server("0x11, 0x%02X, /* FC_RP, [flags] */\n", flags); - print_server("NdrFcShort(0x%02X),\n", 0x02); - print_server("0x%02X,\n", type->type); - print_server("0x%02X,\n", 3); /* alignment - 1 */ - print_server("NdrFcShort(0x%02X),\n", get_type_size(type, 4)); - - field = type->fields; - while (NEXT_LINK(field)) field = NEXT_LINK(field); - while (field) - { - print_server("0x%02X,\n", get_base_type(field->type->type)); - tsize++; - field = PREV_LINK(field); - } - if (tsize % 2) - { - print_server("0x5c, /* FC_PAD */\n"); - tsize++; - } - print_server("0x5b, /* FC_END */\n"); - } - else - { - - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, type->type); - return; - } - } - } - else if (var->ptr_level == 1) - { - ptr_attr = is_attr(var->attrs, ATTR_PTR); - ref_attr = is_attr(var->attrs, ATTR_REF); - unique_attr = is_attr(var->attrs, ATTR_UNIQUE); - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - - if (ptr_attr + ref_attr + unique_attr == 0) - ref_attr = 1; - - if (sizeis_attr) - { - unsigned char type_type = 0; - - type = get_type_by_name(func, ((var_t *)sizeis_attr)->name); - if (type != NULL) - type_type = type->type; - - if (ref_attr) - print_server("0x11, 0x00, /* FC_RP */\n"); - else if (unique_attr) - print_server("0x12, 0x00, /* FC_UP */\n"); - else if (ptr_attr) - print_server("0x14, 0x00, /* FC_FP */\n"); - print_server("NdrFcShort(0x02),\n"); - - if (string_attr) - { - if (var->type->type == RPC_FC_WCHAR) - print_server("0x25, /* FC_C_WSTRING */\n"); - else - print_server("0x22, /* FC_C_CSTRING */\n"); - print_server("0x44, /* FC_STRING_SIZED */\n"); - print_server("0x%02x,\n", 0x20 + type_type); - print_server("0x00,\n"); - - fprintf(server, "#ifndef _ALPHA_\n"); - print_server("NdrFcShort(0x%02X),\n", - get_var_stack_offset_32(func, ((var_t *)sizeis_attr)->name)); - fprintf(server, "#else\n"); - print_server("NdrFcShort(0x%02X),\n", - get_var_stack_offset_64(func, ((var_t *)sizeis_attr)->name)); - fprintf(server, "#endif\n"); - } - else - { - print_server("0x1b, /* FC_CARRAY */\n"); - print_server("0x%02x,\n", get_type_alignment(var->type) - 1); - print_server("NdrFcShort(0x%02x),\n", get_type_size(var->type, 1)); - print_server("0x%02x,\n", 0x20 + type_type); - if (out_attr) - print_server("0x54 /* FC_DEREFERENCE */,\n"); - else - print_server("0x00 /* */,\n"); - - fprintf(server, "#ifndef _ALPHA_\n"); - print_server("NdrFcShort(0x%02X),\n", - get_var_stack_offset_32(func, ((var_t *)sizeis_attr)->name)); - fprintf(server, "#else\n"); - print_server("NdrFcShort(0x%02X),\n", - get_var_stack_offset_64(func, ((var_t *)sizeis_attr)->name)); - fprintf(server, "#endif\n"); - print_server("0x%02x,\n", get_base_type(var->type->type)); - print_server("0x5b, /* FC_END */\n"); - } - } - else if (is_base_type(type)) - { - if (out_attr && !in_attr) - { - if (ref_attr) - print_server("0x11, 0x0c, /* FC_RP [allocated_on_stack] [simple_pointer] */\n"); - else if (unique_attr) - print_server("0x12, 0x0c, /* FC_UP [allocated_on_stack] [simple_pointer] */\n"); - else if (ptr_attr) - print_server("0x14, 0x0c, /* FC_FP [allocated_on_stack] [simple_pointer] */\n"); - } - else - { - if (ref_attr) - print_server("0x11, 0x08, /* FC_RP [simple_pointer] */\n"); - else if (unique_attr) - print_server("0x12, 0x08, /* FC_UP [simple_pointer] */\n"); - else if (ptr_attr) - print_server("0x14, 0x08, /* FC_FP [simple_pointer] */\n"); - } - - if (string_attr) - { - if (var->type->type == RPC_FC_CHAR) - print_server("0x%02x, /* FC_C_CSTRING */\n", RPC_FC_C_CSTRING); - else if (var->type->type == RPC_FC_WCHAR) - print_server("0x%02x, /* FC_C_WSTRING */\n", RPC_FC_C_WSTRING); - else - { - error("%s:%d Invalid type!\n", __FILE__, __LINE__); - return; - } - } - else - print_server("0x%02x, /* FC_ */\n", get_base_type(var->type->type)); - print_server("0x5c, /* FC_PAD */\n"); - } - } - - var = PREV_LINK(var); - } - } - - - - func = PREV_LINK(func); - } - - print_server("0x0\n"); - indent--; - print_server("}\n"); - indent--; - print_server("};\n"); - print_server("\n"); -} - - -static void print_message_buffer_size(func_t *func, unsigned int *type_offset) -{ - unsigned int alignment = 0; - int size = 0; - int last_size = -1; - int in_attr; - int out_attr; - int string_attr, unique_attr; - void *sizeis_attr; - int empty_line; - var_t *var; - - int first_padding = 0; - int padding = 0; - int add_plus = 0; - - unsigned int local_type_offset = *type_offset; - fprintf(server, "\n"); - print_server("_StubMsg.BufferLength ="); - if (func->args) - { - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - for (; var; var = PREV_LINK(var)) - { - out_attr = is_attr(var->attrs, ATTR_OUT); - string_attr = is_attr(var->attrs, ATTR_STRING); - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - unique_attr = is_attr(var->attrs, ATTR_UNIQUE); - - if (out_attr) - { - if (var->ptr_level == 1) - { - if (sizeis_attr) - { - if (string_attr && - (var->type->type == RPC_FC_BYTE || - var->type->type == RPC_FC_CHAR || - var->type->type == RPC_FC_WCHAR)) - { - size =12; - } - else - { - size = 4; - } - } - else if (is_base_type(var->type)) - { - alignment = 0; - switch (var->type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - size = 1; - alignment = 0; - break; - - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - size = 2; - if (last_size > 0 && last_size < 2) - alignment += (2 - last_size); - break; - - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - if (last_size > 0 && last_size < 4) - alignment += (4 - last_size); - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - if (last_size > 0 && last_size < 4) - alignment += (4 - last_size); - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, var->type->type); - return; - } - - if (unique_attr) - { - size += 4; - } - } - } - else if (var->type->type == RPC_FC_RP) - { - size = 12; - } - - if (size != 0) - { - if (add_plus) - fprintf(server, " +"); - fprintf(server, " %dU", size + alignment + first_padding + padding); - - if (first_padding != 0) - first_padding = 0; - - last_size = size; - add_plus = 1; - } - - /* set paddings */ - if (var->ptr_level == 1) - { - if (sizeis_attr) - { - if (string_attr && - (var->type->type == RPC_FC_BYTE || - var->type->type == RPC_FC_CHAR || - var->type->type == RPC_FC_WCHAR)) - { - first_padding = 3; - if (var->type->type == RPC_FC_BYTE || - var->type->type == RPC_FC_CHAR) - first_padding++; - padding = 3; - } - else - { - first_padding = 4; - padding = 3; - } - } - } - - /* calculate the next type offset */ - local_type_offset += get_var_type_offset(var); - } - } - } - - /* return value size */ - if (!is_void(func->def->type, NULL)) - { - switch(func->def->type->type) - { - case RPC_FC_BYTE: - case RPC_FC_SMALL: - case RPC_FC_CHAR: - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - if (last_size > 0 && last_size < 4) - alignment += (4 - last_size); - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - if (last_size > 0 && last_size < 4) - alignment += (4 - last_size); - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, func->def->type->type); - return; - } - - if (add_plus) - fprintf(server, " +"); - - fprintf(server, " %dU", size + alignment + first_padding + padding); - } - - if (size == 0) - fprintf(server, "0U"); - - fprintf(server, ";\n"); - - - if (func->args) - { - local_type_offset = *type_offset; - - empty_line = 0; - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - for (; var; var = PREV_LINK(var)) - { - out_attr = is_attr(var->attrs, ATTR_OUT); - in_attr = is_attr(var->attrs, ATTR_IN); - string_attr = is_attr(var->attrs, ATTR_STRING); - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - - /* set 'in' attribute if neither 'in' nor 'out' is found */ - if (!out_attr && !in_attr) - in_attr = 1; - - if (out_attr) - { - if (var->ptr_level == 1 && sizeis_attr != NULL) - { - if (string_attr) - { - if (var->type->type == RPC_FC_BYTE || - var->type->type == RPC_FC_CHAR || - var->type->type == RPC_FC_WCHAR) - { - if (((var_t *)sizeis_attr)->ptr_level == 0) - print_server("_StubMsg.MaxCount = %s;\n", ((var_t *)sizeis_attr)->name); - else - print_server("_StubMsg.MaxCount = %s ? *%s : 0;\n", - ((var_t *)sizeis_attr)->name, ((var_t *)sizeis_attr)->name); - fprintf(server, "\n"); - print_server("NdrConformantStringBufferSize(\n"); - indent++; - print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_server("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_server("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset + 4); - indent--; - } - } - else - { - if (((var_t *)sizeis_attr)->ptr_level == 0) - print_server("_StubMsg.MaxCount = %s;\n", ((var_t *)sizeis_attr)->name); - else - print_server("_StubMsg.MaxCount = %s ? *%s : 0;\n", - ((var_t *)sizeis_attr)->name, ((var_t *)sizeis_attr)->name); - fprintf(server, "\n"); - print_server("NdrConformantArrayBufferSize(\n"); - indent++; - print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_server("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_server("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset + 4); - indent--; - } - - empty_line = 1; - } - else if (var->type->type == RPC_FC_RP) - { - fprintf(server,"\n"); - print_server("NdrSimpleStructBufferSize(\n"); - indent++; - print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_server("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_server("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset + 4); - indent--; - fprintf(server,"\n"); - } - } - - /* calculate the next type offset */ - local_type_offset += get_var_type_offset(var); - } - - if (empty_line) - fprintf(server, "\n"); - } - - /* get string size */ - if (func->args) - { - empty_line = 0; - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - for (; var; var = PREV_LINK(var)) - { - out_attr = is_attr(var->attrs, ATTR_OUT); - in_attr = is_attr(var->attrs, ATTR_IN); - string_attr = is_attr(var->attrs, ATTR_STRING); - unique_attr = is_attr(var->attrs, ATTR_UNIQUE); - - /* set 'in' attribute if neither 'in' nor 'out' is found */ - if (!out_attr && !in_attr) - in_attr = 1; - - if (var->ptr_level == 1 && - string_attr && - unique_attr == 0 && - (var->type->type == RPC_FC_BYTE || - var->type->type == RPC_FC_CHAR || - var->type->type == RPC_FC_WCHAR)) - { - print_server("_StubMsg.BufferLength += 16;\n"); - empty_line = 1; - } - } - - if (empty_line) - fprintf(server, "\n"); - } } -static void init_pointers (func_t *func) +static void declare_args(const func_t *func) { + int in_attr, out_attr; + int i = 0; var_t *var; - int count = 0; if (!func->args) return; @@ -962,646 +93,110 @@ static void init_pointers (func_t *func) while (NEXT_LINK(var)) var = NEXT_LINK(var); while (var) { - if (var->ptr_level == 0) - { - if (var->type->type == RPC_FC_RP) - { - print_server("*("); - write_type(server, var->type, NULL, var->tname); - fprintf(server, "*)&%s = NULL;\n", var->name); - count++; - } - } - else if (var->ptr_level == 1) - { - print_server("%s = (", var->name); - write_type(server, var->type, NULL, var->tname); - fprintf(server, " __RPC_FAR *)0;\n"); - count++; - } - else if (var->ptr_level > 1) - { - error("Pointer level %d not supported!\n", var->ptr_level); - return; - } + const expr_t *size_is = get_attrp(var->attrs, ATTR_SIZEIS); + int has_size = size_is && (size_is->type != EXPR_VOID); + int is_string = is_attr(var->attrs, ATTR_STRING); - var = PREV_LINK(var); - } - - if (count > 0) - fprintf(server, "\n"); -} - - -static void unmarshall_in_arguments(func_t *func, unsigned int *type_offset) -{ - unsigned int local_type_offset = *type_offset; - unsigned int alignment; - unsigned int size; - unsigned int last_size = 0; - var_t *var; - int in_attr, out_attr; - int string_attr; - int ptr_attr, ref_attr, unique_attr; - void *sizeis_attr; - int default_align = 0; - type_t *type; - - if (!func->args) - return; - - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - for (; var; var = PREV_LINK(var)) - { - out_attr = is_attr(var->attrs, ATTR_OUT); in_attr = is_attr(var->attrs, ATTR_IN); - - /* set 'in' attribute if neither 'in' nor 'out' is set */ + out_attr = is_attr(var->attrs, ATTR_OUT); if (!out_attr && !in_attr) in_attr = 1; - string_attr = is_attr(var->attrs, ATTR_STRING); - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - - type = var->type; - - if (in_attr) + if (!in_attr && !has_size && !is_string) { - if (var->ptr_level == 1) - { - ptr_attr = is_attr(var->attrs, ATTR_PTR); - ref_attr = is_attr(var->attrs, ATTR_REF); - unique_attr = is_attr(var->attrs, ATTR_UNIQUE); - if (ptr_attr + ref_attr + unique_attr == 0) - ref_attr = 1; - - if (ref_attr) - { - if (string_attr) - { - if (type->type == RPC_FC_CHAR || type->type == RPC_FC_WCHAR) - { - print_server("NdrConformantStringUnmarshall(\n"); - indent++; - print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_server("(unsigned char __RPC_FAR * __RPC_FAR *)&%s,\n", var->name); - print_server("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u],\n", - local_type_offset + 2); - print_server("(unsigned char)0);\n"); - indent--; - fprintf(server, "\n"); - default_align = 1; - } - } - else if (sizeis_attr) - { - print_server("NdrConformantArrayUnmarshall(\n"); - indent++; - print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_server("(unsigned char __RPC_FAR * __RPC_FAR *)&%s,\n", var->name); - print_server("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u],\n", - local_type_offset + 4); - print_server("(unsigned char)0);\n"); - indent--; - fprintf(server, "\n"); - default_align = 1; - } - else - { - alignment = 0; - switch (type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - size = 1; - alignment = 0; - break; - - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - size = 2; - if (last_size != 0 && last_size < 2) - alignment = (2 - last_size); - break; - - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - if (last_size != 0 && last_size < 4) - alignment = (4 - last_size); - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - if (last_size != 0 && last_size < 4) - alignment = (4 - last_size); - break; - - case RPC_FC_IGNORE: - size = 0; - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, var->type->type); - return; - } - - if (size != 0) - { - if (default_align) - { - print_server("_StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~0x3);\n"); - fprintf(server, "\n"); - default_align = 0; - } - else - if (alignment != 0) - print_server("_StubMsg.Buffer += %u;\n", alignment); - - print_server(""); - write_name(server, var); - fprintf(server, " = ("); - write_type(server, var->type, NULL, var->tname); - fprintf(server, " __RPC_FAR*)_StubMsg.Buffer;\n"); - print_server("_StubMsg.Buffer += sizeof("); - write_type(server, var->type, NULL, var->tname); - fprintf(server, ");\n"); - fprintf(server, "\n"); - - last_size = size; - } - } - } - else if (unique_attr) - { - print_server("NdrPointerUnmarshall(\n"); - indent++; - print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_server("(unsigned char __RPC_FAR * __RPC_FAR *)&%s,\n", var->name); - print_server("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u],\n", - local_type_offset); - print_server("(unsigned char)0);\n"); - indent--; - fprintf(server, "\n"); - default_align = 1; - } - - } - else - { - if (is_base_type(type)) - { - alignment = 0; - switch (type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - size = 1; - alignment = 0; - break; - - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - size = 2; - if (last_size != 0 && last_size < 2) - alignment = (2 - last_size); - break; - - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - if (last_size != 0 && last_size < 4) - alignment = (4 - last_size); - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - if (last_size != 0 && last_size < 4) - alignment = (4 - last_size); - break; - - case RPC_FC_IGNORE: - size = 0; - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, var->type->type); - return; - } - - if (size != 0) - { - if (default_align) - { - print_server("_StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~0x3);\n"); - fprintf(server, "\n"); - default_align = 0; - } - else - if (alignment != 0) - print_server("_StubMsg.Buffer += %u;\n", alignment); - - print_server(""); - write_name(server, var); - fprintf(server, " = *(("); - write_type(server, var->type, NULL, var->tname); - fprintf(server, " __RPC_FAR*)_StubMsg.Buffer);\n"); - print_server("_StubMsg.Buffer += sizeof("); - write_type(server, var->type, NULL, var->tname); - fprintf(server, ");\n"); - fprintf(server, "\n"); - - last_size = size; - } - } - else if (type->type == RPC_FC_RP) - { - while (type->ref) - type = type->ref; - - if (type->type == RPC_FC_STRUCT) - { - print_server("NdrSimpleStructUnmarshall(\n"); - indent++; - print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_server("(unsigned char __RPC_FAR * __RPC_FAR *)&%s,\n", var->name); - print_server("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u],\n", - local_type_offset + 4); - print_server("(unsigned char)0);\n"); - indent--; - fprintf(server, "\n"); - default_align = 1; - } - } - } + int indirection; + print_server(""); + write_type(server, var->type, NULL, var->tname); + for (indirection = 0; indirection < var->ptr_level - 1; indirection++) + fprintf(server, "*"); + fprintf(server, " _W%u;\n", i++); } - /* calculate the next type offset */ - local_type_offset += get_var_type_offset(var); + print_server(""); + write_type(server, var->type, var, var->tname); + fprintf(server, " "); + write_name(server, var); + write_array(server, var->array, 0); + fprintf(server, ";\n"); + + var = PREV_LINK(var); } } -static void marshall_out_arguments(func_t *func, unsigned int *type_offset) +static void assign_out_args(const func_t *func) { - unsigned int alignment = 0; - unsigned int size = 0; - unsigned int last_size = 0; + int in_attr, out_attr; + int i = 0, sep = 0; var_t *var; - var_t *def; - int out_attr; - int string_attr; - int ptr_attr, ref_attr, unique_attr; - void *sizeis_attr; - unsigned int local_type_offset = *type_offset; - int default_align = 0; - - def = func->def; - - /* marshall the out arguments */ - if (func->args) - { - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - for (; var; var = PREV_LINK(var)) - { - out_attr = is_attr(var->attrs, ATTR_OUT); - if (out_attr) - { - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - string_attr = is_attr(var->attrs, ATTR_STRING); - - ptr_attr = is_attr(var->attrs, ATTR_PTR); - ref_attr = is_attr(var->attrs, ATTR_REF); - unique_attr = is_attr(var->attrs, ATTR_UNIQUE); - if (ptr_attr + ref_attr + unique_attr == 0) - ref_attr = 1; - - if (sizeis_attr != NULL) - { - if (string_attr) - { - fprintf(server, "\n"); - if (((var_t *)sizeis_attr)->ptr_level == 0) - print_server("_StubMsg.MaxCount = %s;\n", ((var_t *)sizeis_attr)->name); - else - print_server("_StubMsg.MaxCount = %s ? *%s : 0;\n", - ((var_t *)sizeis_attr)->name, ((var_t *)sizeis_attr)->name); - fprintf(server, "\n"); - print_server("NdrConformantStringMarshall(\n"); - indent++; - print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_server("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_server("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset + 4); - indent--; - fprintf(server, "\n"); - default_align = 1; - } - else - { - fprintf(server, "\n"); - if (((var_t *)sizeis_attr)->ptr_level == 0) - print_server("_StubMsg.MaxCount = %s;\n", ((var_t *)sizeis_attr)->name); - else - print_server("_StubMsg.MaxCount = %s ? *%s : 0;\n", - ((var_t *)sizeis_attr)->name, ((var_t *)sizeis_attr)->name); - fprintf(server, "\n"); - print_server("NdrConformantArrayMarshall(\n"); - indent++; - print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_server("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_server("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset + 4); - indent--; - fprintf(server, "\n"); - default_align = 1; - } - } - else if (is_base_type(var->type)) - { - alignment = 0; - switch (var->type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - size = 1; - alignment = 0; - break; - - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - size = 2; - if (last_size != 0 && last_size < 2) - alignment = (2 - last_size); - break; - - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - if (last_size != 0 && last_size < 4) - alignment = (4 - last_size); - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - if (last_size != 0 && last_size < 4) - alignment = (4 - last_size); - break; - - case RPC_FC_IGNORE: - size = 0; - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, var->type->type); - return; - } - - if (size != 0) - { - if (var->ptr_level == 1) - { - if (unique_attr) - { - print_server("NdrPointerMarshall(\n"); - indent++; - print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_server("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_server("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset); - indent--; - fprintf(server, "\n"); - default_align = 1; - } - else - { - if (default_align) - { - print_server("_StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~0x3);\n"); - fprintf(server, "\n"); - default_align = 0; - } - else - if (alignment != 0) - print_server("_StubMsg.Buffer += %u;\n", alignment); - - fprintf(server, "\n"); - print_server("*(("); - write_type(server, var->type, NULL, var->tname); - fprintf(server, " __RPC_FAR *)_StubMsg.Buffer) = *"); - write_name(server, var); - fprintf(server, ";\n"); - - print_server("_StubMsg.Buffer += sizeof("); - write_type(server, var->type, NULL, var->tname); - fprintf(server, ");"); - } - } - else - { - error("Pointer level %d is not supported!\n", var->ptr_level); - return; - } - - last_size = size; - } - } - else if (var->type->type == RPC_FC_RP) - { - fprintf(server, "\n"); - print_server("NdrSimpleStructMarshall(\n"); - indent++; - print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_server("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_server("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset + 4); - indent--; - default_align = 1; - } - } - - /* calculate the next type offset */ - local_type_offset += get_var_type_offset(var); - } - } - - /* marshall the return value */ - if (!is_void(def->type, NULL)) - { - alignment = 0; - switch (def->type->type) - { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - size = 4; - if (last_size != 0 && last_size < 4) - alignment = (4 - last_size); - break; - - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: - size = 8; - if (last_size != 0 && last_size < 4) - alignment = (4 - last_size); - break; - - default: - error("%s:%d Unknown/unsupported type 0x%x\n", - __FILE__,__LINE__, def->type->type); - return; - } - - fprintf(server, "\n"); - if (default_align) - { - print_server("_StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~0x3);\n"); - fprintf(server, "\n"); - default_align = 0; - } - else - if (alignment != 0) - print_server("_StubMsg.Buffer += %u;\n", alignment); - print_server("*(("); - write_type(server, def->type, def, def->tname); - fprintf(server, " __RPC_FAR *)_StubMsg.Buffer) = _RetVal;\n"); - print_server("_StubMsg.Buffer += sizeof("); - write_type(server, def->type, def, def->tname); - fprintf(server, ");\n"); - } -} - - -static int use_return_buffer(func_t *func) -{ - var_t *var; - - if (!is_void(func->def->type, NULL)) - return 1; + const expr_t *size_is; + int has_size; if (!func->args) - return 0; + return; var = func->args; while (NEXT_LINK(var)) var = NEXT_LINK(var); while (var) { - if (is_attr(var->attrs, ATTR_OUT)) - return 1; + int is_string = is_attr(var->attrs, ATTR_STRING); + size_is = get_attrp(var->attrs, ATTR_SIZEIS); + has_size = size_is && (size_is->type != EXPR_VOID); + in_attr = is_attr(var->attrs, ATTR_IN); + out_attr = is_attr(var->attrs, ATTR_OUT); + if (!out_attr && !in_attr) + in_attr = 1; + + if (!in_attr) + { + print_server(""); + write_name(server, var); + + if (has_size) + { + unsigned int size; + type_t *type = var->type; + while (type->type == 0 && type->ref) + type = type->ref; + + fprintf(server, " = NdrAllocate(&_StubMsg, "); + write_expr(server, size_is, 1); + size = get_type_memsize(type); + fprintf(server, " * %u);\n", size); + } + else if (!is_string) + { + fprintf(server, " = &_W%u;\n", i); + if (var->ptr_level > 1) + print_server("_W%u = 0;\n", i); + i++; + } + + sep = 1; + } var = PREV_LINK(var); } - return 0; + if (sep) + fprintf(server, "\n"); } -static void cleanup_return_buffer(func_t *func, unsigned int *type_offset) -{ - var_t *var; - int string_attr, unique_attr; - void *sizeis_attr; - unsigned int local_type_offset = *type_offset; - - if (func->args) - { - int first_arg = 1; - - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - string_attr = is_attr(var->attrs, ATTR_STRING); - unique_attr = is_attr(var->attrs, ATTR_UNIQUE); - - if (sizeis_attr != NULL && unique_attr == 0) - { - if (first_arg == 0) - fprintf(server, "\n"); - - indent++; - if (string_attr) - { - if (((var_t *)sizeis_attr)->ptr_level == 0) - print_server("_StubMsg.MaxCount = %s;\n", ((var_t *)sizeis_attr)->name); - else - print_server("_StubMsg.MaxCount = %s ? *%s : 0;\n", - ((var_t *)sizeis_attr)->name, ((var_t *)sizeis_attr)->name); - fprintf(server, "\n"); - print_server("NdrPointerFree(\n"); - indent++; - print_server("&_StubMsg,\n"); - print_server("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_server("&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset); - indent--; - } - else - { - print_server("if ("); - write_name(server, var); - fprintf(server, ")\n"); - indent++; - print_server("_StubMsg.pfnFree("); - write_name(server, var); - fprintf(server, ");\n"); - indent--; - } - indent--; - - first_arg = 0; - } - - /* calculate the next type offset */ - local_type_offset += get_var_type_offset(var); - - var = PREV_LINK(var); - } - } -} - - -static void write_function_stubs(type_t *iface) +static void write_function_stubs(type_t *iface, unsigned int *proc_offset, unsigned int *type_offset) { + char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); int explicit_handle = is_attr(iface->attrs, ATTR_EXPLICIT_HANDLE); - func_t *func = iface->funcs; - var_t *var; - var_t* explicit_handle_var; - unsigned int proc_offset = 0; - unsigned int type_offset = 2; - unsigned int i, sep; - int in_attr; - int out_attr; - void *sizeis_attr; + const func_t *func = iface->funcs; + const var_t *var; + const var_t* explicit_handle_var; while (NEXT_LINK(func)) func = NEXT_LINK(func); while (func) { - var_t *def = func->def; + const var_t *def = func->def; + unsigned long buffer_size = 0; + unsigned int type_offset_func; /* check for a defined binding handle */ explicit_handle_var = get_explicit_handle_var(func); @@ -1613,7 +208,7 @@ static void write_function_stubs(type_t *iface) return; } } - else + else if (implicit_handle) { if (explicit_handle_var) { @@ -1642,50 +237,8 @@ static void write_function_stubs(type_t *iface) fprintf(server, " _RetVal;\n"); } - /* declare arguments */ - if (func->args) - { - i = 0; - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - in_attr = is_attr(var->attrs, ATTR_IN); - out_attr = is_attr(var->attrs, ATTR_OUT); - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - - if (!out_attr && !in_attr) - in_attr = 1; - if (!in_attr && !sizeis_attr) - { - if (var->type->type == RPC_FC_RP) - { - type_t *type = var->type; - while (type->ref) - type = type->ref; - - print_server("struct "); - write_type(server, NULL, NULL, type->name); - fprintf(server, " _%sW;\n", var->name); - } - else - { - print_server(""); - write_type(server, var->type, NULL, var->tname); - fprintf(server, " _W%u;\n", i); - i++; - } - } - - print_server(""); - write_type(server, var->type, var, var->tname); - fprintf(server, " "); - write_name(server, var); - fprintf(server, ";\n"); - - var = PREV_LINK(var); - } - } + /* Declare arguments */ + declare_args(func); print_server("MIDL_STUB_MESSAGE _StubMsg;\n"); print_server("RPC_STATUS _Status;\n"); @@ -1701,14 +254,14 @@ static void write_function_stubs(type_t *iface) indent--; fprintf(server, "\n"); - if (explicit_handle) + write_parameters_init(func); + + if (explicit_handle_var) { print_server("%s = _pRpcMessage->Handle;\n", explicit_handle_var->name); fprintf(server, "\n"); } - init_pointers(func); - print_server("RpcTryFinally\n"); print_server("{\n"); indent++; @@ -1723,11 +276,15 @@ static void write_function_stubs(type_t *iface) print_server("NdrConvert(\n"); indent++; print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_server("(PFORMAT_STRING)&__MIDL_ProcFormatString.Format[%u]);\n", proc_offset); + print_server("(PFORMAT_STRING)&__MIDL_ProcFormatString.Format[%u]);\n", *proc_offset); indent -= 2; fprintf(server, "\n"); - unmarshall_in_arguments(func, &type_offset); + /* make a copy so we don't increment the type offset twice */ + type_offset_func = *type_offset; + + /* unmarshall arguments */ + write_remoting_arguments(server, indent, func, &type_offset_func, PASS_IN, PHASE_UNMARSHAL); } print_server("if (_StubMsg.Buffer > _StubMsg.BufferEnd)\n"); @@ -1747,62 +304,8 @@ static void write_function_stubs(type_t *iface) print_server("RpcEndExcept\n"); fprintf(server, "\n"); - /* assign out arguments */ - if (func->args) - { - sep = 0; - i = 0; - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - in_attr = is_attr(var->attrs, ATTR_IN); - out_attr = is_attr(var->attrs, ATTR_OUT); - if (!out_attr && !in_attr) - in_attr = 1; - - sizeis_attr = get_attrp(var->attrs, ATTR_SIZEIS); - - if (!in_attr) - { - if (sizeis_attr != NULL) - { - print_server(""); - write_name(server, var); - if (((var_t *)sizeis_attr)->ptr_level == 0) - fprintf(server, " = NdrAllocate(&_StubMsg, %s * %d);\n", - ((var_t *)sizeis_attr)->name, get_type_size(var->type, 1)); - else if (((var_t *)sizeis_attr)->ptr_level == 1) - fprintf(server, " = NdrAllocate(&_StubMsg, *%s * %d);\n", - ((var_t *)sizeis_attr)->name, get_type_size(var->type, 1)); - sep = 1; - } - else - { - if (var->type->type == RPC_FC_RP) - { - print_server(""); - write_name(server, var); - fprintf(server, " = &_%sW;\n", var->name); - sep = 1; - } - else - { - print_server(""); - write_name(server, var); - fprintf(server, " = &_W%u;\n", i); - i++; - sep = 1; - } - } - } - - var = PREV_LINK(var); - } - - if (sep) - fprintf(server, "\n"); - } + /* Assign 'out' arguments */ + assign_out_args(func); /* Call the real server function */ if (!is_void(def->type, NULL)) @@ -1837,10 +340,38 @@ static void write_function_stubs(type_t *iface) fprintf(server, "();\n"); } - /* allocate and fill the return message buffer */ - if (use_return_buffer(func)) + if (func->args) { - print_message_buffer_size(func, &type_offset); + const var_t *var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + if (is_attr(var->attrs, ATTR_OUT)) + { + unsigned int alignment; + buffer_size += get_required_buffer_size(var, &alignment, PASS_OUT); + buffer_size += alignment; + } + + var = PREV_LINK(var); + } + } + + if (!is_void(def->type, NULL)) + { + unsigned int alignment; + buffer_size += get_required_buffer_size(def, &alignment, PASS_RETURN); + buffer_size += alignment; + } + + if (has_out_arg_or_return(func)) + { + fprintf(server, "\n"); + print_server("_StubMsg.BufferLength = %u;\n", buffer_size); + + type_offset_func = *type_offset; + write_remoting_arguments(server, indent, func, &type_offset_func, PASS_OUT, PHASE_BUFFERSIZE); + print_server("_pRpcMessage->BufferLength = _StubMsg.BufferLength;\n"); fprintf(server, "\n"); print_server("_Status = I_RpcGetBuffer(_pRpcMessage);\n"); @@ -1849,19 +380,28 @@ static void write_function_stubs(type_t *iface) print_server("RpcRaiseException(_Status);\n"); indent--; fprintf(server, "\n"); - print_server("_StubMsg.Buffer = (unsigned char __RPC_FAR *)_pRpcMessage->Buffer;\n"); - - /* marshall the out arguments */ - marshall_out_arguments(func, &type_offset); + print_server("_StubMsg.Buffer = (unsigned char *)_pRpcMessage->Buffer;\n"); + fprintf(server, "\n"); } + type_offset_func = *type_offset; + + /* marshall arguments */ + write_remoting_arguments(server, indent, func, type_offset, PASS_OUT, PHASE_MARSHAL); + + /* marshall the return value */ + if (!is_void(def->type, NULL)) + print_phase_basetype(server, indent, PHASE_MARSHAL, PASS_RETURN, def, "_RetVal"); + indent--; print_server("}\n"); print_server("RpcFinally\n"); print_server("{\n"); + indent++; - cleanup_return_buffer(func, &type_offset); + write_remoting_arguments(server, indent, func, &type_offset_func, PASS_OUT, PHASE_FREE); + indent--; print_server("}\n"); print_server("RpcEndFinally\n"); @@ -1869,25 +409,12 @@ static void write_function_stubs(type_t *iface) fprintf(server, "\n"); print_server("_pRpcMessage->BufferLength =\n"); indent++; - print_server("(unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);\n"); + print_server("(unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);\n"); indent--; indent--; fprintf(server, "}\n"); fprintf(server, "\n"); - /* update type_offset */ - if (func->args) - { - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - type_offset += get_var_type_offset(var); - - var = PREV_LINK(var); - } - } - /* update proc_offset */ if (func->args) { @@ -1895,12 +422,14 @@ static void write_function_stubs(type_t *iface) while (NEXT_LINK(var)) var = NEXT_LINK(var); while (var) { - proc_offset += get_var_proc_offset(var); - + *proc_offset += get_size_procformatstring_var(var); var = PREV_LINK(var); } } - proc_offset += 2; /* FIXME */ + if (!is_void(def->type, NULL)) + *proc_offset += get_size_procformatstring_var(def); + else + *proc_offset += 2; /* FC_END and FC_PAD */ func = PREV_LINK(func); } @@ -1911,22 +440,22 @@ static void write_dispatchtable(type_t *iface) { unsigned long ver = get_attrv(iface->attrs, ATTR_VERSION); unsigned long method_count = 0; - func_t *cur = iface->funcs; + func_t *func = iface->funcs; print_server("static RPC_DISPATCH_FUNCTION %s_table[] =\n", iface->name); print_server("{\n"); indent++; - while (NEXT_LINK(cur)) cur = NEXT_LINK(cur); - while (cur) + while (NEXT_LINK(func)) func = NEXT_LINK(func); + while (func) { - var_t *def = cur->def; + var_t *def = func->def; print_server("%s_", iface->name); write_name(server, def); fprintf(server, ",\n"); method_count++; - cur = PREV_LINK(cur); + func = PREV_LINK(func); } print_server("0\n"); indent--; @@ -1949,18 +478,25 @@ static void write_stubdescdecl(type_t *iface) } -static void write_stubdescriptor(type_t *iface) +static void write_stubdescriptor(type_t *iface, int expr_eval_routines) { print_server("static const MIDL_STUB_DESC %s_StubDesc =\n", iface->name); print_server("{\n"); indent++; - print_server("(void __RPC_FAR *)& %s___RpcServerInterface,\n", iface->name); + print_server("(void *)& %s___RpcServerInterface,\n", iface->name); print_server("MIDL_user_allocate,\n"); print_server("MIDL_user_free,\n"); - print_server("{NULL},\n"); - print_server("0,\n"); + print_server("{\n"); + indent++; + print_server("0,\n"); + indent--; + print_server("},\n"); print_server("0,\n"); print_server("0,\n"); + if (expr_eval_routines) + print_server("ExprEvalRoutines,\n"); + else + print_server("0,\n"); print_server("0,\n"); print_server("__MIDL_TypeFormatString.Format,\n"); print_server("1, /* -error bounds_check flag */\n"); @@ -2013,7 +549,6 @@ static void write_serverinterfacedecl(type_t *iface) fprintf(server, "\n"); } - static void write_formatdesc( const char *str ) { print_server("typedef struct _MIDL_%s_FORMAT_STRING\n", str ); @@ -2027,77 +562,13 @@ static void write_formatdesc( const char *str ) } -static int get_type_format_string_size(type_t *iface) -{ - int size = 3; - func_t *func; - var_t *var; - - /* determine the type format string size */ - func = iface->funcs; - while (NEXT_LINK(func)) func = NEXT_LINK(func); - while (func) - { - /* argument list size */ - if (func->args) - { - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - size += get_var_type_offset(var); - - var = PREV_LINK(var); - } - } - - func = PREV_LINK(func); - } - - return size; -} - - -static int get_proc_format_string_size(type_t *iface) -{ - int size = 1; - func_t *func; - var_t *var; - - /* determine the proc format string size */ - func = iface->funcs; - while (NEXT_LINK(func)) func = NEXT_LINK(func); - while (func) - { - /* argument list size */ - if (func->args) - { - var = func->args; - while (NEXT_LINK(var)) var = NEXT_LINK(var); - while (var) - { - size += get_var_proc_offset(var); - - var = PREV_LINK(var); - } - } - - /* return value size */ - size += 2; - func = PREV_LINK(func); - } - - return size; -} - - -static void write_formatstringsdecl(type_t *iface) +static void write_formatstringsdecl(ifref_t *ifaces) { print_server("#define TYPE_FORMAT_STRING_SIZE %d\n", - get_type_format_string_size(iface)); + get_size_typeformatstring(ifaces)); print_server("#define PROC_FORMAT_STRING_SIZE %d\n", - get_proc_format_string_size(iface)); + get_size_procformatstring(ifaces)); fprintf(server, "\n"); write_formatdesc("TYPE"); @@ -2126,11 +597,13 @@ static void init_server(void) void write_server(ifref_t *ifaces) { + unsigned int proc_offset = 0; + unsigned int type_offset = 2; ifref_t *iface = ifaces; if (!do_server) return; - if (!iface) + if (!ifaces) return; END_OF_LIST(iface); @@ -2138,34 +611,46 @@ void write_server(ifref_t *ifaces) if (!server) return; - while (iface) + write_formatstringsdecl(ifaces); + + for (; iface; iface = PREV_LINK(iface)) { + if (is_object(iface->iface->attrs) || is_local(iface->iface->attrs)) + continue; + fprintf(server, "/*****************************************************************************\n"); fprintf(server, " * %s interface\n", iface->iface->name); fprintf(server, " */\n"); fprintf(server, "\n"); - write_formatstringsdecl(iface->iface); - write_serverinterfacedecl(iface->iface); - write_stubdescdecl(iface->iface); + if (iface->iface->funcs) + { + int expr_eval_routines; - write_function_stubs(iface->iface); + write_serverinterfacedecl(iface->iface); + write_stubdescdecl(iface->iface); + + write_function_stubs(iface->iface, &proc_offset, &type_offset); + + print_server("#if !defined(__RPC_WIN32__)\n"); + print_server("#error Invalid build platform for this stub.\n"); + print_server("#endif\n"); - write_stubdescriptor(iface->iface); - write_dispatchtable(iface->iface); + fprintf(server, "\n"); - print_server("#if !defined(__RPC_WIN32__)\n"); - print_server("#error Invalid build platform for this stub.\n"); - print_server("#endif\n"); - fprintf(server, "\n"); + expr_eval_routines = write_expr_eval_routines(server, iface->iface->name); + if (expr_eval_routines) + write_expr_eval_routine_list(server, iface->iface->name); - write_procformatstring(iface->iface); - write_typeformatstring(iface->iface); - - fprintf(server, "\n"); - - iface = PREV_LINK(iface); + write_stubdescriptor(iface->iface, expr_eval_routines); + write_dispatchtable(iface->iface); + } } + fprintf(server, "\n"); + + write_procformatstring(server, ifaces); + write_typeformatstring(server, ifaces); + fclose(server); } diff --git a/reactos/tools/widl/typegen.c b/reactos/tools/widl/typegen.c new file mode 100644 index 00000000000..190fae28bfa --- /dev/null +++ b/reactos/tools/widl/typegen.c @@ -0,0 +1,2088 @@ +/* + * Format String Generator for IDL Compiler + * + * Copyright 2005-2006 Eric Kohl + * Copyright 2005-2006 Robert Shearman + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" + +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif +#include +#include +#include +#include +#include + +#include "widl.h" +#include "utils.h" +#include "parser.h" +#include "header.h" +#include "windef.h" +#include "wine/list.h" + +#include "widl.h" +#include "typegen.h" + +static const func_t *current_func; +static const type_t *current_structure; + +/* name of the structure variable for structure callbacks */ +#define STRUCT_EXPR_EVAL_VAR "pS" + +static struct list expr_eval_routines = LIST_INIT(expr_eval_routines); + +struct expr_eval_routine +{ + struct list entry; + const type_t *structure; + size_t structure_size; + const expr_t *expr; +}; + +static size_t type_memsize(const type_t *t, int ptr_level, const expr_t *array); +static size_t fields_memsize(const var_t *v); + +static int compare_expr(const expr_t *a, const expr_t *b) +{ + int ret; + + if (a->type != b->type) + return a->type - b->type; + + switch (a->type) + { + case EXPR_NUM: + case EXPR_HEXNUM: + case EXPR_TRUEFALSE: + return a->u.lval - b->u.lval; + case EXPR_IDENTIFIER: + return strcmp(a->u.sval, b->u.sval); + case EXPR_COND: + ret = compare_expr(a->ref, b->ref); + if (ret != 0) + return ret; + ret = compare_expr(a->u.ext, b->u.ext); + if (ret != 0) + return ret; + return compare_expr(a->ext2, b->ext2); + case EXPR_OR: + case EXPR_AND: + case EXPR_ADD: + case EXPR_SUB: + case EXPR_MUL: + case EXPR_DIV: + case EXPR_SHL: + case EXPR_SHR: + ret = compare_expr(a->ref, b->ref); + if (ret != 0) + return ret; + return compare_expr(a->u.ext, b->u.ext); + case EXPR_NOT: + case EXPR_NEG: + case EXPR_PPTR: + case EXPR_CAST: + case EXPR_SIZEOF: + return compare_expr(a->ref, b->ref); + case EXPR_VOID: + return 0; + } + return -1; +} + +#define WRITE_FCTYPE(file, fctype, typestring_offset) \ + do { \ + if (file) \ + fprintf(file, "/* %2u */\n", typestring_offset); \ + print_file((file), 2, "0x%02x, /* " #fctype " */\n", RPC_##fctype); \ + } \ + while (0) + +static int print_file(FILE *file, int indent, const char *format, ...) +{ + va_list va; + int i, r; + + if (!file) return 0; + + va_start(va, format); + for (i = 0; i < indent; i++) + fprintf(file, " "); + r = vfprintf(file, format, va); + va_end(va); + return r; +} + +static inline int type_has_ref(const type_t *type) +{ + return (type->type == 0 && type->ref); +} + +static inline int is_base_type(unsigned char type) +{ + switch (type) + { + case RPC_FC_BYTE: + case RPC_FC_CHAR: + case RPC_FC_USMALL: + case RPC_FC_SMALL: + case RPC_FC_WCHAR: + case RPC_FC_USHORT: + case RPC_FC_SHORT: + case RPC_FC_ULONG: + case RPC_FC_LONG: + case RPC_FC_HYPER: + case RPC_FC_IGNORE: + case RPC_FC_FLOAT: + case RPC_FC_DOUBLE: + case RPC_FC_ENUM16: + case RPC_FC_ENUM32: + case RPC_FC_ERROR_STATUS_T: + case RPC_FC_BIND_PRIMITIVE: + return TRUE; + + default: + return FALSE; + } +} + +static size_t write_procformatstring_var(FILE *file, int indent, + const var_t *var, int is_return, unsigned int *type_offset) +{ + size_t size; + int ptr_level = var->ptr_level; + const type_t *type = var->type; + + int is_in = is_attr(var->attrs, ATTR_IN); + int is_out = is_attr(var->attrs, ATTR_OUT); + + if (!is_in && !is_out) is_in = TRUE; + + if (ptr_level == 0 && type_has_ref(type)) + type = type->ref; + + if (ptr_level == 0 && !var->array && is_base_type(type->type)) + { + if (is_return) + print_file(file, indent, "0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + else + print_file(file, indent, "0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + + switch(type->type) + { +#define CASE_BASETYPE(fctype) \ + case RPC_##fctype: \ + print_file(file, indent, "0x%02x, /* " #fctype " */\n", RPC_##fctype); \ + size = 2; /* includes param type prefix */ \ + break + + CASE_BASETYPE(FC_BYTE); + CASE_BASETYPE(FC_CHAR); + CASE_BASETYPE(FC_WCHAR); + CASE_BASETYPE(FC_USHORT); + CASE_BASETYPE(FC_SHORT); + CASE_BASETYPE(FC_ULONG); + CASE_BASETYPE(FC_LONG); + CASE_BASETYPE(FC_HYPER); + CASE_BASETYPE(FC_IGNORE); + CASE_BASETYPE(FC_USMALL); + CASE_BASETYPE(FC_SMALL); + CASE_BASETYPE(FC_FLOAT); + CASE_BASETYPE(FC_DOUBLE); + CASE_BASETYPE(FC_ERROR_STATUS_T); +#undef CASE_BASETYPE + + case RPC_FC_BIND_PRIMITIVE: + print_file(file, indent, "0x%02x, /* FC_IGNORE */\n", RPC_FC_IGNORE); + size = 2; /* includes param type prefix */ + break; + + default: + error("Unknown/unsupported type: %s (0x%02x)\n", var->name, type->type); + size = 0; + } + } + else + { + if (is_return) + print_file(file, indent, "0x52, /* FC_RETURN_PARAM */\n"); + else if (is_in && is_out) + print_file(file, indent, "0x50, /* FC_IN_OUT_PARAM */\n"); + else if (is_out) + print_file(file, indent, "0x51, /* FC_OUT_PARAM */\n"); + else + print_file(file, indent, "0x4d, /* FC_IN_PARAM */\n"); + + print_file(file, indent, "0x01,\n"); + print_file(file, indent, "NdrFcShort(0x%x),\n", *type_offset); + size = 4; /* includes param type prefix */ + } + *type_offset += get_size_typeformatstring_var(var); + return size; +} + +void write_procformatstring(FILE *file, const ifref_t *ifaces) +{ + const ifref_t *iface = ifaces; + int indent = 0; + var_t *var; + unsigned int type_offset = 2; + + print_file(file, indent, "static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =\n"); + print_file(file, indent, "{\n"); + indent++; + print_file(file, indent, "0,\n"); + print_file(file, indent, "{\n"); + indent++; + + END_OF_LIST(iface); + + for (; iface; iface = PREV_LINK(iface)) + { + if (is_object(iface->iface->attrs) || is_local(iface->iface->attrs)) + continue; + + if (iface->iface->funcs) + { + func_t *func = iface->iface->funcs; + while (NEXT_LINK(func)) func = NEXT_LINK(func); + for (; func; func = PREV_LINK(func)) + { + /* emit argument data */ + if (func->args) + { + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + write_procformatstring_var(file, indent, var, FALSE, + &type_offset); + + var = PREV_LINK(var); + } + } + + /* emit return value data */ + var = func->def; + if (is_void(var->type, NULL)) + { + print_file(file, indent, "0x5b, /* FC_END */\n"); + print_file(file, indent, "0x5c, /* FC_PAD */\n"); + } + else + write_procformatstring_var(file, indent, var, TRUE, + &type_offset); + } + } + } + + print_file(file, indent, "0x0\n"); + indent--; + print_file(file, indent, "}\n"); + indent--; + print_file(file, indent, "};\n"); + print_file(file, indent, "\n"); +} + +/* write conformance / variance descriptor */ +static size_t write_conf_or_var_desc(FILE *file, const func_t *func, const type_t *structure, const expr_t *expr) +{ + unsigned char operator_type = 0; + const char *operator_string = "no operators"; + const expr_t *subexpr = expr; + unsigned char correlation_type; + + if (!file) return 4; /* optimisation for sizing pass */ + + if (expr->is_const) + { + if (expr->cval > UCHAR_MAX * (USHRT_MAX + 1) + USHRT_MAX) + error("write_conf_or_var_desc: constant value %ld is greater than " + "the maximum constant size of %d\n", expr->cval, + UCHAR_MAX * (USHRT_MAX + 1) + USHRT_MAX); + + print_file(file, 2, "0x%x, /* Corr desc: constant, val = %ld */\n", + RPC_FC_CONSTANT_CONFORMANCE, expr->cval); + print_file(file, 2, "0x%x,\n", expr->cval & ~USHRT_MAX); + print_file(file, 2, "NdrFcShort(0x%x),\n", expr->cval & USHRT_MAX); + + return 4; + } + + switch (subexpr->type) + { + case EXPR_PPTR: + subexpr = subexpr->ref; + operator_type = RPC_FC_DEREFERENCE; + operator_string = "FC_DEREFERENCE"; + break; + case EXPR_DIV: + if (subexpr->u.ext->is_const && (subexpr->u.ext->cval == 2)) + { + subexpr = subexpr->ref; + operator_type = RPC_FC_DIV_2; + operator_string = "FC_DIV_2"; + } + break; + case EXPR_MUL: + if (subexpr->u.ext->is_const && (subexpr->u.ext->cval == 2)) + { + subexpr = subexpr->ref; + operator_type = RPC_FC_MULT_2; + operator_string = "FC_MULT_2"; + } + break; + case EXPR_SUB: + if (subexpr->u.ext->is_const && (subexpr->u.ext->cval == 1)) + { + subexpr = subexpr->ref; + operator_type = RPC_FC_SUB_1; + operator_string = "FC_SUB_1"; + } + break; + case EXPR_ADD: + if (subexpr->u.ext->is_const && (subexpr->u.ext->cval == 1)) + { + subexpr = subexpr->ref; + operator_type = RPC_FC_ADD_1; + operator_string = "FC_ADD_1"; + } + break; + default: + break; + } + + if (subexpr->type == EXPR_IDENTIFIER) + { + const type_t *correlation_variable = NULL; + unsigned char param_type = 0; + const char *param_type_string = NULL; + size_t offset; + + if (structure) + { + const var_t *var; + + for (offset = 0, var = structure->fields; var; var = NEXT_LINK(var)) + { + offset -= type_memsize(var->type, var->ptr_level, var->array); + if (!strcmp(var->name, subexpr->u.sval)) + { + correlation_variable = var->type; + break; + } + } + if (!correlation_variable) + error("write_conf_or_var_desc: couldn't find variable %s in structure\n", + subexpr->u.sval); + + correlation_type = RPC_FC_NORMAL_CONFORMANCE; + } + else + { + const var_t *var = func->args; + + while (NEXT_LINK(var)) var = NEXT_LINK(var); + /* FIXME: not all stack variables are sizeof(void *) */ + for (offset = 0; var; offset += sizeof(void *), var = PREV_LINK(var)) + { + if (!strcmp(var->name, subexpr->u.sval)) + { + correlation_variable = var->type; + break; + } + } + if (!correlation_variable) + error("write_conf_or_var_desc: couldn't find variable %s in function\n", + subexpr->u.sval); + + correlation_type = RPC_FC_TOP_LEVEL_CONFORMANCE; + } + + while (type_has_ref(correlation_variable)) + correlation_variable = correlation_variable->ref; + + switch (correlation_variable->type) + { + case RPC_FC_CHAR: + case RPC_FC_SMALL: + param_type = RPC_FC_SMALL; + param_type_string = "FC_SMALL"; + break; + case RPC_FC_BYTE: + case RPC_FC_USMALL: + param_type = RPC_FC_USMALL; + param_type_string = "FC_USMALL"; + break; + case RPC_FC_WCHAR: + case RPC_FC_SHORT: + param_type = RPC_FC_SHORT; + param_type_string = "FC_SHORT"; + break; + case RPC_FC_USHORT: + param_type = RPC_FC_USHORT; + param_type_string = "FC_USHORT"; + break; + case RPC_FC_LONG: + param_type = RPC_FC_LONG; + param_type_string = "FC_LONG"; + break; + case RPC_FC_ULONG: + param_type = RPC_FC_ULONG; + param_type_string = "FC_ULONG"; + break; + default: + error("write_conf_or_var_desc: conformance variable type not supported 0x%x\n", + correlation_variable->type); + } + + print_file(file, 2, "0x%x, /* Corr desc: %s%s */\n", + correlation_type | param_type, + correlation_type == RPC_FC_TOP_LEVEL_CONFORMANCE ? "parameter, " : "", + param_type_string); + print_file(file, 2, "0x%x, /* %s */\n", operator_type, operator_string); + print_file(file, 2, "NdrFcShort(0x%x), /* %soffset = %d */\n", + offset, + correlation_type == RPC_FC_TOP_LEVEL_CONFORMANCE ? "x86 stack size / " : "", + offset); + } + else + { + unsigned int callback_offset = 0; + + if (structure) + { + struct expr_eval_routine *eval; + int found = 0; + + LIST_FOR_EACH_ENTRY(eval, &expr_eval_routines, struct expr_eval_routine, entry) + { + if (!strcmp(eval->structure->name, structure->name) && + !compare_expr(eval->expr, expr)) + { + found = 1; + break; + } + callback_offset++; + } + + if (!found) + { + eval = xmalloc(sizeof(*eval)); + eval->structure = structure; + eval->structure_size = fields_memsize(structure->fields); + eval->expr = expr; + list_add_tail(&expr_eval_routines, &eval->entry); + } + + correlation_type = RPC_FC_NORMAL_CONFORMANCE; + } + else + { + error("write_conf_or_var_desc: top-level callback conformance unimplemented\n"); + correlation_type = RPC_FC_TOP_LEVEL_CONFORMANCE; + } + + if (callback_offset > USHRT_MAX) + error("Maximum number of callback routines reached\n"); + + print_file(file, 2, "0x%x, /* Corr desc: %s */\n", + correlation_type, + correlation_type == RPC_FC_TOP_LEVEL_CONFORMANCE ? "parameter" : ""); + print_file(file, 2, "0x%x, /* %s */\n", RPC_FC_CALLBACK, "FC_CALLBACK"); + print_file(file, 2, "NdrFcShort(0x%x), /* %u */\n", callback_offset, callback_offset); + } + return 4; +} + +static size_t fields_memsize(const var_t *v) +{ + size_t size = 0; + const var_t *first = v; + if (!v) return 0; + while (NEXT_LINK(v)) v = NEXT_LINK(v); + while (v) { + size += type_memsize(v->type, v->ptr_level, v->array); + if (v == first) break; + v = PREV_LINK(v); + } + return size; +} + +static size_t type_memsize(const type_t *t, int ptr_level, const expr_t *array) +{ + size_t size = 0; + + if (ptr_level) + return sizeof(void *); + + if (type_has_ref(t)) + return type_memsize(t->ref, 0 /* FIXME */, NULL); + + switch (t->type) + { + case RPC_FC_BYTE: + case RPC_FC_CHAR: + case RPC_FC_USMALL: + case RPC_FC_SMALL: + size = 1; + break; + case RPC_FC_WCHAR: + case RPC_FC_USHORT: + case RPC_FC_SHORT: + case RPC_FC_ENUM16: + size = 2; + break; + case RPC_FC_ULONG: + case RPC_FC_LONG: + case RPC_FC_ERROR_STATUS_T: + case RPC_FC_ENUM32: + case RPC_FC_FLOAT: + size = 4; + break; + case RPC_FC_HYPER: + case RPC_FC_DOUBLE: + size = 8; + break; + case RPC_FC_STRUCT: + case RPC_FC_CVSTRUCT: + case RPC_FC_CPSTRUCT: + case RPC_FC_CSTRUCT: + case RPC_FC_PSTRUCT: + case RPC_FC_BOGUS_STRUCT: + case RPC_FC_ENCAPSULATED_UNION: + case RPC_FC_NON_ENCAPSULATED_UNION: + size = fields_memsize(t->fields); + break; + default: + error("type_memsize: Unknown type %d\n", t->type); + size = 0; + } + + if (array) + { + if (array->is_const) + size *= array->cval; + else + size = 0; + } + + return size; +} + +size_t get_type_memsize(const type_t *type) +{ + return type_memsize(type, 0, NULL); +} + +static int write_pointers(FILE *file, const attr_t *attrs, + const type_t *type, int ptr_level, + const expr_t *array, int level, + unsigned int *typestring_offset) +{ + int pointers_written = 0; + const var_t *v; + + /* don't generate a pointer for first-level arrays since we want to + * descend into them to write their pointers, not stop here */ + if ((level == 0 || ptr_level == 0) && is_array_type(attrs, ptr_level, array)) + { + return write_pointers(file, NULL, type, 0, NULL, level + 1, typestring_offset); + } + + if (ptr_level != 0) + { + /* FIXME: only general algorithm implemented, not the actual writing */ + error("write_pointers: Writing type format string for pointer is unimplemented\n"); + return 1; + } + + /* FIXME: search through all refs for pointers too */ + while(type_has_ref(type)) + type = type->ref; + + switch (type->type) + { + /* note: don't descend into complex structures or unions since these + * will always be generated as a separate type */ + case RPC_FC_STRUCT: + case RPC_FC_CVSTRUCT: + case RPC_FC_CPSTRUCT: + case RPC_FC_CSTRUCT: + case RPC_FC_PSTRUCT: + v = type->fields; + if (!v) break; + while (NEXT_LINK(v)) v = NEXT_LINK(v); + for (; v; v = PREV_LINK(v)) + pointers_written += write_pointers(file, v->attrs, v->type, + v->ptr_level, v->array, + level + 1, + typestring_offset); + + break; + + default: + /* nothing to do */ + break; + } + + return pointers_written; +} + +static size_t write_pointer_description(FILE *file, const attr_t *attrs, + const type_t *type, int ptr_level, + const expr_t *array, int level, + size_t typestring_offset) +{ + size_t size = 0; + const var_t *v; + + /* don't generate a pointer for first-level arrays since we want to + * descend into them to write their pointers, not stop here */ + if ((level == 0 || ptr_level == 0) && is_array_type(attrs, ptr_level, array)) + { + return write_pointer_description(file, NULL, type, 0, NULL, + level + 1, typestring_offset); + } + + if (ptr_level != 0) + { + /* FIXME: only general algorithm implemented, not the actual writing */ + error("write_pointer_description: Writing pointer description is unimplemented\n"); + return 0; + } + + /* FIXME: search through all refs for pointers too */ + + switch (type->type) + { + /* note: don't descend into complex structures or unions since these + * will always be generated as a separate type */ + case RPC_FC_STRUCT: + case RPC_FC_CVSTRUCT: + case RPC_FC_CPSTRUCT: + case RPC_FC_CSTRUCT: + case RPC_FC_PSTRUCT: + v = type->fields; + if (!v) break; + while (NEXT_LINK(v)) v = NEXT_LINK(v); + for (; v; v = PREV_LINK(v)) + size += write_pointer_description(file, v->attrs, v->type, + v->ptr_level, v->array, + level + 1, + typestring_offset); + + break; + + default: + /* nothing to do */ + break; + } + + return size; +} + +static size_t write_string_tfs(FILE *file, const attr_t *attrs, + const type_t *type, const expr_t *array, + const char *name, unsigned int *typestring_offset) +{ + const expr_t *size_is = get_attrp(attrs, ATTR_SIZEIS); + int has_size = size_is && (size_is->type != EXPR_VOID); + size_t start_offset = *typestring_offset; + unsigned char flags = 0; + int pointer_type = get_attrv(attrs, ATTR_POINTERTYPE); + if (!pointer_type) + pointer_type = RPC_FC_RP; + + if (!get_attrp(attrs, ATTR_SIZEIS)) + flags |= RPC_FC_P_SIMPLEPOINTER; + + while (type_has_ref(type)) + type = type->ref; + + if ((type->type != RPC_FC_BYTE) && (type->type != RPC_FC_CHAR) && (type->type != RPC_FC_WCHAR)) + { + error("write_string_tfs: Unimplemented for type 0x%x of name: %s\n", type->type, name); + return start_offset; + } + + print_file(file, 2,"0x%x, 0x%x, /* %s%s */\n", + pointer_type, flags, + pointer_type == RPC_FC_FP ? "FC_FP" : (pointer_type == RPC_FC_UP ? "FC_UP" : "FC_RP"), + (flags & RPC_FC_P_SIMPLEPOINTER) ? " [simple_pointer]" : ""); + *typestring_offset += 2; + + if (!(flags & RPC_FC_P_SIMPLEPOINTER)) + { + print_file(file, 2, "NdrFcShort(0x2),\n"); + *typestring_offset += 2; + } + + if (array && array->is_const) + { + if (array->cval > USHRT_MAX) + error("array size for parameter %s exceeds %d bytes by %ld bytes\n", + name, USHRT_MAX, array->cval - USHRT_MAX); + + if (type->type == RPC_FC_CHAR) + WRITE_FCTYPE(file, FC_CSTRING, *typestring_offset); + else + WRITE_FCTYPE(file, FC_WSTRING, *typestring_offset); + print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + *typestring_offset += 2; + + print_file(file, 2, "NdrFcShort(0x%x), /* %d */\n", array->cval, array->cval); + *typestring_offset += 2; + + return start_offset; + } + else if (has_size) + { + if (type->type == RPC_FC_CHAR) + WRITE_FCTYPE(file, FC_C_CSTRING, *typestring_offset); + else + WRITE_FCTYPE(file, FC_C_WSTRING, *typestring_offset); + print_file(file, 2, "0x%x, /* FC_STRING_SIZED */\n", RPC_FC_STRING_SIZED); + *typestring_offset += 2; + + *typestring_offset += write_conf_or_var_desc(file, current_func, NULL, size_is); + + return start_offset; + } + else + { + if (type->type == RPC_FC_CHAR) + WRITE_FCTYPE(file, FC_C_CSTRING, *typestring_offset); + else + WRITE_FCTYPE(file, FC_C_WSTRING, *typestring_offset); + print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + *typestring_offset += 2; + + return start_offset; + } +} + +static size_t write_array_tfs(FILE *file, const attr_t *attrs, + const type_t *type, const expr_t *array, + const char *name, unsigned int *typestring_offset) +{ + const expr_t *length_is = get_attrp(attrs, ATTR_LENGTHIS); + const expr_t *size_is = get_attrp(attrs, ATTR_SIZEIS); + int has_length = length_is && (length_is->type != EXPR_VOID); + int has_size = (size_is && (size_is->type != EXPR_VOID)) || !array->is_const; + size_t start_offset; + int pointer_type = get_attrv(attrs, ATTR_POINTERTYPE); + if (!pointer_type) + pointer_type = RPC_FC_RP; + + print_file(file, 2, "0x%x, 0x00, /* %s */\n", + pointer_type, + pointer_type == RPC_FC_FP ? "FC_FP" : (pointer_type == RPC_FC_UP ? "FC_UP" : "FC_RP")); + print_file(file, 2, "NdrFcShort(0x2),\n"); + *typestring_offset += 4; + + if (array && NEXT_LINK(array)) /* multi-dimensional array */ + { + error("write_array_tfs: Multi-dimensional arrays not implemented yet (param %s)\n", name); + return 0; + } + else + { + size_t pointer_start_offset = *typestring_offset; + int has_pointer = 0; + + if (write_pointers(file, attrs, type, 0, array, 0, typestring_offset) > 0) + has_pointer = 1; + + start_offset = *typestring_offset; + + if (!has_length && !has_size) + { + /* fixed array */ + size_t size = type_memsize(type, 0, array); + if (size < USHRT_MAX) + { + WRITE_FCTYPE(file, FC_SMFARRAY, *typestring_offset); + /* alignment */ + print_file(file, 2, "0x%x, /* 0 */\n", 0); + /* size */ + print_file(file, 2, "NdrFcShort(0x%x), /* %d */\n", size, size); + *typestring_offset += 4; + } + else + { + WRITE_FCTYPE(file, FC_LGFARRAY, *typestring_offset); + /* alignment */ + print_file(file, 2, "0x%x, /* 0 */\n", 0); + /* size */ + print_file(file, 2, "NdrFcLong(0x%x), /* %d */\n", size, size); + *typestring_offset += 6; + } + + if (has_pointer) + { + print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP); + print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + *typestring_offset += 2; + *typestring_offset = write_pointer_description(file, attrs, + type, 0, array, 0, pointer_start_offset); + print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + *typestring_offset += 1; + } + + print_file(file, 2, "0x0, /* FIXME: write out conversion data */\n"); + print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + *typestring_offset += 2; + + return start_offset; + } + else if (has_length && !has_size) + { + /* varying array */ + size_t element_size = type_memsize(type, 0, NULL); + size_t elements = array->cval; + size_t total_size = element_size * elements; + + if (total_size < USHRT_MAX) + { + WRITE_FCTYPE(file, FC_SMVARRAY, *typestring_offset); + /* alignment */ + print_file(file, 2, "0x%x, /* 0 */\n", 0); + /* total size */ + print_file(file, 2, "NdrFcShort(0x%x), /* %d */\n", total_size, total_size); + /* number of elements */ + print_file(file, 2, "NdrFcShort(0x%x), /* %d */\n", elements, elements); + *typestring_offset += 6; + } + else + { + WRITE_FCTYPE(file, FC_LGVARRAY, *typestring_offset); + /* alignment */ + print_file(file, 2, "0x%x, /* 0 */\n", 0); + /* total size */ + print_file(file, 2, "NdrFcLong(0x%x), /* %d */\n", total_size, total_size); + /* number of elements */ + print_file(file, 2, "NdrFcLong(0x%x), /* %d */\n", elements, elements); + *typestring_offset += 10; + } + /* element size */ + print_file(file, 2, "NdrFcShort(0x%x), /* %d */\n", element_size, element_size); + *typestring_offset += 2; + + *typestring_offset += write_conf_or_var_desc(file, current_func, + current_structure, + length_is); + + if (has_pointer) + { + print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP); + print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + *typestring_offset += 2; + *typestring_offset += write_pointer_description(file, attrs, + type, 0, array, 0, pointer_start_offset); + print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + *typestring_offset += 1; + } + + print_file(file, 2, "0x0, /* FIXME: write out conversion data */\n"); + print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + *typestring_offset += 2; + + return start_offset; + } + else if (!has_length && has_size) + { + /* conformant array */ + size_t element_size = type_memsize(type, 0, NULL); + + WRITE_FCTYPE(file, FC_CARRAY, *typestring_offset); + /* alignment */ + print_file(file, 2, "0x%x, /* 0 */\n", 0); + /* element size */ + print_file(file, 2, "NdrFcShort(0x%x), /* %d */\n", element_size, element_size); + *typestring_offset += 4; + + *typestring_offset += write_conf_or_var_desc(file, current_func, + current_structure, + size_is ? size_is : array); + + if (has_pointer) + { + print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP); + print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + *typestring_offset += 2; + *typestring_offset += write_pointer_description(file, attrs, + type, 0, array, 0, pointer_start_offset); + print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + *typestring_offset += 1; + } + + print_file(file, 2, "0x%x, /* FIXME: write out conversion data */\n", type->type); + print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + *typestring_offset += 2; + + return start_offset; + } + else + { + /* conformant varying array */ + size_t element_size = type_memsize(type, 0, NULL); + + WRITE_FCTYPE(file, FC_CVARRAY, *typestring_offset); + /* alignment */ + print_file(file, 2, "0x%x, /* 0 */\n", 0); + /* element size */ + print_file(file, 2, "NdrFcShort(0x%x), /* %d */\n", element_size, element_size); + *typestring_offset += 4; + + *typestring_offset += write_conf_or_var_desc(file, current_func, + current_structure, + size_is ? size_is : array); + *typestring_offset += write_conf_or_var_desc(file, current_func, + current_structure, + length_is); + + if (has_pointer) + { + print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP); + print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + *typestring_offset += 2; + *typestring_offset += write_pointer_description(file, attrs, + type, 0, array, 0, pointer_start_offset); + print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + *typestring_offset += 1; + } + + print_file(file, 2, "0x0, /* FIXME: write out conversion data */\n"); + print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + *typestring_offset += 2; + + return start_offset; + } + } +} + +static const var_t *find_array_or_string_in_struct(const type_t *type) +{ + /* last field is the first in the fields linked list */ + const var_t *last_field = type->fields; + if (is_array_type(last_field->attrs, last_field->ptr_level, last_field->array)) + return last_field; + + assert((last_field->type->type == RPC_FC_CSTRUCT) || + (last_field->type->type == RPC_FC_CPSTRUCT) || + (last_field->type->type == RPC_FC_CVSTRUCT)); + + return find_array_or_string_in_struct(last_field->type); +} + +static size_t write_struct_members(FILE *file, const type_t *type) +{ + size_t typestring_size = 0; + var_t *field; + + field = type->fields; + while (NEXT_LINK(field)) field = NEXT_LINK(field); + for (; field; field = PREV_LINK(field)) + { + if (is_base_type(field->type->type)) + { + switch (field->type->type) + { +#define CASE_BASETYPE(fctype) \ + case RPC_##fctype: \ + print_file(file, 2, "0x%02x,\t\t/* " #fctype " */\n", RPC_##fctype); \ + typestring_size++; \ + break; + CASE_BASETYPE(FC_BYTE); + CASE_BASETYPE(FC_CHAR); + CASE_BASETYPE(FC_SMALL); + CASE_BASETYPE(FC_USMALL); + CASE_BASETYPE(FC_WCHAR); + CASE_BASETYPE(FC_SHORT); + CASE_BASETYPE(FC_USHORT); + CASE_BASETYPE(FC_LONG); + CASE_BASETYPE(FC_ULONG); + CASE_BASETYPE(FC_FLOAT); + CASE_BASETYPE(FC_HYPER); + CASE_BASETYPE(FC_DOUBLE); + CASE_BASETYPE(FC_ENUM16); + CASE_BASETYPE(FC_ENUM32); + CASE_BASETYPE(FC_IGNORE); + CASE_BASETYPE(FC_ERROR_STATUS_T); + default: + break; +#undef CASE_BASETYPE + } + } + else + error("Unsupported member type 0x%x\n", field->type->type); + } + + if (typestring_size % 1) + { + print_file(file, 2, "0x%x,\t\t/* FC_PAD */\n", RPC_FC_PAD); + typestring_size++; + } + + print_file(file, 2, "0x%x,\t\t/* FC_END */\n", RPC_FC_END); + typestring_size++; + + return typestring_size; +} + +static size_t write_struct_tfs(FILE *file, const type_t *type, + const char *name, unsigned int *typestring_offset) +{ + unsigned int total_size; + const var_t *array; + size_t start_offset; + size_t array_offset; + size_t pointer_offset; + + switch (type->type) + { + case RPC_FC_STRUCT: + case RPC_FC_PSTRUCT: + total_size = type_memsize(type, 0, NULL); + + if (total_size > USHRT_MAX) + error("structure size for parameter %s exceeds %d bytes by %d bytes\n", + name, USHRT_MAX, total_size - USHRT_MAX); + + if (type->type == RPC_FC_PSTRUCT) + { + pointer_offset = *typestring_offset; + write_pointers(file, NULL, type, 0, NULL, 0, typestring_offset); + } + else pointer_offset = 0; /* silence warning */ + + start_offset = *typestring_offset; + if (type->type == RPC_FC_STRUCT) + WRITE_FCTYPE(file, FC_STRUCT, *typestring_offset); + else + WRITE_FCTYPE(file, FC_PSTRUCT, *typestring_offset); + /* alignment */ + print_file(file, 2, "0x3,\n"); /* FIXME */ + /* total size */ + print_file(file, 2, "NdrFcShort(0x%x), /* %u */\n", total_size, total_size); + *typestring_offset += 4; + + if (type->type == RPC_FC_PSTRUCT) + { + print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP); + print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + *typestring_offset += 2; + *typestring_offset += write_pointer_description(file, NULL, + type, 0, NULL, 0, pointer_offset); + print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + *typestring_offset += 1; + } + + /* member layout */ + *typestring_offset += write_struct_members(file, type); + return start_offset; + case RPC_FC_CSTRUCT: + case RPC_FC_CPSTRUCT: + total_size = type_memsize(type, 0, NULL); + + if (total_size > USHRT_MAX) + error("structure size for parameter %s exceeds %d bytes by %d bytes\n", + name, USHRT_MAX, total_size - USHRT_MAX); + + array = find_array_or_string_in_struct(type); + current_structure = type; + array_offset = write_array_tfs(file, array->attrs, array->type, + array->array, array->name, + typestring_offset); + current_structure = NULL; + + if (type->type == RPC_FC_CPSTRUCT) + { + pointer_offset = *typestring_offset; + write_pointers(file, NULL, type, 0, NULL, 0, typestring_offset); + } + else pointer_offset = 0; /* silence warning */ + + start_offset = *typestring_offset; + if (type->type == RPC_FC_CSTRUCT) + WRITE_FCTYPE(file, FC_CSTRUCT, *typestring_offset); + else + WRITE_FCTYPE(file, FC_CPSTRUCT, *typestring_offset); + /* alignment */ + print_file(file, 2, "0x0,\n"); + /* total size */ + print_file(file, 2, "NdrFcShort(0x%x), /* %u */\n", total_size, total_size); + *typestring_offset += 4; + print_file(file, 2, "NdrFcShort(0x%x), /* offset = %d (%u) */\n", + array_offset - *typestring_offset, + array_offset - *typestring_offset, + array_offset); + *typestring_offset += 2; + + if (type->type == RPC_FC_CPSTRUCT) + { + print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP); + print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + *typestring_offset += 2; + *typestring_offset += write_pointer_description(file, NULL, + type, 0, NULL, 0, pointer_offset); + print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + *typestring_offset += 1; + } + + print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + *typestring_offset += 1; + + return start_offset; + case RPC_FC_CVSTRUCT: + total_size = type_memsize(type, 0, NULL); + + if (total_size > USHRT_MAX) + error("structure size for parameter %s exceeds %d bytes by %d bytes\n", + name, USHRT_MAX, total_size - USHRT_MAX); + + array = find_array_or_string_in_struct(type); + current_structure = type; + if (is_attr(array->attrs, ATTR_STRING)) + array_offset = write_string_tfs(file, array->attrs, array->type, + array->array, array->name, + typestring_offset); + else + array_offset = write_array_tfs(file, array->attrs, array->type, + array->array, array->name, + typestring_offset); + current_structure = NULL; + + pointer_offset = *typestring_offset; + if (!write_pointers(file, NULL, type, 0, NULL, 0, typestring_offset)) + pointer_offset = 0; + + start_offset = *typestring_offset; + WRITE_FCTYPE(file, FC_CVSTRUCT, *typestring_offset); + /* alignment */ + print_file(file, 2, "0x0,\n"); + /* total size */ + print_file(file, 2, "NdrFcShort(0x%x), /* %u */\n", total_size, total_size); + *typestring_offset += 4; + print_file(file, 2, "NdrFcShort(0x%x), /* offset = %d (%u) */\n", + array_offset - *typestring_offset, + array_offset - *typestring_offset, + array_offset); + *typestring_offset += 2; + + if (pointer_offset != 0) + { + print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP); + print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + *typestring_offset += 2; + *typestring_offset += write_pointer_description(file, NULL, + type, 0, NULL, 0, pointer_offset); + print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + *typestring_offset += 1; + } + + print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + *typestring_offset += 1; + + return start_offset; + default: + error("write_struct_tfs: Unimplemented for type 0x%x\n", type->type); + return *typestring_offset; + } +} + +static void write_pointer_only_tfs(FILE *file, const attr_t *attrs, size_t offset, unsigned int *typeformat_offset) +{ + int in_attr, out_attr; + unsigned char flags = 0; + int pointer_type = get_attrv(attrs, ATTR_POINTERTYPE); + if (!pointer_type) pointer_type = RPC_FC_RP; + in_attr = is_attr(attrs, ATTR_IN); + out_attr = is_attr(attrs, ATTR_OUT); + if (!in_attr && !out_attr) in_attr = 1; + + if (out_attr && !in_attr && pointer_type == RPC_FC_RP) + flags |= 0x04; + + print_file(file, 2, "0x%x, 0x%x,\t\t/* %s%s */\n", + pointer_type, + flags, + pointer_type == RPC_FC_FP ? "FC_FP" : (pointer_type == RPC_FC_UP ? "FC_UP" : "FC_RP"), + (flags & 0x04) ? " [allocated_on_stack]" : ""); + print_file(file, 2, "NdrFcShort(0x%x), /* %d */\n", offset, offset); + *typeformat_offset += 4; +} + +static size_t write_union_tfs(FILE *file, const attr_t *attrs, + const type_t *type, const char *name, + unsigned int *typeformat_offset) +{ + error("write_union_tfs: Unimplemented\n"); + return *typeformat_offset; +} + +static size_t write_typeformatstring_var(FILE *file, int indent, + const var_t *var, unsigned int *typeformat_offset) +{ + const type_t *type = var->type; + int ptr_level = var->ptr_level; + + chat("write_typeformatstring_var: %s\n", var->name); + + while (TRUE) + { + chat("write_typeformatstring: type->type = 0x%x, type->name = %s, ptr_level = %d\n", type->type, type->name, ptr_level); + + if (is_string_type(var->attrs, ptr_level, var->array)) + return write_string_tfs(file, var->attrs, type, var->array, var->name, typeformat_offset); + + if (is_array_type(var->attrs, ptr_level, var->array)) + return write_array_tfs(file, var->attrs, type, var->array, var->name, typeformat_offset); + + if (ptr_level == 0) + { + /* follow reference if the type has one */ + if (type_has_ref(type)) + { + type = type->ref; + /* FIXME: get new ptr_level from type */ + continue; + } + + /* basic types don't need a type format string */ + if (is_base_type(type->type)) + return 0; + + switch (type->type) + { + case RPC_FC_STRUCT: + case RPC_FC_PSTRUCT: + case RPC_FC_CSTRUCT: + case RPC_FC_CPSTRUCT: + case RPC_FC_CVSTRUCT: + case RPC_FC_BOGUS_STRUCT: + return write_struct_tfs(file, type, var->name, typeformat_offset); + case RPC_FC_ENCAPSULATED_UNION: + case RPC_FC_NON_ENCAPSULATED_UNION: + return write_union_tfs(file, var->attrs, type, var->name, typeformat_offset); + case RPC_FC_IGNORE: + case RPC_FC_BIND_PRIMITIVE: + /* nothing to do */ + return 0; + default: + error("write_typeformatstring_var: Unsupported type 0x%x for variable %s\n", type->type, var->name); + } + } + else if (ptr_level == 1 && !type_has_ref(type)) + { + size_t start_offset = *typeformat_offset; + int in_attr = is_attr(var->attrs, ATTR_IN); + int out_attr = is_attr(var->attrs, ATTR_OUT); + int pointer_type = get_attrv(var->attrs, ATTR_POINTERTYPE); + if (!pointer_type) pointer_type = RPC_FC_RP; + + /* special case for pointers to base types */ + switch (type->type) + { +#define CASE_BASETYPE(fctype) \ + case RPC_##fctype: \ + print_file(file, indent, "0x%x, 0x%x, /* %s %s[simple_pointer] */\n", \ + pointer_type, \ + (!in_attr && out_attr) ? 0x0C : 0x08, \ + pointer_type == RPC_FC_FP ? "FC_FP" : (pointer_type == RPC_FC_UP ? "FC_UP" : "FC_RP"), \ + (!in_attr && out_attr) ? "[allocated_on_stack] " : ""); \ + print_file(file, indent, "0x%02x, /* " #fctype " */\n", RPC_##fctype); \ + print_file(file, indent, "0x5c, /* FC_PAD */\n"); \ + *typeformat_offset += 4; \ + return start_offset + CASE_BASETYPE(FC_BYTE); + CASE_BASETYPE(FC_CHAR); + CASE_BASETYPE(FC_SMALL); + CASE_BASETYPE(FC_USMALL); + CASE_BASETYPE(FC_WCHAR); + CASE_BASETYPE(FC_SHORT); + CASE_BASETYPE(FC_USHORT); + CASE_BASETYPE(FC_LONG); + CASE_BASETYPE(FC_ULONG); + CASE_BASETYPE(FC_FLOAT); + CASE_BASETYPE(FC_HYPER); + CASE_BASETYPE(FC_DOUBLE); + CASE_BASETYPE(FC_ENUM16); + CASE_BASETYPE(FC_ENUM32); + CASE_BASETYPE(FC_IGNORE); + CASE_BASETYPE(FC_ERROR_STATUS_T); + default: + break; + } + } + + assert(ptr_level > 0); + + if (file) + fprintf(file, "/* %2u */\n", *typeformat_offset); + write_pointer_only_tfs(file, var->attrs, 2, typeformat_offset); + + ptr_level--; + } +} + + +void write_typeformatstring(FILE *file, const ifref_t *ifaces) +{ + int indent = 0; + var_t *var; + unsigned int typeformat_offset; + const ifref_t *iface = ifaces; + + print_file(file, indent, "static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =\n"); + print_file(file, indent, "{\n"); + indent++; + print_file(file, indent, "0,\n"); + print_file(file, indent, "{\n"); + indent++; + print_file(file, indent, "NdrFcShort(0x0),\n"); + typeformat_offset = 2; + + END_OF_LIST(iface); + + for (; iface; iface = PREV_LINK(iface)) + { + if (is_object(iface->iface->attrs) || is_local(iface->iface->attrs)) + continue; + + if (iface->iface->funcs) + { + func_t *func = iface->iface->funcs; + while (NEXT_LINK(func)) func = NEXT_LINK(func); + for (; func; func = PREV_LINK(func)) + { + current_func = func; + if (func->args) + { + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + write_typeformatstring_var(file, indent, var, + &typeformat_offset); + var = PREV_LINK(var); + } + } + } + } + } + + print_file(file, indent, "0x0\n"); + indent--; + print_file(file, indent, "}\n"); + indent--; + print_file(file, indent, "};\n"); + print_file(file, indent, "\n"); +} + +static unsigned int get_required_buffer_size_type( + const type_t *type, int ptr_level, const expr_t *array, + const char *name, unsigned int *alignment) +{ + *alignment = 0; + if (ptr_level == 0 && !array && !type_has_ref(type)) + { + switch (type->type) + { + case RPC_FC_BYTE: + case RPC_FC_CHAR: + case RPC_FC_USMALL: + case RPC_FC_SMALL: + *alignment = 4; + return 1; + + case RPC_FC_WCHAR: + case RPC_FC_USHORT: + case RPC_FC_SHORT: + *alignment = 4; + return 2; + + case RPC_FC_ULONG: + case RPC_FC_LONG: + case RPC_FC_FLOAT: + case RPC_FC_ERROR_STATUS_T: + *alignment = 4; + return 4; + + case RPC_FC_HYPER: + case RPC_FC_DOUBLE: + *alignment = 8; + return 8; + + case RPC_FC_IGNORE: + case RPC_FC_BIND_PRIMITIVE: + return 0; + + case RPC_FC_STRUCT: + { + size_t size = 0; + const var_t *field; + for (field = type->fields; field; field = NEXT_LINK(field)) + { + unsigned int alignment; + size += get_required_buffer_size_type( + field->type, field->ptr_level, field->array, field->name, + &alignment); + } + return size; + } + + default: + error("get_required_buffer_size: Unknown/unsupported type: %s (0x%02x)\n", name, type->type); + return 0; + } + } + if (ptr_level == 0 && type_has_ref(type)) + return get_required_buffer_size_type(type->ref, 0 /* FIXME */, array, name, alignment); + return 0; +} + +unsigned int get_required_buffer_size(const var_t *var, unsigned int *alignment, enum pass pass) +{ + expr_t *size_is = get_attrp(var->attrs, ATTR_SIZEIS); + int has_size = (size_is && (size_is->type != EXPR_VOID)); + int in_attr = is_attr(var->attrs, ATTR_IN); + int out_attr = is_attr(var->attrs, ATTR_OUT); + + if (!in_attr && !out_attr) + in_attr = 1; + + *alignment = 0; + + if (pass == PASS_OUT) + { + if (out_attr && var->ptr_level > 0) + { + type_t *type = var->type; + while (type->type == 0 && type->ref) + type = type->ref; + + if (type->type == RPC_FC_STRUCT) + { + const var_t *field; + unsigned int size = 36; + for (field = type->fields; field; field = NEXT_LINK(field)) + { + unsigned int align; + size += get_required_buffer_size_type( + field->type, field->ptr_level, field->array, field->name, + &align); + } + return size; + } + } + return 0; + } + else + { + if ((!out_attr || in_attr) && !has_size && !is_attr(var->attrs, ATTR_STRING) && !var->array) + { + if (var->ptr_level > 0 || (var->ptr_level == 0 && type_has_ref(var->type))) + { + type_t *type = var->type; + while (type->type == 0 && type->ref) + type = type->ref; + + if (is_base_type(type->type)) + { + return 25; + } + else if (type->type == RPC_FC_STRUCT) + { + unsigned int size = 36; + const var_t *field; + for (field = type->fields; field; field = NEXT_LINK(field)) + { + unsigned int align; + size += get_required_buffer_size_type( + field->type, field->ptr_level, field->array, field->name, + &align); + } + return size; + } + } + } + + return get_required_buffer_size_type(var->type, var->ptr_level, var->array, var->name, alignment); + } +} + +static void print_phase_function(FILE *file, int indent, const char *type, + enum remoting_phase phase, + const char *varname, unsigned int type_offset) +{ + const char *function; + switch (phase) + { + case PHASE_BUFFERSIZE: + function = "BufferSize"; + break; + case PHASE_MARSHAL: + function = "Marshall"; + break; + case PHASE_UNMARSHAL: + function = "Unmarshall"; + break; + case PHASE_FREE: + function = "Free"; + break; + default: + assert(0); + return; + } + + print_file(file, indent, "Ndr%s%s(\n", type, function); + indent++; + print_file(file, indent, "&_StubMsg,\n"); + print_file(file, indent, "%s%s,\n", + (phase == PHASE_UNMARSHAL) ? "(unsigned char **)&" : "(unsigned char *)", + varname); + print_file(file, indent, "(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%d]%s\n", + type_offset, (phase == PHASE_UNMARSHAL) ? "," : ");"); + if (phase == PHASE_UNMARSHAL) + print_file(file, indent, "0);\n"); + indent--; +} + +void print_phase_basetype(FILE *file, int indent, enum remoting_phase phase, + enum pass pass, const var_t *var, + const char *varname) +{ + const type_t *type = var->type; + unsigned int size; + unsigned int alignment = 0; + + /* no work to do for other phases, buffer sizing is done elsewhere */ + if (phase != PHASE_MARSHAL && phase != PHASE_UNMARSHAL) + return; + + while (type_has_ref(type)) + type = type->ref; + + switch (type->type) + { + case RPC_FC_BYTE: + case RPC_FC_CHAR: + case RPC_FC_SMALL: + case RPC_FC_USMALL: + size = 1; + alignment = 1; + break; + + case RPC_FC_WCHAR: + case RPC_FC_USHORT: + case RPC_FC_SHORT: + size = 2; + alignment = 2; + break; + + case RPC_FC_ULONG: + case RPC_FC_LONG: + case RPC_FC_FLOAT: + case RPC_FC_ERROR_STATUS_T: + size = 4; + alignment = 4; + break; + + case RPC_FC_HYPER: + case RPC_FC_DOUBLE: + size = 8; + alignment = 8; + break; + + case RPC_FC_IGNORE: + case RPC_FC_BIND_PRIMITIVE: + /* no marshalling needed */ + return; + + default: + error("print_phase_basetype: Unsupported type: %s (0x%02x, ptr_level: 0)\n", var->name, type->type); + size = 0; + } + + print_file(file, indent, "_StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + %u) & ~0x%x);\n", + alignment - 1, alignment - 1); + + if (phase == PHASE_MARSHAL) + { + print_file(file, indent, "*("); + write_type(file, var->type, NULL, var->tname); + if (var->ptr_level) + fprintf(file, " *)_StubMsg.Buffer = *"); + else + fprintf(file, " *)_StubMsg.Buffer = "); + fprintf(file, varname); + fprintf(file, ";\n"); + } + else if (phase == PHASE_UNMARSHAL) + { + if (pass == PASS_IN || pass == PASS_RETURN) + print_file(file, indent, ""); + else + print_file(file, indent, "*"); + fprintf(file, varname); + if (pass == PASS_IN && var->ptr_level) + fprintf(file, " = ("); + else + fprintf(file, " = *("); + write_type(file, var->type, NULL, var->tname); + fprintf(file, " *)_StubMsg.Buffer;\n"); + } + + print_file(file, indent, "_StubMsg.Buffer += sizeof("); + write_type(file, var->type, NULL, var->tname); + fprintf(file, ");\n"); +} + +/* returns whether the MaxCount, Offset or ActualCount members need to be + * filled in for the specified phase */ +static inline int is_size_needed_for_phase(enum remoting_phase phase) +{ + return (phase != PHASE_UNMARSHAL); +} + +void write_remoting_arguments(FILE *file, int indent, const func_t *func, + unsigned int *type_offset, enum pass pass, + enum remoting_phase phase) +{ + const expr_t *length_is; + const expr_t *size_is; + int in_attr, out_attr, has_length, has_size, pointer_type; + var_t *var; + + if (!func->args) + return; + + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + for (; var; *type_offset += get_size_typeformatstring_var(var), var = PREV_LINK(var)) + { + const type_t *type = var->type; + length_is = get_attrp(var->attrs, ATTR_LENGTHIS); + size_is = get_attrp(var->attrs, ATTR_SIZEIS); + has_length = length_is && (length_is->type != EXPR_VOID); + has_size = (size_is && (size_is->type != EXPR_VOID)) || (var->array && !var->array->is_const); + + pointer_type = get_attrv(var->attrs, ATTR_POINTERTYPE); + if (!pointer_type) + pointer_type = RPC_FC_RP; + + in_attr = is_attr(var->attrs, ATTR_IN); + out_attr = is_attr(var->attrs, ATTR_OUT); + if (!in_attr && !out_attr) + in_attr = 1; + + switch (pass) + { + case PASS_IN: + if (!in_attr) + continue; + break; + case PASS_OUT: + if (!out_attr) + continue; + break; + case PASS_RETURN: + break; + } + + while (type_has_ref(type)) + type = type->ref; + + if (is_string_type(var->attrs, var->ptr_level, var->array)) + { + if (var->array && var->array->is_const) + print_phase_function(file, indent, "NonConformantString", phase, var->name, *type_offset); + else + { + if (size_is && is_size_needed_for_phase(phase)) + { + print_file(file, indent, "_StubMsg.MaxCount = (unsigned long)"); + write_expr(file, size_is, 1); + fprintf(file, ";\n"); + } + + if ((phase == PHASE_FREE) || (pointer_type == RPC_FC_UP)) + print_phase_function(file, indent, "Pointer", phase, var->name, *type_offset); + else + print_phase_function(file, indent, "ConformantString", phase, var->name, + *type_offset + (has_size ? 4 : 2)); + } + } + else if (is_array_type(var->attrs, var->ptr_level, var->array)) + { + const char *array_type; + + if (var->array && NEXT_LINK(var->array)) /* multi-dimensional array */ + array_type = "ComplexArray"; + else + { + if (!has_length && !has_size) + array_type = "FixedArray"; + else if (has_length && !has_size) + { + if (is_size_needed_for_phase(phase)) + { + print_file(file, indent, "_StubMsg.Offset = (unsigned long)0;\n"); /* FIXME */ + print_file(file, indent, "_StubMsg.ActualCount = (unsigned long)"); + write_expr(file, length_is, 1); + fprintf(file, ";\n\n"); + } + array_type = "VaryingArray"; + } + else if (!has_length && has_size) + { + if (is_size_needed_for_phase(phase) && phase != PHASE_FREE) + { + print_file(file, indent, "_StubMsg.MaxCount = (unsigned long)"); + write_expr(file, size_is ? size_is : var->array, 1); + fprintf(file, ";\n\n"); + } + array_type = "ConformantArray"; + } + else + { + if (is_size_needed_for_phase(phase)) + { + print_file(file, indent, "_StubMsg.MaxCount = (unsigned long)"); + write_expr(file, size_is ? size_is : var->array, 1); + fprintf(file, ";\n"); + print_file(file, indent, "_StubMsg.Offset = (unsigned long)0;\n"); /* FIXME */ + print_file(file, indent, "_StubMsg.ActualCount = (unsigned long)"); + write_expr(file, length_is, 1); + fprintf(file, ";\n\n"); + } + array_type = "ConformantVaryingArray"; + } + } + + if (!in_attr && phase == PHASE_FREE) + { + print_file(file, indent, "if (%s)\n", var->name); + indent++; + print_file(file, indent, "_StubMsg.pfnFree(%s);\n", var->name); + } + else if (phase != PHASE_FREE) + { + if (pointer_type == RPC_FC_UP) + print_phase_function(file, indent, "Pointer", phase, var->name, *type_offset); + else + print_phase_function(file, indent, array_type, phase, var->name, *type_offset + 4); + } + } + else if (var->ptr_level == 0 && is_base_type(type->type)) + { + print_phase_basetype(file, indent, phase, pass, var, var->name); + } + else if (var->ptr_level == 0) + { + const char *ndrtype; + + switch (type->type) + { + case RPC_FC_STRUCT: + ndrtype = "SimpleStruct"; + break; + case RPC_FC_CSTRUCT: + case RPC_FC_CPSTRUCT: + ndrtype = "ConformantStruct"; + break; + case RPC_FC_CVSTRUCT: + ndrtype = "ConformantVaryingStruct"; + break; + case RPC_FC_BOGUS_STRUCT: + ndrtype = "ComplexStruct"; + break; + default: + error("write_remoting_arguments: Unsupported type: %s (0x%02x, ptr_level: %d)\n", + var->name, type->type, var->ptr_level); + ndrtype = NULL; + } + + print_phase_function(file, indent, ndrtype, phase, var->name, *type_offset); + } + else + { + if ((var->ptr_level == 1) && (pointer_type == RPC_FC_RP) && is_base_type(type->type)) + { + print_phase_basetype(file, indent, phase, pass, var, var->name); + } + else if ((var->ptr_level == 1) && (pointer_type == RPC_FC_RP) && (type->type == RPC_FC_STRUCT)) + { + if (phase != PHASE_BUFFERSIZE && phase != PHASE_FREE) + print_phase_function(file, indent, "SimpleStruct", phase, var->name, *type_offset + 4); + } + else + { + print_phase_function(file, indent, "Pointer", phase, var->name, *type_offset); + } + } + fprintf(file, "\n"); + } +} + + +size_t get_size_procformatstring_var(const var_t *var) +{ + unsigned int type_offset = 2; + return write_procformatstring_var(NULL, 0, var, FALSE, &type_offset); +} + + +size_t get_size_typeformatstring_var(const var_t *var) +{ + unsigned int type_offset = 0; + write_typeformatstring_var(NULL, 0, var, &type_offset); + return type_offset; +} + +size_t get_size_procformatstring(const ifref_t *ifaces) +{ + const ifref_t *iface = ifaces; + size_t size = 1; + func_t *func; + var_t *var; + + END_OF_LIST(iface); + + for (; iface; iface = PREV_LINK(iface)) + { + if (is_object(iface->iface->attrs) || is_local(iface->iface->attrs)) + continue; + + if (iface->iface->funcs) + { + func = iface->iface->funcs; + while (NEXT_LINK(func)) func = NEXT_LINK(func); + while (func) + { + /* argument list size */ + if (func->args) + { + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + size += get_size_procformatstring_var(var); + var = PREV_LINK(var); + } + } + + var = func->def; + /* return value size */ + if (is_void(var->type, NULL)) + size += 2; + else + size += get_size_procformatstring_var(var); + + func = PREV_LINK(func); + } + } + } + return size; +} + +size_t get_size_typeformatstring(const ifref_t *ifaces) +{ + const ifref_t *iface = ifaces; + size_t size = 3; + func_t *func; + var_t *var; + + END_OF_LIST(iface); + + for (; iface; iface = PREV_LINK(iface)) + { + if (is_object(iface->iface->attrs) || is_local(iface->iface->attrs)) + continue; + + if (iface->iface->funcs) + { + func = iface->iface->funcs; + while (NEXT_LINK(func)) func = NEXT_LINK(func); + while (func) + { + /* argument list size */ + if (func->args) + { + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + size += get_size_typeformatstring_var(var); + var = PREV_LINK(var); + } + } + + func = PREV_LINK(func); + } + } + } + return size; +} + +static void write_struct_expr(FILE *h, const expr_t *e, int brackets, + const var_t *fields, const char *structvar) +{ + switch (e->type) { + case EXPR_VOID: + break; + case EXPR_NUM: + fprintf(h, "%ld", e->u.lval); + break; + case EXPR_HEXNUM: + fprintf(h, "0x%lx", e->u.lval); + break; + case EXPR_TRUEFALSE: + if (e->u.lval == 0) + fprintf(h, "FALSE"); + else + fprintf(h, "TRUE"); + break; + case EXPR_IDENTIFIER: + { + const var_t *field; + for (field = fields; field; field = NEXT_LINK(field)) + { + if (!strcmp(e->u.sval, field->name)) + { + fprintf(h, "%s->%s", structvar, e->u.sval); + break; + } + } + if (!field) error("no field found for identifier %s\n", e->u.sval); + break; + } + case EXPR_NEG: + fprintf(h, "-"); + write_struct_expr(h, e->ref, 1, fields, structvar); + break; + case EXPR_NOT: + fprintf(h, "~"); + write_struct_expr(h, e->ref, 1, fields, structvar); + break; + case EXPR_PPTR: + fprintf(h, "*"); + write_struct_expr(h, e->ref, 1, fields, structvar); + break; + case EXPR_CAST: + fprintf(h, "("); + write_type(h, e->u.tref->ref, NULL, e->u.tref->name); + fprintf(h, ")"); + write_struct_expr(h, e->ref, 1, fields, structvar); + break; + case EXPR_SIZEOF: + fprintf(h, "sizeof("); + write_type(h, e->u.tref->ref, NULL, e->u.tref->name); + fprintf(h, ")"); + break; + case EXPR_SHL: + case EXPR_SHR: + case EXPR_MUL: + case EXPR_DIV: + case EXPR_ADD: + case EXPR_SUB: + case EXPR_AND: + case EXPR_OR: + if (brackets) fprintf(h, "("); + write_struct_expr(h, e->ref, 1, fields, structvar); + switch (e->type) { + case EXPR_SHL: fprintf(h, " << "); break; + case EXPR_SHR: fprintf(h, " >> "); break; + case EXPR_MUL: fprintf(h, " * "); break; + case EXPR_DIV: fprintf(h, " / "); break; + case EXPR_ADD: fprintf(h, " + "); break; + case EXPR_SUB: fprintf(h, " - "); break; + case EXPR_AND: fprintf(h, " & "); break; + case EXPR_OR: fprintf(h, " | "); break; + default: break; + } + write_struct_expr(h, e->u.ext, 1, fields, structvar); + if (brackets) fprintf(h, ")"); + break; + case EXPR_COND: + if (brackets) fprintf(h, "("); + write_struct_expr(h, e->ref, 1, fields, structvar); + fprintf(h, " ? "); + write_struct_expr(h, e->u.ext, 1, fields, structvar); + fprintf(h, " : "); + write_struct_expr(h, e->ext2, 1, fields, structvar); + if (brackets) fprintf(h, ")"); + break; + } +} + +int write_expr_eval_routines(FILE *file, const char *iface) +{ + int result = 0; + struct expr_eval_routine *eval; + unsigned short callback_offset = 0; + + LIST_FOR_EACH_ENTRY(eval, &expr_eval_routines, struct expr_eval_routine, entry) + { + int indent = 0; + result = 1; + print_file(file, indent, "static void __RPC_USER %s_%sExprEval_%04u(PMIDL_STUB_MESSAGE pStubMsg)\n", + iface, eval->structure->name, callback_offset); + print_file(file, indent, "{\n"); + indent++; + print_file(file, indent, "struct %s *" STRUCT_EXPR_EVAL_VAR " = (struct %s *)(pStubMsg->StackTop - %u);\n", + eval->structure->name, eval->structure->name, eval->structure_size); + fprintf(file, "\n"); + print_file(file, indent, "pStubMsg->Offset = 0;\n"); /* FIXME */ + print_file(file, indent, "pStubMsg->MaxCount = (unsigned long)"); + write_struct_expr(file, eval->expr, 1, eval->structure->fields, STRUCT_EXPR_EVAL_VAR); + fprintf(file, ";\n"); + indent--; + print_file(file, indent, "}\n\n"); + callback_offset++; + } + return result; +} + +void write_expr_eval_routine_list(FILE *file, const char *iface) +{ + struct expr_eval_routine *eval; + struct expr_eval_routine *cursor; + unsigned short callback_offset = 0; + + fprintf(file, "static const EXPR_EVAL ExprEvalRoutines[] =\n"); + fprintf(file, "{\n"); + + LIST_FOR_EACH_ENTRY_SAFE(eval, cursor, &expr_eval_routines, struct expr_eval_routine, entry) + { + print_file(file, 1, "%s_%sExprEval_%04u,\n", + iface, eval->structure->name, callback_offset); + + callback_offset++; + list_remove(&eval->entry); + free(eval); + } + + fprintf(file, "};\n\n"); +} diff --git a/reactos/tools/widl/typegen.h b/reactos/tools/widl/typegen.h new file mode 100644 index 00000000000..eb4c4c7689b --- /dev/null +++ b/reactos/tools/widl/typegen.h @@ -0,0 +1,49 @@ +/* + * Format String Generator for IDL Compiler + * + * Copyright 2005-2006 Eric Kohl + * Copyright 2005 Robert Shearman + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +enum pass +{ + PASS_IN, + PASS_OUT, + PASS_RETURN +}; + +enum remoting_phase +{ + PHASE_BUFFERSIZE, + PHASE_MARSHAL, + PHASE_UNMARSHAL, + PHASE_FREE +}; + +void write_procformatstring(FILE *file, const ifref_t *ifaces); +void write_typeformatstring(FILE *file, const ifref_t *ifaces); +size_t get_type_memsize(const type_t *type); +unsigned int get_required_buffer_size(const var_t *var, unsigned int *alignment, enum pass pass); +void print_phase_basetype(FILE *file, int indent, enum remoting_phase phase, enum pass pass, const var_t *var, const char *varname); +void write_remoting_arguments(FILE *file, int indent, const func_t *func, unsigned int *type_offset, enum pass pass, enum remoting_phase phase); +size_t get_size_procformatstring_var(const var_t *var); +size_t get_size_typeformatstring_var(const var_t *var); +size_t get_size_procformatstring(const ifref_t *ifaces); +size_t get_size_typeformatstring(const ifref_t *ifaces); +int write_expr_eval_routines(FILE *file, const char *iface); +void write_expr_eval_routine_list(FILE *file, const char *iface); diff --git a/reactos/tools/widl/typelib.c b/reactos/tools/widl/typelib.c index 6cce1fa78a5..11e2c4de30c 100644 --- a/reactos/tools/widl/typelib.c +++ b/reactos/tools/widl/typelib.c @@ -2,6 +2,7 @@ * IDL Compiler * * Copyright 2004 Ove Kaaven + * Copyright 2006 Jacek Caban for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -15,24 +16,35 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" +#include "wine/port.h" +#include "wine/wpp.h" #include #include +#include #include #include #include #include #include +#define NONAMELESSUNION +#define NONAMELESSSTRUCT + +#include "windef.h" +#include "winbase.h" + #include "widl.h" #include "utils.h" #include "parser.h" #include "header.h" #include "typelib.h" +#include "widltypes.h" +#include "typelib_struct.h" int in_typelib = 0; @@ -72,7 +84,7 @@ static unsigned short builtin_vt(const char *kw) kwp = bsearch(&key, oatypes, NTYPES, sizeof(oatypes[0]), kw_cmp_func); #else { - int i; + unsigned int i; for (kwp=NULL, i=0; i < NTYPES; i++) if (!kw_cmp_func(&key, &oatypes[i])) { kwp = &oatypes[i]; @@ -145,14 +157,13 @@ unsigned short get_type_vt(type_t *t) return VT_DISPATCH; return VT_USERDEFINED; - case RPC_FC_ENUM16: + case RPC_FC_ENUM16: case RPC_FC_STRUCT: case RPC_FC_PSTRUCT: case RPC_FC_CSTRUCT: case RPC_FC_CPSTRUCT: case RPC_FC_CVSTRUCT: case RPC_FC_BOGUS_STRUCT: - return VT_USERDEFINED; case 0: if(t->attrs) @@ -210,7 +221,7 @@ void add_interface(type_t *iface) typelib->entry = entry; } -void add_coclass(class_t *cls) +void add_coclass(type_t *cls) { typelib_entry_t *entry; @@ -269,6 +280,7 @@ void add_typedef(type_t *tdef, var_t *name) typelib_entry_t *entry; if (!typelib) return; + chat("add typedef: %s\n", name->name); entry = xmalloc(sizeof(*entry)); entry->kind = TKIND_ALIAS; entry->u.tdef = xmalloc(sizeof(*entry->u.tdef)); @@ -278,3 +290,128 @@ void add_typedef(type_t *tdef, var_t *name) LINK(entry, typelib->entry); typelib->entry = entry; } + +static void tlb_read(int fd, void *buf, size_t count) +{ + if(read(fd, buf, count) < count) + error("error while reading importlib.\n"); +} + +static void tlb_lseek(int fd, off_t offset) +{ + if(lseek(fd, offset, SEEK_SET) == -1) + error("lseek failed\n"); +} + +static void msft_read_guid(int fd, MSFT_SegDir *segdir, int offset, GUID *guid) +{ + tlb_lseek(fd, segdir->pGuidTab.offset+offset); + tlb_read(fd, guid, sizeof(GUID)); +} + +static void read_msft_importlib(importlib_t *importlib, int fd) +{ + MSFT_Header header; + MSFT_SegDir segdir; + int *typeinfo_offs; + int i; + + importlib->allocated = 0; + + tlb_lseek(fd, 0); + tlb_read(fd, &header, sizeof(header)); + + importlib->version = header.version; + + typeinfo_offs = xmalloc(header.nrtypeinfos*sizeof(INT)); + tlb_read(fd, typeinfo_offs, header.nrtypeinfos*sizeof(INT)); + tlb_read(fd, &segdir, sizeof(segdir)); + + msft_read_guid(fd, &segdir, header.posguid, &importlib->guid); + + importlib->ntypeinfos = header.nrtypeinfos; + importlib->importinfos = xmalloc(importlib->ntypeinfos*sizeof(importinfo_t)); + + for(i=0; i < importlib->ntypeinfos; i++) { + MSFT_TypeInfoBase base; + MSFT_NameIntro nameintro; + int len; + + tlb_lseek(fd, sizeof(MSFT_Header) + header.nrtypeinfos*sizeof(INT) + sizeof(MSFT_SegDir) + + typeinfo_offs[i]); + tlb_read(fd, &base, sizeof(base)); + + importlib->importinfos[i].importlib = importlib; + importlib->importinfos[i].flags = (base.typekind&0xf)<<24; + importlib->importinfos[i].offset = -1; + importlib->importinfos[i].id = i; + + if(base.posguid != -1) { + importlib->importinfos[i].flags |= MSFT_IMPINFO_OFFSET_IS_GUID; + msft_read_guid(fd, &segdir, base.posguid, &importlib->importinfos[i].guid); + } + + tlb_lseek(fd, segdir.pNametab.offset + base.NameOffset); + tlb_read(fd, &nameintro, sizeof(nameintro)); + + len = nameintro.namelen & 0xff; + + importlib->importinfos[i].name = xmalloc(len+1); + tlb_read(fd, importlib->importinfos[i].name, len); + importlib->importinfos[i].name[len] = 0; + } + + free(typeinfo_offs); +} + +static void read_importlib(importlib_t *importlib) +{ + int fd; + INT magic; + char *file_name; + + file_name = wpp_find_include(importlib->name, NULL, 1); + if(file_name) { + fd = open(file_name, O_RDONLY); + free(file_name); + }else { + fd = open(importlib->name, O_RDONLY); + } + + if(fd < 0) + error("Could not open importlib %s.\n", importlib->name); + + tlb_read(fd, &magic, sizeof(magic)); + + switch(magic) { + case MSFT_MAGIC: + read_msft_importlib(importlib, fd); + break; + default: + error("Wrong or unsupported typelib magic %x\n", magic); + }; + + close(fd); +} + +void add_importlib(const char *name) +{ + importlib_t *importlib; + + if(!typelib) return; + + for(importlib = typelib->importlibs; importlib; importlib = NEXT_LINK(importlib)) { + if(!strcmp(name, importlib->name)) + return; + } + + chat("add_importlib: %s\n", name); + + importlib = xmalloc(sizeof(*importlib)); + importlib->name = xstrdup(name); + + read_importlib(importlib); + + LINK(importlib, typelib->importlibs); + typelib->importlibs = importlib; +} diff --git a/reactos/tools/widl/typelib.h b/reactos/tools/widl/typelib.h index d6ba5a7d700..9fb5bdd9345 100644 --- a/reactos/tools/widl/typelib.h +++ b/reactos/tools/widl/typelib.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WIDL_TYPELIB_H @@ -25,11 +25,12 @@ extern int in_typelib; extern void start_typelib(char *name, attr_t *attrs); extern void end_typelib(void); extern void add_interface(type_t *iface); -extern void add_coclass(class_t *cls); +extern void add_coclass(type_t *cls); extern void add_module(type_t *module); extern void add_struct(type_t *structure); extern void add_enum(type_t *enumeration); extern void add_typedef(type_t *tdef, var_t *name); +extern void add_importlib(const char *name); /* Copied from wtypes.h. Not included directly because that would create a * circular dependency (after all, wtypes.h is generated by widl...) */ diff --git a/reactos/tools/widl/typelib_struct.h b/reactos/tools/widl/typelib_struct.h index cc336641f2b..d3b2ab5b2ba 100644 --- a/reactos/tools/widl/typelib_struct.h +++ b/reactos/tools/widl/typelib_struct.h @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef _WIDL_TYPELIB_STRUCT_H #define _WIDL_TYPELIB_STRUCT_H @@ -34,6 +34,8 @@ * with ICreateTypeLib2 have "MSFT". */ +#define MSFT_MAGIC 0x5446534d + /***************************************************** * MSFT typelibs * @@ -76,7 +78,7 @@ typedef struct tagMSFT_Header { INT res44; /* unknown always: 0x20 (guid hash size?) */ INT res48; /* unknown always: 0x80 (name hash size?) */ INT dispatchpos; /* HREFTYPE to IDispatch, or -1 if no IDispatch */ -/*0x50*/INT res50; /* is zero becomes one when an interface is derived */ +/*0x50*/INT nimpinfos; /* number of impinfos */ } MSFT_Header; /* segments in the type lib file have a structure like this: */ @@ -153,17 +155,19 @@ typedef struct tagMSFT_TypeInfoBase { /* loword is num of inherited interfaces */ INT res18; /* always? 0 */ /*060*/ INT res19; /* always? -1 */ - } MSFT_TypeInfoBase; +} MSFT_TypeInfoBase; /* layout of an entry with information on imported types */ typedef struct tagMSFT_ImpInfo { - INT res0; /* bits 0 - 15: count */ + INT flags; /* bits 0 - 15: count */ /* bit 16: if set oGuid is an offset to Guid */ /* if clear oGuid is a typeinfo index in the specified typelib */ /* bits 24 - 31: TKIND of reference */ INT oImpFile; /* offset in the Import File table */ - INT oGuid; /* offset in Guid table or typeinfo index (see bit 16 of res0) */ - } MSFT_ImpInfo; + INT oGuid; /* offset in Guid table or typeinfo index (see bit 16 of flags) */ +} MSFT_ImpInfo; + +#define MSFT_IMPINFO_OFFSET_IS_GUID 0x00010000 /* function description data */ typedef struct { diff --git a/reactos/tools/widl/utils.c b/reactos/tools/widl/utils.c index 50b32fbce69..9f82184cd94 100644 --- a/reactos/tools/widl/utils.c +++ b/reactos/tools/widl/utils.c @@ -16,9 +16,12 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + #include #include #include diff --git a/reactos/tools/widl/utils.h b/reactos/tools/widl/utils.h index a32ce0ce189..089607dd538 100644 --- a/reactos/tools/widl/utils.h +++ b/reactos/tools/widl/utils.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WIDL_UTILS_H diff --git a/reactos/tools/widl/widl.c b/reactos/tools/widl/widl.c index 97f8c1704ac..c6c4a1cd84c 100644 --- a/reactos/tools/widl/widl.c +++ b/reactos/tools/widl/widl.c @@ -16,10 +16,11 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" +#include "wine/port.h" #include #include @@ -34,12 +35,11 @@ # include #endif -#define WIDL_FULLVERSION "0.1" - #include "widl.h" #include "utils.h" #include "parser.h" #include "wine/wpp.h" +#include "header.h" /* future options to reserve characters for: */ /* a = alignment of structures */ @@ -79,11 +79,12 @@ static char usage[] = " * 0x20 Preprocessor yacc trace\n" ; -static const char version_string[] = "Wine IDL Compiler Version " WIDL_FULLVERSION "\n" +static const char version_string[] = "Wine IDL Compiler version " PACKAGE_VERSION "\n" "Copyright 2002 Ove Kaaven\n"; int win32 = 1; int debuglevel = DEBUGLEVEL_NONE; +int yy_flex_debug; int pedantic = 0; static int do_everything = 1; @@ -115,18 +116,15 @@ FILE *proxy; time_t now; -int getopt (int argc, char *const *argv, const char *optstring); -static void rm_tempfile(void); -static void segvhandler(int sig); - -static const char* short_options = +static const char *short_options = "cC:d:D:EhH:I:NpP:sS:tT:VW"; - static struct option long_options[] = { - {"oldnames", 0, 0, 1}, + { "oldnames", 0, 0, 1 }, { 0, 0, 0, 0 } }; +static void rm_tempfile(void); +static void segvhandler(int sig); static char *make_token(const char *name) { @@ -145,6 +143,21 @@ static char *make_token(const char *name) return token; } +/* duplicate a basename into a valid C token */ +static char *dup_basename_token(const char *name, const char *ext) +{ + char *p, *ret = dup_basename( name, ext ); + /* map invalid characters to '_' */ + for (p = ret; *p; p++) if (!isalnum(*p)) *p = '_'; + return ret; +} + +/* clean things up when aborting on a signal */ +static void exit_on_signal( int sig ) +{ + exit(1); /* this will call the atexit functions */ +} + int main(int argc,char *argv[]) { extern char* optarg; @@ -154,11 +167,16 @@ int main(int argc,char *argv[]) int opti = 0; signal(SIGSEGV, segvhandler); + signal( SIGTERM, exit_on_signal ); + signal( SIGINT, exit_on_signal ); +#ifdef SIGHUP + signal( SIGHUP, exit_on_signal ); +#endif now = time(NULL); while((optc = getopt_long(argc, argv, short_options, long_options, &opti)) != EOF) { - switch (optc) { + switch(optc) { case 1: old_names = 1; break; @@ -225,10 +243,10 @@ int main(int argc,char *argv[]) } } - if (do_everything) { + if(do_everything) { do_header = do_typelib = do_proxies = do_client = do_server = 1; } - if (optind < argc) { + if(optind < argc) { input_name = xstrdup(argv[optind]); } else { @@ -236,7 +254,7 @@ int main(int argc,char *argv[]) return 1; } - if (debuglevel) + if(debuglevel) { setbuf(stdout,0); setbuf(stderr,0); @@ -261,22 +279,23 @@ int main(int argc,char *argv[]) if (!proxy_name && do_proxies) { proxy_name = dup_basename(input_name, ".idl"); - proxy_token = xstrdup(proxy_name); strcat(proxy_name, "_p.c"); } if (!client_name && do_client) { client_name = dup_basename(input_name, ".idl"); - client_token = xstrdup(client_name); strcat(client_name, "_c.c"); } if (!server_name && do_server) { server_name = dup_basename(input_name, ".idl"); - server_token = xstrdup(server_name); strcat(server_name, "_s.c"); } + if (do_proxies) proxy_token = dup_basename_token(proxy_name,"_p.c"); + if (do_client) client_token = dup_basename_token(client_name,"_c.c"); + if (do_server) server_token = dup_basename_token(server_name,"_s.c"); + wpp_add_cmdline_define("__WIDL__"); atexit(rm_tempfile); @@ -314,7 +333,7 @@ int main(int argc,char *argv[]) fprintf(stderr, "Could not open %s for output\n", header_name); return 1; } - fprintf(header, "/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", WIDL_FULLVERSION, input_name); + fprintf(header, "/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", PACKAGE_VERSION, input_name); fprintf(header, "#include \n" ); fprintf(header, "#include \n\n" ); fprintf(header, "#ifndef __WIDL_%s\n", header_token); @@ -327,6 +346,12 @@ int main(int argc,char *argv[]) ret = yyparse(); if(do_header) { + fprintf(header, "/* Begin additional prototypes for all interfaces */\n"); + fprintf(header, "\n"); + write_user_types(); + fprintf(header, "\n"); + fprintf(header, "/* End additional prototypes */\n"); + fprintf(header, "\n"); fprintf(header, "#ifdef __cplusplus\n"); fprintf(header, "}\n"); fprintf(header, "#endif\n"); diff --git a/reactos/tools/widl/widl.h b/reactos/tools/widl/widl.h index db8b95cc396..d41ca7074a4 100644 --- a/reactos/tools/widl/widl.h +++ b/reactos/tools/widl/widl.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WIDL_WIDL_H diff --git a/reactos/tools/widl/widl.mak b/reactos/tools/widl/widl.mak index e7979f40bdd..a93263d4c8e 100644 --- a/reactos/tools/widl/widl.mak +++ b/reactos/tools/widl/widl.mak @@ -42,11 +42,12 @@ WIDL_SOURCES = $(addprefix $(WIDL_BASE_), \ lex.yy.c \ proxy.c \ server.c \ + typegen.c \ typelib.c \ utils.c \ widl.c \ write_msft.c \ - y.tab.c \ + parser.tab.c \ port$(SEP)mkstemps.c \ ) @@ -93,6 +94,10 @@ $(WIDL_INT_)server.o: $(WIDL_BASE_)server.c | $(WIDL_INT) $(ECHO_CC) ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@ +$(WIDL_INT_)typegen.o: $(WIDL_BASE_)typegen.c | $(WIDL_INT) + $(ECHO_CC) + ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@ + $(WIDL_INT_)typelib.o: $(WIDL_BASE_)typelib.c | $(WIDL_INT) $(ECHO_CC) ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@ @@ -109,7 +114,7 @@ $(WIDL_INT_)write_msft.o: $(WIDL_BASE_)write_msft.c | $(WIDL_INT) $(ECHO_CC) ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@ -$(WIDL_INT_)y.tab.o: $(WIDL_BASE_)y.tab.c | $(WIDL_INT) +$(WIDL_INT_)parser.tab.o: $(WIDL_BASE_)parser.tab.c | $(WIDL_INT) $(ECHO_CC) ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@ diff --git a/reactos/tools/widl/widl.man b/reactos/tools/widl/widl.man.in similarity index 80% rename from reactos/tools/widl/widl.man rename to reactos/tools/widl/widl.man.in index 11b528d0e60..2d9ac8034e8 100644 --- a/reactos/tools/widl/widl.man +++ b/reactos/tools/widl/widl.man.in @@ -1,10 +1,11 @@ -.TH WIDL 1 "March 2004" "Wine Manpage" "Wine Developers Manual" +.\" -*- nroff -*- +.TH WIDL 1 "October 2005" "@PACKAGE_STRING@" "Wine Developers Manual" .SH NAME widl \- Wine Interface Definition Language Compiler .SH SYNOPSIS .BR "widl "\fI[options]\fR " \fIinfile.idl\fR" .SH DESCRIPTION -.B widl +.B widl is a Wine tool which purpose is to compile Interface Definition Language (IDL) files. .PP .SH OPTIONS @@ -14,56 +15,56 @@ No options are used. The program prints the help info and then exits. .PP .B General options: -.IP \fB--oldnames\fR -Use old naming conventions. -.IP \fB-V\fR +.IP "\fB-V\fR" Print version number and exits from the program. .PP .B Header options: -.IP \fB-h\fR +.IP "\fB-h\fR" Generate header files. .IP "\fB-H \fIfile\fR" Name of header file to generate. The default header filename is infile.h. +.IP "\fB--oldnames\fR" +Use old naming conventions. .PP .B Type library options: .IP \fB-t\fR Generate a type library. .IP "\fB-T \fIfile\fR" -Define the name of the type library to be generated. +Define the name of the type library to be generated. The default filename is infile.tlb. .PP .B Proxy/stub generation options: -.IP \fB-c\fR +.IP "\fB-c\fR" Generate client stub. -.IP \fB-C \fIfile\fR +.IP "\fB-C \fIfile\fR" Name of client stub file (default is infile_c.c) -.IP \fB-c\fR +.IP "\fB-p\fR" Generate proxy. -.IP \fB-P \fIfile\fR +.IP "\fB-P \fIfile\fR" Name of proxy file (default is infile_p.c) -.IP \fB-s\fR +.IP "\fB-s\fR" Generate server stub. -.IP \fB-S \fIfile\fR +.IP "\fB-S \fIfile\fR" Name of server stub file (default is infile_s.c) .PP .B Preprocessor options: .IP "\fB-I \fIpath\fR" -Add a header search dir to path. Multiple search +Add a header search dir to path. Multiple search dirs are allowed. .IP "\fB-D \fIid[=val]\fR" Define preprocessor identifier id value. -.IP \fB-E\fR +.IP "\fB-E\fR" Preprocess only. -.IP \fB-N\fR +.IP "\fB-N\fR" Do not preprocess input. .PP .B Debug options: -.IP \fB-W\fR +.IP "\fB-W\fR" Enable pedantic warnings. .IP "\fB-d \fIn\fR" .nf -Set debug level to n. +Set debug level to n. n may be '0x01', '0x02', '0x04', '0x08', '0x10' or '0x20'. (See section \fBDebug\fR) .PP diff --git a/reactos/tools/widl/widltypes.h b/reactos/tools/widl/widltypes.h index 5db3c09c0d2..b0a18165923 100644 --- a/reactos/tools/widl/widltypes.h +++ b/reactos/tools/widl/widltypes.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WIDL_WIDLTYPES_H @@ -24,7 +24,6 @@ #include #include "guiddef.h" #include "wine/rpcfc.h" -#include "winglue.h" #ifndef UUID_DEFINED #define UUID_DEFINED @@ -41,13 +40,14 @@ typedef struct _typeref_t typeref_t; typedef struct _var_t var_t; typedef struct _func_t func_t; typedef struct _ifref_t ifref_t; -typedef struct _class_t class_t; typedef struct _typelib_entry_t typelib_entry_t; +typedef struct _importlib_t importlib_t; +typedef struct _importinfo_t importinfo_t; typedef struct _typelib_t typelib_t; #define DECL_LINK(type) \ type *l_next; \ - type *l_prev; + type *l_prev #define LINK(x,y) do { x->l_next = y; if (y) y->l_prev = x; } while (0) @@ -55,18 +55,32 @@ typedef struct _typelib_t typelib_t; #define NEXT_LINK(x) ((x)->l_next) #define PREV_LINK(x) ((x)->l_prev) +#define END_OF_LIST(list) \ + do { \ + if (list) { \ + while (NEXT_LINK(list)) \ + list = NEXT_LINK(list); \ + } \ + } while(0) + enum attr_type { + ATTR_AGGREGATABLE, + ATTR_APPOBJECT, ATTR_ASYNC, ATTR_AUTO_HANDLE, + ATTR_BINDABLE, ATTR_CALLAS, ATTR_CASE, ATTR_CONTEXTHANDLE, ATTR_CONTROL, ATTR_DEFAULT, + ATTR_DEFAULTCOLLELEM, ATTR_DEFAULTVALUE_EXPR, ATTR_DEFAULTVALUE_STRING, + ATTR_DEFAULTVTABLE, ATTR_DISPINTERFACE, + ATTR_DISPLAYBIND, ATTR_DLLNAME, ATTR_DUAL, ATTR_ENDPOINT, @@ -83,12 +97,15 @@ enum attr_type ATTR_ID, ATTR_IDEMPOTENT, ATTR_IIDIS, + ATTR_IMMEDIATEBIND, ATTR_IMPLICIT_HANDLE, ATTR_IN, ATTR_INPUTSYNC, ATTR_LENGTHIS, ATTR_LOCAL, + ATTR_NONBROWSABLE, ATTR_NONCREATABLE, + ATTR_NONEXTENSIBLE, ATTR_OBJECT, ATTR_ODL, ATTR_OLEAUTOMATION, @@ -99,10 +116,10 @@ enum attr_type ATTR_PROPGET, ATTR_PROPPUT, ATTR_PROPPUTREF, - ATTR_PTR, ATTR_PUBLIC, + ATTR_RANGE, ATTR_READONLY, - ATTR_REF, + ATTR_REQUESTEDIT, ATTR_RESTRICTED, ATTR_RETVAL, ATTR_SIZEIS, @@ -111,7 +128,6 @@ enum attr_type ATTR_SWITCHIS, ATTR_SWITCHTYPE, ATTR_TRANSMITAS, - ATTR_UNIQUE, ATTR_UUID, ATTR_V1ENUM, ATTR_VARARG, @@ -139,11 +155,13 @@ enum expr_type EXPR_AND, EXPR_OR, EXPR_COND, + EXPR_TRUEFALSE, }; enum type_kind { - TKIND_ENUM = 0, + TKIND_PRIMITIVE = -1, + TKIND_ENUM, TKIND_RECORD, TKIND_MODULE, TKIND_INTERFACE, @@ -161,38 +179,39 @@ struct _attr_t { void *pval; } u; /* parser-internal */ - DECL_LINK(attr_t) + DECL_LINK(attr_t); }; struct _expr_t { enum expr_type type; - expr_t *ref; + const expr_t *ref; union { long lval; - char *sval; - expr_t *ext; - typeref_t *tref; + const char *sval; + const expr_t *ext; + const typeref_t *tref; } u; - expr_t *ext2; + const expr_t *ext2; int is_const; long cval; /* parser-internal */ - DECL_LINK(expr_t) + DECL_LINK(expr_t); }; struct _type_t { - char *name; + const char *name; + enum type_kind kind; unsigned char type; struct _type_t *ref; - char *rname; - attr_t *attrs; - func_t *funcs; - var_t *fields; + const attr_t *attrs; + func_t *funcs; /* interfaces and modules */ + var_t *fields; /* interfaces, structures and enumerations */ + ifref_t *ifaces; /* coclasses */ int ignore, is_const, sign; - int defined, written; + int defined, written, user_types_registered; int typelib_idx; /* parser-internal */ - DECL_LINK(type_t) + DECL_LINK(type_t); }; struct _typeref_t { @@ -207,13 +226,12 @@ struct _var_t { expr_t *array; type_t *type; var_t *args; /* for function pointers */ - char *tname; + const char *tname; attr_t *attrs; expr_t *eval; - long lval; /* parser-internal */ - DECL_LINK(var_t) + DECL_LINK(var_t); }; struct _func_t { @@ -222,7 +240,7 @@ struct _func_t { int ignore, idx; /* parser-internal */ - DECL_LINK(func_t) + DECL_LINK(func_t); }; struct _ifref_t { @@ -230,29 +248,45 @@ struct _ifref_t { attr_t *attrs; /* parser-internal */ - DECL_LINK(ifref_t) -}; - -struct _class_t { - char *name; - attr_t *attrs; - ifref_t *ifaces; - - /* parser-internal */ - DECL_LINK(class_t) + DECL_LINK(ifref_t); }; struct _typelib_entry_t { enum type_kind kind; union { - class_t *class; + type_t *class; type_t *interface; type_t *module; type_t *structure; type_t *enumeration; var_t *tdef; } u; - DECL_LINK(typelib_entry_t) + DECL_LINK(typelib_entry_t); +}; + +struct _importinfo_t { + int offset; + GUID guid; + int flags; + int id; + + char *name; + + importlib_t *importlib; +}; + +struct _importlib_t { + char *name; + + int version; + GUID guid; + + importinfo_t *importinfos; + int ntypeinfos; + + int allocated; + + DECL_LINK(importlib_t); }; struct _typelib_t { @@ -260,6 +294,7 @@ struct _typelib_t { char *filename; attr_t *attrs; typelib_entry_t *entry; + importlib_t *importlibs; }; #endif diff --git a/reactos/tools/widl/winglue.h b/reactos/tools/widl/winglue.h deleted file mode 100644 index 7cf64273769..00000000000 --- a/reactos/tools/widl/winglue.h +++ /dev/null @@ -1,229 +0,0 @@ -#ifndef _WINGLUE_H -#define _WINGLUE_H - -#define LOWORD(l) ((unsigned short)(l)) -#define HIWORD(l) ((unsigned short)((unsigned long)(l) >> 16)) -#define MAKELONG(low,high) ((unsigned long)(((unsigned short)(low)) | (((unsigned long)((unsigned short)(high))) << 16))) - -typedef char CHAR; -typedef int INT; -typedef short SHORT; -typedef unsigned char BYTE; -typedef unsigned short WORD; -typedef unsigned int DWORD; -typedef unsigned int UINT; -typedef unsigned int ULONG; -typedef DWORD LCID; -typedef const unsigned char *LPCSTR; -typedef int HRESULT; -typedef GUID *REFGUID; - -#define S_OK ((HRESULT)0x00000000L) -#define S_FALSE ((HRESULT)0x00000001L) -#define E_OUTOFMEMORY ((HRESULT)0x8007000EL) -#define TYPE_E_IOERROR ((HRESULT)0x80028CA2L) - -#define LANG_NEUTRAL 0x00 -#define LANG_ARABIC 0x01 -#define LANG_BULGARIAN 0x02 -#define LANG_CATALAN 0x03 -#define LANG_CHINESE 0x04 -#define LANG_CZECH 0x05 -#define LANG_DANISH 0x06 -#define LANG_GERMAN 0x07 -#define LANG_GREEK 0x08 -#define LANG_ENGLISH 0x09 -#define LANG_SPANISH 0x0a -#define LANG_FINNISH 0x0b -#define LANG_FRENCH 0x0c -#define LANG_HEBREW 0x0d -#define LANG_HUNGARIAN 0x0e -#define LANG_ICELANDIC 0x0f -#define LANG_ITALIAN 0x10 -#define LANG_JAPANESE 0x11 -#define LANG_KOREAN 0x12 -#define LANG_DUTCH 0x13 -#define LANG_NORWEGIAN 0x14 -#define LANG_POLISH 0x15 -#define LANG_PORTUGUESE 0x16 -#define LANG_ROMANIAN 0x18 -#define LANG_RUSSIAN 0x19 -#define LANG_CROATIAN 0x1a -#define LANG_SERBIAN 0x1a -#define LANG_SLOVAK 0x1b -#define LANG_ALBANIAN 0x1c -#define LANG_SWEDISH 0x1d -#define LANG_THAI 0x1e -#define LANG_TURKISH 0x1f -#define LANG_URDU 0x20 -#define LANG_INDONESIAN 0x21 -#define LANG_UKRAINIAN 0x22 -#define LANG_BELARUSIAN 0x23 -#define LANG_SLOVENIAN 0x24 -#define LANG_ESTONIAN 0x25 -#define LANG_LATVIAN 0x26 -#define LANG_LITHUANIAN 0x27 -#define LANG_FARSI 0x29 -#define LANG_VIETNAMESE 0x2a -#define LANG_ARMENIAN 0x2b -#define LANG_AZERI 0x2c -#define LANG_BASQUE 0x2d -#define LANG_MACEDONIAN 0x2f -#define LANG_AFRIKAANS 0x36 -#define LANG_GEORGIAN 0x37 -#define LANG_FAEROESE 0x38 -#define LANG_HINDI 0x39 -#define LANG_MALAY 0x3e -#define LANG_KAZAK 0x3f -#define LANG_KYRGYZ 0x40 -#define LANG_SWAHILI 0x41 -#define LANG_UZBEK 0x43 -#define LANG_TATAR 0x44 -#define LANG_BENGALI 0x45 -#define LANG_PUNJABI 0x46 -#define LANG_GUJARATI 0x47 -#define LANG_ORIYA 0x48 -#define LANG_TAMIL 0x49 -#define LANG_TELUGU 0x4a -#define LANG_KANNADA 0x4b -#define LANG_MALAYALAM 0x4c -#define LANG_ASSAMESE 0x4d -#define LANG_MARATHI 0x4e -#define LANG_SANSKRIT 0x4f -#define LANG_MONGOLIAN 0x50 -#define LANG_GALICIAN 0x56 -#define LANG_KONKANI 0x57 -#define LANG_MANIPURI 0x58 -#define LANG_SINDHI 0x59 -#define LANG_SYRIAC 0x5a -#define LANG_KASHMIRI 0x60 -#define LANG_NEPALI 0x61 -#define LANG_DIVEHI 0x65 -#define LANG_INVARIANT 0x7f -#define SUBLANG_NEUTRAL 0x00 -#define SUBLANG_DEFAULT 0x01 -#define SUBLANG_SYS_DEFAULT 0x02 -#define SUBLANG_ARABIC_SAUDI_ARABIA 0x01 -#define SUBLANG_ARABIC_IRAQ 0x02 -#define SUBLANG_ARABIC_EGYPT 0x03 -#define SUBLANG_ARABIC_LIBYA 0x04 -#define SUBLANG_ARABIC_ALGERIA 0x05 -#define SUBLANG_ARABIC_MOROCCO 0x06 -#define SUBLANG_ARABIC_TUNISIA 0x07 -#define SUBLANG_ARABIC_OMAN 0x08 -#define SUBLANG_ARABIC_YEMEN 0x09 -#define SUBLANG_ARABIC_SYRIA 0x0a -#define SUBLANG_ARABIC_JORDAN 0x0b -#define SUBLANG_ARABIC_LEBANON 0x0c -#define SUBLANG_ARABIC_KUWAIT 0x0d -#define SUBLANG_ARABIC_UAE 0x0e -#define SUBLANG_ARABIC_BAHRAIN 0x0f -#define SUBLANG_ARABIC_QATAR 0x10 -#define SUBLANG_AZERI_LATIN 0x01 -#define SUBLANG_AZERI_CYRILLIC 0x02 -#define SUBLANG_CHINESE_TRADITIONAL 0x01 -#define SUBLANG_CHINESE_SIMPLIFIED 0x02 -#define SUBLANG_CHINESE_HONGKONG 0x03 -#define SUBLANG_CHINESE_SINGAPORE 0x04 -#define SUBLANG_CHINESE_MACAU 0x05 -#define SUBLANG_DUTCH 0x01 -#define SUBLANG_DUTCH_BELGIAN 0x02 -#define SUBLANG_ENGLISH_US 0x01 -#define SUBLANG_ENGLISH_UK 0x02 -#define SUBLANG_ENGLISH_AUS 0x03 -#define SUBLANG_ENGLISH_CAN 0x04 -#define SUBLANG_ENGLISH_NZ 0x05 -#define SUBLANG_ENGLISH_EIRE 0x06 -#define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07 -#define SUBLANG_ENGLISH_JAMAICA 0x08 -#define SUBLANG_ENGLISH_CARIBBEAN 0x09 -#define SUBLANG_ENGLISH_BELIZE 0x0a -#define SUBLANG_ENGLISH_TRINIDAD 0x0b -#define SUBLANG_ENGLISH_ZIMBABWE 0x0c -#define SUBLANG_ENGLISH_PHILIPPINES 0x0d -#define SUBLANG_FRENCH 0x01 -#define SUBLANG_FRENCH_BELGIAN 0x02 -#define SUBLANG_FRENCH_CANADIAN 0x03 -#define SUBLANG_FRENCH_SWISS 0x04 -#define SUBLANG_FRENCH_LUXEMBOURG 0x05 -#define SUBLANG_FRENCH_MONACO 0x06 -#define SUBLANG_GERMAN 0x01 -#define SUBLANG_GERMAN_SWISS 0x02 -#define SUBLANG_GERMAN_AUSTRIAN 0x03 -#define SUBLANG_GERMAN_LUXEMBOURG 0x04 -#define SUBLANG_GERMAN_LIECHTENSTEIN 0x05 -#define SUBLANG_ITALIAN 0x01 -#define SUBLANG_ITALIAN_SWISS 0x02 -#define SUBLANG_KASHMIRI_INDIA 0x02 -#define SUBLANG_KASHMIRI_SASIA 0x02 -#define SUBLANG_KOREAN 0x01 -#define SUBLANG_LITHUANIAN 0x01 -#define SUBLANG_MALAY_MALAYSIA 0x01 -#define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 -#define SUBLANG_NEPALI_INDIA 0x02 -#define SUBLANG_NORWEGIAN_BOKMAL 0x01 -#define SUBLANG_NORWEGIAN_NYNORSK 0x02 -#define SUBLANG_PORTUGUESE 0x01 -#define SUBLANG_PORTUGUESE_BRAZILIAN 0x02 -#define SUBLANG_SERBIAN_LATIN 0x02 -#define SUBLANG_SERBIAN_CYRILLIC 0x03 -#define SUBLANG_SPANISH 0x01 -#define SUBLANG_SPANISH_MEXICAN 0x02 -#define SUBLANG_SPANISH_MODERN 0x03 -#define SUBLANG_SPANISH_GUATEMALA 0x04 -#define SUBLANG_SPANISH_COSTA_RICA 0x05 -#define SUBLANG_SPANISH_PANAMA 0x06 -#define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07 -#define SUBLANG_SPANISH_VENEZUELA 0x08 -#define SUBLANG_SPANISH_COLOMBIA 0x09 -#define SUBLANG_SPANISH_PERU 0x0a -#define SUBLANG_SPANISH_ARGENTINA 0x0b -#define SUBLANG_SPANISH_ECUADOR 0x0c -#define SUBLANG_SPANISH_CHILE 0x0d -#define SUBLANG_SPANISH_URUGUAY 0x0e -#define SUBLANG_SPANISH_PARAGUAY 0x0f -#define SUBLANG_SPANISH_BOLIVIA 0x10 -#define SUBLANG_SPANISH_EL_SALVADOR 0x11 -#define SUBLANG_SPANISH_HONDURAS 0x12 -#define SUBLANG_SPANISH_NICARAGUA 0x13 -#define SUBLANG_SPANISH_PUERTO_RICO 0x14 -#define SUBLANG_SWEDISH 0x01 -#define SUBLANG_SWEDISH_FINLAND 0x02 -#define SUBLANG_URDU_PAKISTAN 0x01 -#define SUBLANG_URDU_INDIA 0x02 -#define SUBLANG_UZBEK_LATIN 0x01 -#define SUBLANG_UZBEK_CYRILLIC 0x02 - -/* non standard; keep the number high enough (but < 0xff) */ -#define LANG_ESPERANTO 0x8f -#define LANG_WALON 0x90 -#define LANG_CORNISH 0x91 -#define LANG_WELSH 0x92 -#define LANG_BRETON 0x93 - -/* FIXME: these are not in the Windows header */ -#define LANG_GAELIC 0x3c -#define LANG_MALTESE 0x3a -#define LANG_MAORI 0x28 -#define LANG_RHAETO_ROMANCE 0x17 -#define LANG_SAAMI 0x3b -#define LANG_SORBIAN 0x2e -#define LANG_SUTU 0x30 -#define LANG_TSONGA 0x31 -#define LANG_TSWANA 0x32 -#define LANG_VENDA 0x33 -#define LANG_XHOSA 0x34 -#define LANG_ZULU 0x35 - -#define PRIMARYLANGID(l) ((WORD)(l)&0x3ff) -#define LANGIDFROMLCID(l) ((WORD)(l)) -#define SUBLANGID(l) ((WORD)(l)>>10) - -#ifndef max -#define max(a,b) ((a)>(b)?(a):(b)) -#endif -#ifndef min -#define min(a,b) ((a)<(b)?(a):(b)) -#endif - -#endif /* _WINGLUE_H */ diff --git a/reactos/tools/widl/write_msft.c b/reactos/tools/widl/write_msft.c index 6a263dc8eb1..8148a93dd70 100644 --- a/reactos/tools/widl/write_msft.c +++ b/reactos/tools/widl/write_msft.c @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * -------------------------------------------------------------------------------------- * Known problems: @@ -27,22 +27,24 @@ * */ +#include "config.h" +#include "wine/port.h" + #include #include #include #include #include #include -#ifdef WIN32 -#include /* write() */ -#else -#include /* create */ -#include /* write and close */ -#endif /* WIN32 */ #define NONAMELESSUNION #define NONAMELESSSTRUCT +#include "winerror.h" +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "widltypes.h" #include "typelib.h" #include "typelib_struct.h" @@ -72,7 +74,7 @@ typedef struct tagMSFT_ImpFile { int guid; LCID lcid; int version; - char filename[0]; /* preceeded by two bytes of encoded (length << 2) + flags in the low two bits. */ + char filename[0]; /* preceded by two bytes of encoded (length << 2) + flags in the low two bits. */ } MSFT_ImpFile; typedef struct _msft_typelib_t @@ -83,12 +85,12 @@ typedef struct _msft_typelib_t char *typelib_segment_data[MSFT_SEG_MAX]; int typelib_segment_block_length[MSFT_SEG_MAX]; - int typelib_typeinfo_offsets[0x200]; /* Hope that's enough. */ + INT typelib_typeinfo_offsets[0x200]; /* Hope that's enough. */ - int *typelib_namehash_segment; - int *typelib_guidhash_segment; + INT *typelib_namehash_segment; + INT *typelib_guidhash_segment; - int help_string_dll_offset; + INT help_string_dll_offset; struct _msft_typeinfo_t *typeinfos; struct _msft_typeinfo_t *last_typeinfo; @@ -99,10 +101,12 @@ typedef struct _msft_typeinfo_t msft_typelib_t *typelib; MSFT_TypeInfoBase *typeinfo; - int var_data_allocated; + int typekind; + + unsigned int var_data_allocated; int *var_data; - int func_data_allocated; + unsigned int func_data_allocated; int *func_data; int vars_allocated; @@ -152,7 +156,7 @@ static void ctl2_init_header( typelib->typelib_header.res44 = 0x20; typelib->typelib_header.res48 = 0x80; typelib->typelib_header.dispatchpos = -1; - typelib->typelib_header.res50 = 0; + typelib->typelib_header.nimpinfos = 0; } /**************************************************************************** @@ -297,7 +301,7 @@ static int ctl2_encode_name( converted_name[1] = 0x00; - value = lhash_val_of_name_sys(typelib->typelib_header.varflags & 0x0f, typelib->typelib_header.lcid, (LPCSTR)converted_name + 4); + value = lhash_val_of_name_sys(typelib->typelib_header.varflags & 0x0f, typelib->typelib_header.lcid, converted_name + 4); converted_name[2] = value; converted_name[3] = value >> 8; @@ -338,7 +342,7 @@ static int ctl2_encode_string( converted_string[0] = length & 0xff; converted_string[1] = (length >> 8) & 0xff; - if(length < 3) { /* strings of this length are padded with upto 8 bytes incl the 2 byte length */ + if(length < 3) { /* strings of this length are padded with up to 8 bytes incl the 2 byte length */ for(offset = 0; offset < 4; offset++) converted_string[length + offset + 2] = 0x57; length += 4; @@ -579,7 +583,7 @@ static int ctl2_alloc_string( } /**************************************************************************** - * alloc_importinfo + * alloc_msft_importinfo * * Allocates and initializes an import information structure in a type library. * @@ -588,7 +592,7 @@ static int ctl2_alloc_string( * Success: The offset of the new importinfo. * Failure: -1 (this is invariably an out of memory condition). */ -static int alloc_importinfo( +static int alloc_msft_importinfo( msft_typelib_t *typelib, /* [I] The type library to allocate in. */ MSFT_ImpInfo *impinfo) /* [I] The import information to store. */ { @@ -604,6 +608,8 @@ static int alloc_importinfo( } } + impinfo->flags |= typelib->typelib_header.nimpinfos++; + offset = ctl2_alloc_segment(typelib, MSFT_SEG_IMPORTINFO, sizeof(MSFT_ImpInfo), 0); if (offset == -1) return -1; @@ -658,8 +664,84 @@ static int alloc_importfile( return offset; } +static void alloc_importinfo(msft_typelib_t *typelib, importinfo_t *importinfo) +{ + importlib_t *importlib = importinfo->importlib; + + chat("alloc_importinfo: %s\n", importinfo->name); + + if(!importlib->allocated) { + MSFT_GuidEntry guid; + int guid_idx; + + chat("allocating importlib %s\n", importlib->name); + + importlib->allocated = -1; + + memcpy(&guid.guid, &importlib->guid, sizeof(GUID)); + guid.hreftype = 2; + + guid_idx = ctl2_alloc_guid(typelib, &guid); + + alloc_importfile(typelib, guid_idx, importlib->version&0xffff, + importlib->version>>16, importlib->name); + } + + if(importinfo->offset == -1 || !(importinfo->flags & MSFT_IMPINFO_OFFSET_IS_GUID)) { + MSFT_ImpInfo impinfo; + + impinfo.flags = importinfo->flags; + impinfo.oImpFile = 0; + + if(importinfo->flags & MSFT_IMPINFO_OFFSET_IS_GUID) { + MSFT_GuidEntry guid; + + guid.hreftype = 0; + memcpy(&guid.guid, &importinfo->guid, sizeof(GUID)); + + impinfo.oGuid = ctl2_alloc_guid(typelib, &guid); + + importinfo->offset = alloc_msft_importinfo(typelib, &impinfo); + + typelib->typelib_segment_data[MSFT_SEG_GUID][impinfo.oGuid+sizeof(GUID)] + = importinfo->offset+1; + + if(!strcmp(importinfo->name, "IDispatch")) + typelib->typelib_header.dispatchpos = importinfo->offset+1; + }else { + impinfo.oGuid = importinfo->id; + importinfo->offset = alloc_msft_importinfo(typelib, &impinfo); + } + } +} + +static importinfo_t *find_importinfo(msft_typelib_t *typelib, const char *name) +{ + importlib_t *importlib; + int i; + + chat("search importlib %s\n", name); + + if(!name) + return NULL; + + for(importlib = typelib->typelib->importlibs; importlib; importlib = NEXT_LINK(importlib)) { + for(i=0; i < importlib->ntypeinfos; i++) { + if(!strcmp(name, importlib->importinfos[i].name)) { + chat("Found %s in importlib.\n", name); + return importlib->importinfos+i; + } + } + } + + return NULL; +} + static void add_structure_typeinfo(msft_typelib_t *typelib, type_t *structure); static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface); +static void add_enum_typeinfo(msft_typelib_t *typelib, type_t *enumeration); +static void add_coclass_typeinfo(msft_typelib_t *typelib, type_t *cls); + /**************************************************************************** * encode_type @@ -746,6 +828,8 @@ static int encode_type( break; case VT_R8: + case VT_I8: + case VT_UI8: *encoded_type = default_type; *width = 8; *alignment = 8; @@ -777,16 +861,17 @@ static int encode_type( case VT_PTR: { int next_vt; - while((next_vt = get_type_vt(type->ref)) == 0) { - if(type->ref == NULL) { - next_vt = VT_VOID; + for(next_vt = 0; type->ref; type = type->ref) { + next_vt = get_type_vt(type->ref); + if (next_vt != 0) break; - } - type = type->ref; } + /* if no type found then it must be void */ + if (next_vt == 0) + next_vt = VT_VOID; encode_type(typelib, next_vt, type->ref, &target_type, NULL, NULL, &child_size); - if(type->ref->type == RPC_FC_IP) { + if(type->ref && (type->ref->type == RPC_FC_IP)) { chat("encode_type: skipping ptr\n"); *encoded_type = target_type; *width = 4; @@ -885,8 +970,15 @@ static int encode_type( case RPC_FC_IP: add_interface_typeinfo(typelib, type); break; + case RPC_FC_ENUM16: + add_enum_typeinfo(typelib, type); + break; case 0: - error("encode_type: VT_USERDEFINED - can't yet add typedef's on the fly\n"); + if (type->kind == TKIND_COCLASS) + add_coclass_typeinfo(typelib, type); + else + error("encode_type: VT_USERDEFINED - can't yet add typedef's on the fly\n"); + break; default: error("encode_type: VT_USERDEFINED - unhandled type %d\n", type->type); } @@ -943,7 +1035,7 @@ static int encode_type( static void dump_type(type_t *t) { - chat("dump_type: %p name %s type %d ref %p rname %s attrs %p\n", t, t->name, t->type, t->ref, t->rname, t->attrs); + chat("dump_type: %p name %s type %d ref %p attrs %p\n", t, t->name, t->type, t->ref, t->attrs); if(t->ref) dump_type(t->ref); } @@ -1165,7 +1257,7 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func, int index) int num_params = 0, num_defaults = 0; var_t *arg, *last_arg = NULL; char *namedata; - attr_t *attr; + const attr_t *attr; unsigned int funcflags = 0, callconv = 4 /* CC_STDCALL */; unsigned int funckind, invokekind = 1 /* INVOKE_FUNC */; int help_context = 0, help_string_context = 0, help_string_offset = -1; @@ -1175,7 +1267,7 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func, int index) id = ((0x6000 | (typeinfo->typeinfo->datatype2 & 0xffff)) << 16) | index; - switch(typeinfo->typeinfo->typekind & 15) { + switch(typeinfo->typekind) { case TKIND_DISPATCH: funckind = 0x4; /* FUNC_DISPATCH */ break; @@ -1237,7 +1329,7 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func, int index) funcflags |= 0x40; /* FUNCFLAG_FHIDDEN */ break; case ATTR_ID: - id = expr->u.lval; + id = expr->cval; break; case ATTR_OUT: break; @@ -1253,6 +1345,9 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func, int index) case ATTR_RESTRICTED: funcflags |= 0x1; /* FUNCFLAG_FRESTRICTED */ break; + case ATTR_BINDABLE: + funcflags |= 0x4; /* FUNCFLAG_BINDABLE */ + break; default: warning("add_func_desc: ignoring attr %d\n", attr->type); break; @@ -1261,8 +1356,8 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func, int index) switch(invokekind) { case 0x2: /* INVOKE_PROPERTYGET */ - if((num_params != 0 && (typeinfo->typeinfo->typekind & 15) == TKIND_DISPATCH) - || (num_params != 1 && (typeinfo->typeinfo->typekind & 15) == TKIND_INTERFACE)) { + if((num_params != 0 && typeinfo->typekind == TKIND_DISPATCH) + || (num_params != 1 && typeinfo->typekind == TKIND_INTERFACE)) { error("expecting no args on a propget func\n"); return S_FALSE; } @@ -1346,7 +1441,7 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func, int index) } for (arg = last_arg, i = 0; arg; arg = PREV_LINK(arg), i++) { - attr_t *attr; + const attr_t *attr; int paramflags = 0; int *paramdata = typedata + 6 + extra_attr + (num_defaults ? num_params : 0) + i * 3; int *defaultdata = num_defaults ? typedata + 6 + extra_attr + i : NULL; @@ -1358,18 +1453,28 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func, int index) switch(attr->type) { case ATTR_DEFAULTVALUE_EXPR: { + int vt; expr_t *expr = (expr_t *)attr->u.pval; + if (arg->type->type == RPC_FC_ENUM16) + vt = VT_INT; + else + vt = get_var_vt(arg); paramflags |= 0x30; /* PARAMFLAG_FHASDEFAULT | PARAMFLAG_FOPT */ chat("default value %ld\n", expr->cval); - write_value(typeinfo->typelib, defaultdata, (*paramdata >> 16) & 0x1ff, &expr->cval); + write_value(typeinfo->typelib, defaultdata, vt, &expr->cval); break; } case ATTR_DEFAULTVALUE_STRING: { char *s = (char *)attr->u.pval; + int vt; + if (arg->type->type == RPC_FC_ENUM16) + vt = VT_INT; + else + vt = get_var_vt(arg); paramflags |= 0x30; /* PARAMFLAG_FHASDEFAULT | PARAMFLAG_FOPT */ chat("default value '%s'\n", s); - write_value(typeinfo->typelib, defaultdata, (*paramdata >> 16) & 0x1ff, s); + write_value(typeinfo->typelib, defaultdata, vt, s); break; } case ATTR_IN: @@ -1433,12 +1538,12 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func, int index) namedata = typeinfo->typelib->typelib_segment_data[MSFT_SEG_NAME] + name_offset; if (*((INT *)namedata) == -1) { *((INT *)namedata) = typeinfo->typelib->typelib_typeinfo_offsets[typeinfo->typeinfo->typekind >> 16]; - if((typeinfo->typeinfo->typekind & 15) == TKIND_MODULE) + if(typeinfo->typekind == TKIND_MODULE) namedata[9] |= 0x10; } else namedata[9] &= ~0x10; - if((typeinfo->typeinfo->typekind & 15) == TKIND_MODULE) + if(typeinfo->typekind == TKIND_MODULE) namedata[9] |= 0x20; if(invokekind != 0x4 /* INVOKE_PROPERTYPUT */ && invokekind != 0x8 /* INVOKE_PROPERTYPUTREF */) { @@ -1454,14 +1559,15 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func, int index) static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var) { - int offset, typedata_size, id; + int offset, id; + unsigned int typedata_size; INT *typedata; int var_datawidth; int var_alignment; int var_type_size, var_kind = 0 /* VAR_PERINSTANCE */; int alignment; int varflags = 0; - attr_t *attr; + const attr_t *attr; char *namedata; int var_num = (typeinfo->typeinfo->cElement >> 16) & 0xffff; @@ -1476,7 +1582,7 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var) varflags |= 0x40; /* VARFLAG_FHIDDEN */ break; case ATTR_ID: - id = expr->u.lval; + id = expr->cval; break; case ATTR_READONLY: varflags |= 0x01; /* VARFLAG_FREADONLY */ @@ -1542,9 +1648,9 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var) typeinfo->datawidth += var_alignment - 1; typeinfo->datawidth &= ~(var_alignment - 1); - switch(typeinfo->typeinfo->typekind & 0xf) { + switch(typeinfo->typekind) { case TKIND_ENUM: - write_value(typeinfo->typelib, &typedata[4], VT_I4, &var->lval); + write_value(typeinfo->typelib, &typedata[4], VT_I4, &var->eval->cval); var_kind = 2; /* VAR_CONST */ var_type_size += 16; /* sizeof(VARIANT) */ typeinfo->datawidth = var_datawidth; @@ -1559,7 +1665,7 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var) var_alignment = 4; break; default: - error("add_var_desc: unhandled type kind %d\n", typeinfo->typeinfo->typekind & 0xf); + error("add_var_desc: unhandled type kind %d\n", typeinfo->typekind); break; } @@ -1596,12 +1702,12 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var) namedata = typeinfo->typelib->typelib_segment_data[MSFT_SEG_NAME] + offset; if (*((INT *)namedata) == -1) { *((INT *)namedata) = typeinfo->typelib->typelib_typeinfo_offsets[typeinfo->typeinfo->typekind >> 16]; - if((typeinfo->typeinfo->typekind & 15) != TKIND_DISPATCH) + if(typeinfo->typekind != TKIND_DISPATCH) namedata[9] |= 0x10; } else namedata[9] &= ~0x10; - if ((typeinfo->typeinfo->typekind & 15) == TKIND_ENUM) { + if (typeinfo->typekind == TKIND_ENUM) { namedata[9] |= 0x20; } typeinfo->var_names[var_num] = offset; @@ -1609,20 +1715,26 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var) return S_OK; } -static HRESULT add_impl_type(msft_typeinfo_t *typeinfo, type_t *ref) +static HRESULT add_impl_type(msft_typeinfo_t *typeinfo, type_t *ref, importinfo_t *importinfo) { - if(ref->typelib_idx == -1) - add_interface_typeinfo(typeinfo->typelib, ref); - if(ref->typelib_idx == -1) - error("add_impl_type: unable to add inherited interface\n"); + if(importinfo) { + alloc_importinfo(typeinfo->typelib, importinfo); + typeinfo->typeinfo->datatype1 = importinfo->offset+1; + }else { + if(ref->typelib_idx == -1) + add_interface_typeinfo(typeinfo->typelib, ref); + if(ref->typelib_idx == -1) + error("add_impl_type: unable to add inherited interface\n"); + + typeinfo->typeinfo->datatype1 = typeinfo->typelib->typelib_typeinfo_offsets[ref->typelib_idx]; + } - typeinfo->typeinfo->datatype1 = typeinfo->typelib->typelib_typeinfo_offsets[ref->typelib_idx]; typeinfo->typeinfo->cImplTypes++; return S_OK; } static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, enum type_kind kind, - char *name, attr_t *attr, int idx) + const char *name, const attr_t *attr, int idx) { msft_typeinfo_t *msft_typeinfo; int nameoffset; @@ -1643,6 +1755,7 @@ static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, enum type_ typelib->typelib_segment_data[MSFT_SEG_NAME][nameoffset + 9] = 0x38; *((int *)&typelib->typelib_segment_data[MSFT_SEG_NAME][nameoffset]) = typeinfo_offset; + msft_typeinfo->typekind = kind; msft_typeinfo->typeinfo = typeinfo; typeinfo->typekind |= kind | 0x20; @@ -1652,6 +1765,21 @@ static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, enum type_ for( ; attr; attr = NEXT_LINK(attr)) { switch(attr->type) { + case ATTR_AGGREGATABLE: + if (kind == TKIND_COCLASS) + typeinfo->flags |= 0x400; /* TYPEFLAG_FAGGREGATABLE */ + break; + + case ATTR_APPOBJECT: + if (kind == TKIND_COCLASS) + typeinfo->flags |= 0x1; /* TYPEFLAG_FAPPOBJECT */ + break; + + case ATTR_CONTROL: + if (kind == TKIND_COCLASS) + typeinfo->flags |= 0x20; /* TYPEFLAG_FCONTROL */ + break; + case ATTR_DISPINTERFACE: break; @@ -1661,6 +1789,13 @@ static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, enum type_ typeinfo->datatype1 = offset; break; } + + case ATTR_DUAL: + /* FIXME: check interface is compatible */ + typeinfo->typekind = (typeinfo->typekind & ~0xff) | 0x34; + typeinfo->flags |= 0x140; /* TYPEFLAG_FDUAL | TYPEFLAG_FOLEAUTOMATION */ + break; + case ATTR_HELPCONTEXT: { expr_t *expr = (expr_t*)attr->u.pval; @@ -1688,9 +1823,20 @@ static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, enum type_ typeinfo->flags &= ~0x2; /* TYPEFLAG_FCANCREATE */ break; + case ATTR_NONEXTENSIBLE: + typeinfo->flags |= 0x80; /* TYPEFLAG_FNONEXTENSIBLE */ + break; + + case ATTR_OBJECT: + break; + case ATTR_ODL: break; + case ATTR_OLEAUTOMATION: + typeinfo->flags |= 0x100; /* TYPEFLAG_FOLEAUTOMATION */ + break; + case ATTR_PUBLIC: break; @@ -1747,13 +1893,10 @@ static void add_dispatch(msft_typelib_t *typelib) guidentry.guid = iid_idispatch; guidentry.hreftype = 1; guidentry.next_hash = -1; - impinfo.res0 = 0x301 << 16; + impinfo.flags = TKIND_INTERFACE << 24 | MSFT_IMPINFO_OFFSET_IS_GUID; impinfo.oImpFile = impfile_offset; impinfo.oGuid = ctl2_alloc_guid(typelib, &guidentry); - typelib->typelib_header.dispatchpos = alloc_importinfo(typelib, &impinfo) | 0x01; - - typelib->typelib_header.res50 = 1; - + typelib->typelib_header.dispatchpos = alloc_msft_importinfo(typelib, &impinfo) | 0x01; } static void add_dispinterface_typeinfo(msft_typelib_t *typelib, type_t *dispinterface) @@ -1763,6 +1906,9 @@ static void add_dispinterface_typeinfo(msft_typelib_t *typelib, type_t *dispinte var_t *var; msft_typeinfo_t *msft_typeinfo; + if (-1 < dispinterface->typelib_idx) + return; + dispinterface->typelib_idx = typelib->typelib_header.nrtypeinfos; msft_typeinfo = create_msft_typeinfo(typelib, TKIND_DISPATCH, dispinterface->name, dispinterface->attrs, typelib->typelib_header.nrtypeinfos); @@ -1807,8 +1953,13 @@ static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface) func_t *func; type_t *ref; msft_typeinfo_t *msft_typeinfo; + importinfo_t *ref_importinfo = NULL; int num_parents = 0, num_funcs = 0; - attr_t *attr; + const attr_t *attr; + const type_t *derived; + + if (-1 < interface->typelib_idx) + return; for(attr = interface->attrs; attr; attr = NEXT_LINK(attr)) if(attr->type == ATTR_DISPINTERFACE) @@ -1817,8 +1968,12 @@ static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface) /* midl adds the parent interface first, unless the parent itself has no parent (i.e. it stops before IUnknown). */ - if(interface->ref && interface->ref->ref && interface->ref->typelib_idx == -1) - add_interface_typeinfo(typelib, interface->ref); + if(interface->ref) { + ref_importinfo = find_importinfo(typelib, interface->ref->name); + + if(!ref_importinfo && interface->ref->ref && interface->ref->typelib_idx == -1) + add_interface_typeinfo(typelib, interface->ref); + } interface->typelib_idx = typelib->typelib_header.nrtypeinfos; msft_typeinfo = create_msft_typeinfo(typelib, TKIND_INTERFACE, interface->name, interface->attrs, @@ -1826,14 +1981,22 @@ static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface) msft_typeinfo->typeinfo->size = 4; msft_typeinfo->typeinfo->typekind |= 0x2200; + for (derived = interface->ref; derived; derived = derived->ref) + if (derived->name && !strcmp(derived->name, "IDispatch")) + msft_typeinfo->typeinfo->flags |= 0x1000; /* TYPEFLAG_FDISPATCHABLE */ + + /* can't be dual if it doesn't derive from IDispatch */ + if (!(msft_typeinfo->typeinfo->flags & 0x1000)) /* TYPEFLAG_FDISPATCHABLE */ + msft_typeinfo->typeinfo->flags &= ~0x40; /* TYPEFLAG_FDUAL */ + if(interface->ref) - add_impl_type(msft_typeinfo, interface->ref); + add_impl_type(msft_typeinfo, interface->ref, ref_importinfo); /* count the number of inherited interfaces and non-local functions */ for(ref = interface->ref; ref; ref = ref->ref) { num_parents++; for(func = ref->funcs; func; func = NEXT_LINK(func)) { - attr_t *attr; + const attr_t *attr; for(attr = func->def->attrs; attr; attr = NEXT_LINK(attr)) if(attr->type == ATTR_LOCAL) break; @@ -1860,6 +2023,9 @@ static void add_structure_typeinfo(msft_typelib_t *typelib, type_t *structure) var_t *cur = structure->fields; msft_typeinfo_t *msft_typeinfo; + if (-1 < structure->typelib_idx) + return; + structure->typelib_idx = typelib->typelib_header.nrtypeinfos; msft_typeinfo = create_msft_typeinfo(typelib, TKIND_RECORD, structure->name, structure->attrs, typelib->typelib_header.nrtypeinfos); @@ -1896,7 +2062,10 @@ static void add_typedef_typeinfo(msft_typelib_t *typelib, var_t *tdef) { msft_typeinfo_t *msft_typeinfo; int alignment; - attr_t *attrs; + const attr_t *attrs; + + if (-1 < tdef->type->typelib_idx) + return; tdef->type->typelib_idx = typelib->typelib_header.nrtypeinfos; msft_typeinfo = create_msft_typeinfo(typelib, TKIND_ALIAS, tdef->name, tdef->type->attrs, @@ -1909,15 +2078,19 @@ static void add_typedef_typeinfo(msft_typelib_t *typelib, var_t *tdef) msft_typeinfo->typeinfo->typekind |= (alignment << 11 | alignment << 6); } -static void add_coclass_typeinfo(msft_typelib_t *typelib, class_t *cls) +static void add_coclass_typeinfo(msft_typelib_t *typelib, type_t *cls) { msft_typeinfo_t *msft_typeinfo; ifref_t *iref; int num_ifaces = 0, offset, i; MSFT_RefRecord *ref, *first = NULL, *first_source = NULL; int have_default = 0, have_default_source = 0; - attr_t *attr; + const attr_t *attr; + if (-1 < cls->typelib_idx) + return; + + cls->typelib_idx = typelib->typelib_header.nrtypeinfos; msft_typeinfo = create_msft_typeinfo(typelib, TKIND_COCLASS, cls->name, cls->attrs, typelib->typelib_header.nrtypeinfos); @@ -1995,6 +2168,9 @@ static void add_module_typeinfo(msft_typelib_t *typelib, type_t *module) func_t *func; msft_typeinfo_t *msft_typeinfo; + if (-1 < module->typelib_idx) + return; + module->typelib_idx = typelib->typelib_header.nrtypeinfos; msft_typeinfo = create_msft_typeinfo(typelib, TKIND_MODULE, module->name, module->attrs, typelib->typelib_header.nrtypeinfos); @@ -2057,7 +2233,7 @@ static void set_name(msft_typelib_t *typelib) static void set_version(msft_typelib_t *typelib) { long version = MAKELONG(0,0); - attr_t *attr; + const attr_t *attr; for(attr = typelib->typelib->attrs; attr; attr = NEXT_LINK(attr)) { if(attr->type == ATTR_VERSION) { @@ -2072,7 +2248,7 @@ static void set_guid(msft_typelib_t *typelib) { MSFT_GuidEntry guidentry; int offset; - attr_t *attr; + const attr_t *attr; GUID guid = {0,0,0,{0,0,0,0,0,0}}; guidentry.guid = guid; @@ -2096,7 +2272,7 @@ static void set_guid(msft_typelib_t *typelib) static void set_doc_string(msft_typelib_t *typelib) { - attr_t *attr; + const attr_t *attr; int offset; for(attr = typelib->typelib->attrs; attr; attr = NEXT_LINK(attr)) { @@ -2112,7 +2288,7 @@ static void set_doc_string(msft_typelib_t *typelib) static void set_help_file_name(msft_typelib_t *typelib) { int offset; - attr_t *attr; + const attr_t *attr; for(attr = typelib->typelib->attrs; attr; attr = NEXT_LINK(attr)) { if(attr->type == ATTR_HELPFILE) { offset = ctl2_alloc_string(typelib, attr->u.pval); @@ -2126,10 +2302,10 @@ static void set_help_file_name(msft_typelib_t *typelib) static void set_help_context(msft_typelib_t *typelib) { - attr_t *attr; + const attr_t *attr; for(attr = typelib->typelib->attrs; attr; attr = NEXT_LINK(attr)) { if(attr->type == ATTR_HELPCONTEXT) { - expr_t *expr = (expr_t *)attr->u.pval; + const expr_t *expr = (expr_t *)attr->u.pval; typelib->typelib_header.helpcontext = expr->cval; } } @@ -2139,7 +2315,7 @@ static void set_help_context(msft_typelib_t *typelib) static void set_help_string_dll(msft_typelib_t *typelib) { int offset; - attr_t *attr; + const attr_t *attr; for(attr = typelib->typelib->attrs; attr; attr = NEXT_LINK(attr)) { if(attr->type == ATTR_HELPSTRINGDLL) { offset = ctl2_alloc_string(typelib, attr->u.pval); @@ -2153,10 +2329,10 @@ static void set_help_string_dll(msft_typelib_t *typelib) static void set_help_string_context(msft_typelib_t *typelib) { - attr_t *attr; + const attr_t *attr; for(attr = typelib->typelib->attrs; attr; attr = NEXT_LINK(attr)) { if(attr->type == ATTR_HELPSTRINGCONTEXT) { - expr_t *expr = (expr_t *)attr->u.pval; + const expr_t *expr = (expr_t *)attr->u.pval; typelib->typelib_header.helpstringcontext = expr->cval; } } @@ -2171,7 +2347,7 @@ static void set_lcid(msft_typelib_t *typelib) static void set_lib_flags(msft_typelib_t *typelib) { - attr_t *attr; + const attr_t *attr; typelib->typelib_header.flags = 0; for(attr = typelib->typelib->attrs; attr; attr = NEXT_LINK(attr)) { @@ -2299,9 +2475,9 @@ static int save_all_changes(msft_typelib_t *typelib) filepos += ctl2_finalize_segment(typelib, filepos, MSFT_SEG_TYPEINFO); filepos += ctl2_finalize_segment(typelib, filepos, MSFT_SEG_GUIDHASH); filepos += ctl2_finalize_segment(typelib, filepos, MSFT_SEG_GUID); + filepos += ctl2_finalize_segment(typelib, filepos, MSFT_SEG_REFERENCES); filepos += ctl2_finalize_segment(typelib, filepos, MSFT_SEG_IMPORTINFO); filepos += ctl2_finalize_segment(typelib, filepos, MSFT_SEG_IMPORTFILES); - filepos += ctl2_finalize_segment(typelib, filepos, MSFT_SEG_REFERENCES); filepos += ctl2_finalize_segment(typelib, filepos, MSFT_SEG_NAMEHASH); filepos += ctl2_finalize_segment(typelib, filepos, MSFT_SEG_NAME); filepos += ctl2_finalize_segment(typelib, filepos, MSFT_SEG_STRING); @@ -2322,9 +2498,9 @@ static int save_all_changes(msft_typelib_t *typelib) if (!ctl2_write_segment(typelib, fd, MSFT_SEG_TYPEINFO )) return retval; if (!ctl2_write_segment(typelib, fd, MSFT_SEG_GUIDHASH )) return retval; if (!ctl2_write_segment(typelib, fd, MSFT_SEG_GUID )) return retval; + if (!ctl2_write_segment(typelib, fd, MSFT_SEG_REFERENCES )) return retval; if (!ctl2_write_segment(typelib, fd, MSFT_SEG_IMPORTINFO )) return retval; if (!ctl2_write_segment(typelib, fd, MSFT_SEG_IMPORTFILES )) return retval; - if (!ctl2_write_segment(typelib, fd, MSFT_SEG_REFERENCES )) return retval; if (!ctl2_write_segment(typelib, fd, MSFT_SEG_NAMEHASH )) return retval; if (!ctl2_write_segment(typelib, fd, MSFT_SEG_NAME )) return retval; if (!ctl2_write_segment(typelib, fd, MSFT_SEG_STRING )) return retval; diff --git a/reactos/tools/widl/y.tab.h b/reactos/tools/widl/y.tab.h deleted file mode 100644 index 0921fdba71c..00000000000 --- a/reactos/tools/widl/y.tab.h +++ /dev/null @@ -1,309 +0,0 @@ -/* A Bison parser, made by GNU Bison 1.875. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - aIDENTIFIER = 258, - aKNOWNTYPE = 259, - aNUM = 260, - aHEXNUM = 261, - aSTRING = 262, - aUUID = 263, - aEOF = 264, - SHL = 265, - SHR = 266, - tAGGREGATABLE = 267, - tALLOCATE = 268, - tAPPOBJECT = 269, - tARRAYS = 270, - tASYNC = 271, - tASYNCUUID = 272, - tAUTOHANDLE = 273, - tBINDABLE = 274, - tBOOLEAN = 275, - tBROADCAST = 276, - tBYTE = 277, - tBYTECOUNT = 278, - tCALLAS = 279, - tCALLBACK = 280, - tCASE = 281, - tCDECL = 282, - tCHAR = 283, - tCOCLASS = 284, - tCODE = 285, - tCOMMSTATUS = 286, - tCONST = 287, - tCONTEXTHANDLE = 288, - tCONTEXTHANDLENOSERIALIZE = 289, - tCONTEXTHANDLESERIALIZE = 290, - tCONTROL = 291, - tCPPQUOTE = 292, - tDEFAULT = 293, - tDEFAULTVALUE = 294, - tDISPINTERFACE = 295, - tDLLNAME = 296, - tDOUBLE = 297, - tDUAL = 298, - tENDPOINT = 299, - tENTRY = 300, - tENUM = 301, - tERRORSTATUST = 302, - tEXPLICITHANDLE = 303, - tEXTERN = 304, - tFLOAT = 305, - tHANDLE = 306, - tHANDLET = 307, - tHELPCONTEXT = 308, - tHELPFILE = 309, - tHELPSTRING = 310, - tHELPSTRINGCONTEXT = 311, - tHELPSTRINGDLL = 312, - tHIDDEN = 313, - tHYPER = 314, - tID = 315, - tIDEMPOTENT = 316, - tIIDIS = 317, - tIMPLICITHANDLE = 318, - tIMPORT = 319, - tIMPORTLIB = 320, - tIN = 321, - tINCLUDE = 322, - tINLINE = 323, - tINPUTSYNC = 324, - tINT = 325, - tINT64 = 326, - tINTERFACE = 327, - tLENGTHIS = 328, - tLIBRARY = 329, - tLOCAL = 330, - tLONG = 331, - tMETHODS = 332, - tMODULE = 333, - tNONCREATABLE = 334, - tOBJECT = 335, - tODL = 336, - tOLEAUTOMATION = 337, - tOPTIONAL = 338, - tOUT = 339, - tPOINTERDEFAULT = 340, - tPROPERTIES = 341, - tPROPGET = 342, - tPROPPUT = 343, - tPROPPUTREF = 344, - tPTR = 345, - tPUBLIC = 346, - tREADONLY = 347, - tREF = 348, - tRESTRICTED = 349, - tRETVAL = 350, - tSHORT = 351, - tSIGNED = 352, - tSINGLE = 353, - tSIZEIS = 354, - tSIZEOF = 355, - tSMALL = 356, - tSOURCE = 357, - tSTDCALL = 358, - tSTRING = 359, - tSTRUCT = 360, - tSWITCH = 361, - tSWITCHIS = 362, - tSWITCHTYPE = 363, - tTRANSMITAS = 364, - tTYPEDEF = 365, - tUNION = 366, - tUNIQUE = 367, - tUNSIGNED = 368, - tUUID = 369, - tV1ENUM = 370, - tVARARG = 371, - tVERSION = 372, - tVOID = 373, - tWCHAR = 374, - tWIREMARSHAL = 375, - tPOINTERTYPE = 376, - COND = 377, - CAST = 378, - PPTR = 379, - NEG = 380 - }; -#endif -#define aIDENTIFIER 258 -#define aKNOWNTYPE 259 -#define aNUM 260 -#define aHEXNUM 261 -#define aSTRING 262 -#define aUUID 263 -#define aEOF 264 -#define SHL 265 -#define SHR 266 -#define tAGGREGATABLE 267 -#define tALLOCATE 268 -#define tAPPOBJECT 269 -#define tARRAYS 270 -#define tASYNC 271 -#define tASYNCUUID 272 -#define tAUTOHANDLE 273 -#define tBINDABLE 274 -#define tBOOLEAN 275 -#define tBROADCAST 276 -#define tBYTE 277 -#define tBYTECOUNT 278 -#define tCALLAS 279 -#define tCALLBACK 280 -#define tCASE 281 -#define tCDECL 282 -#define tCHAR 283 -#define tCOCLASS 284 -#define tCODE 285 -#define tCOMMSTATUS 286 -#define tCONST 287 -#define tCONTEXTHANDLE 288 -#define tCONTEXTHANDLENOSERIALIZE 289 -#define tCONTEXTHANDLESERIALIZE 290 -#define tCONTROL 291 -#define tCPPQUOTE 292 -#define tDEFAULT 293 -#define tDEFAULTVALUE 294 -#define tDISPINTERFACE 295 -#define tDLLNAME 296 -#define tDOUBLE 297 -#define tDUAL 298 -#define tENDPOINT 299 -#define tENTRY 300 -#define tENUM 301 -#define tERRORSTATUST 302 -#define tEXPLICITHANDLE 303 -#define tEXTERN 304 -#define tFLOAT 305 -#define tHANDLE 306 -#define tHANDLET 307 -#define tHELPCONTEXT 308 -#define tHELPFILE 309 -#define tHELPSTRING 310 -#define tHELPSTRINGCONTEXT 311 -#define tHELPSTRINGDLL 312 -#define tHIDDEN 313 -#define tHYPER 314 -#define tID 315 -#define tIDEMPOTENT 316 -#define tIIDIS 317 -#define tIMPLICITHANDLE 318 -#define tIMPORT 319 -#define tIMPORTLIB 320 -#define tIN 321 -#define tINCLUDE 322 -#define tINLINE 323 -#define tINPUTSYNC 324 -#define tINT 325 -#define tINT64 326 -#define tINTERFACE 327 -#define tLENGTHIS 328 -#define tLIBRARY 329 -#define tLOCAL 330 -#define tLONG 331 -#define tMETHODS 332 -#define tMODULE 333 -#define tNONCREATABLE 334 -#define tOBJECT 335 -#define tODL 336 -#define tOLEAUTOMATION 337 -#define tOPTIONAL 338 -#define tOUT 339 -#define tPOINTERDEFAULT 340 -#define tPROPERTIES 341 -#define tPROPGET 342 -#define tPROPPUT 343 -#define tPROPPUTREF 344 -#define tPTR 345 -#define tPUBLIC 346 -#define tREADONLY 347 -#define tREF 348 -#define tRESTRICTED 349 -#define tRETVAL 350 -#define tSHORT 351 -#define tSIGNED 352 -#define tSINGLE 353 -#define tSIZEIS 354 -#define tSIZEOF 355 -#define tSMALL 356 -#define tSOURCE 357 -#define tSTDCALL 358 -#define tSTRING 359 -#define tSTRUCT 360 -#define tSWITCH 361 -#define tSWITCHIS 362 -#define tSWITCHTYPE 363 -#define tTRANSMITAS 364 -#define tTYPEDEF 365 -#define tUNION 366 -#define tUNIQUE 367 -#define tUNSIGNED 368 -#define tUUID 369 -#define tV1ENUM 370 -#define tVARARG 371 -#define tVERSION 372 -#define tVOID 373 -#define tWCHAR 374 -#define tWIREMARSHAL 375 -#define tPOINTERTYPE 376 -#define COND 377 -#define CAST 378 -#define PPTR 379 -#define NEG 380 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 106 "parser.y" -typedef union YYSTYPE { - attr_t *attr; - expr_t *expr; - type_t *type; - typeref_t *tref; - var_t *var; - func_t *func; - ifref_t *ifref; - class_t *clas; - char *str; - UUID *uuid; - unsigned int num; -} YYSTYPE; -/* Line 1248 of yacc.c. */ -#line 300 "y.tab.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - - -