https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9a0ddc1388bb296ea8c7b9...
commit 9a0ddc1388bb296ea8c7b97057b44428ad3b843e Author: Amine Khaldi amine.khaldi@reactos.org AuthorDate: Sun Dec 1 19:42:07 2019 +0100 Commit: Amine Khaldi amine.khaldi@reactos.org CommitDate: Sun Dec 1 19:42:07 2019 +0100
[VBSCRIPT] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/vbscript/compile.c | 108 +- dll/win32/vbscript/global.c | 1168 ++++++++++------ dll/win32/vbscript/interp.c | 138 +- dll/win32/vbscript/lex.c | 66 +- dll/win32/vbscript/parse.h | 13 +- dll/win32/vbscript/parser.tab.c | 2600 +++++++++++++++++++++--------------- dll/win32/vbscript/parser.tab.h | 149 ++- dll/win32/vbscript/parser.y | 169 ++- dll/win32/vbscript/regexp.c | 28 +- dll/win32/vbscript/vbdisp.c | 288 ++-- dll/win32/vbscript/vbregexp.c | 4 +- dll/win32/vbscript/vbscript.c | 281 ++-- dll/win32/vbscript/vbscript.h | 111 +- dll/win32/vbscript/vbscript.rc | 42 + dll/win32/vbscript/vbscript_defs.h | 37 + dll/win32/vbscript/vbscript_main.c | 64 +- media/doc/README.WINE | 2 +- 17 files changed, 3165 insertions(+), 2103 deletions(-)
diff --git a/dll/win32/vbscript/compile.c b/dll/win32/vbscript/compile.c index 302804f4c28..c129f3670da 100644 --- a/dll/win32/vbscript/compile.c +++ b/dll/win32/vbscript/compile.c @@ -136,7 +136,7 @@ static WCHAR *compiler_alloc_string(vbscode_t *vbscode, const WCHAR *str) size_t size; WCHAR *ret;
- size = (strlenW(str)+1)*sizeof(WCHAR); + size = (lstrlenW(str)+1)*sizeof(WCHAR); ret = compiler_alloc(vbscode, size); if(ret) memcpy(ret, str, size); @@ -375,12 +375,24 @@ static inline BOOL emit_catch(compile_ctx_t *ctx, unsigned off) return emit_catch_jmp(ctx, off, ctx->instr_cnt); }
+static HRESULT compile_error(script_ctx_t *ctx, HRESULT error) +{ + if(error == SCRIPT_E_REPORTED) + return error; + + clear_ei(&ctx->ei); + ctx->ei.scode = error = map_hres(error); + ctx->ei.bstrSource = get_vbscript_string(VBS_COMPILE_ERROR); + ctx->ei.bstrDescription = get_vbscript_error_string(error); + return report_script_error(ctx); +} + static expression_t *lookup_const_decls(compile_ctx_t *ctx, const WCHAR *name, BOOL lookup_global) { const_decl_t *decl;
for(decl = ctx->const_decls; decl; decl = decl->next) { - if(!strcmpiW(decl->name, name)) + if(!wcsicmp(decl->name, name)) return decl->value_expr; }
@@ -388,7 +400,7 @@ static expression_t *lookup_const_decls(compile_ctx_t *ctx, const WCHAR *name, B return NULL;
for(decl = ctx->global_consts; decl; decl = decl->next) { - if(!strcmpiW(decl->name, name)) + if(!wcsicmp(decl->name, name)) return decl->value_expr; }
@@ -536,10 +548,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) return push_instr_str(ctx, OP_string, ((string_expression_t*)expr)->value); case EXPR_SUB: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_sub); - case EXPR_USHORT: - return push_instr_int(ctx, OP_short, ((int_expression_t*)expr)->value); - case EXPR_ULONG: - return push_instr_int(ctx, OP_long, ((int_expression_t*)expr)->value); + case EXPR_INT: + return push_instr_int(ctx, OP_int, ((int_expression_t*)expr)->value); case EXPR_XOR: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_xor); default: @@ -781,7 +791,7 @@ static HRESULT compile_forto_statement(compile_ctx_t *ctx, forto_statement_t *st if(!push_instr(ctx, OP_val)) return E_OUTOFMEMORY; }else { - hres = push_instr_int(ctx, OP_short, 1); + hres = push_instr_int(ctx, OP_int, 1); if(FAILED(hres)) return hres; } @@ -994,7 +1004,7 @@ static BOOL lookup_dim_decls(compile_ctx_t *ctx, const WCHAR *name) dim_decl_t *dim_decl;
for(dim_decl = ctx->dim_decls; dim_decl; dim_decl = dim_decl->next) { - if(!strcmpiW(dim_decl->name, name)) + if(!wcsicmp(dim_decl->name, name)) return TRUE; }
@@ -1006,7 +1016,7 @@ static BOOL lookup_args_name(compile_ctx_t *ctx, const WCHAR *name) unsigned i;
for(i = 0; i < ctx->func->arg_cnt; i++) { - if(!strcmpiW(ctx->func->args[i].name, name)) + if(!wcsicmp(ctx->func->args[i].name, name)) return TRUE; }
@@ -1198,6 +1208,21 @@ static HRESULT compile_onerror_statement(compile_ctx_t *ctx, onerror_statement_t return push_instr_int(ctx, OP_errmode, stat->resume_next); }
+static HRESULT compile_retval_statement(compile_ctx_t *ctx, retval_statement_t *stat) +{ + HRESULT hres; + + hres = compile_expression(ctx, stat->expr); + if(FAILED(hres)) + return hres; + + hres = push_instr(ctx, OP_retval); + if(FAILED(hres)) + return hres; + + return S_OK; +} + static HRESULT compile_statement(compile_ctx_t *ctx, statement_ctx_t *stat_ctx, statement_t *stat) { HRESULT hres; @@ -1269,6 +1294,9 @@ static HRESULT compile_statement(compile_ctx_t *ctx, statement_ctx_t *stat_ctx, case STAT_WHILELOOP: hres = compile_while_statement(ctx, (while_statement_t*)stat); break; + case STAT_RETVAL: + hres = compile_retval_statement(ctx, (retval_statement_t*)stat); + break; default: FIXME("Unimplemented statement type %d\n", stat->type); hres = E_NOTIMPL; @@ -1444,7 +1472,7 @@ static BOOL lookup_funcs_name(compile_ctx_t *ctx, const WCHAR *name) function_t *iter;
for(iter = ctx->funcs; iter; iter = iter->next) { - if(!strcmpiW(iter->name, name)) + if(!wcsicmp(iter->name, name)) return TRUE; }
@@ -1511,7 +1539,7 @@ static BOOL lookup_class_name(compile_ctx_t *ctx, const WCHAR *name) class_desc_t *iter;
for(iter = ctx->classes; iter; iter = iter->next) { - if(!strcmpiW(iter->name, name)) + if(!wcsicmp(iter->name, name)) return TRUE; }
@@ -1563,7 +1591,7 @@ static BOOL lookup_class_funcs(class_desc_t *class_desc, const WCHAR *name) unsigned i;
for(i=0; i < class_desc->func_cnt; i++) { - if(class_desc->funcs[i].name && !strcmpiW(class_desc->funcs[i].name, name)) + if(class_desc->funcs[i].name && !wcsicmp(class_desc->funcs[i].name, name)) return TRUE; }
@@ -1619,14 +1647,14 @@ static HRESULT compile_class(compile_ctx_t *ctx, class_decl_t *class_decl) } }
- if(!strcmpiW(class_initializeW, func_decl->name)) { + if(!wcsicmp(class_initializeW, func_decl->name)) { if(func_decl->type != FUNC_SUB) { FIXME("class initializer is not sub\n"); return E_FAIL; }
class_desc->class_initialize_id = i; - }else if(!strcmpiW(class_terminateW, func_decl->name)) { + }else if(!wcsicmp(class_terminateW, func_decl->name)) { if(func_decl->type != FUNC_SUB) { FIXME("class terminator is not sub\n"); return E_FAIL; @@ -1690,17 +1718,17 @@ static BOOL lookup_script_identifier(script_ctx_t *script, const WCHAR *identifi function_t *func;
for(var = script->global_vars; var; var = var->next) { - if(!strcmpiW(var->name, identifier)) + if(!wcsicmp(var->name, identifier)) return TRUE; }
for(func = script->global_funcs; func; func = func->next) { - if(!strcmpiW(func->name, identifier)) + if(!wcsicmp(func->name, identifier)) return TRUE; }
for(class = script->classes; class; class = class->next) { - if(!strcmpiW(class->name, identifier)) + if(!wcsicmp(class->name, identifier)) return TRUE; }
@@ -1797,7 +1825,7 @@ static void release_compiler(compile_ctx_t *ctx) release_vbscode(ctx->code); }
-HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *delimiter, vbscode_t **ret) +HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *delimiter, DWORD flags, vbscode_t **ret) { function_t *new_func; function_decl_t *func_decl; @@ -1806,13 +1834,15 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli vbscode_t *code; HRESULT hres;
- hres = parse_script(&ctx.parser, src, delimiter); + if (!src) src = L""; + + hres = parse_script(&ctx.parser, src, delimiter, flags); if(FAILED(hres)) - return hres; + return compile_error(script, hres);
code = ctx.code = alloc_vbscode(&ctx, src); if(!ctx.code) - return E_OUTOFMEMORY; + return compile_error(script, E_OUTOFMEMORY);
ctx.funcs = NULL; ctx.func_decls = NULL; @@ -1826,7 +1856,7 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli hres = compile_func(&ctx, ctx.parser.stats, &ctx.code->main_code); if(FAILED(hres)) { release_compiler(&ctx); - return hres; + return compile_error(script, hres); }
ctx.global_consts = ctx.const_decls; @@ -1835,7 +1865,7 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli hres = create_function(&ctx, func_decl, &new_func); if(FAILED(hres)) { release_compiler(&ctx); - return hres; + return compile_error(script, hres); }
new_func->next = ctx.funcs; @@ -1846,14 +1876,14 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli hres = compile_class(&ctx, class_decl); if(FAILED(hres)) { release_compiler(&ctx); - return hres; + return compile_error(script, hres); } }
hres = check_script_collisions(&ctx, script); if(FAILED(hres)) { release_compiler(&ctx); - return hres; + return compile_error(script, hres); }
if(ctx.global_vars) { @@ -1896,3 +1926,29 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli *ret = code; return S_OK; } + +HRESULT compile_procedure(script_ctx_t *script, const WCHAR *src, const WCHAR *delimiter, DWORD flags, class_desc_t **ret) +{ + class_desc_t *desc; + vbscode_t *code; + HRESULT hres; + + hres = compile_script(script, src, delimiter, flags, &code); + if(FAILED(hres)) + return hres; + + if(!(desc = compiler_alloc_zero(code, sizeof(*desc)))) + return E_OUTOFMEMORY; + if(!(desc->funcs = compiler_alloc_zero(code, sizeof(*desc->funcs)))) + return E_OUTOFMEMORY; + + desc->ctx = script; + desc->func_cnt = 1; + desc->funcs->entries[VBDISP_CALLGET] = &code->main_code; + + desc->next = script->procs; + script->procs = desc; + + *ret = desc; + return S_OK; +} diff --git a/dll/win32/vbscript/global.c b/dll/win32/vbscript/global.c index 6d26b2c6a5c..db1f4c74405 100644 --- a/dll/win32/vbscript/global.c +++ b/dll/win32/vbscript/global.c @@ -29,6 +29,7 @@
#ifdef __REACTOS__ #include <wingdi.h> +#include <winnls.h> #endif
WINE_DEFAULT_DEBUG_CHANNEL(vbscript); @@ -43,6 +44,252 @@ const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY = static const WCHAR emptyW[] = {0}; static const WCHAR vbscriptW[] = {'V','B','S','c','r','i','p','t',0};
+#define BP_GET 1 +#define BP_GETPUT 2 + +typedef struct { + UINT16 len; + WCHAR buf[7]; +} string_constant_t; + +struct _builtin_prop_t { + const WCHAR *name; + HRESULT (*proc)(BuiltinDisp*,VARIANT*,unsigned,VARIANT*); + DWORD flags; + unsigned min_args; + UINT_PTR max_args; +}; + +static inline BuiltinDisp *impl_from_IDispatch(IDispatch *iface) +{ + return CONTAINING_RECORD(iface, BuiltinDisp, IDispatch_iface); +} + +static HRESULT WINAPI Builtin_QueryInterface(IDispatch *iface, REFIID riid, void **ppv) +{ + BuiltinDisp *This = impl_from_IDispatch(iface); + + if(IsEqualGUID(&IID_IUnknown, riid)) { + TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); + *ppv = &This->IDispatch_iface; + }else if(IsEqualGUID(&IID_IDispatch, riid)) { + TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv); + *ppv = &This->IDispatch_iface; + }else { + WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI Builtin_AddRef(IDispatch *iface) +{ + BuiltinDisp *This = impl_from_IDispatch(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; +} + +static ULONG WINAPI Builtin_Release(IDispatch *iface) +{ + BuiltinDisp *This = impl_from_IDispatch(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if(!ref) { + assert(!This->ctx); + heap_free(This); + } + + return ref; +} + +static HRESULT WINAPI Builtin_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo) +{ + BuiltinDisp *This = impl_from_IDispatch(iface); + TRACE("(%p)->(%p)\n", This, pctinfo); + *pctinfo = 0; + return S_OK; +} + +static HRESULT WINAPI Builtin_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + BuiltinDisp *This = impl_from_IDispatch(iface); + TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); + return DISP_E_BADINDEX; +} + +HRESULT get_builtin_id(BuiltinDisp *disp, const WCHAR *name, DISPID *id) +{ + size_t min = 1, max = disp->member_cnt - 1, i; + int r; + + while(min <= max) { + i = (min + max) / 2; + r = wcsicmp(disp->members[i].name, name); + if(!r) { + *id = i; + return S_OK; + } + if(r < 0) + min = i+1; + else + max = i-1; + } + + return DISP_E_MEMBERNOTFOUND; + +} + +static HRESULT WINAPI Builtin_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *names, UINT name_cnt, + LCID lcid, DISPID *ids) +{ + BuiltinDisp *This = impl_from_IDispatch(iface); + unsigned i; + HRESULT hres; + + TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), names, name_cnt, lcid, ids); + + if(!This->ctx) { + FIXME("NULL context\n"); + return E_UNEXPECTED; + } + + for(i = 0; i < name_cnt; i++) { + hres = get_builtin_id(This, names[i], &ids[i]); + if(FAILED(hres)) + return hres; + } + + return S_OK; +} + +static HRESULT WINAPI Builtin_Invoke(IDispatch *iface, DISPID id, REFIID riid, LCID lcid, WORD flags, + DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei, UINT *err) +{ + BuiltinDisp *This = impl_from_IDispatch(iface); + const builtin_prop_t *prop; + VARIANT args[8]; + unsigned argn, i; + + TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, id, debugstr_guid(riid), lcid, flags, dp, res, ei, err); + + if(!This->ctx) { + FIXME("NULL context\n"); + return E_UNEXPECTED; + } + + if(id >= This->member_cnt || (!This->members[id].proc && !This->members[id].flags)) + return DISP_E_MEMBERNOTFOUND; + prop = This->members + id; + + switch(flags) { + case DISPATCH_PROPERTYGET: + if(!(prop->flags & (BP_GET|BP_GETPUT))) { + FIXME("property does not support DISPATCH_PROPERTYGET\n"); + return E_FAIL; + } + break; + case DISPATCH_PROPERTYGET|DISPATCH_METHOD: + if(!prop->proc && prop->flags == BP_GET) { + const int vt = prop->min_args, val = prop->max_args; + switch(vt) { + case VT_I2: + V_VT(res) = VT_I2; + V_I2(res) = val; + break; + case VT_I4: + V_VT(res) = VT_I4; + V_I4(res) = val; + break; + case VT_BSTR: { + const string_constant_t *str = (const string_constant_t*)prop->max_args; + BSTR ret; + + ret = SysAllocStringLen(str->buf, str->len); + if(!ret) + return E_OUTOFMEMORY; + + V_VT(res) = VT_BSTR; + V_BSTR(res) = ret; + break; + } + DEFAULT_UNREACHABLE; + } + return S_OK; + } + break; + case DISPATCH_METHOD: + if(prop->flags & (BP_GET|BP_GETPUT)) { + FIXME("Call on property\n"); + return E_FAIL; + } + break; + case DISPATCH_PROPERTYPUT: + if(!(prop->flags & BP_GETPUT)) { + FIXME("property does not support DISPATCH_PROPERTYPUT\n"); + return E_FAIL; + } + + FIXME("call put\n"); + return E_NOTIMPL; + default: + FIXME("unsupported flags %x\n", flags); + return E_NOTIMPL; + } + + argn = arg_cnt(dp); + + if(argn < prop->min_args || argn > (prop->max_args ? prop->max_args : prop->min_args)) { + WARN("invalid number of arguments\n"); + return MAKE_VBSERROR(VBSE_FUNC_ARITY_MISMATCH); + } + + assert(argn < ARRAY_SIZE(args)); + + for(i=0; i < argn; i++) { + if(V_VT(dp->rgvarg+dp->cArgs-i-1) == (VT_BYREF|VT_VARIANT)) + args[i] = *V_VARIANTREF(dp->rgvarg+dp->cArgs-i-1); + else + args[i] = dp->rgvarg[dp->cArgs-i-1]; + } + + return prop->proc(This, args, dp->cArgs, res); +} + +static const IDispatchVtbl BuiltinDispVtbl = { + Builtin_QueryInterface, + Builtin_AddRef, + Builtin_Release, + Builtin_GetTypeInfoCount, + Builtin_GetTypeInfo, + Builtin_GetIDsOfNames, + Builtin_Invoke +}; + +static HRESULT create_builtin_dispatch(script_ctx_t *ctx, const builtin_prop_t *members, size_t member_cnt, BuiltinDisp **ret) +{ + BuiltinDisp *disp; + + if(!(disp = heap_alloc(sizeof(*disp)))) + return E_OUTOFMEMORY; + + disp->IDispatch_iface.lpVtbl = &BuiltinDispVtbl; + disp->ref = 1; + disp->members = members; + disp->member_cnt = member_cnt; + disp->ctx = ctx; + + *ret = disp; + return S_OK; +} + static IInternetHostSecurityManager *get_sec_mgr(script_ctx_t *ctx) { IInternetHostSecurityManager *secmgr; @@ -202,6 +449,19 @@ static HRESULT to_string(VARIANT *v, BSTR *ret) return S_OK; }
+static HRESULT to_system_time(VARIANT *v, SYSTEMTIME *st) +{ + VARIANT date; + HRESULT hres; + + V_VT(&date) = VT_EMPTY; + hres = VariantChangeType(&date, v, 0, VT_DATE); + if(FAILED(hres)) + return hres; + + return VariantTimeToSystemTime(V_DATE(&date), st); +} + static HRESULT set_object_site(script_ctx_t *ctx, IUnknown *obj) { IObjectWithSite *obj_site; @@ -333,7 +593,7 @@ static HRESULT show_msgbox(script_ctx_t *ctx, BSTR prompt, unsigned type, BSTR o if(orig_title && *orig_title) { WCHAR *ptr;
- title = title_buf = heap_alloc(sizeof(vbscriptW) + (strlenW(orig_title)+2)*sizeof(WCHAR)); + title = title_buf = heap_alloc(sizeof(vbscriptW) + (lstrlenW(orig_title)+2)*sizeof(WCHAR)); if(!title) return E_OUTOFMEMORY;
@@ -342,7 +602,7 @@ static HRESULT show_msgbox(script_ctx_t *ctx, BSTR prompt, unsigned type, BSTR o
*ptr++ = ':'; *ptr++ = ' '; - strcpyW(ptr, orig_title); + lstrcpyW(ptr, orig_title); }else { title = vbscriptW; } @@ -369,7 +629,7 @@ static HRESULT show_msgbox(script_ctx_t *ctx, BSTR prompt, unsigned type, BSTR o return return_short(res, ret); }
-static HRESULT Global_CCur(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CCur(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { VARIANT v; HRESULT hres; @@ -392,7 +652,7 @@ static HRESULT Global_CCur(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI return S_OK; }
-static HRESULT Global_CInt(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CInt(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { VARIANT v; HRESULT hres; @@ -414,7 +674,7 @@ static HRESULT Global_CInt(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI } }
-static HRESULT Global_CLng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CLng(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { int i; HRESULT hres; @@ -432,7 +692,7 @@ static HRESULT Global_CLng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI return return_int(res, i); }
-static HRESULT Global_CBool(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CBool(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { VARIANT v; HRESULT hres; @@ -453,7 +713,7 @@ static HRESULT Global_CBool(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return S_OK; }
-static HRESULT Global_CByte(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CByte(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { VARIANT v; HRESULT hres; @@ -476,13 +736,13 @@ static HRESULT Global_CByte(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return S_OK; }
-static HRESULT Global_CDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CDate(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_CDbl(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CDbl(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { VARIANT v; HRESULT hres; @@ -504,7 +764,7 @@ static HRESULT Global_CDbl(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI } }
-static HRESULT Global_CSng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CSng(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { VARIANT v; HRESULT hres; @@ -525,13 +785,16 @@ static HRESULT Global_CSng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI return S_OK; }
-static HRESULT Global_CStr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CStr(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { BSTR str; HRESULT hres;
TRACE("%s\n", debugstr_variant(arg));
+ if(V_VT(arg) == VT_NULL) + return MAKE_VBSERROR(VBSE_ILLEGAL_NULL_USE); + hres = to_string(arg, &str); if(FAILED(hres)) return hres; @@ -544,7 +807,7 @@ static inline WCHAR hex_char(unsigned n) return n < 10 ? '0'+n : 'A'+n-10; }
-static HRESULT Global_Hex(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Hex(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { WCHAR buf[17], *ptr; DWORD n; @@ -585,7 +848,7 @@ static HRESULT Global_Hex(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_string(res, ptr); }
-static HRESULT Global_Oct(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Oct(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; WCHAR buf[23], *ptr; @@ -626,27 +889,30 @@ static HRESULT Global_Oct(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_string(res, ptr); }
-static HRESULT Global_VarType(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_VarType(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { + VARTYPE vt; + TRACE("(%s)\n", debugstr_variant(arg));
assert(args_cnt == 1);
- if(V_VT(arg) & ~VT_TYPEMASK) { + vt = V_VT(arg) & ~VT_BYREF; + if(vt & ~(VT_TYPEMASK | VT_ARRAY)) { FIXME("not supported %s\n", debugstr_variant(arg)); return E_NOTIMPL; }
- return return_short(res, V_VT(arg)); + return return_short(res, vt); }
-static HRESULT Global_IsDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_IsDate(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_IsEmpty(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_IsEmpty(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { TRACE("(%s)\n", debugstr_variant(arg));
@@ -659,7 +925,7 @@ static HRESULT Global_IsEmpty(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, V return S_OK; }
-static HRESULT Global_IsNull(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_IsNull(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { TRACE("(%s)\n", debugstr_variant(arg));
@@ -672,7 +938,7 @@ static HRESULT Global_IsNull(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VA return S_OK; }
-static HRESULT Global_IsNumeric(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_IsNumeric(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -686,13 +952,13 @@ static HRESULT Global_IsNumeric(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, return return_bool(res, SUCCEEDED(hres)); }
-static HRESULT Global_IsArray(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_IsArray(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_IsObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_IsObject(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { TRACE("(%s)\n", debugstr_variant(arg));
@@ -705,7 +971,7 @@ static HRESULT Global_IsObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, return S_OK; }
-static HRESULT Global_Atn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Atn(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -717,7 +983,7 @@ static HRESULT Global_Atn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_double(res, atan(d)); }
-static HRESULT Global_Cos(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Cos(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -729,7 +995,7 @@ static HRESULT Global_Cos(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_double(res, cos(d)); }
-static HRESULT Global_Sin(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Sin(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -741,7 +1007,7 @@ static HRESULT Global_Sin(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_double(res, sin(d)); }
-static HRESULT Global_Tan(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Tan(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -753,7 +1019,7 @@ static HRESULT Global_Tan(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_double(res, tan(d)); }
-static HRESULT Global_Exp(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Exp(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -765,7 +1031,7 @@ static HRESULT Global_Exp(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_double(res, exp(d)); }
-static HRESULT Global_Log(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Log(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -780,7 +1046,7 @@ static HRESULT Global_Log(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_double(res, log(d)); }
-static HRESULT Global_Sqr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Sqr(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -795,19 +1061,19 @@ static HRESULT Global_Sqr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_double(res, sqrt(d)); }
-static HRESULT Global_Randomize(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Randomize(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Rnd(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Rnd(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Timer(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Timer(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { SYSTEMTIME lt; double sec; @@ -818,13 +1084,13 @@ static HRESULT Global_Timer(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR
}
-static HRESULT Global_LBound(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_LBound(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_UBound(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_UBound(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { SAFEARRAY *sa; HRESULT hres; @@ -862,7 +1128,7 @@ static HRESULT Global_UBound(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VA return return_int(res, ubound); }
-static HRESULT Global_RGB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_RGB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; int i, color[3]; @@ -884,7 +1150,7 @@ static HRESULT Global_RGB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_int(res, RGB(color[0], color[1], color[2])); }
-static HRESULT Global_Len(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Len(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { DWORD len; HRESULT hres; @@ -910,13 +1176,13 @@ static HRESULT Global_Len(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_int(res, len); }
-static HRESULT Global_LenB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_LenB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Left(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Left(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { BSTR str, ret, conv_str = NULL; int len, str_len; @@ -954,13 +1220,13 @@ static HRESULT Global_Left(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VAR return return_bstr(res, ret); }
-static HRESULT Global_LeftB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_LeftB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Right(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Right(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { BSTR str, ret, conv_str = NULL; int len, str_len; @@ -998,13 +1264,13 @@ static HRESULT Global_Right(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VA return return_bstr(res, ret); }
-static HRESULT Global_RightB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_RightB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Mid(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Mid(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { int len = -1, start, str_len; BSTR str; @@ -1057,13 +1323,13 @@ static HRESULT Global_Mid(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARI return S_OK; }
-static HRESULT Global_MidB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_MidB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_StrComp(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_StrComp(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { BSTR left, right; int mode, ret; @@ -1098,7 +1364,7 @@ static HRESULT Global_StrComp(vbdisp_t *This, VARIANT *args, unsigned args_cnt, return hres; }
- ret = mode ? strcmpiW(left, right) : strcmpW(left, right); + ret = mode ? wcsicmp(left, right) : wcscmp(left, right); val = ret < 0 ? -1 : (ret > 0 ? 1 : 0);
SysFreeString(left); @@ -1106,7 +1372,7 @@ static HRESULT Global_StrComp(vbdisp_t *This, VARIANT *args, unsigned args_cnt, return return_short(res, val); }
-static HRESULT Global_LCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_LCase(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { BSTR str; HRESULT hres; @@ -1127,7 +1393,7 @@ static HRESULT Global_LCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR WCHAR *ptr;
for(ptr = str; *ptr; ptr++) - *ptr = tolowerW(*ptr); + *ptr = towlower(*ptr);
V_VT(res) = VT_BSTR; V_BSTR(res) = str; @@ -1137,7 +1403,7 @@ static HRESULT Global_LCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return S_OK; }
-static HRESULT Global_UCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_UCase(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { BSTR str; HRESULT hres; @@ -1158,7 +1424,7 @@ static HRESULT Global_UCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR WCHAR *ptr;
for(ptr = str; *ptr; ptr++) - *ptr = toupperW(*ptr); + *ptr = towupper(*ptr);
V_VT(res) = VT_BSTR; V_BSTR(res) = str; @@ -1168,7 +1434,7 @@ static HRESULT Global_UCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return S_OK; }
-static HRESULT Global_LTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_LTrim(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { BSTR str, conv_str = NULL; WCHAR *ptr; @@ -1185,7 +1451,7 @@ static HRESULT Global_LTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR str = conv_str; }
- for(ptr = str; *ptr && isspaceW(*ptr); ptr++); + for(ptr = str; *ptr && iswspace(*ptr); ptr++);
str = SysAllocString(ptr); SysFreeString(conv_str); @@ -1195,7 +1461,7 @@ static HRESULT Global_LTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return return_bstr(res, str); }
-static HRESULT Global_RTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_RTrim(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { BSTR str, conv_str = NULL; WCHAR *ptr; @@ -1212,7 +1478,7 @@ static HRESULT Global_RTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR str = conv_str; }
- for(ptr = str+SysStringLen(str); ptr-1 > str && isspaceW(*(ptr-1)); ptr--); + for(ptr = str+SysStringLen(str); ptr-1 > str && iswspace(*(ptr-1)); ptr--);
str = SysAllocStringLen(str, ptr-str); SysFreeString(conv_str); @@ -1222,7 +1488,7 @@ static HRESULT Global_RTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return return_bstr(res, str); }
-static HRESULT Global_Trim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Trim(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { BSTR str, conv_str = NULL; WCHAR *begin_ptr, *end_ptr; @@ -1239,8 +1505,8 @@ static HRESULT Global_Trim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI str = conv_str; }
- for(begin_ptr = str; *begin_ptr && isspaceW(*begin_ptr); begin_ptr++); - for(end_ptr = str+SysStringLen(str); end_ptr-1 > begin_ptr && isspaceW(*(end_ptr-1)); end_ptr--); + for(begin_ptr = str; *begin_ptr && iswspace(*begin_ptr); begin_ptr++); + for(end_ptr = str+SysStringLen(str); end_ptr-1 > begin_ptr && iswspace(*(end_ptr-1)); end_ptr--);
str = SysAllocStringLen(begin_ptr, end_ptr-begin_ptr); SysFreeString(conv_str); @@ -1250,7 +1516,7 @@ static HRESULT Global_Trim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI return return_bstr(res, str); }
-static HRESULT Global_Space(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Space(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { BSTR str; int n, i; @@ -1282,13 +1548,13 @@ static HRESULT Global_Space(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return S_OK; }
-static HRESULT Global_String(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_String(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_InStr(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_InStr(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { VARIANT *startv, *str1v, *str2v; BSTR str1, str2; @@ -1346,7 +1612,7 @@ static HRESULT Global_InStr(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VA if(start < SysStringLen(str1)) { WCHAR *ptr;
- ptr = strstrW(str1+start, str2); + ptr = wcsstr(str1+start, str2); ret = ptr ? ptr-str1+1 : 0; }else { ret = 0; @@ -1355,34 +1621,58 @@ static HRESULT Global_InStr(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VA return return_int(res, ret); }
-static HRESULT Global_InStrB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_InStrB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_AscB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_AscB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_ChrB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_ChrB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Asc(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Asc(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + BSTR conv_str = NULL, str; + HRESULT hres = S_OK; + + TRACE("(%s)\n", debugstr_variant(arg)); + + switch(V_VT(arg)) { + case VT_NULL: + return MAKE_VBSERROR(VBSE_ILLEGAL_NULL_USE); + case VT_EMPTY: + return MAKE_VBSERROR(VBSE_ILLEGAL_FUNC_CALL); + case VT_BSTR: + str = V_BSTR(arg); + break; + default: + hres = to_string(arg, &conv_str); + if(FAILED(hres)) + return hres; + str = conv_str; + } + + if(!SysStringLen(str) || *str >= 0x100) + hres = MAKE_VBSERROR(VBSE_ILLEGAL_FUNC_CALL); + else if(res) + hres = return_short(res, *str); + SysFreeString(conv_str); + return hres; }
/* The function supports only single-byte and double-byte character sets. It * ignores language specified by IActiveScriptSite::GetLCID. The argument needs * to be in range of short or unsigned short. */ -static HRESULT Global_Chr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Chr(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { int cp, c, len = 0; CPINFO cpi; @@ -1424,19 +1714,19 @@ static HRESULT Global_Chr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return S_OK; }
-static HRESULT Global_AscW(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_AscW(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_ChrW(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_ChrW(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Abs(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Abs(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; VARIANT dst; @@ -1457,7 +1747,7 @@ static HRESULT Global_Abs(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return S_OK; }
-static HRESULT Global_Fix(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Fix(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; VARIANT dst; @@ -1478,7 +1768,7 @@ static HRESULT Global_Fix(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return S_OK; }
-static HRESULT Global_Int(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Int(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; VARIANT dst; @@ -1499,7 +1789,7 @@ static HRESULT Global_Int(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return S_OK; }
-static HRESULT Global_Sgn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Sgn(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { double v; short val; @@ -1520,7 +1810,7 @@ static HRESULT Global_Sgn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_short(res, val); }
-static HRESULT Global_Now(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Now(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { SYSTEMTIME lt; double date; @@ -1532,7 +1822,7 @@ static HRESULT Global_Now(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_date(res, date); }
-static HRESULT Global_Date(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Date(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { SYSTEMTIME lt; UDATE ud; @@ -1550,7 +1840,7 @@ static HRESULT Global_Date(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI return return_date(res, date); }
-static HRESULT Global_Time(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Time(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { SYSTEMTIME lt; UDATE ud; @@ -1568,79 +1858,109 @@ static HRESULT Global_Time(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI return return_date(res, time); }
-static HRESULT Global_Day(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Day(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME st; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + hres = to_system_time(arg, &st); + return FAILED(hres) ? hres : return_short(res, st.wDay); }
-static HRESULT Global_Month(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Month(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME st; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + hres = to_system_time(arg, &st); + return FAILED(hres) ? hres : return_short(res, st.wMonth); }
-static HRESULT Global_Weekday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Weekday(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Year(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Year(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME st; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + hres = to_system_time(arg, &st); + return FAILED(hres) ? hres : return_short(res, st.wYear); }
-static HRESULT Global_Hour(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Hour(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME st; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + hres = to_system_time(arg, &st); + return FAILED(hres) ? hres : return_short(res, st.wHour); }
-static HRESULT Global_Minute(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Minute(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME st; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + hres = to_system_time(arg, &st); + return FAILED(hres) ? hres : return_short(res, st.wMinute); }
-static HRESULT Global_Second(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Second(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME st; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + hres = to_system_time(arg, &st); + return FAILED(hres) ? hres : return_short(res, st.wSecond); }
-static HRESULT Global_DateValue(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_DateValue(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_TimeValue(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_TimeValue(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_DateSerial(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_DateSerial(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_TimeSerial(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_TimeSerial(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_InputBox(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_InputBox(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_MsgBox(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_MsgBox(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { BSTR prompt, title = NULL; int type = MB_OK; @@ -1666,14 +1986,14 @@ static HRESULT Global_MsgBox(vbdisp_t *This, VARIANT *args, unsigned args_cnt, V }
if(SUCCEEDED(hres)) - hres = show_msgbox(This->desc->ctx, prompt, type, title, res); + hres = show_msgbox(This->ctx, prompt, type, title, res);
SysFreeString(prompt); SysFreeString(title); return hres; }
-static HRESULT Global_CreateObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CreateObject(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { IUnknown *obj; HRESULT hres; @@ -1685,7 +2005,7 @@ static HRESULT Global_CreateObject(vbdisp_t *This, VARIANT *arg, unsigned args_c return E_INVALIDARG; }
- obj = create_object(This->desc->ctx, V_BSTR(arg)); + obj = create_object(This->ctx, V_BSTR(arg)); if(!obj) return VB_E_CANNOT_CREATE_OBJ;
@@ -1701,7 +2021,7 @@ static HRESULT Global_CreateObject(vbdisp_t *This, VARIANT *arg, unsigned args_c return S_OK; }
-static HRESULT Global_GetObject(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_GetObject(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { IBindCtx *bind_ctx; IUnknown *obj_unk; @@ -1717,7 +2037,7 @@ static HRESULT Global_GetObject(vbdisp_t *This, VARIANT *args, unsigned args_cnt return E_NOTIMPL; }
- if(This->desc->ctx->safeopt & (INTERFACE_USES_SECURITY_MANAGER|INTERFACESAFE_FOR_UNTRUSTED_DATA)) { + if(This->ctx->safeopt & (INTERFACE_USES_SECURITY_MANAGER|INTERFACESAFE_FOR_UNTRUSTED_DATA)) { WARN("blocked in current safety mode\n"); return VB_E_CANNOT_CREATE_OBJ; } @@ -1737,7 +2057,7 @@ static HRESULT Global_GetObject(vbdisp_t *This, VARIANT *args, unsigned args_cnt if(FAILED(hres)) return hres;
- hres = set_object_site(This->desc->ctx, obj_unk); + hres = set_object_site(This->ctx, obj_unk); if(FAILED(hres)) { IUnknown_Release(obj_unk); return hres; @@ -1758,25 +2078,25 @@ static HRESULT Global_GetObject(vbdisp_t *This, VARIANT *args, unsigned args_cnt return hres; }
-static HRESULT Global_DateAdd(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_DateAdd(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_DateDiff(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_DateDiff(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_DatePart(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_DatePart(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_TypeName(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_TypeName(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { static const WCHAR ByteW[] = {'B', 'y', 't', 'e', 0}; static const WCHAR IntegerW[] = {'I', 'n', 't', 'e', 'g', 'e', 'r', 0}; @@ -1826,7 +2146,7 @@ static HRESULT Global_TypeName(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, } }
-static HRESULT Global_Array(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Array(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { SAFEARRAYBOUND bounds; SAFEARRAY *sa; @@ -1868,37 +2188,37 @@ static HRESULT Global_Array(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return S_OK; }
-static HRESULT Global_Erase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Erase(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Filter(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Filter(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Join(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Join(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Split(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Split(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Replace(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Replace(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_StrReverse(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_StrReverse(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { WCHAR *ptr1, *ptr2, ch; BSTR ret; @@ -1921,7 +2241,7 @@ static HRESULT Global_StrReverse(vbdisp_t *This, VARIANT *arg, unsigned args_cnt return return_bstr(res, ret); }
-static HRESULT Global_InStrRev(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_InStrRev(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { int start, ret = 0; BSTR str1, str2; @@ -1981,13 +2301,13 @@ static HRESULT Global_InStrRev(vbdisp_t *This, VARIANT *args, unsigned args_cnt, return return_int(res, ret); }
-static HRESULT Global_LoadPicture(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_LoadPicture(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_ScriptEngine(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_ScriptEngine(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { TRACE("%s\n", debugstr_variant(arg));
@@ -1996,7 +2316,7 @@ static HRESULT Global_ScriptEngine(vbdisp_t *This, VARIANT *arg, unsigned args_c return return_string(res, vbscriptW); }
-static HRESULT Global_ScriptEngineMajorVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_ScriptEngineMajorVersion(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { TRACE("%s\n", debugstr_variant(arg));
@@ -2005,7 +2325,7 @@ static HRESULT Global_ScriptEngineMajorVersion(vbdisp_t *This, VARIANT *arg, uns return return_int(res, VBSCRIPT_MAJOR_VERSION); }
-static HRESULT Global_ScriptEngineMinorVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_ScriptEngineMinorVersion(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { TRACE("%s\n", debugstr_variant(arg));
@@ -2014,7 +2334,7 @@ static HRESULT Global_ScriptEngineMinorVersion(vbdisp_t *This, VARIANT *arg, uns return return_int(res, VBSCRIPT_MINOR_VERSION); }
-static HRESULT Global_ScriptEngineBuildVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_ScriptEngineBuildVersion(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { TRACE("%s\n", debugstr_variant(arg));
@@ -2023,31 +2343,31 @@ static HRESULT Global_ScriptEngineBuildVersion(vbdisp_t *This, VARIANT *arg, uns return return_int(res, VBSCRIPT_BUILD_VERSION); }
-static HRESULT Global_FormatNumber(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_FormatNumber(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_FormatCurrency(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_FormatCurrency(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_FormatPercent(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_FormatPercent(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_FormatDateTime(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_FormatDateTime(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_WeekdayName(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_WeekdayName(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { int weekday, first_day = 1, abbrev = 0; BSTR ret; @@ -2080,7 +2400,7 @@ static HRESULT Global_WeekdayName(vbdisp_t *This, VARIANT *args, unsigned args_c return return_bstr(res, ret); }
-static HRESULT Global_MonthName(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_MonthName(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { int month, abbrev = 0; BSTR ret; @@ -2107,7 +2427,7 @@ static HRESULT Global_MonthName(vbdisp_t *This, VARIANT *args, unsigned args_cnt return return_bstr(res, ret); }
-static HRESULT Global_Round(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Round(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { double n; HRESULT hres; @@ -2135,42 +2455,57 @@ static HRESULT Global_Round(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return return_double(res, round(n)); }
-static HRESULT Global_Escape(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Escape(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Unescape(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Unescape(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Eval(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Eval(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_Execute(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Execute(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_ExecuteGlobal(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_ExecuteGlobal(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
-static HRESULT Global_GetRef(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_GetRef(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; }
+static HRESULT Global_Err(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +{ + TRACE("\n"); + + if(args_cnt) { + FIXME("Setter not supported\n"); + return E_NOTIMPL; + } + + V_VT(res) = VT_DISPATCH; + V_DISPATCH(res) = &This->ctx->err_obj->IDispatch_iface; + IDispatch_AddRef(V_DISPATCH(res)); + return S_OK; +} + static const string_constant_t vbCr = {1, {'\r'}}; static const string_constant_t vbCrLf = {2, {'\r','\n'}}; static const string_constant_t vbNewLine = {2, {'\r','\n'}}; @@ -2182,296 +2517,363 @@ static const string_constant_t vbTab = {1, {'\t'}}; static const string_constant_t vbVerticalTab = {1, {0xb}};
static const builtin_prop_t global_props[] = { - {DISPID_GLOBAL_VBUSESYSTEM, NULL, BP_GET, VT_I2, 0}, - {DISPID_GLOBAL_USESYSTEMDAYOFWEEK, NULL, BP_GET, VT_I2, 0}, - {DISPID_GLOBAL_VBSUNDAY, NULL, BP_GET, VT_I2, 1}, - {DISPID_GLOBAL_VBMONDAY, NULL, BP_GET, VT_I2, 2}, - {DISPID_GLOBAL_VBTUESDAY, NULL, BP_GET, VT_I2, 3}, - {DISPID_GLOBAL_VBWEDNESDAY, NULL, BP_GET, VT_I2, 4}, - {DISPID_GLOBAL_VBTHURSDAY, NULL, BP_GET, VT_I2, 5}, - {DISPID_GLOBAL_VBFRIDAY, NULL, BP_GET, VT_I2, 6}, - {DISPID_GLOBAL_VBSATURDAY, NULL, BP_GET, VT_I2, 7}, - {DISPID_GLOBAL_VBFIRSTJAN1, NULL, BP_GET, VT_I2, 1}, - {DISPID_GLOBAL_VBFIRSTFOURDAYS, NULL, BP_GET, VT_I2, 2}, - {DISPID_GLOBAL_VBFIRSTFULLWEEK, NULL, BP_GET, VT_I2, 3}, - {DISPID_GLOBAL_VBOKONLY, NULL, BP_GET, VT_I2, MB_OK}, - {DISPID_GLOBAL_VBOKCANCEL, NULL, BP_GET, VT_I2, MB_OKCANCEL}, - {DISPID_GLOBAL_VBABORTRETRYIGNORE, NULL, BP_GET, VT_I2, MB_ABORTRETRYIGNORE}, - {DISPID_GLOBAL_VBYESNOCANCEL, NULL, BP_GET, VT_I2, MB_YESNOCANCEL}, - {DISPID_GLOBAL_VBYESNO, NULL, BP_GET, VT_I2, MB_YESNO}, - {DISPID_GLOBAL_VBRETRYCANCEL, NULL, BP_GET, VT_I2, MB_RETRYCANCEL}, - {DISPID_GLOBAL_VBCRITICAL, NULL, BP_GET, VT_I2, MB_ICONHAND}, - {DISPID_GLOBAL_VBQUESTION, NULL, BP_GET, VT_I2, MB_ICONQUESTION}, - {DISPID_GLOBAL_VBEXCLAMATION, NULL, BP_GET, VT_I2, MB_ICONEXCLAMATION}, - {DISPID_GLOBAL_VBINFORMATION, NULL, BP_GET, VT_I2, MB_ICONASTERISK}, - {DISPID_GLOBAL_VBDEFAULTBUTTON1, NULL, BP_GET, VT_I2, MB_DEFBUTTON1}, - {DISPID_GLOBAL_VBDEFAULTBUTTON2, NULL, BP_GET, VT_I2, MB_DEFBUTTON2}, - {DISPID_GLOBAL_VBDEFAULTBUTTON3, NULL, BP_GET, VT_I2, MB_DEFBUTTON3}, - {DISPID_GLOBAL_VBDEFAULTBUTTON4, NULL, BP_GET, VT_I2, MB_DEFBUTTON4}, - {DISPID_GLOBAL_VBAPPLICATIONMODAL, NULL, BP_GET, VT_I2, MB_APPLMODAL}, - {DISPID_GLOBAL_VBSYSTEMMODAL, NULL, BP_GET, VT_I2, MB_SYSTEMMODAL}, - {DISPID_GLOBAL_VBOK, NULL, BP_GET, VT_I2, IDOK}, - {DISPID_GLOBAL_VBCANCEL, NULL, BP_GET, VT_I2, IDCANCEL}, - {DISPID_GLOBAL_VBABORT, NULL, BP_GET, VT_I2, IDABORT}, - {DISPID_GLOBAL_VBRETRY, NULL, BP_GET, VT_I2, IDRETRY}, - {DISPID_GLOBAL_VBIGNORE, NULL, BP_GET, VT_I2, IDIGNORE}, - {DISPID_GLOBAL_VBYES, NULL, BP_GET, VT_I2, IDYES}, - {DISPID_GLOBAL_VBNO, NULL, BP_GET, VT_I2, IDNO}, - {DISPID_GLOBAL_VBEMPTY, NULL, BP_GET, VT_I2, VT_EMPTY}, - {DISPID_GLOBAL_VBNULL, NULL, BP_GET, VT_I2, VT_NULL}, - {DISPID_GLOBAL_VBINTEGER, NULL, BP_GET, VT_I2, VT_I2}, - {DISPID_GLOBAL_VBLONG, NULL, BP_GET, VT_I2, VT_I4}, - {DISPID_GLOBAL_VBSINGLE, NULL, BP_GET, VT_I2, VT_R4}, - {DISPID_GLOBAL_VBDOUBLE, NULL, BP_GET, VT_I2, VT_R8}, - {DISPID_GLOBAL_VBCURRENCY, NULL, BP_GET, VT_I2, VT_CY}, - {DISPID_GLOBAL_VBDATE, NULL, BP_GET, VT_I2, VT_DATE}, - {DISPID_GLOBAL_VBSTRING, NULL, BP_GET, VT_I2, VT_BSTR}, - {DISPID_GLOBAL_VBOBJECT, NULL, BP_GET, VT_I2, VT_DISPATCH}, - {DISPID_GLOBAL_VBERROR, NULL, BP_GET, VT_I2, VT_ERROR}, - {DISPID_GLOBAL_VBBOOLEAN, NULL, BP_GET, VT_I2, VT_BOOL}, - {DISPID_GLOBAL_VBVARIANT, NULL, BP_GET, VT_I2, VT_VARIANT}, - {DISPID_GLOBAL_VBDATAOBJECT, NULL, BP_GET, VT_I2, VT_UNKNOWN}, - {DISPID_GLOBAL_VBDECIMAL, NULL, BP_GET, VT_I2, VT_DECIMAL}, - {DISPID_GLOBAL_VBBYTE, NULL, BP_GET, VT_I2, VT_UI1}, - {DISPID_GLOBAL_VBARRAY, NULL, BP_GET, VT_I2, VT_ARRAY}, - {DISPID_GLOBAL_VBTRUE, NULL, BP_GET, VT_I2, VARIANT_TRUE}, - {DISPID_GLOBAL_VBFALSE, NULL, BP_GET, VT_I2, VARIANT_FALSE}, - {DISPID_GLOBAL_VBUSEDEFAULT, NULL, BP_GET, VT_I2, -2}, - {DISPID_GLOBAL_VBBINARYCOMPARE, NULL, BP_GET, VT_I2, 0}, - {DISPID_GLOBAL_VBTEXTCOMPARE, NULL, BP_GET, VT_I2, 1}, - {DISPID_GLOBAL_VBDATABASECOMPARE, NULL, BP_GET, VT_I2, 2}, - {DISPID_GLOBAL_VBGENERALDATE, NULL, BP_GET, VT_I2, 0}, - {DISPID_GLOBAL_VBLONGDATE, NULL, BP_GET, VT_I2, 1}, - {DISPID_GLOBAL_VBSHORTDATE, NULL, BP_GET, VT_I2, 2}, - {DISPID_GLOBAL_VBLONGTIME, NULL, BP_GET, VT_I2, 3}, - {DISPID_GLOBAL_VBSHORTTIME, NULL, BP_GET, VT_I2, 4}, - {DISPID_GLOBAL_VBOBJECTERROR, NULL, BP_GET, VT_I4, 0x80040000}, - {DISPID_GLOBAL_VBBLACK, NULL, BP_GET, VT_I4, 0x000000}, - {DISPID_GLOBAL_VBBLUE, NULL, BP_GET, VT_I4, 0xff0000}, - {DISPID_GLOBAL_VBCYAN, NULL, BP_GET, VT_I4, 0xffff00}, - {DISPID_GLOBAL_VBGREEN, NULL, BP_GET, VT_I4, 0x00ff00}, - {DISPID_GLOBAL_VBMAGENTA, NULL, BP_GET, VT_I4, 0xff00ff}, - {DISPID_GLOBAL_VBRED, NULL, BP_GET, VT_I4, 0x0000ff}, - {DISPID_GLOBAL_VBWHITE, NULL, BP_GET, VT_I4, 0xffffff}, - {DISPID_GLOBAL_VBYELLOW, NULL, BP_GET, VT_I4, 0x00ffff}, - {DISPID_GLOBAL_VBCR, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbCr}, - {DISPID_GLOBAL_VBCRLF, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbCrLf}, - {DISPID_GLOBAL_VBNEWLINE, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbNewLine}, - {DISPID_GLOBAL_VBFORMFEED, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbFormFeed}, - {DISPID_GLOBAL_VBLF, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbLf}, - {DISPID_GLOBAL_VBNULLCHAR, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbNullChar}, - {DISPID_GLOBAL_VBNULLSTRING, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbNullString}, - {DISPID_GLOBAL_VBTAB, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbTab}, - {DISPID_GLOBAL_VBVERTICALTAB, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbVerticalTab}, - {DISPID_GLOBAL_CCUR, Global_CCur, 0, 1}, - {DISPID_GLOBAL_CINT, Global_CInt, 0, 1}, - {DISPID_GLOBAL_CLNG, Global_CLng, 0, 1}, - {DISPID_GLOBAL_CBOOL, Global_CBool, 0, 1}, - {DISPID_GLOBAL_CBYTE, Global_CByte, 0, 1}, - {DISPID_GLOBAL_CDATE, Global_CDate, 0, 1}, - {DISPID_GLOBAL_CDBL, Global_CDbl, 0, 1}, - {DISPID_GLOBAL_CSNG, Global_CSng, 0, 1}, - {DISPID_GLOBAL_CSTR, Global_CStr, 0, 1}, - {DISPID_GLOBAL_HEX, Global_Hex, 0, 1}, - {DISPID_GLOBAL_OCT, Global_Oct, 0, 1}, - {DISPID_GLOBAL_VARTYPE, Global_VarType, 0, 1}, - {DISPID_GLOBAL_ISDATE, Global_IsDate, 0, 1}, - {DISPID_GLOBAL_ISEMPTY, Global_IsEmpty, 0, 1}, - {DISPID_GLOBAL_ISNULL, Global_IsNull, 0, 1}, - {DISPID_GLOBAL_ISNUMERIC, Global_IsNumeric, 0, 1}, - {DISPID_GLOBAL_ISARRAY, Global_IsArray, 0, 1}, - {DISPID_GLOBAL_ISOBJECT, Global_IsObject, 0, 1}, - {DISPID_GLOBAL_ATN, Global_Atn, 0, 1}, - {DISPID_GLOBAL_COS, Global_Cos, 0, 1}, - {DISPID_GLOBAL_SIN, Global_Sin, 0, 1}, - {DISPID_GLOBAL_TAN, Global_Tan, 0, 1}, - {DISPID_GLOBAL_EXP, Global_Exp, 0, 1}, - {DISPID_GLOBAL_LOG, Global_Log, 0, 1}, - {DISPID_GLOBAL_SQR, Global_Sqr, 0, 1}, - {DISPID_GLOBAL_RANDOMIZE, Global_Randomize, 0, 1}, - {DISPID_GLOBAL_RND, Global_Rnd, 0, 1}, - {DISPID_GLOBAL_TIMER, Global_Timer, 0, 0}, - {DISPID_GLOBAL_LBOUND, Global_LBound, 0, 1}, - {DISPID_GLOBAL_UBOUND, Global_UBound, 0, 1, 2}, - {DISPID_GLOBAL_RGB, Global_RGB, 0, 3}, - {DISPID_GLOBAL_LEN, Global_Len, 0, 1}, - {DISPID_GLOBAL_LENB, Global_LenB, 0, 1}, - {DISPID_GLOBAL_LEFT, Global_Left, 0, 2}, - {DISPID_GLOBAL_LEFTB, Global_LeftB, 0, 2}, - {DISPID_GLOBAL_RIGHT, Global_Right, 0, 2}, - {DISPID_GLOBAL_RIGHTB, Global_RightB, 0, 2}, - {DISPID_GLOBAL_MID, Global_Mid, 0, 2, 3}, - {DISPID_GLOBAL_MIDB, Global_MidB, 0, 2, 3}, - {DISPID_GLOBAL_STRCOMP, Global_StrComp, 0, 2, 3}, - {DISPID_GLOBAL_LCASE, Global_LCase, 0, 1}, - {DISPID_GLOBAL_UCASE, Global_UCase, 0, 1}, - {DISPID_GLOBAL_LTRIM, Global_LTrim, 0, 1}, - {DISPID_GLOBAL_RTRIM, Global_RTrim, 0, 1}, - {DISPID_GLOBAL_TRIM, Global_Trim, 0, 1}, - {DISPID_GLOBAL_SPACE, Global_Space, 0, 1}, - {DISPID_GLOBAL_STRING, Global_String, 0, 0, 2}, - {DISPID_GLOBAL_INSTR, Global_InStr, 0, 2, 4}, - {DISPID_GLOBAL_INSTRB, Global_InStrB, 0, 3, 4}, - {DISPID_GLOBAL_ASCB, Global_AscB, 0, 1}, - {DISPID_GLOBAL_CHRB, Global_ChrB, 0, 1}, - {DISPID_GLOBAL_ASC, Global_Asc, 0, 1}, - {DISPID_GLOBAL_CHR, Global_Chr, 0, 1}, - {DISPID_GLOBAL_ASCW, Global_AscW, 0, 1}, - {DISPID_GLOBAL_CHRW, Global_ChrW, 0, 1}, - {DISPID_GLOBAL_ABS, Global_Abs, 0, 1}, - {DISPID_GLOBAL_FIX, Global_Fix, 0, 1}, - {DISPID_GLOBAL_INT, Global_Int, 0, 1}, - {DISPID_GLOBAL_SGN, Global_Sgn, 0, 1}, - {DISPID_GLOBAL_NOW, Global_Now, 0, 0}, - {DISPID_GLOBAL_DATE, Global_Date, 0, 0}, - {DISPID_GLOBAL_TIME, Global_Time, 0, 0}, - {DISPID_GLOBAL_DAY, Global_Day, 0, 1}, - {DISPID_GLOBAL_MONTH, Global_Month, 0, 1}, - {DISPID_GLOBAL_WEEKDAY, Global_Weekday, 0, 1, 2}, - {DISPID_GLOBAL_YEAR, Global_Year, 0, 1}, - {DISPID_GLOBAL_HOUR, Global_Hour, 0, 1}, - {DISPID_GLOBAL_MINUTE, Global_Minute, 0, 1}, - {DISPID_GLOBAL_SECOND, Global_Second, 0, 1}, - {DISPID_GLOBAL_DATEVALUE, Global_DateValue, 0, 1}, - {DISPID_GLOBAL_TIMEVALUE, Global_TimeValue, 0, 1}, - {DISPID_GLOBAL_DATESERIAL, Global_DateSerial, 0, 3}, - {DISPID_GLOBAL_TIMESERIAL, Global_TimeSerial, 0, 3}, - {DISPID_GLOBAL_INPUTBOX, Global_InputBox, 0, 1, 7}, - {DISPID_GLOBAL_MSGBOX, Global_MsgBox, 0, 1, 5}, - {DISPID_GLOBAL_CREATEOBJECT, Global_CreateObject, 0, 1}, - {DISPID_GLOBAL_GETOBJECT, Global_GetObject, 0, 0, 2}, - {DISPID_GLOBAL_DATEADD, Global_DateAdd, 0, 3}, - {DISPID_GLOBAL_DATEDIFF, Global_DateDiff, 0, 3, 5}, - {DISPID_GLOBAL_DATEPART, Global_DatePart, 0, 2, 4}, - {DISPID_GLOBAL_TYPENAME, Global_TypeName, 0, 1}, - {DISPID_GLOBAL_ARRAY, Global_Array, 0, 0, MAXDWORD}, - {DISPID_GLOBAL_ERASE, Global_Erase, 0, 1}, - {DISPID_GLOBAL_FILTER, Global_Filter, 0, 2, 4}, - {DISPID_GLOBAL_JOIN, Global_Join, 0, 1, 2}, - {DISPID_GLOBAL_SPLIT, Global_Split, 0, 1, 4}, - {DISPID_GLOBAL_REPLACE, Global_Replace, 0, 3, 6}, - {DISPID_GLOBAL_STRREVERSE, Global_StrReverse, 0, 1}, - {DISPID_GLOBAL_INSTRREV, Global_InStrRev, 0, 2, 4}, - {DISPID_GLOBAL_LOADPICTURE, Global_LoadPicture, 0, 1}, - {DISPID_GLOBAL_SCRIPTENGINE, Global_ScriptEngine, 0, 0}, - {DISPID_GLOBAL_SCRIPTENGINEMAJORVERSION, Global_ScriptEngineMajorVersion, 0, 0}, - {DISPID_GLOBAL_SCRIPTENGINEMINORVERSION, Global_ScriptEngineMinorVersion, 0, 0}, - {DISPID_GLOBAL_SCRIPTENGINEBUILDVERSION, Global_ScriptEngineBuildVersion, 0, 0}, - {DISPID_GLOBAL_FORMATNUMBER, Global_FormatNumber, 0, 1, 5}, - {DISPID_GLOBAL_FORMATCURRENCY, Global_FormatCurrency, 0, 1, 5}, - {DISPID_GLOBAL_FORMATPERCENT, Global_FormatPercent, 0, 1, 5}, - {DISPID_GLOBAL_FORMATDATETIME, Global_FormatDateTime, 0, 1, 2}, - {DISPID_GLOBAL_WEEKDAYNAME, Global_WeekdayName, 0, 1, 3}, - {DISPID_GLOBAL_MONTHNAME, Global_MonthName, 0, 1, 2}, - {DISPID_GLOBAL_ROUND, Global_Round, 0, 1, 2}, - {DISPID_GLOBAL_ESCAPE, Global_Escape, 0, 1}, - {DISPID_GLOBAL_UNESCAPE, Global_Unescape, 0, 1}, - {DISPID_GLOBAL_EVAL, Global_Eval, 0, 1}, - {DISPID_GLOBAL_EXECUTE, Global_Execute, 0, 1}, - {DISPID_GLOBAL_EXECUTEGLOBAL, Global_ExecuteGlobal, 0, 1}, - {DISPID_GLOBAL_GETREF, Global_GetRef, 0, 1}, - {DISPID_GLOBAL_VBMSGBOXHELPBUTTON, NULL, BP_GET, VT_I4, MB_HELP}, - {DISPID_GLOBAL_VBMSGBOXSETFOREGROUND, NULL, BP_GET, VT_I4, MB_SETFOREGROUND}, - {DISPID_GLOBAL_VBMSGBOXRIGHT, NULL, BP_GET, VT_I4, MB_RIGHT}, - {DISPID_GLOBAL_VBMSGBOXRTLREADING, NULL, BP_GET, VT_I4, MB_RTLREADING} + {NULL}, /* no default value */ + {L"Abs", Global_Abs, 0, 1}, + {L"Array", Global_Array, 0, 0, MAXDWORD}, + {L"Asc", Global_Asc, 0, 1}, + {L"AscB", Global_AscB, 0, 1}, + {L"AscW", Global_AscW, 0, 1}, + {L"Atn", Global_Atn, 0, 1}, + {L"CBool", Global_CBool, 0, 1}, + {L"CByte", Global_CByte, 0, 1}, + {L"CCur", Global_CCur, 0, 1}, + {L"CDate", Global_CDate, 0, 1}, + {L"CDbl", Global_CDbl, 0, 1}, + {L"Chr", Global_Chr, 0, 1}, + {L"ChrB", Global_ChrB, 0, 1}, + {L"ChrW", Global_ChrW, 0, 1}, + {L"CInt", Global_CInt, 0, 1}, + {L"CLng", Global_CLng, 0, 1}, + {L"Cos", Global_Cos, 0, 1}, + {L"CreateObject", Global_CreateObject, 0, 1}, + {L"CSng", Global_CSng, 0, 1}, + {L"CStr", Global_CStr, 0, 1}, + {L"Date", Global_Date, 0, 0}, + {L"DateAdd", Global_DateAdd, 0, 3}, + {L"DateDiff", Global_DateDiff, 0, 3, 5}, + {L"DatePart", Global_DatePart, 0, 2, 4}, + {L"DateSerial", Global_DateSerial, 0, 3}, + {L"DateValue", Global_DateValue, 0, 1}, + {L"Day", Global_Day, 0, 1}, + {L"Erase", Global_Erase, 0, 1}, + {L"Err", Global_Err, BP_GETPUT}, + {L"Escape", Global_Escape, 0, 1}, + {L"Eval", Global_Eval, 0, 1}, + {L"Execute", Global_Execute, 0, 1}, + {L"ExecuteGlobal", Global_ExecuteGlobal, 0, 1}, + {L"Exp", Global_Exp, 0, 1}, + {L"Filter", Global_Filter, 0, 2, 4}, + {L"Fix", Global_Fix, 0, 1}, + {L"FormatCurrency", Global_FormatCurrency, 0, 1, 5}, + {L"FormatDateTime", Global_FormatDateTime, 0, 1, 2}, + {L"FormatNumber", Global_FormatNumber, 0, 1, 5}, + {L"FormatPercent", Global_FormatPercent, 0, 1, 5}, + {L"GetObject", Global_GetObject, 0, 0, 2}, + {L"GetRef", Global_GetRef, 0, 1}, + {L"Hex", Global_Hex, 0, 1}, + {L"Hour", Global_Hour, 0, 1}, + {L"InputBox", Global_InputBox, 0, 1, 7}, + {L"InStr", Global_InStr, 0, 2, 4}, + {L"InStrB", Global_InStrB, 0, 3, 4}, + {L"InStrRev", Global_InStrRev, 0, 2, 4}, + {L"Int", Global_Int, 0, 1}, + {L"IsArray", Global_IsArray, 0, 1}, + {L"IsDate", Global_IsDate, 0, 1}, + {L"IsEmpty", Global_IsEmpty, 0, 1}, + {L"IsNull", Global_IsNull, 0, 1}, + {L"IsNumeric", Global_IsNumeric, 0, 1}, + {L"IsObject", Global_IsObject, 0, 1}, + {L"Join", Global_Join, 0, 1, 2}, + {L"LBound", Global_LBound, 0, 1}, + {L"LCase", Global_LCase, 0, 1}, + {L"Left", Global_Left, 0, 2}, + {L"LeftB", Global_LeftB, 0, 2}, + {L"Len", Global_Len, 0, 1}, + {L"LenB", Global_LenB, 0, 1}, + {L"LoadPicture", Global_LoadPicture, 0, 1}, + {L"Log", Global_Log, 0, 1}, + {L"LTrim", Global_LTrim, 0, 1}, + {L"Mid", Global_Mid, 0, 2, 3}, + {L"MidB", Global_MidB, 0, 2, 3}, + {L"Minute", Global_Minute, 0, 1}, + {L"Month", Global_Month, 0, 1}, + {L"MonthName", Global_MonthName, 0, 1, 2}, + {L"MsgBox", Global_MsgBox, 0, 1, 5}, + {L"Now", Global_Now, 0, 0}, + {L"Oct", Global_Oct, 0, 1}, + {L"Randomize", Global_Randomize, 0, 1}, + {L"Replace", Global_Replace, 0, 3, 6}, + {L"RGB", Global_RGB, 0, 3}, + {L"Right", Global_Right, 0, 2}, + {L"RightB", Global_RightB, 0, 2}, + {L"Rnd", Global_Rnd, 0, 1}, + {L"Round", Global_Round, 0, 1, 2}, + {L"RTrim", Global_RTrim, 0, 1}, + {L"ScriptEngine", Global_ScriptEngine, 0, 0}, + {L"ScriptEngineBuildVersion", Global_ScriptEngineBuildVersion, 0, 0}, + {L"ScriptEngineMajorVersion", Global_ScriptEngineMajorVersion, 0, 0}, + {L"ScriptEngineMinorVersion", Global_ScriptEngineMinorVersion, 0, 0}, + {L"Second", Global_Second, 0, 1}, + {L"Sgn", Global_Sgn, 0, 1}, + {L"Sin", Global_Sin, 0, 1}, + {L"Space", Global_Space, 0, 1}, + {L"Split", Global_Split, 0, 1, 4}, + {L"Sqr", Global_Sqr, 0, 1}, + {L"StrComp", Global_StrComp, 0, 2, 3}, + {L"String", Global_String, 0, 0, 2}, + {L"StrReverse", Global_StrReverse, 0, 1}, + {L"Tan", Global_Tan, 0, 1}, + {L"Time", Global_Time, 0, 0}, + {L"Timer", Global_Timer, 0, 0}, + {L"TimeSerial", Global_TimeSerial, 0, 3}, + {L"TimeValue", Global_TimeValue, 0, 1}, + {L"Trim", Global_Trim, 0, 1}, + {L"TypeName", Global_TypeName, 0, 1}, + {L"UBound", Global_UBound, 0, 1, 2}, + {L"UCase", Global_UCase, 0, 1}, + {L"Unescape", Global_Unescape, 0, 1}, + {L"VarType", Global_VarType, 0, 1}, + {L"vbAbort", NULL, BP_GET, VT_I2, IDABORT}, + {L"vbAbortRetryIgnore", NULL, BP_GET, VT_I2, MB_ABORTRETRYIGNORE}, + {L"vbApplicationModal", NULL, BP_GET, VT_I2, MB_APPLMODAL}, + {L"vbArray", NULL, BP_GET, VT_I2, VT_ARRAY}, + {L"vbBinaryCompare", NULL, BP_GET, VT_I2, 0}, + {L"vbBlack", NULL, BP_GET, VT_I4, 0x000000}, + {L"vbBlue", NULL, BP_GET, VT_I4, 0xff0000}, + {L"vbBoolean", NULL, BP_GET, VT_I2, VT_BOOL}, + {L"vbByte", NULL, BP_GET, VT_I2, VT_UI1}, + {L"vbCancel", NULL, BP_GET, VT_I2, IDCANCEL}, + {L"vbCr", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbCr}, + {L"vbCritical", NULL, BP_GET, VT_I2, MB_ICONHAND}, + {L"vbCrLf", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbCrLf}, + {L"vbCurrency", NULL, BP_GET, VT_I2, VT_CY}, + {L"vbCyan", NULL, BP_GET, VT_I4, 0xffff00}, + {L"vbDatabaseCompare", NULL, BP_GET, VT_I2, 2}, + {L"vbDataObject", NULL, BP_GET, VT_I2, VT_UNKNOWN}, + {L"vbDate", NULL, BP_GET, VT_I2, VT_DATE}, + {L"vbDecimal", NULL, BP_GET, VT_I2, VT_DECIMAL}, + {L"vbDefaultButton1", NULL, BP_GET, VT_I2, MB_DEFBUTTON1}, + {L"vbDefaultButton2", NULL, BP_GET, VT_I2, MB_DEFBUTTON2}, + {L"vbDefaultButton3", NULL, BP_GET, VT_I2, MB_DEFBUTTON3}, + {L"vbDefaultButton4", NULL, BP_GET, VT_I2, MB_DEFBUTTON4}, + {L"vbDouble", NULL, BP_GET, VT_I2, VT_R8}, + {L"vbEmpty", NULL, BP_GET, VT_I2, VT_EMPTY}, + {L"vbError", NULL, BP_GET, VT_I2, VT_ERROR}, + {L"vbExclamation", NULL, BP_GET, VT_I2, MB_ICONEXCLAMATION}, + {L"vbFalse", NULL, BP_GET, VT_I2, VARIANT_FALSE}, + {L"vbFirstFourDays", NULL, BP_GET, VT_I2, 2}, + {L"vbFirstFullWeek", NULL, BP_GET, VT_I2, 3}, + {L"vbFirstJan1", NULL, BP_GET, VT_I2, 1}, + {L"vbFormFeed", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbFormFeed}, + {L"vbFriday", NULL, BP_GET, VT_I2, 6}, + {L"vbGeneralDate", NULL, BP_GET, VT_I2, 0}, + {L"vbGreen", NULL, BP_GET, VT_I4, 0x00ff00}, + {L"vbIgnore", NULL, BP_GET, VT_I2, IDIGNORE}, + {L"vbInformation", NULL, BP_GET, VT_I2, MB_ICONASTERISK}, + {L"vbInteger", NULL, BP_GET, VT_I2, VT_I2}, + {L"vbLf", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbLf}, + {L"vbLong", NULL, BP_GET, VT_I2, VT_I4}, + {L"vbLongDate", NULL, BP_GET, VT_I2, 1}, + {L"vbLongTime", NULL, BP_GET, VT_I2, 3}, + {L"vbMagenta", NULL, BP_GET, VT_I4, 0xff00ff}, + {L"vbMonday", NULL, BP_GET, VT_I2, 2}, + {L"vbMsgBoxHelpButton", NULL, BP_GET, VT_I4, MB_HELP}, + {L"vbMsgBoxRight", NULL, BP_GET, VT_I4, MB_RIGHT}, + {L"vbMsgBoxRtlReading", NULL, BP_GET, VT_I4, MB_RTLREADING}, + {L"vbMsgBoxSetForeground", NULL, BP_GET, VT_I4, MB_SETFOREGROUND}, + {L"vbNewLine", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbNewLine}, + {L"vbNo", NULL, BP_GET, VT_I2, IDNO}, + {L"vbNull", NULL, BP_GET, VT_I2, VT_NULL}, + {L"vbNullChar", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbNullChar}, + {L"vbNullString", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbNullString}, + {L"vbObject", NULL, BP_GET, VT_I2, VT_DISPATCH}, + {L"vbObjectError", NULL, BP_GET, VT_I4, 0x80040000}, + {L"vbOK", NULL, BP_GET, VT_I2, IDOK}, + {L"vbOKCancel", NULL, BP_GET, VT_I2, MB_OKCANCEL}, + {L"vbOKOnly", NULL, BP_GET, VT_I2, MB_OK}, + {L"vbQuestion", NULL, BP_GET, VT_I2, MB_ICONQUESTION}, + {L"vbRed", NULL, BP_GET, VT_I4, 0x0000ff}, + {L"vbRetry", NULL, BP_GET, VT_I2, IDRETRY}, + {L"vbRetryCancel", NULL, BP_GET, VT_I2, MB_RETRYCANCEL}, + {L"vbSaturday", NULL, BP_GET, VT_I2, 7}, + {L"vbShortDate", NULL, BP_GET, VT_I2, 2}, + {L"vbShortTime", NULL, BP_GET, VT_I2, 4}, + {L"vbSingle", NULL, BP_GET, VT_I2, VT_R4}, + {L"vbString", NULL, BP_GET, VT_I2, VT_BSTR}, + {L"vbSunday", NULL, BP_GET, VT_I2, 1}, + {L"vbSystemModal", NULL, BP_GET, VT_I2, MB_SYSTEMMODAL}, + {L"vbTab", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbTab}, + {L"vbTextCompare", NULL, BP_GET, VT_I2, 1}, + {L"vbThursday", NULL, BP_GET, VT_I2, 5}, + {L"vbTrue", NULL, BP_GET, VT_I2, VARIANT_TRUE}, + {L"vbTuesday", NULL, BP_GET, VT_I2, 3}, + {L"vbUseDefault", NULL, BP_GET, VT_I2, -2}, + {L"vbUseSystem", NULL, BP_GET, VT_I2, 0}, + {L"vbUseSystemDayOfWeek", NULL, BP_GET, VT_I2, 0}, + {L"vbVariant", NULL, BP_GET, VT_I2, VT_VARIANT}, + {L"vbVerticalTab", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbVerticalTab}, + {L"vbWednesday", NULL, BP_GET, VT_I2, 4}, + {L"vbWhite", NULL, BP_GET, VT_I4, 0xffffff}, + {L"vbYellow", NULL, BP_GET, VT_I4, 0x00ffff}, + {L"vbYes", NULL, BP_GET, VT_I2, IDYES}, + {L"vbYesNo", NULL, BP_GET, VT_I2, MB_YESNO}, + {L"vbYesNoCancel", NULL, BP_GET, VT_I2, MB_YESNOCANCEL}, + {L"Weekday", Global_Weekday, 0, 1, 2}, + {L"WeekdayName", Global_WeekdayName, 0, 1, 3}, + {L"Year", Global_Year, 0, 1} };
-static HRESULT Err_Description(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT err_string_prop(BSTR *prop, VARIANT *args, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + BSTR str; + HRESULT hres; + + if(!args_cnt) + return return_string(res, *prop ? *prop : L""); + + hres = to_string(args, &str); + if(FAILED(hres)) + return hres; + + SysFreeString(*prop); + *prop = str; + return S_OK; }
-static HRESULT Err_HelpContext(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Err_Description(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + return err_string_prop(&This->ctx->ei.bstrDescription, args, args_cnt, res); }
-static HRESULT Err_HelpFile(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Err_HelpContext(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + + if(args_cnt) { + FIXME("setter not implemented\n"); + return E_NOTIMPL; + } + + return return_int(res, This->ctx->ei.dwHelpContext); }
-static HRESULT Err_Number(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Err_HelpFile(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +{ + TRACE("\n"); + return err_string_prop(&This->ctx->ei.bstrHelpFile, args, args_cnt, res); +} + +static HRESULT Err_Number(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { HRESULT hres;
TRACE("\n");
- if(!This->desc) - return E_UNEXPECTED; - if(args_cnt) { FIXME("setter not implemented\n"); return E_NOTIMPL; }
- hres = This->desc->ctx->err_number; + hres = This->ctx->ei.scode; return return_int(res, HRESULT_FACILITY(hres) == FACILITY_VBS ? HRESULT_CODE(hres) : hres); }
-static HRESULT Err_Source(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Err_Source(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + return err_string_prop(&This->ctx->ei.bstrSource, args, args_cnt, res); }
-static HRESULT Err_Clear(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Err_Clear(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { TRACE("\n");
- if(!This->desc) - return E_UNEXPECTED; - - This->desc->ctx->err_number = S_OK; + clear_ei(&This->ctx->ei); return S_OK; }
-static HRESULT Err_Raise(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Err_Raise(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + BSTR source = NULL, description = NULL, helpfile = NULL; + int code, helpcontext = 0; + HRESULT hres, error; + + TRACE("%s %u...\n", debugstr_variant(args), args_cnt); + + hres = to_int(args, &code); + if(FAILED(hres)) + return hres; + if(code > 0 && code > 0xffff) + return E_INVALIDARG; + + if(args_cnt >= 2) + hres = to_string(args + 1, &source); + if(args_cnt >= 3 && SUCCEEDED(hres)) + hres = to_string(args + 2, &description); + if(args_cnt >= 4 && SUCCEEDED(hres)) + hres = to_string(args + 3, &helpfile); + if(args_cnt >= 5 && SUCCEEDED(hres)) + hres = to_int(args + 4, &helpcontext); + + if(SUCCEEDED(hres)) { + script_ctx_t *ctx = This->ctx; + + error = (code & ~0xffff) ? map_hres(code) : MAKE_VBSERROR(code); + + if(source) { + if(ctx->ei.bstrSource) SysFreeString(ctx->ei.bstrSource); + ctx->ei.bstrSource = source; + } + if(!ctx->ei.bstrSource) + ctx->ei.bstrSource = get_vbscript_string(VBS_RUNTIME_ERROR); + if(description) { + if(ctx->ei.bstrDescription) SysFreeString(ctx->ei.bstrDescription); + ctx->ei.bstrDescription = description; + } + if(!ctx->ei.bstrDescription) + ctx->ei.bstrDescription = get_vbscript_error_string(error); + if(helpfile) { + if(ctx->ei.bstrHelpFile) SysFreeString(ctx->ei.bstrHelpFile); + ctx->ei.bstrHelpFile = helpfile; + } + if(args_cnt >= 5) + ctx->ei.dwHelpContext = helpcontext; + + ctx->ei.scode = error; + hres = SCRIPT_E_RECORDED; + }else { + SysFreeString(source); + SysFreeString(description); + SysFreeString(helpfile); + } + + return hres; }
static const builtin_prop_t err_props[] = { - {DISPID_ERR_DESCRIPTION, Err_Description, BP_GETPUT}, - {DISPID_ERR_HELPCONTEXT, Err_HelpContext, BP_GETPUT}, - {DISPID_ERR_HELPFILE, Err_HelpFile, BP_GETPUT}, - {DISPID_ERR_NUMBER, Err_Number, BP_GETPUT}, - {DISPID_ERR_SOURCE, Err_Source, BP_GETPUT}, - {DISPID_ERR_CLEAR, Err_Clear}, - {DISPID_ERR_RAISE, Err_Raise, 0, 5}, + {NULL, Err_Number, BP_GETPUT}, + {L"Clear", Err_Clear}, + {L"Description", Err_Description, BP_GETPUT}, + {L"HelpContext", Err_HelpContext, BP_GETPUT}, + {L"HelpFile", Err_HelpFile, BP_GETPUT}, + {L"Number", Err_Number, BP_GETPUT}, + {L"Raise", Err_Raise, 0, 1, 5}, + {L"Source", Err_Source, BP_GETPUT} };
-HRESULT init_global(script_ctx_t *ctx) +void detach_global_objects(script_ctx_t *ctx) { - HRESULT hres; - - ctx->global_desc.ctx = ctx; - ctx->global_desc.builtin_prop_cnt = ARRAY_SIZE(global_props); - ctx->global_desc.builtin_props = global_props; - - hres = get_typeinfo(GlobalObj_tid, &ctx->global_desc.typeinfo); - if(FAILED(hres)) - return hres; - - hres = create_vbdisp(&ctx->global_desc, &ctx->global_obj); - if(FAILED(hres)) - return hres; + if(ctx->err_obj) { + ctx->err_obj->ctx = NULL; + IDispatch_Release(&ctx->err_obj->IDispatch_iface); + ctx->err_obj = NULL; + }
- hres = create_script_disp(ctx, &ctx->script_obj); - if(FAILED(hres)) - return hres; + if(ctx->global_obj) { + ctx->global_obj->ctx = NULL; + IDispatch_Release(&ctx->global_obj->IDispatch_iface); + ctx->global_obj = NULL; + } +}
- ctx->err_desc.ctx = ctx; - ctx->err_desc.builtin_prop_cnt = ARRAY_SIZE(err_props); - ctx->err_desc.builtin_props = err_props; +HRESULT init_global(script_ctx_t *ctx) +{ + HRESULT hres;
- hres = get_typeinfo(ErrObj_tid, &ctx->err_desc.typeinfo); + hres = create_builtin_dispatch(ctx, global_props, ARRAY_SIZE(global_props), &ctx->global_obj); if(FAILED(hres)) return hres;
- return create_vbdisp(&ctx->err_desc, &ctx->err_obj); + return create_builtin_dispatch(ctx, err_props, ARRAY_SIZE(err_props), &ctx->err_obj); } diff --git a/dll/win32/vbscript/interp.c b/dll/win32/vbscript/interp.c index b46bd01c0fc..80ecc416998 100644 --- a/dll/win32/vbscript/interp.c +++ b/dll/win32/vbscript/interp.c @@ -83,7 +83,7 @@ typedef struct { static BOOL lookup_dynamic_vars(dynamic_var_t *var, const WCHAR *name, ref_t *ref) { while(var) { - if(!strcmpiW(var->name, name)) { + if(!wcsicmp(var->name, name)) { ref->type = var->is_const ? REF_CONST : REF_VAR; ref->u.v = &var->v; return TRUE; @@ -104,18 +104,16 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ DISPID id; HRESULT hres;
- static const WCHAR errW[] = {'e','r','r',0}; - if(invoke_type == VBDISP_LET && (ctx->func->type == FUNC_FUNCTION || ctx->func->type == FUNC_PROPGET || ctx->func->type == FUNC_DEFGET) - && !strcmpiW(name, ctx->func->name)) { + && !wcsicmp(name, ctx->func->name)) { ref->type = REF_VAR; ref->u.v = &ctx->ret_val; return S_OK; }
for(i=0; i < ctx->func->var_cnt; i++) { - if(!strcmpiW(ctx->func->vars[i].name, name)) { + if(!wcsicmp(ctx->func->vars[i].name, name)) { ref->type = REF_VAR; ref->u.v = ctx->vars+i; return TRUE; @@ -123,7 +121,7 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ }
for(i=0; i < ctx->func->arg_cnt; i++) { - if(!strcmpiW(ctx->func->args[i].name, name)) { + if(!wcsicmp(ctx->func->args[i].name, name)) { ref->type = REF_VAR; ref->u.v = ctx->args+i; return S_OK; @@ -137,7 +135,7 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ if(ctx->vbthis) { /* FIXME: Bind such identifier while generating bytecode. */ for(i=0; i < ctx->vbthis->desc->prop_cnt; i++) { - if(!strcmpiW(ctx->vbthis->desc->props[i].name, name)) { + if(!wcsicmp(ctx->vbthis->desc->props[i].name, name)) { ref->type = REF_VAR; ref->u.v = ctx->vbthis->props+i; return S_OK; @@ -168,23 +166,17 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ return S_OK;
for(func = ctx->script->global_funcs; func; func = func->next) { - if(!strcmpiW(func->name, name)) { + if(!wcsicmp(func->name, name)) { ref->type = REF_FUNC; ref->u.f = func; return S_OK; } }
- if(!strcmpiW(name, errW)) { - ref->type = REF_OBJ; - ref->u.obj = (IDispatch*)&ctx->script->err_obj->IDispatchEx_iface; - return S_OK; - } - - hres = vbdisp_get_id(ctx->script->global_obj, name, invoke_type, TRUE, &id); + hres = get_builtin_id(ctx->script->global_obj, name, &id); if(SUCCEEDED(hres)) { ref->type = REF_DISP; - ref->u.d.disp = (IDispatch*)&ctx->script->global_obj->IDispatchEx_iface; + ref->u.d.disp = &ctx->script->global_obj->IDispatch_iface; ref->u.d.id = id; return S_OK; } @@ -226,7 +218,7 @@ static HRESULT add_dynamic_var(exec_ctx_t *ctx, const WCHAR *name, if(!new_var) return E_OUTOFMEMORY;
- size = (strlenW(name)+1)*sizeof(WCHAR); + size = (lstrlenW(name)+1)*sizeof(WCHAR); str = heap_pool_alloc(heap, size); if(!str) return E_OUTOFMEMORY; @@ -247,6 +239,14 @@ static HRESULT add_dynamic_var(exec_ctx_t *ctx, const WCHAR *name, return S_OK; }
+void clear_ei(EXCEPINFO *ei) +{ + SysFreeString(ei->bstrSource); + SysFreeString(ei->bstrDescription); + SysFreeString(ei->bstrHelpFile); + memset(ei, 0, sizeof(*ei)); +} + static inline VARIANT *stack_pop(exec_ctx_t *ctx) { assert(ctx->top); @@ -319,7 +319,7 @@ static HRESULT stack_pop_val(exec_ctx_t *ctx, variant_val_t *r) HRESULT hres;
hres = get_disp_value(ctx->script, V_DISPATCH(r->v), &r->store); - if(r->owned) + if(r->owned && V_DISPATCH(r->v)) IDispatch_Release(V_DISPATCH(r->v)); if(FAILED(hres)) return hres; @@ -350,7 +350,8 @@ static HRESULT stack_assume_val(exec_ctx_t *ctx, unsigned n)
disp = V_DISPATCH(v); hres = get_disp_value(ctx->script, disp, v); - IDispatch_Release(disp); + if(disp) + IDispatch_Release(disp); if(FAILED(hres)) return hres; } @@ -580,7 +581,7 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res) break; case REF_FUNC: vbstack_to_dp(ctx, arg_cnt, FALSE, &dp); - hres = exec_script(ctx->script, ref.u.f, NULL, &dp, res); + hres = exec_script(ctx->script, FALSE, ref.u.f, NULL, &dp, res); if(FAILED(hres)) return hres; break; @@ -688,23 +689,27 @@ static HRESULT interp_mcallv(exec_ctx_t *ctx)
static HRESULT assign_value(exec_ctx_t *ctx, VARIANT *dst, VARIANT *src, WORD flags) { + VARIANT value; HRESULT hres;
- hres = VariantCopyInd(dst, src); + V_VT(&value) = VT_EMPTY; + hres = VariantCopyInd(&value, src); if(FAILED(hres)) return hres;
- if(V_VT(dst) == VT_DISPATCH && !(flags & DISPATCH_PROPERTYPUTREF)) { - VARIANT value; + if(V_VT(&value) == VT_DISPATCH && !(flags & DISPATCH_PROPERTYPUTREF)) { + IDispatch *disp = V_DISPATCH(&value);
- hres = get_disp_value(ctx->script, V_DISPATCH(dst), &value); - IDispatch_Release(V_DISPATCH(dst)); + V_VT(&value) = VT_EMPTY; + hres = get_disp_value(ctx->script, disp, &value); + if(disp) + IDispatch_Release(disp); if(FAILED(hres)) return hres; - - *dst = value; }
+ VariantClear(dst); + *dst = value; return S_OK; }
@@ -988,7 +993,7 @@ static HRESULT interp_new(exec_ctx_t *ctx)
TRACE("%s\n", debugstr_w(arg));
- if(!strcmpiW(arg, regexpW)) { + if(!wcsicmp(arg, regexpW)) { V_VT(&v) = VT_DISPATCH; hres = create_regexp(&V_DISPATCH(&v)); if(FAILED(hres)) @@ -998,7 +1003,7 @@ static HRESULT interp_new(exec_ctx_t *ctx) }
for(class_desc = ctx->script->classes; class_desc; class_desc = class_desc->next) { - if(!strcmpiW(class_desc->name, arg)) + if(!wcsicmp(class_desc->name, arg)) break; } if(!class_desc) { @@ -1258,6 +1263,30 @@ static HRESULT interp_ret(exec_ctx_t *ctx) return S_OK; }
+static HRESULT interp_retval(exec_ctx_t *ctx) +{ + variant_val_t val; + HRESULT hres; + + TRACE("\n"); + + hres = stack_pop_val(ctx, &val); + if(FAILED(hres)) + return hres; + + if(val.owned) { + VariantClear(&ctx->ret_val); + ctx->ret_val = *val.v; + } + else { + hres = VariantCopy(&ctx->ret_val, val.v); + if(FAILED(hres)) + return hres; + } + + return S_OK; +} + static HRESULT interp_stop(exec_ctx_t *ctx) { WARN("\n"); @@ -1297,7 +1326,7 @@ static HRESULT interp_errmode(exec_ctx_t *ctx) TRACE("%d\n", err_mode);
ctx->resume_next = err_mode; - ctx->script->err_number = S_OK; + clear_ei(&ctx->script->ei); return S_OK; }
@@ -1315,27 +1344,20 @@ static HRESULT interp_string(exec_ctx_t *ctx) return stack_push(ctx, &v); }
-static HRESULT interp_long(exec_ctx_t *ctx) +static HRESULT interp_int(exec_ctx_t *ctx) { const LONG arg = ctx->instr->arg1.lng; VARIANT v;
TRACE("%d\n", arg);
- V_VT(&v) = VT_I4; - V_I4(&v) = arg; - return stack_push(ctx, &v); -} - -static HRESULT interp_short(exec_ctx_t *ctx) -{ - const LONG arg = ctx->instr->arg1.lng; - VARIANT v; - - TRACE("%d\n", arg); - - V_VT(&v) = VT_I2; - V_I2(&v) = arg; + if(arg == (INT16)arg) { + V_VT(&v) = VT_I2; + V_I2(&v) = arg; + }else { + V_VT(&v) = VT_I4; + V_I4(&v) = arg; + } return stack_push(ctx, &v); }
@@ -2061,7 +2083,7 @@ static void release_exec(exec_ctx_t *ctx) heap_free(ctx->stack); }
-HRESULT exec_script(script_ctx_t *ctx, function_t *func, vbdisp_t *vbthis, DISPPARAMS *dp, VARIANT *res) +HRESULT exec_script(script_ctx_t *ctx, BOOL extern_caller, function_t *func, vbdisp_t *vbthis, DISPPARAMS *dp, VARIANT *res) { exec_ctx_t exec = {func->code_ctx}; vbsop_t op; @@ -2123,6 +2145,9 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func, vbdisp_t *vbthis, DISPP return E_OUTOFMEMORY; }
+ if(extern_caller) + IActiveScriptSite_OnEnterScript(ctx->site); + if(vbthis) { exec.this_obj = (IDispatch*)&vbthis->IDispatchEx_iface; exec.vbthis = vbthis; @@ -2141,7 +2166,15 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func, vbdisp_t *vbthis, DISPP op = exec.instr->op; hres = op_funcs[op](&exec); if(FAILED(hres)) { - ctx->err_number = hres = map_hres(hres); + if(hres != SCRIPT_E_RECORDED) { + clear_ei(&ctx->ei); + + ctx->ei.scode = hres = map_hres(hres); + ctx->ei.bstrSource = get_vbscript_string(VBS_RUNTIME_ERROR); + ctx->ei.bstrDescription = get_vbscript_error_string(hres); + }else { + hres = ctx->ei.scode; + }
if(exec.resume_next) { unsigned stack_off; @@ -2186,8 +2219,15 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func, vbdisp_t *vbthis, DISPP }
assert(!exec.top); - if(func->type != FUNC_FUNCTION && func->type != FUNC_PROPGET && func->type != FUNC_DEFGET) - assert(V_VT(&exec.ret_val) == VT_EMPTY); + + if(extern_caller) { + IActiveScriptSite_OnLeaveScript(ctx->site); + if(FAILED(hres)) { + if(!ctx->ei.scode) + ctx->ei.scode = hres; + hres = report_script_error(ctx); + } + }
if(SUCCEEDED(hres) && res) { *res = exec.ret_val; diff --git a/dll/win32/vbscript/lex.c b/dll/win32/vbscript/lex.c index 571854db58e..26b3d45a727 100644 --- a/dll/win32/vbscript/lex.c +++ b/dll/win32/vbscript/lex.c @@ -16,11 +16,13 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" -#include "wine/port.h" - +#ifdef __REACTOS__ +#include <wine/config.h> +#include <wine/port.h> +#endif #include <assert.h> #include <limits.h> +#include <math.h>
#include "vbscript.h" #include "parse.h" @@ -153,17 +155,17 @@ static const struct {
static inline BOOL is_identifier_char(WCHAR c) { - return isalnumW(c) || c == '_'; + return iswalnum(c) || c == '_'; }
-static int check_keyword(parser_ctx_t *ctx, const WCHAR *word) +static int check_keyword(parser_ctx_t *ctx, const WCHAR *word, const WCHAR **lval) { const WCHAR *p1 = ctx->ptr; const WCHAR *p2 = word; WCHAR c;
while(p1 < ctx->end && *p2) { - c = tolowerW(*p1); + c = towlower(*p1); if(c != *p2) return c - *p2; p1++; @@ -174,17 +176,18 @@ static int check_keyword(parser_ctx_t *ctx, const WCHAR *word) return 1;
ctx->ptr = p1; + *lval = word; return 0; }
-static int check_keywords(parser_ctx_t *ctx) +static int check_keywords(parser_ctx_t *ctx, const WCHAR **lval) { int min = 0, max = ARRAY_SIZE(keywords)-1, r, i;
while(min <= max) { i = (min+max)/2;
- r = check_keyword(ctx, keywords[i].word); + r = check_keyword(ctx, keywords[i].word, lval); if(!r) return keywords[i].token;
@@ -224,7 +227,7 @@ static int parse_string_literal(parser_ctx_t *ctx, const WCHAR **ret) int len = 0;
while(ctx->ptr < ctx->end) { - if(*ctx->ptr == '\n') { + if(*ctx->ptr == '\n' || *ctx->ptr == '\r') { FIXME("newline inside string literal\n"); return 0; } @@ -270,7 +273,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) if(*ctx->ptr == '0' && !('0' <= ctx->ptr[1] && ctx->ptr[1] <= '9') && ctx->ptr[1] != '.') return *ctx->ptr++;
- while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { + while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) { hlp = d*10 + *(ctx->ptr++) - '0'; if(d>MAXLONGLONG/10 || hlp<0) { exp++; @@ -279,7 +282,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) else d = hlp; } - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { + while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) { exp++; ctx->ptr++; } @@ -288,7 +291,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) use_int = FALSE; ctx->ptr++;
- while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { + while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) { hlp = d*10 + *(ctx->ptr++) - '0'; if(d>MAXLONGLONG/10 || hlp<0) break; @@ -296,19 +299,22 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) d = hlp; exp--; } - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) + while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) ctx->ptr++; }
if(*ctx->ptr == 'e' || *ctx->ptr == 'E') { int e = 0, sign = 1;
- if(*++ctx->ptr == '-') { + ctx->ptr++; + if(*ctx->ptr == '-') { ctx->ptr++; sign = -1; + }else if(*ctx->ptr == '+') { + ctx->ptr++; }
- if(!isdigitW(*ctx->ptr)) { + if(!iswdigit(*ctx->ptr)) { FIXME("Invalid numeric literal\n"); return 0; } @@ -319,7 +325,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) e = e*10 + *(ctx->ptr++) - '0'; if(sign == -1 && -e+exp < -(INT_MAX/100)) { /* The literal will be rounded to 0 anyway. */ - while(isdigitW(*ctx->ptr)) + while(iswdigit(*ctx->ptr)) ctx->ptr++; *(double*)ret = 0; return tDouble; @@ -329,15 +335,14 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) FIXME("Invalid numeric literal\n"); return 0; } - } while(isdigitW(*ctx->ptr)); + } while(iswdigit(*ctx->ptr));
exp += sign*e; }
if(use_int && (LONG)d == d) { - LONG l = d; - *(LONG*)ret = l; - return (short)l == l ? tShort : tLong; + *(LONG*)ret = d; + return tInt; }
r = exp>=0 ? d*pow(10, exp) : d/pow(10, -exp); @@ -378,7 +383,7 @@ static int parse_hex_literal(parser_ctx_t *ctx, LONG *ret) ctx->ptr++;
*ret = l; - return (short)l == l ? tShort : tLong; + return tInt; }
static void skip_spaces(parser_ctx_t *ctx) @@ -390,7 +395,7 @@ static void skip_spaces(parser_ctx_t *ctx) static int comment_line(parser_ctx_t *ctx) { static const WCHAR newlineW[] = {'\n','\r',0}; - ctx->ptr = strpbrkW(ctx->ptr, newlineW); + ctx->ptr = wcspbrk(ctx->ptr, newlineW); if(ctx->ptr) ctx->ptr++; else @@ -411,8 +416,8 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx) if('0' <= c && c <= '9') return parse_numeric_literal(ctx, lval);
- if(isalphaW(c)) { - int ret = check_keywords(ctx); + if(iswalpha(c)) { + int ret = check_keywords(ctx, lval); if(!ret) return parse_identifier(ctx, lval); if(ret != tREM) @@ -492,15 +497,24 @@ int parser_lex(void *lval, parser_ctx_t *ctx) { int ret;
+ if (ctx->last_token == tEXPRESSION) + { + ctx->last_token = tNL; + return tEXPRESSION; + } + while(1) { ret = parse_next_token(lval, ctx); if(ret == '_') { skip_spaces(ctx); - if(*ctx->ptr != '\n') { + if(*ctx->ptr != '\n' && *ctx->ptr != '\r') { FIXME("'_' not followed by newline\n"); return 0; } - ctx->ptr++; + if(*ctx->ptr == '\r') + ctx->ptr++; + if(*ctx->ptr == '\n') + ctx->ptr++; continue; } if(ret != tNL || ctx->last_token != tNL) diff --git a/dll/win32/vbscript/parse.h b/dll/win32/vbscript/parse.h index 1fc2650748e..6e5188c8c5e 100644 --- a/dll/win32/vbscript/parse.h +++ b/dll/win32/vbscript/parse.h @@ -34,6 +34,7 @@ typedef enum { EXPR_GTEQ, EXPR_IDIV, EXPR_IMP, + EXPR_INT, EXPR_IS, EXPR_LT, EXPR_LTEQ, @@ -51,8 +52,6 @@ typedef enum { EXPR_OR, EXPR_STRING, EXPR_SUB, - EXPR_ULONG, - EXPR_USHORT, EXPR_XOR } expression_type_t;
@@ -121,7 +120,8 @@ typedef enum { STAT_STOP, STAT_UNTIL, STAT_WHILE, - STAT_WHILELOOP + STAT_WHILELOOP, + STAT_RETVAL } statement_type_t;
typedef struct _statement_t { @@ -251,6 +251,11 @@ typedef struct { case_clausule_t *case_clausules; } select_statement_t;
+typedef struct { + statement_t stat; + expression_t *expr; +} retval_statement_t; + typedef struct { const WCHAR *code; const WCHAR *ptr; @@ -271,7 +276,7 @@ typedef struct { heap_pool_t heap; } parser_ctx_t;
-HRESULT parse_script(parser_ctx_t*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN; +HRESULT parse_script(parser_ctx_t*,const WCHAR*,const WCHAR*,DWORD) DECLSPEC_HIDDEN; void parser_release(parser_ctx_t*) DECLSPEC_HIDDEN; int parser_lex(void*,parser_ctx_t*) DECLSPEC_HIDDEN; void *parser_alloc(parser_ctx_t*,size_t) DECLSPEC_HIDDEN; diff --git a/dll/win32/vbscript/parser.tab.c b/dll/win32/vbscript/parser.tab.c index af2c0448591..cc702c598a9 100644 --- a/dll/win32/vbscript/parser.tab.c +++ b/dll/win32/vbscript/parser.tab.c @@ -1,8 +1,9 @@ -/* A Bison parser, made by GNU Bison 3.0. */ +/* A Bison parser, made by GNU Bison 3.4.1. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 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 @@ -40,11 +41,14 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */
+/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + /* Identify Bison output. */ #define YYBISON 1
/* Bison version. */ -#define YYBISON_VERSION "3.0" +#define YYBISON_VERSION "3.4.1"
/* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -67,8 +71,8 @@ #define yynerrs parser_nerrs
-/* Copy the first part of user declarations. */ -#line 19 "parser.y" /* yacc.c:339 */ +/* First part of user prologue. */ +#line 19 "parser.y"
#include "vbscript.h" @@ -81,6 +85,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(vbscript); static int parser_error(parser_ctx_t *,const char*);
static void parse_complete(parser_ctx_t*,BOOL); +static void handle_isexpression_script(parser_ctx_t *ctx, expression_t *expr);
static void source_add_statement(parser_ctx_t*,statement_t*); static void source_add_class(parser_ctx_t*,class_decl_t*); @@ -124,21 +129,23 @@ static class_decl_t *add_dim_prop(parser_ctx_t*,class_decl_t*,dim_decl_t*,unsign
static statement_t *link_statements(statement_t*,statement_t*);
-static const WCHAR propertyW[] = {'p','r','o','p','e','r','t','y',0}; - #define STORAGE_IS_PRIVATE 1 #define STORAGE_IS_DEFAULT 2
#define CHECK_ERROR if(((parser_ctx_t*)ctx)->hres != S_OK) YYABORT
-#line 136 "parser.tab.c" /* yacc.c:339 */ +#line 139 "parser.tab.c"
-# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif # else -# define YY_NULL 0 +# define YY_NULLPTR ((void*)0) # endif # endif
@@ -150,8 +157,8 @@ static const WCHAR propertyW[] = {'p','r','o','p','e','r','t','y',0}; # define YYERROR_VERBOSE 0 #endif
-/* In a future release of Bison, this section will be replaced - by #include "parser.tab.h". */ +/* Use api.header.include to #include this header + instead of duplicating it here. */ #ifndef YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_VBSCRIPT_PARSER_TAB_H_INCLUDED # define YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_VBSCRIPT_PARSER_TAB_H_INCLUDED /* Debug traces. */ @@ -167,83 +174,82 @@ extern int parser_debug; # define YYTOKENTYPE enum yytokentype { - tEOF = 258, - tNL = 259, - tREM = 260, + tEXPRESSION = 258, + tEOF = 259, + tNL = 260, tEMPTYBRACKETS = 261, - tTRUE = 262, - tFALSE = 263, - tNOT = 264, - tAND = 265, - tOR = 266, - tXOR = 267, - tEQV = 268, - tIMP = 269, - tNEQ = 270, - tIS = 271, - tLTEQ = 272, - tGTEQ = 273, - tMOD = 274, - tCALL = 275, - tDIM = 276, - tSUB = 277, - tFUNCTION = 278, - tPROPERTY = 279, - tGET = 280, - tLET = 281, - tCONST = 282, - tIF = 283, - tELSE = 284, - tELSEIF = 285, - tEND = 286, - tTHEN = 287, - tEXIT = 288, - tWHILE = 289, - tWEND = 290, - tDO = 291, - tLOOP = 292, - tUNTIL = 293, - tFOR = 294, - tTO = 295, - tSTEP = 296, - tEACH = 297, - tIN = 298, - tSELECT = 299, - tCASE = 300, - tBYREF = 301, - tBYVAL = 302, - tOPTION = 303, - tEXPLICIT = 304, - tSTOP = 305, - tNOTHING = 306, - tEMPTY = 307, - tNULL = 308, - tCLASS = 309, - tSET = 310, - tNEW = 311, - tPUBLIC = 312, - tPRIVATE = 313, - tDEFAULT = 314, - tME = 315, - tERROR = 316, - tNEXT = 317, - tON = 318, - tRESUME = 319, - tGOTO = 320, - tIdentifier = 321, - tString = 322, - tLong = 323, - tShort = 324, + tLTEQ = 262, + tGTEQ = 263, + tNEQ = 264, + tSTOP = 265, + tME = 266, + tREM = 267, + tTRUE = 268, + tFALSE = 269, + tNOT = 270, + tAND = 271, + tOR = 272, + tXOR = 273, + tEQV = 274, + tIMP = 275, + tIS = 276, + tMOD = 277, + tCALL = 278, + tDIM = 279, + tSUB = 280, + tFUNCTION = 281, + tGET = 282, + tLET = 283, + tCONST = 284, + tIF = 285, + tELSE = 286, + tELSEIF = 287, + tEND = 288, + tTHEN = 289, + tEXIT = 290, + tWHILE = 291, + tWEND = 292, + tDO = 293, + tLOOP = 294, + tUNTIL = 295, + tFOR = 296, + tTO = 297, + tEACH = 298, + tIN = 299, + tSELECT = 300, + tCASE = 301, + tBYREF = 302, + tBYVAL = 303, + tOPTION = 304, + tNOTHING = 305, + tEMPTY = 306, + tNULL = 307, + tCLASS = 308, + tSET = 309, + tNEW = 310, + tPUBLIC = 311, + tPRIVATE = 312, + tNEXT = 313, + tON = 314, + tRESUME = 315, + tGOTO = 316, + tIdentifier = 317, + tString = 318, + tDEFAULT = 319, + tERROR = 320, + tEXPLICIT = 321, + tPROPERTY = 322, + tSTEP = 323, + tInt = 324, tDouble = 325 }; #endif
/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 88 "parser.y" /* yacc.c:355 */ +#line 87 "parser.y"
const WCHAR *string; statement_t *statement; @@ -258,12 +264,14 @@ union YYSTYPE const_decl_t *const_decl; case_clausule_t *case_clausule; unsigned uint; - LONG lng; + LONG integer; BOOL boolean; double dbl;
-#line 266 "parser.tab.c" /* yacc.c:355 */ +#line 272 "parser.tab.c" + }; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif @@ -274,9 +282,7 @@ int parser_parse (parser_ctx_t *ctx);
#endif /* !YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_VBSCRIPT_PARSER_TAB_H_INCLUDED */
-/* Copy the second part of user declarations. */
-#line 280 "parser.tab.c" /* yacc.c:358 */
#ifdef short # undef short @@ -297,13 +303,13 @@ typedef signed char yytype_int8; #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else -typedef unsigned short int yytype_uint16; +typedef unsigned short yytype_uint16; #endif
#ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else -typedef short int yytype_int16; +typedef short yytype_int16; #endif
#ifndef YYSIZE_T @@ -315,7 +321,7 @@ typedef short int yytype_int16; # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else -# define YYSIZE_T unsigned int +# define YYSIZE_T unsigned # endif #endif
@@ -333,14 +339,24 @@ typedef short int yytype_int16; # endif #endif
-#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if (! defined __GNUC__ || __GNUC__ < 2 \ - || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) -# define __attribute__(Spec) /* empty */ +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ # endif #endif
+#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -348,7 +364,7 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ @@ -368,6 +384,8 @@ typedef short int yytype_int16; #endif
+#define YY_ASSERT(E) ((void) (0 && (E))) + #if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -497,29 +515,29 @@ union yyalloc #endif /* !YYCOPY_NEEDED */
/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 5 +#define YYFINAL 48 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 944 +#define YYLAST 1153
/* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 87 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 60 +#define YYNNTS 63 /* YYNRULES -- Number of rules. */ -#define YYNRULES 169 +#define YYNRULES 232 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 343 +#define YYNSTATES 405
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 325
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ + as returned by yylex. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -561,23 +579,30 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 147, 147, 150, 151, 153, 155, 156, 159, 160, - 163, 164, 167, 170, 171, 172, 173, 174, 177, 178, - 179, 181, 182, 183, 185, 188, 191, 192, 193, 194, - 195, 196, 197, 198, 200, 201, 202, 203, 204, 206, - 208, 212, 213, 216, 217, 220, 221, 222, 225, 226, - 229, 230, 233, 236, 237, 240, 241, 244, 245, 248, - 250, 251, 254, 256, 259, 260, 263, 264, 267, 271, - 272, 275, 276, 277, 281, 282, 285, 286, 289, 290, - 291, 293, 295, 298, 299, 302, 303, 306, 307, 310, - 311, 314, 315, 318, 319, 322, 323, 326, 327, 328, - 329, 330, 331, 332, 333, 336, 337, 340, 341, 342, - 345, 346, 349, 350, 354, 355, 357, 361, 362, 365, - 366, 367, 368, 371, 372, 375, 376, 377, 378, 379, - 380, 381, 384, 385, 386, 387, 390, 391, 392, 395, - 396, 399, 402, 403, 405, 407, 408, 411, 413, 415, - 419, 421, 425, 426, 429, 430, 431, 434, 435, 438, - 439, 442, 443, 444, 448, 449, 453, 454, 455, 456 + 0, 148, 148, 149, 152, 153, 156, 157, 158, 161, + 162, 165, 166, 167, 170, 171, 174, 175, 178, 181, + 182, 183, 184, 185, 188, 189, 190, 192, 193, 194, + 196, 199, 202, 203, 204, 205, 206, 207, 208, 209, + 211, 212, 213, 214, 215, 217, 219, 223, 224, 227, + 228, 231, 232, 233, 236, 237, 240, 241, 244, 247, + 248, 251, 252, 255, 256, 259, 261, 262, 266, 267, + 270, 271, 274, 275, 278, 282, 283, 286, 287, 288, + 292, 293, 296, 297, 300, 301, 302, 305, 306, 309, + 310, 313, 314, 317, 318, 321, 322, 325, 326, 329, + 330, 333, 334, 337, 338, 339, 340, 341, 342, 343, + 344, 347, 348, 351, 352, 353, 356, 357, 360, 361, + 365, 366, 368, 372, 373, 376, 377, 378, 379, 380, + 383, 384, 387, 388, 389, 390, 391, 392, 393, 396, + 397, 398, 401, 402, 405, 406, 409, 412, 413, 414, + 416, 418, 420, 421, 422, 423, 426, 428, 430, 434, + 436, 440, 441, 444, 445, 446, 449, 450, 453, 454, + 457, 458, 459, 463, 464, 465, 466, 467, 468, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 525, + 526, 527, 528 }; #endif
@@ -586,23 +611,24 @@ static const yytype_uint16 yyrline[] = First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "tEOF", "tNL", "tREM", "tEMPTYBRACKETS", - "tTRUE", "tFALSE", "tNOT", "tAND", "tOR", "tXOR", "tEQV", "tIMP", "tNEQ", - "tIS", "tLTEQ", "tGTEQ", "tMOD", "tCALL", "tDIM", "tSUB", "tFUNCTION", - "tPROPERTY", "tGET", "tLET", "tCONST", "tIF", "tELSE", "tELSEIF", "tEND", - "tTHEN", "tEXIT", "tWHILE", "tWEND", "tDO", "tLOOP", "tUNTIL", "tFOR", - "tTO", "tSTEP", "tEACH", "tIN", "tSELECT", "tCASE", "tBYREF", "tBYVAL", - "tOPTION", "tEXPLICIT", "tSTOP", "tNOTHING", "tEMPTY", "tNULL", "tCLASS", - "tSET", "tNEW", "tPUBLIC", "tPRIVATE", "tDEFAULT", "tME", "tERROR", - "tNEXT", "tON", "tRESUME", "tGOTO", "tIdentifier", "tString", "tLong", - "tShort", "tDouble", "':'", "'='", "'0'", "'.'", "','", "'('", "')'", - "'-'", "'>'", "'<'", "'&'", "'+'", "'\\'", "'*'", "'/'", "'^'", - "$accept", "Program", "OptionExplicit_opt", "SourceElements", - "StatementsNl_opt", "StatementsNl", "StatementNl", "Statement", - "SimpleStatement", "MemberExpression", "DimDeclList", "DimDecl", - "DimList", "ConstDeclList", "ConstDecl", "ConstExpression", "DoType", - "Step_opt", "IfStatement", "EndIf_opt", "ElseIfs_opt", "ElseIfs", - "ElseIf", "Else_opt", "CaseClausules", "Arguments_opt", + "$end", "error", "$undefined", "tEXPRESSION", "tEOF", "tNL", + "tEMPTYBRACKETS", "tLTEQ", "tGTEQ", "tNEQ", "tSTOP", "tME", "tREM", + "tTRUE", "tFALSE", "tNOT", "tAND", "tOR", "tXOR", "tEQV", "tIMP", "tIS", + "tMOD", "tCALL", "tDIM", "tSUB", "tFUNCTION", "tGET", "tLET", "tCONST", + "tIF", "tELSE", "tELSEIF", "tEND", "tTHEN", "tEXIT", "tWHILE", "tWEND", + "tDO", "tLOOP", "tUNTIL", "tFOR", "tTO", "tEACH", "tIN", "tSELECT", + "tCASE", "tBYREF", "tBYVAL", "tOPTION", "tNOTHING", "tEMPTY", "tNULL", + "tCLASS", "tSET", "tNEW", "tPUBLIC", "tPRIVATE", "tNEXT", "tON", + "tRESUME", "tGOTO", "tIdentifier", "tString", "tDEFAULT", "tERROR", + "tEXPLICIT", "tPROPERTY", "tSTEP", "tInt", "tDouble", "':'", "'='", + "'0'", "'.'", "','", "'('", "')'", "'-'", "'>'", "'<'", "'&'", "'+'", + "'\\'", "'*'", "'/'", "'^'", "$accept", "Program", + "OptionExplicit_opt", "SourceElements", "ExpressionNl_opt", + "BodyStatements", "StatementsNl_opt", "StatementsNl", "StatementNl", + "Statement", "SimpleStatement", "MemberExpression", "DimDeclList", + "DimDecl", "DimList", "ConstDeclList", "ConstDecl", "ConstExpression", + "DoType", "Step_opt", "IfStatement", "EndIf_opt", "ElseIfs_opt", + "ElseIfs", "ElseIf", "Else_opt", "CaseClausules", "Arguments_opt", "ArgumentList_opt", "ArgumentList", "EmptyBrackets_opt", "ExpressionList", "Expression", "EqvExpression", "XorExpression", "OrExpression", "AndExpression", "NotExpression", "EqualityExpression", @@ -612,7 +638,7 @@ static const char *const yytname[] = "NumericLiteralExpression", "IntegerValue", "PrimaryExpression", "ClassDeclaration", "ClassBody", "PropertyDecl", "FunctionDecl", "Storage_opt", "Storage", "ArgumentsDecl_opt", "ArgumentDeclList", - "ArgumentDecl", "Identifier", "StSep", YY_NULL + "ArgumentDecl", "Identifier", "DotIdentifier", "StSep", YY_NULLPTR }; #endif
@@ -633,12 +659,12 @@ static const yytype_uint16 yytoknum[] = }; # endif
-#define YYPACT_NINF -205 +#define YYPACT_NINF -294
#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-205))) + (!!((Yystate) == (-294)))
-#define YYTABLE_NINF -153 +#define YYTABLE_NINF -162
#define yytable_value_is_error(Yytable_value) \ 0 @@ -647,41 +673,47 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - -12, -8, 47, -205, 22, -205, 346, 22, 22, -205, - -205, 34, 35, -205, 35, 537, 134, 537, 12, 32, - 60, -205, 35, 34, -10, -205, -205, 65, -205, 639, - 537, -205, 57, 2, 427, -205, 85, -205, -205, -205, - 109, -205, -205, -205, -205, 4, -205, 33, 5, -205, - 46, 81, -205, -205, 537, -205, -205, -205, 35, -205, - -205, -205, -205, -205, 571, 4, 16, 126, 155, 160, - 168, -205, 37, 117, 29, 181, 119, 79, 130, -205, - 85, -205, -205, -205, -205, -205, -205, -205, 18, -205, - -205, 537, 680, 35, 146, 537, 22, 4, -205, 121, - -205, 13, -205, 639, -205, 457, 457, 147, -205, -205, - 77, 0, 35, 35, 35, 457, 148, -205, 35, -205, - 111, 35, 601, -205, -205, -205, -205, 537, 387, 537, - 537, 537, 537, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 733, 18, - 183, -205, 639, 178, 537, 18, 8, 152, 165, 156, - -205, -205, -205, 151, 1, 537, 457, -205, 6, 6, - -205, -205, -205, -205, 154, 157, -205, 136, -205, -205, - 126, 639, 143, 155, 160, 168, -205, 117, 117, 117, - 117, 117, 117, 117, 29, 181, 181, 119, 79, 130, - 130, -205, 198, 680, 95, -205, 537, 28, 189, 35, - 204, 22, 22, 96, 170, 537, -205, -205, -205, 223, - -205, -3, -205, 22, 22, -205, 111, -205, 210, 868, - 214, -205, -205, 212, 537, 18, 537, 507, 221, 22, - 199, 8, 8, 70, 22, 223, 35, 35, 177, 180, - 253, 774, 774, -205, 537, 231, -205, 210, 230, -205, - -205, 223, 815, 71, 22, 22, 17, 219, 8, 22, - -205, -205, 201, 202, 206, 8, 253, 253, -205, -3, - -205, 234, 239, 19, 269, 243, -205, -205, 213, 537, - 22, 868, 639, 537, -205, -205, -205, 6, 200, 203, - -205, -205, -205, -205, 255, 257, 274, 774, 254, -205, - 223, 815, -205, 189, -205, 22, -3, -3, -205, -205, - 639, -205, -205, 222, -205, 774, 216, 220, -205, -205, - 250, 22, 22, 259, 774, 774, -205, 267, 268, 266, - 278, -205, -205 + 34, 617, -19, 50, -294, -294, -294, -294, 617, -294, + -294, -294, 166, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, 617, 660, 660, 30, 2, 16, 43, + 96, 51, 111, -294, 37, 53, -17, 110, 100, 41, + 65, -294, 119, -294, -294, -294, -294, 15, -294, 466, + -294, -294, 19, -294, -294, -294, -294, 545, -294, -294, + -294, 617, 617, 617, 617, 617, 660, 660, 660, 660, + 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, + 660, 1085, 15, 15, -294, -294, -294, 368, 166, 166, + 617, 117, 617, 20, 107, 163, 166, 368, 126, -294, + 149, 721, -294, 212, 152, 391, -294, 119, -294, -294, + 131, -294, -294, 545, 147, -8, 43, 96, 51, 111, + -294, 53, 53, 53, 53, 53, 53, 53, -17, 110, + 110, 100, 41, 65, 65, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, 2, + -294, 154, 11, -294, 160, 164, 18, -294, -294, -294, + -294, -294, 9, -294, -294, 617, 771, 166, 169, 617, + 15, 2, -294, 144, -294, -294, 721, 545, 172, -294, + -294, -32, 166, 166, -294, -294, 545, 171, 166, -294, + 68, 166, 116, 516, 821, 9, 199, -294, 721, 202, + 617, 9, 82, 175, 190, 176, -294, 4, 617, 13, + 13, -294, -294, -294, -294, 173, 177, -294, -16, -294, + -294, 721, 66, 216, 771, 142, -294, 617, 104, 211, + 166, 227, 15, 15, 85, 201, 617, -294, -294, 241, + 97, -294, 15, 15, -294, 68, -294, 234, 1021, 237, + -294, -294, 230, 617, 9, 617, 588, 238, 15, 221, + 82, 82, -5, 15, 241, 166, 166, 200, 203, 270, + 871, 871, -294, 617, 249, -294, 234, 248, -294, -294, + 241, 921, 7, 15, 15, 10, 239, 82, 15, -294, + -294, 224, 225, 226, 82, 270, 270, -294, 97, -294, + 250, 871, 212, 256, 113, 285, 258, -294, -294, 243, + 617, 15, 1021, 721, 617, -294, -294, -294, 13, 228, + 229, -294, -294, -294, -294, 267, -294, 271, 305, 971, + 283, -294, 241, 921, -294, 211, -294, 15, 97, 97, + -294, -294, 721, -294, -294, 257, -294, 871, 240, 242, + -294, -294, 281, 15, 15, 251, 871, 871, -294, 287, + 288, 255, 261, -294, -294 };
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -689,63 +721,71 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 3, 0, 0, 5, 0, 1, 152, 166, 167, 4, - 2, 0, 0, 165, 0, 0, 0, 0, 0, 0, - 0, 34, 0, 0, 155, 156, 140, 0, 164, 13, - 0, 6, 0, 15, 81, 22, 0, 123, 7, 27, - 0, 153, 41, 168, 169, 81, 21, 43, 45, 37, - 50, 0, 125, 126, 0, 131, 129, 130, 0, 127, - 134, 132, 135, 133, 0, 81, 0, 85, 87, 89, - 91, 93, 95, 97, 105, 107, 110, 112, 114, 117, - 120, 119, 128, 32, 30, 31, 28, 29, 0, 55, - 56, 0, 152, 0, 0, 0, 0, 81, 154, 0, - 14, 0, 12, 17, 82, 0, 0, 124, 18, 77, - 76, 78, 0, 0, 0, 0, 19, 74, 0, 47, - 0, 0, 0, 96, 121, 122, 124, 0, 152, 0, + 4, 9, 0, 0, 6, 145, 132, 133, 0, 138, + 136, 137, 0, 173, 134, 174, 175, 176, 177, 178, + 140, 141, 139, 0, 0, 0, 0, 87, 0, 91, + 93, 95, 97, 99, 101, 103, 111, 113, 116, 118, + 120, 123, 126, 125, 135, 130, 47, 0, 1, 161, + 102, 127, 0, 128, 129, 3, 88, 0, 131, 80, + 10, 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, 152, 0, - 0, 9, 10, 0, 0, 0, 152, 124, 0, 0, - 139, 16, 80, 0, 0, 0, 0, 42, 81, 81, - 44, 138, 136, 137, 0, 48, 51, 0, 52, 53, - 86, 8, 62, 88, 90, 92, 94, 99, 104, 103, - 102, 98, 100, 101, 106, 109, 108, 111, 113, 115, - 116, 118, 0, 152, 26, 11, 0, 0, 71, 0, - 0, 0, 0, 0, 153, 0, 35, 36, 75, 20, - 79, 0, 157, 0, 0, 46, 0, 54, 64, 152, - 0, 60, 23, 0, 0, 0, 0, 0, 0, 0, - 0, 152, 152, 0, 0, 33, 0, 0, 0, 159, - 81, 152, 152, 49, 0, 69, 65, 66, 62, 63, - 24, 25, 152, 57, 0, 0, 83, 0, 152, 0, - 146, 143, 0, 0, 0, 152, 81, 81, 158, 0, - 161, 0, 0, 0, 0, 0, 67, 61, 0, 0, - 0, 152, 8, 0, 40, 145, 141, 81, 0, 0, - 144, 162, 163, 160, 0, 0, 0, 152, 0, 39, - 58, 152, 72, 71, 84, 0, 0, 0, 150, 151, - 8, 70, 59, 0, 73, 152, 0, 0, 68, 38, - 0, 0, 0, 0, 152, 152, 147, 0, 0, 0, - 0, 148, 149 + 0, 0, 229, 230, 5, 2, 40, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 164, 165, + 0, 19, 7, 0, 21, 87, 28, 0, 8, 33, + 0, 162, 144, 0, 0, 84, 92, 94, 96, 98, + 100, 109, 108, 105, 110, 104, 106, 107, 112, 115, + 114, 117, 119, 121, 122, 124, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 179, 48, 231, 232, 87, + 27, 49, 51, 43, 56, 0, 0, 38, 36, 34, + 35, 37, 0, 61, 62, 0, 161, 0, 0, 0, + 0, 87, 163, 0, 20, 18, 23, 0, 131, 24, + 83, 82, 0, 0, 86, 81, 0, 25, 0, 53, + 0, 0, 0, 161, 161, 0, 0, 15, 16, 0, + 0, 0, 161, 131, 0, 0, 22, 0, 0, 87, + 87, 85, 50, 143, 142, 0, 54, 57, 0, 58, + 59, 14, 68, 0, 161, 32, 17, 0, 0, 77, + 0, 0, 154, 148, 0, 162, 0, 41, 42, 26, + 0, 166, 0, 0, 52, 0, 60, 70, 161, 0, + 66, 29, 0, 0, 0, 0, 0, 0, 152, 0, + 161, 161, 0, 150, 39, 0, 0, 0, 168, 87, + 161, 161, 55, 0, 75, 71, 72, 68, 69, 30, + 31, 161, 63, 0, 0, 89, 0, 161, 0, 155, + 149, 0, 0, 0, 161, 87, 87, 167, 0, 170, + 0, 161, 12, 0, 0, 0, 0, 73, 67, 0, + 0, 0, 161, 14, 0, 46, 153, 146, 87, 0, + 0, 151, 171, 172, 169, 0, 13, 0, 0, 161, + 0, 45, 64, 161, 78, 77, 90, 0, 0, 0, + 159, 160, 14, 76, 65, 0, 79, 161, 0, 0, + 74, 44, 0, 0, 0, 0, 161, 161, 156, 0, + 0, 0, 0, 157, 158 };
/* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -205, -205, -205, -205, -124, -148, 298, -26, -205, -6, - 188, 99, 83, 190, -205, -205, 106, -205, -205, 54, - -205, 58, -205, -205, 7, -25, -205, -21, -33, 20, - 135, 191, 193, 194, 192, -45, -205, 56, 185, 66, - 195, 182, 67, -56, -4, 211, 158, -205, -205, -205, - -204, -205, -138, -128, -87, -163, 53, -102, 48, 27 + -294, -294, -294, -294, -294, -293, -233, -231, -38, -85, + -294, -46, 101, 54, 40, 99, -294, -294, 69, -294, + -294, 23, -294, 22, -294, -294, -40, -99, -294, -103, + -96, -11, 3, 276, 282, 284, 290, 27, -294, 130, + 272, 102, 279, 269, 128, 39, 21, 120, 90, -294, + -294, -294, -268, -294, -229, -227, -199, -245, 25, -157, + -12, -294, 98 };
/* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 2, 3, 6, 150, 151, 152, 32, 33, 65, - 46, 47, 174, 49, 50, 178, 91, 290, 35, 231, - 255, 256, 257, 285, 238, 107, 108, 163, 117, 265, - 111, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 175, 37, 38, - 210, 211, 39, 40, 41, 223, 248, 249, 42, 9 + -1, 3, 4, 49, 26, 340, 236, 237, 238, 103, + 104, 27, 190, 191, 255, 193, 194, 259, 205, 351, + 106, 290, 314, 315, 316, 346, 297, 58, 219, 114, + 59, 324, 115, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 256, + 45, 108, 271, 272, 109, 110, 111, 282, 307, 308, + 46, 186, 84 };
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -753,285 +793,347 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 34, 110, 36, 100, 205, 45, 224, 36, 125, 123, - 104, 119, 104, 109, 127, 127, 7, 97, 212, 36, - 116, 13, 7, 34, 202, 36, 7, 127, 213, 209, - 127, 127, 127, 127, 43, 44, 1, 270, 271, -142, - 126, 4, 127, 246, 247, 92, 89, 5, 128, 98, - 90, 306, 133, 134, 135, 136, 13, 228, 13, 13, - 48, 102, 51, 28, 295, 24, 25, 94, 236, 214, - 96, 300, 157, 103, 93, 166, 166, 161, 160, 233, - 115, 120, 221, 8, 162, 127, 34, 186, 36, 8, - 160, 201, 293, 8, 26, 272, 273, 34, 28, 36, - 28, 28, 182, 212, 212, 95, 124, 141, 118, 137, - 30, 142, 289, 213, 213, 148, 138, 139, 113, 114, - 243, 121, 34, 156, 36, 274, 99, 281, 282, 89, - 212, 113, 114, 90, 315, 222, 222, 212, 288, 129, - 213, 153, 34, 312, 36, 220, 34, 213, 36, -74, - 66, -74, 88, 122, 214, 214, 83, 84, 85, 112, - 167, 168, 169, 145, 146, 101, 48, 130, 313, 51, - 86, 131, 229, 87, 230, 34, 203, 36, 132, 171, - 172, 214, 208, 321, 173, 158, 159, 323, 214, 187, - 188, 189, 190, 191, 192, 193, 328, 34, 140, 36, - 143, 330, 144, 258, 60, 61, 62, 195, 196, 63, - 337, 338, 199, 200, 326, 327, 147, 280, 154, 165, - 204, 206, -124, 34, 215, 36, 149, 216, 218, 217, - 155, 225, 226, 232, 237, 240, 244, 127, 241, 242, - 254, 164, 259, 301, 302, 34, 34, 36, 36, 260, - 251, 252, 267, 269, 278, 279, 34, 48, 36, 104, - 284, 230, 262, 294, 222, 304, 268, 297, 298, 250, - 305, 275, 299, 307, 308, 309, 316, 318, 320, 317, - 319, 333, 322, 336, 329, 34, 34, 36, 36, 207, - 341, 291, 292, 331, 276, 277, 296, 332, 339, 340, - 219, 34, 342, 36, 31, 34, 170, 36, 239, 253, - 234, 176, 287, 314, 34, 286, 36, 311, 180, 34, - 324, 36, 183, 185, 184, 194, 198, 250, 34, 34, - 36, 36, 303, 179, 0, 227, 0, 0, 197, 0, - 0, 235, 325, 0, 0, 0, 0, 0, 0, 10, - 245, 0, 0, 0, 0, 0, 0, 0, 334, 335, - 0, 0, 0, 0, 250, 250, 11, 12, 0, 261, - 13, 263, 266, 14, 15, 0, 0, 0, 0, 16, - 17, 0, 18, 0, 0, 19, 0, 0, 0, 283, - 20, 181, 0, 0, 0, 0, 21, 0, 0, 0, - 22, 23, 0, 24, 25, 0, 26, 11, 12, 27, - 0, 13, 28, 0, 14, 15, 0, 29, 0, 0, - 16, 17, 30, 18, 310, 0, 19, 0, 266, 0, - 0, 20, 0, 104, 52, 53, 54, 21, 0, 0, - 0, 0, 23, 0, 24, 25, 0, 26, 0, 0, - 27, 13, 0, 28, 0, 0, 0, 0, 29, 0, - 0, 0, 0, 30, 52, 53, 54, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 55, 56, - 57, 13, 0, 58, 0, 0, 0, 26, 0, 0, - 0, 0, 0, 28, 59, 60, 61, 62, 0, 0, - 63, 0, 105, 106, 0, 64, 0, 0, 55, 56, - 57, 0, 0, 58, 52, 53, 54, 26, 0, 0, - 0, 0, 0, 28, 59, 60, 61, 62, 0, 0, - 63, 13, 105, 30, 0, 64, 264, 0, 0, 0, - 0, 0, 0, 0, 52, 53, 54, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 55, 56, - 57, 13, 0, 58, 0, 0, 0, 26, 0, 0, - 0, 0, 0, 28, 59, 60, 61, 62, 52, 53, - 63, 0, 0, 30, 0, 64, 0, 0, 55, 56, - 57, 0, 0, 58, 0, 13, 0, 26, 0, 0, - 0, 0, 0, 28, 59, 60, 61, 62, 52, 53, - 63, 0, 0, 30, 0, 64, 0, 0, 0, 0, - 0, 0, 55, 56, 57, 0, 0, 58, 0, 0, - 0, 26, 0, 0, 0, 0, 0, 28, 59, 60, - 61, 62, 0, 0, 63, 0, 0, 30, 0, 64, - 0, 0, 55, 56, 57, 0, 0, 0, 0, 11, - 12, -152, -152, 13, 0, 0, 14, 15, 59, 60, - 61, 62, 16, 17, 63, 18, 0, 0, 19, 177, - 0, 0, 0, 20, 0, 0, 0, 0, 0, 21, - 0, 0, 0, 0, 23, 0, 24, 25, 0, 26, - 11, 12, 27, 0, 13, 28, 0, 14, 15, 0, - 29, 0, 0, 16, 17, 30, 18, -8, 0, 19, - 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 0, 23, 0, 24, 25, 0, - 26, 0, 0, 27, 0, 0, 28, 0, 0, 0, - 0, 29, 0, 11, 12, 0, 30, 13, 0, 0, - 14, 15, 0, 0, 0, 0, 16, 17, -8, 18, - 0, 0, 19, 0, 0, 0, 0, 20, 0, 0, - 0, 0, 0, 21, 0, 0, 0, 0, 23, 0, - 24, 25, 0, 26, 11, 12, 27, 0, 13, 28, - 0, 14, 15, 0, 29, -8, 0, 16, 17, 30, - 18, 0, 0, 19, 0, 0, 0, 0, 20, 0, - 0, 0, 0, 0, 21, 0, 0, 0, 0, 23, - 0, 24, 25, 0, 26, 11, 12, 27, 0, 13, - 28, 0, 14, 15, 0, 29, 0, 0, 16, 17, - 30, 18, 0, 0, 19, 0, 0, 0, 0, 20, - 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, - 23, 0, 24, 25, 0, 26, 0, -8, 27, 0, - 0, 28, 0, 0, 0, 0, 29, 0, 11, 12, - 0, 30, 13, 0, 0, 14, 15, 0, 0, 0, - 0, 16, 17, 0, 18, 0, 0, 19, 0, 0, - 0, 0, 20, 0, 0, 0, 0, 0, 21, 0, - 0, 0, 0, 23, 0, 24, 25, 0, 26, 0, - 0, 27, 0, 0, 28, 0, 0, 0, 0, 29, - 0, 0, 0, 0, 30 + 51, 263, 220, 105, 28, 283, 218, 266, 56, 221, + 224, 102, 61, 273, 82, 274, 214, 229, 343, 56, + 82, 60, 331, 332, 61, 82, 52, 61, 287, 61, + 61, 292, 329, 330, 55, 50, 61, 1, 61, 61, + -80, 189, -80, 275, 66, 67, 68, 47, 366, 333, + 48, 211, 233, 20, 21, 105, 203, 22, 69, 356, + 204, 74, 62, 53, 54, 75, 361, 226, 64, 185, + 107, 273, 273, 274, 274, 350, 192, 195, 57, 226, + 83, 112, 208, 2, 210, 354, 83, 230, 349, 280, + 227, 83, 120, 196, 392, 202, 112, 288, 273, 289, + 274, 275, 275, 399, 400, 273, 270, 274, 107, 70, + 222, 223, 243, 377, 63, -147, 71, 72, 107, 135, + 375, 374, 107, 251, 61, 78, 79, 65, 275, 6, + 7, 246, 76, 61, 73, 275, 383, 253, 98, 99, + 385, 254, 197, 198, 305, 306, 295, 368, 262, 390, + 207, 80, 302, 281, 281, 199, 222, 223, 200, 13, + 105, 15, 16, 17, 18, 19, 9, 10, 11, 13, + 105, 15, 16, 17, 18, 19, 129, 130, 203, 14, + 187, 188, 204, 77, 201, 20, 21, 105, 105, 22, + 212, 206, 105, 81, 258, 239, 121, 122, 123, 124, + 125, 126, 127, 317, 244, 245, 133, 134, 235, 209, + 249, 250, 241, 339, 213, 105, 192, 215, 105, 195, + 247, 388, 389, 216, 225, 342, 342, 107, 13, 228, + 15, 16, 17, 18, 19, 231, 232, 107, 265, 362, + 363, 240, 105, 268, 248, -131, 267, 276, 277, 278, + 284, 279, 285, 291, 107, 107, 342, 296, 192, 107, + 299, 61, 281, 303, 105, 105, 313, 318, 309, 319, + 294, 326, 341, 341, 328, 105, 56, 337, 338, 304, + 345, 289, 107, 365, 355, 107, 358, 359, 360, 367, + 369, 370, 380, 335, 336, 105, 320, 381, 322, 325, + 234, 371, 342, 341, 378, 379, 105, 105, 242, 107, + 382, 342, 342, 384, 395, 391, 344, 393, 398, 394, + 401, 402, 403, 105, 298, 312, 309, 105, 404, 252, + 257, 107, 107, 264, 293, 386, 105, 116, 347, 269, + 348, 105, 107, 376, 117, 128, 132, 118, 286, 341, + 105, 105, 260, 372, 119, 131, 0, 325, 341, 341, + 0, 0, 107, 364, 0, 0, 309, 309, 0, 0, + 300, 301, 0, 107, 107, 0, 0, 0, 0, 5, + 310, 311, 0, 0, 0, 0, 0, 0, 0, 0, + 107, 0, 321, 0, 107, 0, 327, 56, 0, 0, + 0, 334, 5, 107, 6, 7, 8, 0, 107, 0, + 0, 0, 0, 0, 0, 0, 0, 107, 107, 0, + 0, 352, 353, 0, 0, 0, 357, 0, 0, 0, + 13, 0, 15, 16, 17, 18, 19, 0, 0, 0, + 0, 9, 10, 11, 23, 0, 12, 0, 0, 373, + 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 0, 0, 22, 0, 113, 217, 0, 24, + 85, 0, 0, 25, 0, 387, 86, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, + 88, 396, 397, 0, 0, 89, 90, 0, 0, 0, + 0, 91, 92, 0, 93, 0, 0, 94, 0, 0, + 0, 95, 0, 0, 0, 0, 0, 0, 0, 96, + 97, 261, 98, 99, 0, 100, 86, 5, 13, 0, + 15, 16, 17, 18, 19, 0, 0, 101, 0, 87, + 88, 0, 23, 0, 0, 89, 90, 0, 0, 0, + 0, 91, 92, 0, 93, 0, 5, 94, 6, 7, + 8, 95, 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 98, 99, 0, 100, 0, 0, 13, 0, + 15, 16, 17, 18, 19, 0, 0, 101, 0, 0, + 0, 0, 23, 0, 0, 9, 10, 11, 0, 5, + 12, 6, 7, 8, 0, 0, 0, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 0, 0, 22, 323, + 113, 23, 0, 24, 0, 0, 0, 25, 5, 0, + 6, 7, 8, 0, 0, 0, 0, 0, 9, 10, + 11, 0, 0, 12, 0, 0, 0, 0, 0, 0, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 0, + 0, 22, 0, 0, 23, 0, 24, 9, 10, 11, + 25, 5, 12, 6, 7, 0, 0, 0, 0, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 0, 0, + 22, 0, 0, 23, 0, 24, 0, 0, 0, 25, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 9, 10, 11, 0, 0, 12, 0, 0, 0, 0, + 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 86, 5, 22, 0, 0, 23, 0, 24, 0, + 0, 0, 25, 0, 87, 88, -161, -161, 0, 0, + 89, 90, 0, 0, 0, 0, 91, 92, 0, 93, + 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, + 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, + 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, + 89, 90, 0, 0, 0, 0, 91, 92, 0, 93, + -14, 0, 94, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, + 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, + 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, + 89, 90, 0, 0, 0, 0, 91, 92, -14, 93, + 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, + 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, + 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, + 89, 90, 0, 0, -11, 0, 91, 92, 0, 93, + 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, + 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, + 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, + 89, 90, 0, 0, 0, 0, 91, 92, 0, 93, + 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 98, 99, -14, + 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, + 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, + 89, 90, 0, 0, -14, 0, 91, 92, 0, 93, + 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, + 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, + 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, + 89, 90, 0, 0, 0, 0, 91, 92, 0, 93, + 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, + 100, 0, 0, 13, 0, 15, 16, 17, 18, 19, + 0, 0, 101, 0, 0, 0, 0, 23, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 13, 0, 15, + 16, 17, 18, 19 };
static const yytype_int16 yycheck[] = { - 6, 34, 6, 29, 152, 11, 169, 11, 64, 54, - 6, 6, 6, 34, 14, 14, 4, 23, 156, 23, - 45, 24, 4, 29, 148, 29, 4, 14, 156, 21, - 14, 14, 14, 14, 7, 8, 48, 241, 242, 31, - 65, 49, 14, 46, 47, 18, 34, 0, 32, 59, - 38, 32, 15, 16, 17, 18, 24, 181, 24, 24, - 12, 4, 14, 66, 268, 57, 58, 19, 40, 156, - 22, 275, 97, 71, 42, 75, 75, 103, 77, 203, - 76, 76, 76, 71, 105, 14, 92, 132, 92, 71, - 77, 147, 75, 71, 60, 25, 26, 103, 66, 103, - 66, 66, 128, 241, 242, 45, 58, 78, 75, 72, - 76, 82, 41, 241, 242, 88, 79, 80, 22, 23, - 24, 75, 128, 96, 128, 55, 61, 251, 252, 34, - 268, 22, 23, 38, 297, 168, 169, 275, 262, 13, - 268, 93, 148, 291, 148, 166, 152, 275, 152, 72, - 15, 74, 17, 72, 241, 242, 22, 23, 24, 74, - 112, 113, 114, 84, 85, 30, 118, 12, 292, 121, - 36, 11, 29, 39, 31, 181, 149, 181, 10, 68, - 69, 268, 155, 307, 73, 64, 65, 311, 275, 133, - 134, 135, 136, 137, 138, 139, 320, 203, 81, 203, - 19, 325, 83, 229, 68, 69, 70, 141, 142, 73, - 334, 335, 145, 146, 316, 317, 86, 250, 72, 72, - 37, 43, 74, 229, 72, 229, 91, 62, 77, 73, - 95, 77, 75, 35, 45, 31, 66, 14, 211, 212, - 30, 106, 28, 276, 277, 251, 252, 251, 252, 37, - 223, 224, 31, 54, 77, 75, 262, 209, 262, 6, - 29, 31, 235, 44, 297, 31, 239, 66, 66, 221, - 31, 244, 66, 4, 31, 62, 76, 22, 4, 76, - 23, 31, 28, 24, 62, 291, 292, 291, 292, 154, - 24, 264, 265, 77, 246, 247, 269, 77, 31, 31, - 165, 307, 24, 307, 6, 311, 118, 311, 209, 226, - 204, 121, 258, 293, 320, 257, 320, 290, 127, 325, - 313, 325, 129, 131, 130, 140, 144, 279, 334, 335, - 334, 335, 279, 122, -1, 177, -1, -1, 143, -1, - -1, 206, 315, -1, -1, -1, -1, -1, -1, 3, - 215, -1, -1, -1, -1, -1, -1, -1, 331, 332, - -1, -1, -1, -1, 316, 317, 20, 21, -1, 234, - 24, 236, 237, 27, 28, -1, -1, -1, -1, 33, - 34, -1, 36, -1, -1, 39, -1, -1, -1, 254, - 44, 4, -1, -1, -1, -1, 50, -1, -1, -1, - 54, 55, -1, 57, 58, -1, 60, 20, 21, 63, - -1, 24, 66, -1, 27, 28, -1, 71, -1, -1, - 33, 34, 76, 36, 289, -1, 39, -1, 293, -1, - -1, 44, -1, 6, 7, 8, 9, 50, -1, -1, - -1, -1, 55, -1, 57, 58, -1, 60, -1, -1, - 63, 24, -1, 66, -1, -1, -1, -1, 71, -1, - -1, -1, -1, 76, 7, 8, 9, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, - 53, 24, -1, 56, -1, -1, -1, 60, -1, -1, - -1, -1, -1, 66, 67, 68, 69, 70, -1, -1, - 73, -1, 75, 76, -1, 78, -1, -1, 51, 52, - 53, -1, -1, 56, 7, 8, 9, 60, -1, -1, - -1, -1, -1, 66, 67, 68, 69, 70, -1, -1, - 73, 24, 75, 76, -1, 78, 29, -1, -1, -1, - -1, -1, -1, -1, 7, 8, 9, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, - 53, 24, -1, 56, -1, -1, -1, 60, -1, -1, - -1, -1, -1, 66, 67, 68, 69, 70, 7, 8, - 73, -1, -1, 76, -1, 78, -1, -1, 51, 52, - 53, -1, -1, 56, -1, 24, -1, 60, -1, -1, - -1, -1, -1, 66, 67, 68, 69, 70, 7, 8, - 73, -1, -1, 76, -1, 78, -1, -1, -1, -1, - -1, -1, 51, 52, 53, -1, -1, 56, -1, -1, - -1, 60, -1, -1, -1, -1, -1, 66, 67, 68, - 69, 70, -1, -1, 73, -1, -1, 76, -1, 78, - -1, -1, 51, 52, 53, -1, -1, -1, -1, 20, - 21, 22, 23, 24, -1, -1, 27, 28, 67, 68, - 69, 70, 33, 34, 73, 36, -1, -1, 39, 78, - -1, -1, -1, 44, -1, -1, -1, -1, -1, 50, - -1, -1, -1, -1, 55, -1, 57, 58, -1, 60, - 20, 21, 63, -1, 24, 66, -1, 27, 28, -1, - 71, -1, -1, 33, 34, 76, 36, 37, -1, 39, - -1, -1, -1, -1, 44, -1, -1, -1, -1, -1, - 50, -1, -1, -1, -1, 55, -1, 57, 58, -1, - 60, -1, -1, 63, -1, -1, 66, -1, -1, -1, - -1, 71, -1, 20, 21, -1, 76, 24, -1, -1, - 27, 28, -1, -1, -1, -1, 33, 34, 35, 36, - -1, -1, 39, -1, -1, -1, -1, 44, -1, -1, - -1, -1, -1, 50, -1, -1, -1, -1, 55, -1, - 57, 58, -1, 60, 20, 21, 63, -1, 24, 66, - -1, 27, 28, -1, 71, 31, -1, 33, 34, 76, - 36, -1, -1, 39, -1, -1, -1, -1, 44, -1, - -1, -1, -1, -1, 50, -1, -1, -1, -1, 55, - -1, 57, 58, -1, 60, 20, 21, 63, -1, 24, - 66, -1, 27, 28, -1, 71, -1, -1, 33, 34, - 76, 36, -1, -1, 39, -1, -1, -1, -1, 44, - -1, -1, -1, -1, -1, 50, -1, -1, -1, -1, - 55, -1, 57, 58, -1, 60, -1, 62, 63, -1, - -1, 66, -1, -1, -1, -1, 71, -1, 20, 21, - -1, 76, 24, -1, -1, 27, 28, -1, -1, -1, - -1, 33, 34, -1, 36, -1, -1, 39, -1, -1, - -1, -1, 44, -1, -1, -1, -1, -1, 50, -1, - -1, -1, -1, 55, -1, 57, 58, -1, 60, -1, - -1, 63, -1, -1, 66, -1, -1, -1, -1, 71, - -1, -1, -1, -1, 76 + 12, 234, 105, 49, 1, 250, 105, 238, 6, 105, + 113, 49, 20, 242, 5, 242, 101, 6, 311, 6, + 5, 5, 27, 28, 20, 5, 23, 20, 261, 20, + 20, 264, 300, 301, 4, 8, 20, 3, 20, 20, + 72, 87, 74, 242, 7, 8, 9, 66, 341, 54, + 0, 97, 34, 69, 70, 101, 36, 73, 21, 327, + 40, 78, 19, 24, 25, 82, 334, 75, 17, 81, + 49, 300, 301, 300, 301, 68, 88, 89, 76, 75, + 71, 77, 94, 49, 96, 75, 71, 76, 321, 76, + 189, 71, 65, 90, 387, 92, 77, 31, 327, 33, + 327, 300, 301, 396, 397, 334, 24, 334, 87, 72, + 25, 26, 211, 358, 18, 33, 79, 80, 97, 80, + 353, 352, 101, 226, 20, 84, 85, 16, 327, 13, + 14, 216, 22, 20, 81, 334, 369, 69, 56, 57, + 373, 73, 25, 26, 47, 48, 42, 34, 233, 382, + 43, 86, 67, 249, 250, 38, 25, 26, 41, 62, + 206, 64, 65, 66, 67, 68, 50, 51, 52, 62, + 216, 64, 65, 66, 67, 68, 74, 75, 36, 63, + 82, 83, 40, 83, 67, 69, 70, 233, 234, 73, + 64, 93, 238, 74, 78, 207, 66, 67, 68, 69, + 70, 71, 72, 288, 60, 61, 78, 79, 205, 46, + 222, 223, 209, 309, 65, 261, 228, 5, 264, 231, + 217, 378, 379, 71, 77, 310, 311, 206, 62, 75, + 64, 65, 66, 67, 68, 75, 72, 216, 39, 335, + 336, 72, 288, 240, 72, 74, 44, 72, 58, 73, + 77, 248, 75, 37, 233, 234, 341, 46, 270, 238, + 33, 20, 358, 62, 310, 311, 32, 30, 280, 39, + 267, 33, 310, 311, 53, 321, 6, 77, 75, 276, + 31, 33, 261, 33, 45, 264, 62, 62, 62, 33, + 5, 33, 25, 305, 306, 341, 293, 26, 295, 296, + 202, 58, 387, 341, 76, 76, 352, 353, 210, 288, + 5, 396, 397, 30, 33, 58, 313, 77, 67, 77, + 33, 33, 67, 369, 270, 285, 338, 373, 67, 228, + 231, 310, 311, 235, 265, 375, 382, 61, 316, 241, + 317, 387, 321, 354, 62, 73, 77, 63, 258, 387, + 396, 397, 232, 350, 64, 76, -1, 354, 396, 397, + -1, -1, 341, 338, -1, -1, 378, 379, -1, -1, + 272, 273, -1, 352, 353, -1, -1, -1, -1, 11, + 282, 283, -1, -1, -1, -1, -1, -1, -1, -1, + 369, -1, 294, -1, 373, -1, 298, 6, -1, -1, + -1, 303, 11, 382, 13, 14, 15, -1, 387, -1, + -1, -1, -1, -1, -1, -1, -1, 396, 397, -1, + -1, 323, 324, -1, -1, -1, 328, -1, -1, -1, + 62, -1, 64, 65, 66, 67, 68, -1, -1, -1, + -1, 50, 51, 52, 76, -1, 55, -1, -1, 351, + -1, -1, -1, 62, 63, 64, 65, 66, 67, 68, + 69, 70, -1, -1, 73, -1, 75, 76, -1, 78, + 4, -1, -1, 82, -1, 377, 10, 11, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 23, + 24, 393, 394, -1, -1, 29, 30, -1, -1, -1, + -1, 35, 36, -1, 38, -1, -1, 41, -1, -1, + -1, 45, -1, -1, -1, -1, -1, -1, -1, 53, + 54, 5, 56, 57, -1, 59, 10, 11, 62, -1, + 64, 65, 66, 67, 68, -1, -1, 71, -1, 23, + 24, -1, 76, -1, -1, 29, 30, -1, -1, -1, + -1, 35, 36, -1, 38, -1, 11, 41, 13, 14, + 15, 45, -1, -1, -1, -1, -1, -1, -1, -1, + 54, -1, 56, 57, -1, 59, -1, -1, 62, -1, + 64, 65, 66, 67, 68, -1, -1, 71, -1, -1, + -1, -1, 76, -1, -1, 50, 51, 52, -1, 11, + 55, 13, 14, 15, -1, -1, -1, 62, 63, 64, + 65, 66, 67, 68, 69, 70, -1, -1, 73, 31, + 75, 76, -1, 78, -1, -1, -1, 82, 11, -1, + 13, 14, 15, -1, -1, -1, -1, -1, 50, 51, + 52, -1, -1, 55, -1, -1, -1, -1, -1, -1, + 62, 63, 64, 65, 66, 67, 68, 69, 70, -1, + -1, 73, -1, -1, 76, -1, 78, 50, 51, 52, + 82, 11, 55, 13, 14, -1, -1, -1, -1, 62, + 63, 64, 65, 66, 67, 68, 69, 70, -1, -1, + 73, -1, -1, 76, -1, 78, -1, -1, -1, 82, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 50, 51, 52, -1, -1, 55, -1, -1, -1, -1, + -1, -1, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 10, 11, 73, -1, -1, 76, -1, 78, -1, + -1, -1, 82, -1, 23, 24, 25, 26, -1, -1, + 29, 30, -1, -1, -1, -1, 35, 36, -1, 38, + -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, + 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, + -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, + 29, 30, -1, -1, -1, -1, 35, 36, -1, 38, + 39, -1, 41, -1, -1, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, + 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, + -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, + 29, 30, -1, -1, -1, -1, 35, 36, 37, 38, + -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, + 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, + -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, + 29, 30, -1, -1, 33, -1, 35, 36, -1, 38, + -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, + 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, + -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, + 29, 30, -1, -1, -1, -1, 35, 36, -1, 38, + -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, 56, 57, 58, + 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, + -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, + 29, 30, -1, -1, 33, -1, 35, 36, -1, 38, + -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, + 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, + -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, + 29, 30, -1, -1, -1, -1, 35, 36, -1, 38, + -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, + 59, -1, -1, 62, -1, 64, 65, 66, 67, 68, + -1, -1, 71, -1, -1, -1, -1, 76, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, + 65, 66, 67, 68 };
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 48, 88, 89, 49, 0, 90, 4, 71, 146, - 3, 20, 21, 24, 27, 28, 33, 34, 36, 39, - 44, 50, 54, 55, 57, 58, 60, 63, 66, 71, - 76, 93, 94, 95, 96, 105, 131, 135, 136, 139, - 140, 141, 145, 146, 146, 96, 97, 98, 145, 100, - 101, 145, 7, 8, 9, 51, 52, 53, 56, 67, - 68, 69, 70, 73, 78, 96, 117, 118, 119, 120, + 0, 3, 49, 88, 89, 11, 13, 14, 15, 50, + 51, 52, 55, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 73, 76, 78, 82, 91, 98, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 22, 23, 24, 36, 39, 117, 34, - 38, 103, 146, 42, 145, 45, 145, 96, 59, 61, - 94, 117, 4, 71, 6, 75, 76, 112, 113, 114, - 115, 117, 74, 22, 23, 76, 112, 115, 75, 6, - 76, 75, 72, 122, 145, 130, 112, 14, 32, 13, - 12, 11, 10, 15, 16, 17, 18, 72, 79, 80, - 81, 78, 82, 19, 83, 84, 85, 86, 146, 117, - 91, 92, 93, 145, 72, 117, 146, 112, 64, 65, - 77, 94, 114, 114, 117, 72, 75, 145, 145, 145, - 97, 68, 69, 73, 99, 134, 100, 78, 102, 132, - 118, 4, 94, 119, 120, 121, 122, 124, 124, 124, - 124, 124, 124, 124, 125, 126, 126, 127, 128, 129, - 129, 130, 91, 146, 37, 92, 43, 117, 146, 21, - 137, 138, 139, 140, 141, 72, 62, 73, 77, 117, - 114, 76, 115, 142, 142, 77, 75, 133, 91, 29, - 31, 106, 35, 91, 103, 117, 40, 45, 111, 98, - 31, 146, 146, 24, 66, 117, 46, 47, 143, 144, - 145, 146, 146, 99, 30, 107, 108, 109, 94, 28, - 37, 117, 146, 117, 29, 116, 117, 31, 146, 54, - 137, 137, 25, 26, 55, 146, 145, 145, 77, 75, - 115, 91, 91, 117, 29, 110, 108, 106, 91, 41, - 104, 146, 146, 75, 44, 137, 146, 66, 66, 66, - 137, 115, 115, 143, 31, 31, 32, 4, 31, 62, - 117, 146, 92, 91, 116, 142, 76, 76, 22, 23, - 4, 91, 28, 91, 111, 146, 144, 144, 91, 62, - 91, 77, 77, 31, 146, 146, 24, 91, 91, 31, - 31, 24, 24 + 131, 132, 133, 134, 135, 137, 147, 66, 0, 90, + 124, 147, 119, 132, 132, 4, 6, 76, 114, 117, + 5, 20, 19, 18, 17, 16, 7, 8, 9, 21, + 72, 79, 80, 81, 78, 82, 22, 83, 84, 85, + 86, 74, 5, 71, 149, 4, 10, 23, 24, 29, + 30, 35, 36, 38, 41, 45, 53, 54, 56, 57, + 59, 71, 95, 96, 97, 98, 107, 133, 138, 141, + 142, 143, 77, 75, 116, 119, 120, 121, 122, 123, + 124, 126, 126, 126, 126, 126, 126, 126, 127, 128, + 128, 129, 130, 131, 131, 132, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 147, 148, 149, 149, 98, + 99, 100, 147, 102, 103, 147, 119, 25, 26, 38, + 41, 67, 119, 36, 40, 105, 149, 43, 147, 46, + 147, 98, 64, 65, 96, 5, 71, 76, 114, 115, + 116, 117, 25, 26, 116, 77, 75, 114, 75, 6, + 76, 75, 72, 34, 149, 119, 93, 94, 95, 147, + 72, 119, 149, 114, 60, 61, 96, 119, 72, 147, + 147, 116, 99, 69, 73, 101, 136, 102, 78, 104, + 134, 5, 96, 93, 149, 39, 94, 44, 119, 149, + 24, 139, 140, 141, 142, 143, 72, 58, 73, 119, + 76, 117, 144, 144, 77, 75, 135, 93, 31, 33, + 108, 37, 93, 105, 119, 42, 46, 113, 100, 33, + 149, 149, 67, 62, 119, 47, 48, 145, 146, 147, + 149, 149, 101, 32, 109, 110, 111, 96, 30, 39, + 119, 149, 119, 31, 118, 119, 33, 149, 53, 139, + 139, 27, 28, 54, 149, 147, 147, 77, 75, 117, + 92, 95, 96, 92, 119, 31, 112, 110, 108, 93, + 68, 106, 149, 149, 75, 45, 139, 149, 62, 62, + 62, 139, 117, 117, 145, 33, 92, 33, 34, 5, + 33, 58, 119, 149, 94, 93, 118, 144, 76, 76, + 25, 26, 5, 93, 30, 93, 113, 149, 146, 146, + 93, 58, 92, 77, 77, 33, 149, 149, 67, 92, + 92, 33, 33, 67, 67 };
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 87, 88, 89, 89, 90, 90, 90, 91, 91, - 92, 92, 93, 94, 94, 94, 94, 94, 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, 97, 97, 98, 98, 98, 99, 99, - 100, 100, 101, 102, 102, 103, 103, 104, 104, 105, - 105, 105, 106, 106, 107, 107, 108, 108, 109, 110, - 110, 111, 111, 111, 112, 112, 113, 113, 114, 114, - 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, - 119, 120, 120, 121, 121, 122, 122, 123, 123, 123, - 123, 123, 123, 123, 123, 124, 124, 125, 125, 125, - 126, 126, 127, 127, 128, 128, 128, 129, 129, 130, + 0, 87, 88, 88, 89, 89, 90, 90, 90, 91, + 91, 92, 92, 92, 93, 93, 94, 94, 95, 96, + 96, 96, 96, 96, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 98, 98, 99, + 99, 100, 100, 100, 101, 101, 102, 102, 103, 104, + 104, 105, 105, 106, 106, 107, 107, 107, 108, 108, + 109, 109, 110, 110, 111, 112, 112, 113, 113, 113, + 114, 114, 115, 115, 116, 116, 116, 117, 117, 118, + 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, + 123, 124, 124, 125, 125, 125, 125, 125, 125, 125, + 125, 126, 126, 127, 127, 127, 128, 128, 129, 129, 130, 130, 130, 131, 131, 132, 132, 132, 132, 132, - 132, 132, 133, 133, 133, 133, 134, 134, 134, 135, - 135, 136, 137, 137, 137, 137, 137, 138, 138, 138, - 139, 139, 140, 140, 141, 141, 141, 142, 142, 143, - 143, 144, 144, 144, 145, 145, 146, 146, 146, 146 + 133, 133, 134, 134, 134, 134, 134, 134, 134, 135, + 135, 135, 136, 136, 137, 137, 138, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 140, 140, 140, 141, + 141, 142, 142, 143, 143, 143, 144, 144, 145, 145, + 146, 146, 146, 147, 147, 147, 147, 147, 147, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 149, + 149, 149, 149 };
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { - 0, 2, 3, 0, 3, 0, 2, 2, 0, 1, - 1, 2, 2, 1, 2, 1, 3, 2, 2, 3, - 4, 2, 1, 5, 6, 6, 4, 1, 2, 2, - 2, 2, 2, 5, 1, 4, 4, 2, 10, 8, - 7, 1, 3, 1, 3, 1, 4, 2, 1, 3, - 1, 3, 3, 1, 2, 1, 1, 0, 2, 9, - 5, 7, 0, 2, 0, 1, 1, 2, 5, 0, - 3, 0, 4, 5, 1, 3, 1, 1, 1, 3, - 2, 0, 1, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 3, 1, 2, 1, 3, 3, - 3, 3, 3, 3, 3, 1, 3, 1, 3, 3, - 1, 3, 1, 3, 1, 3, 3, 1, 3, 1, - 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 1, 7, 0, 3, 4, 4, 3, 9, 11, 11, - 8, 8, 0, 1, 2, 1, 1, 1, 3, 1, - 3, 2, 3, 3, 1, 1, 1, 1, 2, 2 + 0, 2, 3, 3, 0, 3, 0, 2, 2, 0, + 2, 0, 1, 2, 0, 1, 1, 2, 2, 1, + 2, 1, 3, 2, 2, 3, 4, 2, 1, 5, + 6, 6, 4, 1, 2, 2, 2, 2, 2, 5, + 1, 4, 4, 2, 10, 8, 7, 1, 3, 1, + 3, 1, 4, 2, 1, 3, 1, 3, 3, 1, + 2, 1, 1, 0, 2, 9, 5, 7, 0, 2, + 0, 1, 1, 2, 5, 0, 3, 0, 4, 5, + 1, 3, 1, 1, 1, 3, 2, 0, 1, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 2, 1, 3, 3, 3, 3, 3, 3, + 3, 1, 3, 1, 3, 3, 1, 3, 1, 3, + 1, 3, 3, 1, 3, 1, 1, 2, 2, 2, + 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 7, 0, 1, 3, + 2, 4, 2, 4, 1, 3, 9, 11, 11, 8, + 8, 0, 1, 2, 1, 1, 1, 3, 1, 3, + 2, 3, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 2 };
@@ -1047,22 +1149,22 @@ static const yytype_uint8 yyr2[] =
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (ctx, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (ctx, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0)
/* Error token number */ #define YYTERROR 1 @@ -1102,38 +1204,38 @@ do { \ } while (0)
-/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/
static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) +yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) { - FILE *yyo = yyoutput; - YYUSE (yyo); + FILE *yyoutput = yyo; + YYUSE (yyoutput); YYUSE (ctx); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); + YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); }
-/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/
static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) +yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) { - YYFPRINTF (yyoutput, "%s %s (", + YYFPRINTF (yyo, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
- yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx); - YYFPRINTF (yyoutput, ")"); + yy_symbol_value_print (yyo, yytype, yyvaluep, ctx); + YYFPRINTF (yyo, ")"); }
/*------------------------------------------------------------------. @@ -1167,7 +1269,7 @@ do { \ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parser_ctx_t *ctx) { - unsigned long int yylno = yyrline[yyrule]; + unsigned long yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", @@ -1178,7 +1280,7 @@ yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parser_ctx_t * YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) + &yyvsp[(yyi + 1) - (yynrhs)] , ctx); YYFPRINTF (stderr, "\n"); } @@ -1282,7 +1384,10 @@ yytnamerr (char *yyres, const char *yystr) case '\': if (*++yyp != '\') goto do_not_strip_quotes; - /* Fall through. */ + else + goto append; + + append: default: if (yyres) yyres[yyn] = *yyp; @@ -1300,7 +1405,7 @@ yytnamerr (char *yyres, const char *yystr) if (! yyres) return yystrlen (yystr);
- return yystpcpy (yyres, yystr) - yyres; + return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); } # endif
@@ -1316,11 +1421,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULL; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1377,11 +1482,11 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else return 2; - yysize = yysize1; } } } @@ -1393,6 +1498,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, case N: \ yyformat = S; \ break + default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); @@ -1404,9 +1510,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
{ YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else return 2; - yysize = yysize1; }
if (*yymsg_alloc < yysize) @@ -1537,23 +1644,33 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate;
+ /*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | +| yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ - yynewstate: +yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++;
- yysetstate: - *yyssp = yystate; + +/*--------------------------------------------------------------------. +| yynewstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + *yyssp = (yytype_int16) yystate;
if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + goto yyexhaustedlab; +#else { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
-#ifdef yyoverflow +# if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into @@ -1569,14 +1686,10 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); - yyss = yyss1; yyvs = yyvs1; } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else +# else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; @@ -1592,35 +1705,33 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif -#endif /* no yyoverflow */
yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long) yystacksize));
if (yyss + yystacksize - 1 <= yyssp) YYABORT; } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
if (yystate == YYFINAL) YYACCEPT;
goto yybackup;
+ /*-----------. | yybackup. | `-----------*/ yybackup: - /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */
@@ -1678,7 +1789,6 @@ yybackup: YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate;
@@ -1693,7 +1803,7 @@ yydefault:
/*-----------------------------. -| yyreduce -- Do a reduction. | +| yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ @@ -1713,965 +1823,1345 @@ yyreduce: YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: -#line 147 "parser.y" /* yacc.c:1646 */ + case 2: +#line 148 "parser.y" { parse_complete(ctx, (yyvsp[-2].boolean)); } -#line 1720 "parser.tab.c" /* yacc.c:1646 */ +#line 1830 "parser.tab.c" break;
case 3: -#line 150 "parser.y" /* yacc.c:1646 */ - { (yyval.boolean) = FALSE; } -#line 1726 "parser.tab.c" /* yacc.c:1646 */ +#line 149 "parser.y" + { handle_isexpression_script(ctx, (yyvsp[-1].expression)); } +#line 1836 "parser.tab.c" break;
case 4: -#line 151 "parser.y" /* yacc.c:1646 */ - { (yyval.boolean) = TRUE; } -#line 1732 "parser.tab.c" /* yacc.c:1646 */ +#line 152 "parser.y" + { (yyval.boolean) = FALSE; } +#line 1842 "parser.tab.c" break;
- case 6: -#line 155 "parser.y" /* yacc.c:1646 */ - { source_add_statement(ctx, (yyvsp[0].statement)); } -#line 1738 "parser.tab.c" /* yacc.c:1646 */ + case 5: +#line 153 "parser.y" + { (yyval.boolean) = TRUE; } +#line 1848 "parser.tab.c" break;
case 7: -#line 156 "parser.y" /* yacc.c:1646 */ - { source_add_class(ctx, (yyvsp[0].class_decl)); } -#line 1744 "parser.tab.c" /* yacc.c:1646 */ +#line 157 "parser.y" + { source_add_statement(ctx, (yyvsp[0].statement)); } +#line 1854 "parser.tab.c" break;
case 8: -#line 159 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = NULL; } -#line 1750 "parser.tab.c" /* yacc.c:1646 */ +#line 158 "parser.y" + { source_add_class(ctx, (yyvsp[0].class_decl)); } +#line 1860 "parser.tab.c" break;
case 9: -#line 160 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].statement); } -#line 1756 "parser.tab.c" /* yacc.c:1646 */ +#line 161 "parser.y" + { (yyval.expression) = NULL; } +#line 1866 "parser.tab.c" break;
case 10: -#line 163 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].statement); } -#line 1762 "parser.tab.c" /* yacc.c:1646 */ +#line 162 "parser.y" + { (yyval.expression) = (yyvsp[-1].expression); } +#line 1872 "parser.tab.c" break;
case 11: -#line 164 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = link_statements((yyvsp[-1].statement), (yyvsp[0].statement)); } -#line 1768 "parser.tab.c" /* yacc.c:1646 */ +#line 165 "parser.y" + { (yyval.statement) = NULL; } +#line 1878 "parser.tab.c" break;
case 12: -#line 167 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[-1].statement); } -#line 1774 "parser.tab.c" /* yacc.c:1646 */ +#line 166 "parser.y" + { (yyval.statement) = (yyvsp[0].statement); } +#line 1884 "parser.tab.c" break;
case 13: -#line 170 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = NULL; } -#line 1780 "parser.tab.c" /* yacc.c:1646 */ +#line 167 "parser.y" + { (yyval.statement) = link_statements((yyvsp[-1].statement), (yyvsp[0].statement)); } +#line 1890 "parser.tab.c" break;
case 14: -#line 171 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].statement); } -#line 1786 "parser.tab.c" /* yacc.c:1646 */ +#line 170 "parser.y" + { (yyval.statement) = NULL; } +#line 1896 "parser.tab.c" break;
case 15: -#line 172 "parser.y" /* yacc.c:1646 */ +#line 171 "parser.y" { (yyval.statement) = (yyvsp[0].statement); } -#line 1792 "parser.tab.c" /* yacc.c:1646 */ +#line 1902 "parser.tab.c" break;
case 16: -#line 173 "parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].statement)->next = (yyvsp[0].statement); (yyval.statement) = (yyvsp[-2].statement); } -#line 1798 "parser.tab.c" /* yacc.c:1646 */ +#line 174 "parser.y" + { (yyval.statement) = (yyvsp[0].statement); } +#line 1908 "parser.tab.c" break;
case 17: -#line 174 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[-1].statement); } -#line 1804 "parser.tab.c" /* yacc.c:1646 */ +#line 175 "parser.y" + { (yyval.statement) = link_statements((yyvsp[-1].statement), (yyvsp[0].statement)); } +#line 1914 "parser.tab.c" break;
case 18: -#line 177 "parser.y" /* yacc.c:1646 */ - { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.statement) = new_call_statement(ctx, FALSE, (yyvsp[-1].member)); CHECK_ERROR; } -#line 1810 "parser.tab.c" /* yacc.c:1646 */ +#line 178 "parser.y" + { (yyval.statement) = (yyvsp[-1].statement); } +#line 1920 "parser.tab.c" break;
case 19: -#line 178 "parser.y" /* yacc.c:1646 */ - { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.statement) = new_call_statement(ctx, TRUE, (yyvsp[-1].member)); CHECK_ERROR; } -#line 1816 "parser.tab.c" /* yacc.c:1646 */ +#line 181 "parser.y" + { (yyval.statement) = NULL; } +#line 1926 "parser.tab.c" break;
case 20: -#line 180 "parser.y" /* yacc.c:1646 */ - { (yyvsp[-3].member)->args = (yyvsp[-2].expression); (yyval.statement) = new_assign_statement(ctx, (yyvsp[-3].member), (yyvsp[0].expression)); CHECK_ERROR; } -#line 1822 "parser.tab.c" /* yacc.c:1646 */ +#line 182 "parser.y" + { (yyval.statement) = (yyvsp[0].statement); } +#line 1932 "parser.tab.c" break;
case 21: -#line 181 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_dim_statement(ctx, (yyvsp[0].dim_decl)); CHECK_ERROR; } -#line 1828 "parser.tab.c" /* yacc.c:1646 */ +#line 183 "parser.y" + { (yyval.statement) = (yyvsp[0].statement); } +#line 1938 "parser.tab.c" break;
case 22: -#line 182 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].statement); } -#line 1834 "parser.tab.c" /* yacc.c:1646 */ +#line 184 "parser.y" + { (yyvsp[-2].statement)->next = (yyvsp[0].statement); (yyval.statement) = (yyvsp[-2].statement); } +#line 1944 "parser.tab.c" break;
case 23: -#line 184 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_while_statement(ctx, STAT_WHILE, (yyvsp[-3].expression), (yyvsp[-1].statement)); CHECK_ERROR; } -#line 1840 "parser.tab.c" /* yacc.c:1646 */ +#line 185 "parser.y" + { (yyval.statement) = (yyvsp[-1].statement); } +#line 1950 "parser.tab.c" break;
case 24: -#line 186 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_while_statement(ctx, (yyvsp[-4].boolean) ? STAT_WHILELOOP : STAT_UNTIL, (yyvsp[-3].expression), (yyvsp[-1].statement)); - CHECK_ERROR; } -#line 1847 "parser.tab.c" /* yacc.c:1646 */ +#line 188 "parser.y" + { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.statement) = new_call_statement(ctx, FALSE, (yyvsp[-1].member)); CHECK_ERROR; } +#line 1956 "parser.tab.c" break;
case 25: -#line 189 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_while_statement(ctx, (yyvsp[-1].boolean) ? STAT_DOWHILE : STAT_DOUNTIL, (yyvsp[0].expression), (yyvsp[-3].statement)); - CHECK_ERROR; } -#line 1854 "parser.tab.c" /* yacc.c:1646 */ +#line 189 "parser.y" + { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.statement) = new_call_statement(ctx, TRUE, (yyvsp[-1].member)); CHECK_ERROR; } +#line 1962 "parser.tab.c" break;
case 26: -#line 191 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_while_statement(ctx, STAT_DOWHILE, NULL, (yyvsp[-1].statement)); CHECK_ERROR; } -#line 1860 "parser.tab.c" /* yacc.c:1646 */ +#line 191 "parser.y" + { (yyvsp[-3].member)->args = (yyvsp[-2].expression); (yyval.statement) = new_assign_statement(ctx, (yyvsp[-3].member), (yyvsp[0].expression)); CHECK_ERROR; } +#line 1968 "parser.tab.c" break;
case 27: -#line 192 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_function_statement(ctx, (yyvsp[0].func_decl)); CHECK_ERROR; } -#line 1866 "parser.tab.c" /* yacc.c:1646 */ +#line 192 "parser.y" + { (yyval.statement) = new_dim_statement(ctx, (yyvsp[0].dim_decl)); CHECK_ERROR; } +#line 1974 "parser.tab.c" break;
case 28: -#line 193 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_statement(ctx, STAT_EXITDO, 0); CHECK_ERROR; } -#line 1872 "parser.tab.c" /* yacc.c:1646 */ +#line 193 "parser.y" + { (yyval.statement) = (yyvsp[0].statement); } +#line 1980 "parser.tab.c" break;
case 29: -#line 194 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_statement(ctx, STAT_EXITFOR, 0); CHECK_ERROR; } -#line 1878 "parser.tab.c" /* yacc.c:1646 */ +#line 195 "parser.y" + { (yyval.statement) = new_while_statement(ctx, STAT_WHILE, (yyvsp[-3].expression), (yyvsp[-1].statement)); CHECK_ERROR; } +#line 1986 "parser.tab.c" break;
case 30: -#line 195 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_statement(ctx, STAT_EXITFUNC, 0); CHECK_ERROR; } -#line 1884 "parser.tab.c" /* yacc.c:1646 */ +#line 197 "parser.y" + { (yyval.statement) = new_while_statement(ctx, (yyvsp[-4].boolean) ? STAT_WHILELOOP : STAT_UNTIL, (yyvsp[-3].expression), (yyvsp[-1].statement)); + CHECK_ERROR; } +#line 1993 "parser.tab.c" break;
case 31: -#line 196 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_statement(ctx, STAT_EXITPROP, 0); CHECK_ERROR; } -#line 1890 "parser.tab.c" /* yacc.c:1646 */ +#line 200 "parser.y" + { (yyval.statement) = new_while_statement(ctx, (yyvsp[-1].boolean) ? STAT_DOWHILE : STAT_DOUNTIL, (yyvsp[0].expression), (yyvsp[-3].statement)); + CHECK_ERROR; } +#line 2000 "parser.tab.c" break;
case 32: -#line 197 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_statement(ctx, STAT_EXITSUB, 0); CHECK_ERROR; } -#line 1896 "parser.tab.c" /* yacc.c:1646 */ +#line 202 "parser.y" + { (yyval.statement) = new_while_statement(ctx, STAT_DOWHILE, NULL, (yyvsp[-1].statement)); CHECK_ERROR; } +#line 2006 "parser.tab.c" break;
case 33: -#line 199 "parser.y" /* yacc.c:1646 */ - { (yyvsp[-3].member)->args = (yyvsp[-2].expression); (yyval.statement) = new_set_statement(ctx, (yyvsp[-3].member), (yyvsp[0].expression)); CHECK_ERROR; } -#line 1902 "parser.tab.c" /* yacc.c:1646 */ +#line 203 "parser.y" + { (yyval.statement) = new_function_statement(ctx, (yyvsp[0].func_decl)); CHECK_ERROR; } +#line 2012 "parser.tab.c" break;
case 34: -#line 200 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_statement(ctx, STAT_STOP, 0); CHECK_ERROR; } -#line 1908 "parser.tab.c" /* yacc.c:1646 */ +#line 204 "parser.y" + { (yyval.statement) = new_statement(ctx, STAT_EXITDO, 0); CHECK_ERROR; } +#line 2018 "parser.tab.c" break;
case 35: -#line 201 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_onerror_statement(ctx, TRUE); CHECK_ERROR; } -#line 1914 "parser.tab.c" /* yacc.c:1646 */ +#line 205 "parser.y" + { (yyval.statement) = new_statement(ctx, STAT_EXITFOR, 0); CHECK_ERROR; } +#line 2024 "parser.tab.c" break;
case 36: -#line 202 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_onerror_statement(ctx, FALSE); CHECK_ERROR; } -#line 1920 "parser.tab.c" /* yacc.c:1646 */ +#line 206 "parser.y" + { (yyval.statement) = new_statement(ctx, STAT_EXITFUNC, 0); CHECK_ERROR; } +#line 2030 "parser.tab.c" break;
case 37: -#line 203 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_const_statement(ctx, (yyvsp[0].const_decl)); CHECK_ERROR; } -#line 1926 "parser.tab.c" /* yacc.c:1646 */ +#line 207 "parser.y" + { (yyval.statement) = new_statement(ctx, STAT_EXITPROP, 0); CHECK_ERROR; } +#line 2036 "parser.tab.c" break;
case 38: -#line 205 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_forto_statement(ctx, (yyvsp[-8].string), (yyvsp[-6].expression), (yyvsp[-4].expression), (yyvsp[-3].expression), (yyvsp[-1].statement)); CHECK_ERROR; } -#line 1932 "parser.tab.c" /* yacc.c:1646 */ +#line 208 "parser.y" + { (yyval.statement) = new_statement(ctx, STAT_EXITSUB, 0); CHECK_ERROR; } +#line 2042 "parser.tab.c" break;
case 39: -#line 207 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_foreach_statement(ctx, (yyvsp[-5].string), (yyvsp[-3].expression), (yyvsp[-1].statement)); } -#line 1938 "parser.tab.c" /* yacc.c:1646 */ +#line 210 "parser.y" + { (yyvsp[-3].member)->args = (yyvsp[-2].expression); (yyval.statement) = new_set_statement(ctx, (yyvsp[-3].member), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2048 "parser.tab.c" break;
case 40: -#line 209 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_select_statement(ctx, (yyvsp[-4].expression), (yyvsp[-2].case_clausule)); } -#line 1944 "parser.tab.c" /* yacc.c:1646 */ +#line 211 "parser.y" + { (yyval.statement) = new_statement(ctx, STAT_STOP, 0); CHECK_ERROR; } +#line 2054 "parser.tab.c" break;
case 41: -#line 212 "parser.y" /* yacc.c:1646 */ - { (yyval.member) = new_member_expression(ctx, NULL, (yyvsp[0].string)); CHECK_ERROR; } -#line 1950 "parser.tab.c" /* yacc.c:1646 */ +#line 212 "parser.y" + { (yyval.statement) = new_onerror_statement(ctx, TRUE); CHECK_ERROR; } +#line 2060 "parser.tab.c" break;
case 42: -#line 213 "parser.y" /* yacc.c:1646 */ - { (yyval.member) = new_member_expression(ctx, (yyvsp[-2].expression), (yyvsp[0].string)); CHECK_ERROR; } -#line 1956 "parser.tab.c" /* yacc.c:1646 */ +#line 213 "parser.y" + { (yyval.statement) = new_onerror_statement(ctx, FALSE); CHECK_ERROR; } +#line 2066 "parser.tab.c" break;
case 43: -#line 216 "parser.y" /* yacc.c:1646 */ - { (yyval.dim_decl) = (yyvsp[0].dim_decl); } -#line 1962 "parser.tab.c" /* yacc.c:1646 */ +#line 214 "parser.y" + { (yyval.statement) = new_const_statement(ctx, (yyvsp[0].const_decl)); CHECK_ERROR; } +#line 2072 "parser.tab.c" break;
case 44: -#line 217 "parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].dim_decl)->next = (yyvsp[0].dim_decl); (yyval.dim_decl) = (yyvsp[-2].dim_decl); } -#line 1968 "parser.tab.c" /* yacc.c:1646 */ +#line 216 "parser.y" + { (yyval.statement) = new_forto_statement(ctx, (yyvsp[-8].string), (yyvsp[-6].expression), (yyvsp[-4].expression), (yyvsp[-3].expression), (yyvsp[-1].statement)); CHECK_ERROR; } +#line 2078 "parser.tab.c" break;
case 45: -#line 220 "parser.y" /* yacc.c:1646 */ - { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[0].string), FALSE, NULL); CHECK_ERROR; } -#line 1974 "parser.tab.c" /* yacc.c:1646 */ +#line 218 "parser.y" + { (yyval.statement) = new_foreach_statement(ctx, (yyvsp[-5].string), (yyvsp[-3].expression), (yyvsp[-1].statement)); } +#line 2084 "parser.tab.c" break;
case 46: -#line 221 "parser.y" /* yacc.c:1646 */ - { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[-3].string), TRUE, (yyvsp[-1].dim_list)); CHECK_ERROR; } -#line 1980 "parser.tab.c" /* yacc.c:1646 */ +#line 220 "parser.y" + { (yyval.statement) = new_select_statement(ctx, (yyvsp[-4].expression), (yyvsp[-2].case_clausule)); } +#line 2090 "parser.tab.c" break;
case 47: -#line 222 "parser.y" /* yacc.c:1646 */ - { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[-1].string), TRUE, NULL); CHECK_ERROR; } -#line 1986 "parser.tab.c" /* yacc.c:1646 */ +#line 223 "parser.y" + { (yyval.member) = new_member_expression(ctx, NULL, (yyvsp[0].string)); CHECK_ERROR; } +#line 2096 "parser.tab.c" break;
case 48: -#line 225 "parser.y" /* yacc.c:1646 */ - { (yyval.dim_list) = new_dim(ctx, (yyvsp[0].uint), NULL); } -#line 1992 "parser.tab.c" /* yacc.c:1646 */ +#line 224 "parser.y" + { (yyval.member) = new_member_expression(ctx, (yyvsp[-2].expression), (yyvsp[0].string)); CHECK_ERROR; } +#line 2102 "parser.tab.c" break;
case 49: -#line 226 "parser.y" /* yacc.c:1646 */ - { (yyval.dim_list) = new_dim(ctx, (yyvsp[-2].uint), (yyvsp[0].dim_list)); } -#line 1998 "parser.tab.c" /* yacc.c:1646 */ +#line 227 "parser.y" + { (yyval.dim_decl) = (yyvsp[0].dim_decl); } +#line 2108 "parser.tab.c" break;
case 50: -#line 229 "parser.y" /* yacc.c:1646 */ - { (yyval.const_decl) = (yyvsp[0].const_decl); } -#line 2004 "parser.tab.c" /* yacc.c:1646 */ +#line 228 "parser.y" + { (yyvsp[-2].dim_decl)->next = (yyvsp[0].dim_decl); (yyval.dim_decl) = (yyvsp[-2].dim_decl); } +#line 2114 "parser.tab.c" break;
case 51: -#line 230 "parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].const_decl)->next = (yyvsp[0].const_decl); (yyval.const_decl) = (yyvsp[-2].const_decl); } -#line 2010 "parser.tab.c" /* yacc.c:1646 */ +#line 231 "parser.y" + { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[0].string), FALSE, NULL); CHECK_ERROR; } +#line 2120 "parser.tab.c" break;
case 52: -#line 233 "parser.y" /* yacc.c:1646 */ - { (yyval.const_decl) = new_const_decl(ctx, (yyvsp[-2].string), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2016 "parser.tab.c" /* yacc.c:1646 */ +#line 232 "parser.y" + { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[-3].string), TRUE, (yyvsp[-1].dim_list)); CHECK_ERROR; } +#line 2126 "parser.tab.c" break;
case 53: -#line 236 "parser.y" /* yacc.c:1646 */ - { (yyval.expression) = (yyvsp[0].expression); } -#line 2022 "parser.tab.c" /* yacc.c:1646 */ +#line 233 "parser.y" + { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[-1].string), TRUE, NULL); CHECK_ERROR; } +#line 2132 "parser.tab.c" break;
case 54: -#line 237 "parser.y" /* yacc.c:1646 */ - { (yyval.expression) = new_unary_expression(ctx, EXPR_NEG, (yyvsp[0].expression)); CHECK_ERROR; } -#line 2028 "parser.tab.c" /* yacc.c:1646 */ +#line 236 "parser.y" + { (yyval.dim_list) = new_dim(ctx, (yyvsp[0].uint), NULL); } +#line 2138 "parser.tab.c" break;
case 55: -#line 240 "parser.y" /* yacc.c:1646 */ - { (yyval.boolean) = TRUE; } -#line 2034 "parser.tab.c" /* yacc.c:1646 */ +#line 237 "parser.y" + { (yyval.dim_list) = new_dim(ctx, (yyvsp[-2].uint), (yyvsp[0].dim_list)); } +#line 2144 "parser.tab.c" break;
case 56: -#line 241 "parser.y" /* yacc.c:1646 */ - { (yyval.boolean) = FALSE; } -#line 2040 "parser.tab.c" /* yacc.c:1646 */ +#line 240 "parser.y" + { (yyval.const_decl) = (yyvsp[0].const_decl); } +#line 2150 "parser.tab.c" break;
case 57: -#line 244 "parser.y" /* yacc.c:1646 */ - { (yyval.expression) = NULL;} -#line 2046 "parser.tab.c" /* yacc.c:1646 */ +#line 241 "parser.y" + { (yyvsp[-2].const_decl)->next = (yyvsp[0].const_decl); (yyval.const_decl) = (yyvsp[-2].const_decl); } +#line 2156 "parser.tab.c" break;
case 58: -#line 245 "parser.y" /* yacc.c:1646 */ - { (yyval.expression) = (yyvsp[0].expression); } -#line 2052 "parser.tab.c" /* yacc.c:1646 */ +#line 244 "parser.y" + { (yyval.const_decl) = new_const_decl(ctx, (yyvsp[-2].string), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2162 "parser.tab.c" break;
case 59: -#line 249 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_if_statement(ctx, (yyvsp[-7].expression), (yyvsp[-4].statement), (yyvsp[-3].elseif), (yyvsp[-2].statement)); CHECK_ERROR; } -#line 2058 "parser.tab.c" /* yacc.c:1646 */ +#line 247 "parser.y" + { (yyval.expression) = (yyvsp[0].expression); } +#line 2168 "parser.tab.c" break;
case 60: -#line 250 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_if_statement(ctx, (yyvsp[-3].expression), (yyvsp[-1].statement), NULL, NULL); CHECK_ERROR; } -#line 2064 "parser.tab.c" /* yacc.c:1646 */ +#line 248 "parser.y" + { (yyval.expression) = new_unary_expression(ctx, EXPR_NEG, (yyvsp[0].expression)); CHECK_ERROR; } +#line 2174 "parser.tab.c" ... 3379 lines suppressed ...