diff --git a/reactos/dll/win32/vbscript/compile.c b/reactos/dll/win32/vbscript/compile.c index d61c6491e85..4251bb2f022 100644 --- a/reactos/dll/win32/vbscript/compile.c +++ b/reactos/dll/win32/vbscript/compile.c @@ -1649,11 +1649,10 @@ static HRESULT compile_class(compile_ctx_t *ctx, class_decl_t *class_decl) return E_OUTOFMEMORY; class_desc->props[i].is_public = prop_decl->is_public; + class_desc->props[i].is_array = prop_decl->is_array; - if(prop_decl->is_array) { - class_desc->props[i].is_array = TRUE; + if(prop_decl->is_array) class_desc->array_cnt++; - } } if(class_desc->array_cnt) { diff --git a/reactos/dll/win32/vbscript/global.c b/reactos/dll/win32/vbscript/global.c index 206afc5e0bc..a3d01d5fac2 100644 --- a/reactos/dll/win32/vbscript/global.c +++ b/reactos/dll/win32/vbscript/global.c @@ -85,6 +85,15 @@ static HRESULT return_bstr(VARIANT *res, BSTR str) return S_OK; } +static HRESULT return_bool(VARIANT *res, BOOL val) +{ + if(res) { + V_VT(res) = VT_BOOL; + V_BOOL(res) = val ? VARIANT_TRUE : VARIANT_FALSE; + } + return S_OK; +} + static HRESULT return_short(VARIANT *res, short val) { if(res) { @@ -108,16 +117,6 @@ static HRESULT return_int(VARIANT *res, int val) return S_OK; } -static HRESULT return_bool(VARIANT *res, int val) -{ - if(res) { - V_VT(res) = VT_BOOL; - V_BOOL(res) = val != 0 ? VARIANT_TRUE : VARIANT_FALSE; - } - - return S_OK; -} - static inline HRESULT return_double(VARIANT *res, double val) { if(res) { @@ -146,75 +145,29 @@ static inline HRESULT return_date(VARIANT *res, double date) HRESULT to_int(VARIANT *v, int *ret) { - if(V_VT(v) == (VT_BYREF|VT_VARIANT)) - v = V_VARIANTREF(v); + VARIANT r; + HRESULT hres; - switch(V_VT(v)) { - case VT_I2: - *ret = V_I2(v); - break; - case VT_I4: - *ret = V_I4(v); - break; - case VT_R8: { - double n = floor(V_R8(v)+0.5); - INT32 i; - - if(!is_int32(n)) { - FIXME("%lf is out of int range\n", n); - return E_FAIL; - } - - /* Round half to even */ - i = n; - if(i%2 && n-V_R8(v) == 0.5) - i--; - - *ret = i; - break; - } - case VT_BOOL: - *ret = V_BOOL(v) ? -1 : 0; - break; - default: - FIXME("not supported %s\n", debugstr_variant(v)); - return E_NOTIMPL; - } + V_VT(&r) = VT_EMPTY; + hres = VariantChangeType(&r, v, 0, VT_I4); + if(FAILED(hres)) + return hres; + *ret = V_I4(&r); return S_OK; } static HRESULT to_double(VARIANT *v, double *ret) { - switch(V_VT(v)) { - case VT_I2: - *ret = V_I2(v); - break; - case VT_I4: - *ret = V_I4(v); - break; - case VT_R4: - *ret = V_R4(v); - break; - case VT_R8: - *ret = V_R8(v); - break; - case VT_BSTR: { - VARIANT dst; - HRESULT hres; + VARIANT dst; + HRESULT hres; - V_VT(&dst) = VT_EMPTY; - hres = VariantChangeType(&dst, v, VARIANT_LOCALBOOL, VT_R8); - if(FAILED(hres)) - return hres; - *ret = V_R8(&dst); - break; - } - default: - FIXME("arg %s not supported\n", debugstr_variant(v)); - return E_NOTIMPL; - } + V_VT(&dst) = VT_EMPTY; + hres = VariantChangeType(&dst, v, 0, VT_R8); + if(FAILED(hres)) + return hres; + *ret = V_R8(&dst); return S_OK; } @@ -323,14 +276,15 @@ static IUnknown *create_object(script_ctx_t *ctx, const WCHAR *progid) return obj; } -static HRESULT show_msgbox(script_ctx_t *ctx, BSTR prompt, VARIANT *res) +static HRESULT show_msgbox(script_ctx_t *ctx, BSTR prompt, unsigned type, BSTR orig_title, VARIANT *res) { SCRIPTUICHANDLING uic_handling = SCRIPTUICHANDLING_ALLOW; IActiveScriptSiteUIControl *ui_control; IActiveScriptSiteWindow *acts_window; + WCHAR *title_buf = NULL; const WCHAR *title; HWND hwnd = NULL; - int ret; + int ret = 0; HRESULT hres; hres = IActiveScriptSite_QueryInterface(ctx->site, &IID_IActiveScriptSiteUIControl, (void**)&ui_control); @@ -351,23 +305,43 @@ static HRESULT show_msgbox(script_ctx_t *ctx, BSTR prompt, VARIANT *res) return E_FAIL; } - title = (ctx->safeopt & INTERFACE_USES_SECURITY_MANAGER) ? vbscriptW : emptyW; - hres = IActiveScriptSite_QueryInterface(ctx->site, &IID_IActiveScriptSiteWindow, (void**)&acts_window); if(FAILED(hres)) { FIXME("No IActiveScriptSiteWindow\n"); return hres; } + if(ctx->safeopt & INTERFACE_USES_SECURITY_MANAGER) { + if(orig_title && *orig_title) { + WCHAR *ptr; + + title = title_buf = heap_alloc(sizeof(vbscriptW) + (strlenW(orig_title)+2)*sizeof(WCHAR)); + if(!title) + return E_OUTOFMEMORY; + + memcpy(title_buf, vbscriptW, sizeof(vbscriptW)); + ptr = title_buf + sizeof(vbscriptW)/sizeof(WCHAR)-1; + + *ptr++ = ':'; + *ptr++ = ' '; + strcpyW(ptr, orig_title); + }else { + title = vbscriptW; + } + }else { + title = orig_title ? orig_title : emptyW; + } + hres = IActiveScriptSiteWindow_GetWindow(acts_window, &hwnd); if(SUCCEEDED(hres)) { hres = IActiveScriptSiteWindow_EnableModeless(acts_window, FALSE); if(SUCCEEDED(hres)) { - ret = MessageBoxW(hwnd, prompt, title, MB_OK); + ret = MessageBoxW(hwnd, prompt, title, type); hres = IActiveScriptSiteWindow_EnableModeless(acts_window, TRUE); } } + heap_free(title_buf); IActiveScriptSiteWindow_Release(acts_window); if(FAILED(hres)) { FIXME("failed: %08x\n", hres); @@ -379,64 +353,111 @@ static HRESULT show_msgbox(script_ctx_t *ctx, BSTR prompt, VARIANT *res) static HRESULT Global_CCur(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Global_CInt(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) -{ - int val; + VARIANT v; HRESULT hres; TRACE("%s\n", debugstr_variant(arg)); assert(args_cnt == 1); - hres = to_int(arg, &val); + V_VT(&v) = VT_EMPTY; + hres = VariantChangeType(&v, arg, 0, VT_CY); if(FAILED(hres)) return hres; - return return_int(res, val); + if(!res) { + VariantClear(&v); + return DISP_E_BADVARTYPE; + } + + *res = v; + return S_OK; } -static HRESULT Global_CLng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CInt(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; -} + VARIANT v; + HRESULT hres; -static HRESULT Global_CBool(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) -{ - int val; TRACE("%s\n", debugstr_variant(arg)); assert(args_cnt == 1); - switch(V_VT(arg)) { - case VT_I2: - val = V_I2(arg); - break; - case VT_I4: - val = V_I4(arg); - break; - case VT_R4: - val = V_R4(arg) > 0.0 || V_R4(arg) < 0.0; - break; - case VT_R8: - val = V_R8(arg) > 0.0 || V_R8(arg) < 0.0; - break; - default: - ERR("Not a numeric value: %s\n", debugstr_variant(arg)); - return E_FAIL; - } + V_VT(&v) = VT_EMPTY; + hres = VariantChangeType(&v, arg, 0, VT_I2); + if(FAILED(hres)) + return hres; - return return_bool(res, val); + if(!res) + return DISP_E_BADVARTYPE; + else { + *res = v; + return S_OK; + } +} + +static HRESULT Global_CLng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +{ + int i; + HRESULT hres; + + TRACE("%s\n", debugstr_variant(arg)); + + assert(args_cnt == 1); + + hres = to_int(arg, &i); + if(FAILED(hres)) + return hres; + if(!res) + return DISP_E_BADVARTYPE; + + V_VT(res) = VT_I4; + V_I4(res) = i; + return S_OK; +} + +static HRESULT Global_CBool(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +{ + VARIANT v; + HRESULT hres; + + TRACE("%s\n", debugstr_variant(arg)); + + assert(args_cnt == 1); + + V_VT(&v) = VT_EMPTY; + hres = VariantChangeType(&v, arg, VARIANT_LOCALBOOL, VT_BOOL); + if(FAILED(hres)) + return hres; + + if(res) + *res = v; + else + VariantClear(&v); + return S_OK; } static HRESULT Global_CByte(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + VARIANT v; + HRESULT hres; + + TRACE("%s\n", debugstr_variant(arg)); + + assert(args_cnt == 1); + + V_VT(&v) = VT_EMPTY; + hres = VariantChangeType(&v, arg, VARIANT_LOCALBOOL, VT_UI1); + if(FAILED(hres)) + return hres; + + if(!res) { + VariantClear(&v); + return DISP_E_BADVARTYPE; + } + + *res = v; + return S_OK; } static HRESULT Global_CDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) @@ -447,14 +468,45 @@ static HRESULT Global_CDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR static HRESULT Global_CDbl(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + VARIANT v; + HRESULT hres; + + TRACE("%s\n", debugstr_variant(arg)); + + assert(args_cnt == 1); + + V_VT(&v) = VT_EMPTY; + hres = VariantChangeType(&v, arg, 0, VT_R8); + if(FAILED(hres)) + return hres; + + if(!res) + return DISP_E_BADVARTYPE; + else { + *res = v; + return S_OK; + } } static HRESULT Global_CSng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + VARIANT v; + HRESULT hres; + + TRACE("%s\n", debugstr_variant(arg)); + + assert(args_cnt == 1); + + V_VT(&v) = VT_EMPTY; + hres = VariantChangeType(&v, arg, 0, VT_R4); + if(FAILED(hres)) + return hres; + + if(!res) + return DISP_E_BADVARTYPE; + + *res = v; + return S_OK; } static HRESULT Global_CStr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) @@ -526,8 +578,16 @@ static HRESULT Global_Oct(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA static HRESULT Global_VarType(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("(%s)\n", debugstr_variant(arg)); + + assert(args_cnt == 1); + + if(V_VT(arg) & ~VT_TYPEMASK) { + FIXME("not supported %s\n", debugstr_variant(arg)); + return E_NOTIMPL; + } + + return return_short(res, V_VT(arg)); } static HRESULT Global_IsDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) @@ -564,8 +624,16 @@ static HRESULT Global_IsNull(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VA static HRESULT Global_IsNumeric(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + HRESULT hres; + double d; + + TRACE("(%s)\n", debugstr_variant(arg)); + + assert(args_cnt == 1); + + hres = to_double(arg, &d); + + return return_bool(res, SUCCEEDED(hres)); } static HRESULT Global_IsArray(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) @@ -587,46 +655,94 @@ static HRESULT Global_IsObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, return S_OK; } -static HRESULT Global_Ant(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Atn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + HRESULT hres; + double d; + + hres = to_double(arg, &d); + if(FAILED(hres)) + return hres; + + return return_double(res, atan(d)); } static HRESULT Global_Cos(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + HRESULT hres; + double d; + + hres = to_double(arg, &d); + if(FAILED(hres)) + return hres; + + return return_double(res, cos(d)); } static HRESULT Global_Sin(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + HRESULT hres; + double d; + + hres = to_double(arg, &d); + if(FAILED(hres)) + return hres; + + return return_double(res, sin(d)); } static HRESULT Global_Tan(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + HRESULT hres; + double d; + + hres = to_double(arg, &d); + if(FAILED(hres)) + return hres; + + return return_double(res, tan(d)); } static HRESULT Global_Exp(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + HRESULT hres; + double d; + + hres = to_double(arg, &d); + if(FAILED(hres)) + return hres; + + return return_double(res, exp(d)); } static HRESULT Global_Log(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + HRESULT hres; + double d; + + hres = to_double(arg, &d); + if(FAILED(hres)) + return hres; + + if(d <= 0) + return MAKE_VBSERROR(VBSE_ILLEGAL_FUNC_CALL); + else + return return_double(res, log(d)); } static HRESULT Global_Sqr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + HRESULT hres; + double d; + + hres = to_double(arg, &d); + if(FAILED(hres)) + return hres; + + if(d < 0) + return MAKE_VBSERROR(VBSE_ILLEGAL_FUNC_CALL); + else + return return_double(res, sqrt(d)); } static HRESULT Global_Randomize(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) @@ -1123,9 +1239,15 @@ static HRESULT Global_Asc(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return E_NOTIMPL; } +/* 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) { - int c; + int cp, c, len = 0; + CPINFO cpi; + WCHAR ch; + char buf[2]; HRESULT hres; TRACE("%s\n", debugstr_variant(arg)); @@ -1134,14 +1256,26 @@ static HRESULT Global_Chr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA if(FAILED(hres)) return hres; - if(c < 0 || c >= 0x100) { - FIXME("invalid arg\n"); + cp = GetACP(); + if(!GetCPInfo(cp, &cpi)) + cpi.MaxCharSize = 1; + + if((c!=(short)c && c!=(unsigned short)c) || + (unsigned short)c>=(cpi.MaxCharSize>1 ? 0x10000 : 0x100)) { + WARN("invalid arg %d\n", c); + return MAKE_VBSERROR(VBSE_ILLEGAL_FUNC_CALL); + } + + if(c>>8) + buf[len++] = c>>8; + if(!len || IsDBCSLeadByteEx(cp, buf[0])) + buf[len++] = c; + if(!MultiByteToWideChar(0, 0, buf, len, &ch, 1)) { + WARN("invalid arg %d, cp %d\n", c, cp); return E_FAIL; } if(res) { - WCHAR ch = c; - V_VT(res) = VT_BSTR; V_BSTR(res) = SysAllocStringLen(&ch, 1); if(!V_BSTR(res)) @@ -1164,26 +1298,86 @@ static HRESULT Global_ChrW(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI static HRESULT Global_Abs(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + HRESULT hres; + VARIANT dst; + + TRACE("(%s)\n", debugstr_variant(arg)); + + assert(args_cnt == 1); + + hres = VarAbs(arg, &dst); + if(FAILED(hres)) + return hres; + + if (res) + *res = dst; + else + VariantClear(&dst); + + return S_OK; } static HRESULT Global_Fix(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + HRESULT hres; + VARIANT dst; + + TRACE("(%s)\n", debugstr_variant(arg)); + + assert(args_cnt == 1); + + hres = VarFix(arg, &dst); + if(FAILED(hres)) + return hres; + + if (res) + *res = dst; + else + VariantClear(&dst); + + return S_OK; } static HRESULT Global_Int(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + HRESULT hres; + VARIANT dst; + + TRACE("(%s)\n", debugstr_variant(arg)); + + assert(args_cnt == 1); + + hres = VarInt(arg, &dst); + if(FAILED(hres)) + return hres; + + if (res) + *res = dst; + else + VariantClear(&dst); + + return S_OK; } static HRESULT Global_Sgn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + double v; + short val; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + assert(args_cnt == 1); + + if(V_VT(arg) == VT_NULL) + return MAKE_VBSERROR(VBSE_ILLEGAL_NULL_USE); + + hres = to_double(arg, &v); + if (FAILED(hres)) + return hres; + + val = v == 0 ? 0 : (v > 0 ? 1 : -1); + return return_short(res, val); } static HRESULT Global_Now(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) @@ -1200,14 +1394,38 @@ static HRESULT Global_Now(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA static HRESULT Global_Date(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME lt; + UDATE ud; + DATE date; + HRESULT hres; + + TRACE("\n"); + + GetLocalTime(<); + ud.st = lt; + ud.wDayOfYear = 0; + hres = VarDateFromUdateEx(&ud, 0, VAR_DATEVALUEONLY, &date); + if(FAILED(hres)) + return hres; + return return_date(res, date); } static HRESULT Global_Time(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME lt; + UDATE ud; + DATE time; + HRESULT hres; + + TRACE("\n"); + + GetLocalTime(<); + ud.st = lt; + ud.wDayOfYear = 0; + hres = VarDateFromUdateEx(&ud, 0, VAR_TIMEVALUEONLY, &time); + if(FAILED(hres)) + return hres; + return return_date(res, time); } static HRESULT Global_Day(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) @@ -1284,22 +1502,34 @@ static HRESULT Global_InputBox(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, static HRESULT Global_MsgBox(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { - BSTR prompt; + BSTR prompt, title = NULL; + int type = MB_OK; HRESULT hres; TRACE("\n"); - if(args_cnt != 1) { - FIXME("unsupported arg_cnt %d\n", args_cnt); - return E_NOTIMPL; - } + assert(1 <= args_cnt && args_cnt <= 5); hres = to_string(args, &prompt); if(FAILED(hres)) return hres; - hres = show_msgbox(This->desc->ctx, prompt, res); + if(args_cnt > 1) + hres = to_int(args+1, &type); + + if(SUCCEEDED(hres) && args_cnt > 2) + hres = to_string(args+2, &title); + + if(SUCCEEDED(hres) && args_cnt > 3) { + FIXME("unsupported arg_cnt %d\n", args_cnt); + hres = E_NOTIMPL; + } + + if(SUCCEEDED(hres)) + hres = show_msgbox(This->desc->ctx, prompt, type, title, res); + SysFreeString(prompt); + SysFreeString(title); return hres; } @@ -1408,8 +1638,52 @@ static HRESULT Global_DatePart(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, static HRESULT Global_TypeName(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + static const WCHAR ByteW[] = {'B', 'y', 't', 'e', 0}; + static const WCHAR IntegerW[] = {'I', 'n', 't', 'e', 'g', 'e', 'r', 0}; + static const WCHAR LongW[] = {'L', 'o', 'n', 'g', 0}; + static const WCHAR SingleW[] = {'S', 'i', 'n', 'g', 'l', 'e', 0}; + static const WCHAR DoubleW[] = {'D', 'o', 'u', 'b', 'l', 'e', 0}; + static const WCHAR CurrencyW[] = {'C', 'u', 'r', 'r', 'e', 'n', 'c', 'y', 0}; + static const WCHAR DecimalW[] = {'D', 'e', 'c', 'i', 'm', 'a', 'l', 0}; + static const WCHAR DateW[] = {'D', 'a', 't', 'e', 0}; + static const WCHAR StringW[] = {'S', 't', 'r', 'i', 'n', 'g', 0}; + static const WCHAR BooleanW[] = {'B', 'o', 'o', 'l', 'e', 'a', 'n', 0}; + static const WCHAR EmptyW[] = {'E', 'm', 'p', 't', 'y', 0}; + static const WCHAR NullW[] = {'N', 'u', 'l', 'l', 0}; + + TRACE("(%s)\n", debugstr_variant(arg)); + + assert(args_cnt == 1); + + switch(V_VT(arg)) { + case VT_UI1: + return return_string(res, ByteW); + case VT_I2: + return return_string(res, IntegerW); + case VT_I4: + return return_string(res, LongW); + case VT_R4: + return return_string(res, SingleW); + case VT_R8: + return return_string(res, DoubleW); + case VT_CY: + return return_string(res, CurrencyW); + case VT_DECIMAL: + return return_string(res, DecimalW); + case VT_DATE: + return return_string(res, DateW); + case VT_BSTR: + return return_string(res, StringW); + case VT_BOOL: + return return_string(res, BooleanW); + case VT_EMPTY: + return return_string(res, EmptyW); + case VT_NULL: + return return_string(res, NullW); + default: + FIXME("arg %s not supported\n", debugstr_variant(arg)); + return E_NOTIMPL; + } } static HRESULT Global_Array(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) @@ -1485,26 +1759,53 @@ static HRESULT Global_LoadPicture(vbdisp_t *This, VARIANT *arg, unsigned args_cn static HRESULT Global_ScriptEngine(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("%s\n", debugstr_variant(arg)); + + assert(args_cnt == 0); + + return return_string(res, vbscriptW); } static HRESULT Global_ScriptEngineMajorVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("%s\n", debugstr_variant(arg)); + + assert(args_cnt == 0); + + if(res) { + V_VT(res) = VT_I4; + V_I4(res) = VBSCRIPT_MAJOR_VERSION; + } + + return S_OK; } static HRESULT Global_ScriptEngineMinorVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("%s\n", debugstr_variant(arg)); + + assert(args_cnt == 0); + + if(res) { + V_VT(res) = VT_I4; + V_I4(res) = VBSCRIPT_MINOR_VERSION; + } + + return S_OK; } static HRESULT Global_ScriptEngineBuildVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("%s\n", debugstr_variant(arg)); + + assert(args_cnt == 0); + + if(res) { + V_VT(res) = VT_I4; + V_I4(res) = VBSCRIPT_BUILD_VERSION; + } + + return S_OK; } static HRESULT Global_FormatNumber(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) @@ -1765,7 +2066,7 @@ static const builtin_prop_t global_props[] = { {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_Ant, 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}, diff --git a/reactos/dll/win32/vbscript/interp.c b/reactos/dll/win32/vbscript/interp.c index 4a7624b81eb..aae6758f3a0 100644 --- a/reactos/dll/win32/vbscript/interp.c +++ b/reactos/dll/win32/vbscript/interp.c @@ -555,7 +555,7 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res) v = V_VT(ref.u.v) == (VT_VARIANT|VT_BYREF) ? V_VARIANTREF(ref.u.v) : ref.u.v; if(arg_cnt) { - SAFEARRAY *array; + SAFEARRAY *array = NULL; switch(V_VT(v)) { case VT_ARRAY|VT_BYREF|VT_VARIANT: @@ -564,11 +564,20 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res) case VT_ARRAY|VT_VARIANT: array = V_ARRAY(ref.u.v); break; + case VT_DISPATCH: + vbstack_to_dp(ctx, arg_cnt, FALSE, &dp); + hres = disp_call(ctx->script, V_DISPATCH(v), DISPID_VALUE, &dp, res); + if(FAILED(hres)) + return hres; + break; default: FIXME("arguments not implemented\n"); return E_NOTIMPL; } + if(!array) + break; + vbstack_to_dp(ctx, arg_cnt, FALSE, &dp); hres = array_access(ctx, array, &dp, &v); if(FAILED(hres)) @@ -1270,6 +1279,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; return S_OK; } diff --git a/reactos/dll/win32/vbscript/lex.c b/reactos/dll/win32/vbscript/lex.c index 264c74cd4e9..7dcc482bddd 100644 --- a/reactos/dll/win32/vbscript/lex.c +++ b/reactos/dll/win32/vbscript/lex.c @@ -19,6 +19,9 @@ #include "vbscript.h" #include "parser.tab.h" +#include +#include + static const WCHAR andW[] = {'a','n','d',0}; static const WCHAR byrefW[] = {'b','y','r','e','f',0}; static const WCHAR byvalW[] = {'b','y','v','a','l',0}; @@ -251,28 +254,91 @@ static int parse_string_literal(parser_ctx_t *ctx, const WCHAR **ret) static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) { - double n = 0; + BOOL use_int = TRUE; + LONGLONG d = 0, hlp; + int exp = 0; + double r; if(*ctx->ptr == '0' && !('0' <= ctx->ptr[1] && ctx->ptr[1] <= '9') && ctx->ptr[1] != '.') return *ctx->ptr++; - do { - n = n*10 + *ctx->ptr++ - '0'; - }while('0' <= *ctx->ptr && *ctx->ptr <= '9'); - - if(*ctx->ptr != '.') { - if((LONG)n == n) { - LONG l = n; - *(LONG*)ret = l; - return (short)l == l ? tShort : tLong; + while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { + hlp = d*10 + *(ctx->ptr++) - '0'; + if(d>MAXLONGLONG/10 || hlp<0) { + exp++; + break; } - }else { - double e = 1.0; - while('0' <= *++ctx->ptr && *ctx->ptr <= '9') - n += (e /= 10.0)*(*ctx->ptr-'0'); + else + d = hlp; + } + while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { + exp++; + ctx->ptr++; } - *(double*)ret = n; + if(*ctx->ptr == '.') { + use_int = FALSE; + ctx->ptr++; + + while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { + hlp = d*10 + *(ctx->ptr++) - '0'; + if(d>MAXLONGLONG/10 || hlp<0) + break; + + d = hlp; + exp--; + } + while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) + ctx->ptr++; + } + + if(*ctx->ptr == 'e' || *ctx->ptr == 'E') { + int e = 0, sign = 1; + + if(*++ctx->ptr == '-') { + ctx->ptr++; + sign = -1; + } + + if(!isdigitW(*ctx->ptr)) { + FIXME("Invalid numeric literal\n"); + return 0; + } + + use_int = FALSE; + + do { + 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)) + ctx->ptr++; + *(double*)ret = 0; + return tDouble; + } + + if(sign*e + exp > INT_MAX/100) { + FIXME("Invalid numeric literal\n"); + return 0; + } + } while(isdigitW(*ctx->ptr)); + + exp += sign*e; + } + + if(use_int && (LONG)d == d) { + LONG l = d; + *(LONG*)ret = l; + return (short)l == l ? tShort : tLong; + } + + r = exp>=0 ? d*pow(10, exp) : d/pow(10, -exp); + if(isinf(r)) { + FIXME("Invalid numeric literal\n"); + return 0; + } + + *(double*)ret = r; return tDouble; } diff --git a/reactos/dll/win32/vbscript/parser.tab.c b/reactos/dll/win32/vbscript/parser.tab.c index 18ac409bfb6..212783a652e 100644 --- a/reactos/dll/win32/vbscript/parser.tab.c +++ b/reactos/dll/win32/vbscript/parser.tab.c @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.5" +#define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -58,23 +58,18 @@ /* Pull parsers. */ #define YYPULL 1 -/* Using locations. */ -#define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse parser_parse #define yylex parser_lex #define yyerror parser_error -#define yylval parser_lval -#define yychar parser_char #define yydebug parser_debug #define yynerrs parser_nerrs /* Copy the first part of user declarations. */ +#line 19 "parser.y" /* yacc.c:339 */ -/* Line 268 of yacc.c */ -#line 19 "parser.y" #include "vbscript.h" @@ -132,14 +127,15 @@ static const WCHAR propertyW[] = {'p','r','o','p','e','r','t','y',0}; #define CHECK_ERROR if(((parser_ctx_t*)ctx)->hres != S_OK) YYABORT +#line 136 "parser.tab.c" /* yacc.c:339 */ -/* Line 268 of yacc.c */ -#line 144 "parser.tab.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE @@ -149,97 +145,97 @@ static const WCHAR propertyW[] = {'p','r','o','p','e','r','t','y',0}; # define YYERROR_VERBOSE 0 #endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 + +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int parser_debug; #endif - -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - tEOF = 258, - tNL = 259, - tREM = 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, - tDouble = 325 - }; + enum yytokentype + { + tEOF = 258, + tNL = 259, + tREM = 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, + tDouble = 325 + }; #endif - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { - -/* Line 293 of yacc.c */ -#line 88 "parser.y" +#line 88 "parser.y" /* yacc.c:355 */ const WCHAR *string; statement_t *statement; @@ -255,25 +251,24 @@ typedef union YYSTYPE case_clausule_t *case_clausule; unsigned uint; LONG lng; - BOOL bool; + BOOL boolean; double dbl; - - -/* Line 293 of yacc.c */ -#line 271 "parser.tab.c" -} YYSTYPE; +#line 263 "parser.tab.c" /* yacc.c:355 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + +int parser_parse (parser_ctx_t *ctx); + + + /* Copy the second part of user declarations. */ - -/* Line 343 of yacc.c */ -#line 283 "parser.tab.c" +#line 277 "parser.tab.c" /* yacc.c:358 */ #ifdef short # undef short @@ -287,11 +282,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -311,8 +303,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -326,38 +317,67 @@ typedef short int yytype_int16; # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ -# define YY_(msgid) msgid +# define YY_(Msgid) Msgid +# endif +#endif + +#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 + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) +# define YYUSE(E) ((void) (E)) #else -# define YYUSE(e) /* empty */ +# define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + #if ! defined yyoverflow || YYERROR_VERBOSE @@ -376,9 +396,9 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif @@ -388,8 +408,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -405,7 +425,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -413,15 +433,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -431,7 +449,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -456,35 +474,35 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from FROM to TO. The source and destination do +/* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -500,17 +518,19 @@ union yyalloc #define YYNNTS 59 /* YYNRULES -- Number of rules. */ #define YYNRULES 164 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 335 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 325 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -549,91 +569,7 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 7, 8, 12, 13, 16, 19, 20, - 22, 24, 27, 30, 32, 35, 37, 41, 44, 47, - 51, 56, 59, 61, 67, 74, 81, 86, 88, 91, - 94, 97, 100, 103, 109, 111, 116, 121, 124, 135, - 144, 152, 154, 158, 160, 164, 166, 171, 174, 176, - 180, 182, 186, 190, 192, 195, 197, 199, 200, 203, - 213, 218, 226, 227, 230, 231, 233, 235, 238, 244, - 245, 249, 250, 255, 261, 263, 267, 269, 271, 272, - 274, 276, 280, 282, 286, 288, 292, 294, 298, 300, - 304, 306, 310, 312, 315, 317, 321, 325, 329, 333, - 337, 341, 345, 347, 351, 353, 357, 361, 363, 367, - 369, 373, 375, 379, 383, 385, 389, 391, 393, 396, - 399, 401, 404, 406, 408, 410, 412, 414, 416, 418, - 420, 422, 424, 426, 428, 430, 432, 436, 438, 446, - 447, 451, 456, 461, 465, 475, 487, 499, 508, 517, - 518, 520, 523, 525, 527, 529, 533, 535, 539, 542, - 546, 550, 552, 554, 556 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 88, 0, -1, 89, 90, 3, -1, -1, 48, 49, - 4, -1, -1, 90, 93, -1, 90, 135, -1, -1, - 92, -1, 93, -1, 93, 92, -1, 94, 4, -1, - 71, -1, 71, 94, -1, 95, -1, 95, 71, 94, - -1, 95, 71, -1, 96, 113, -1, 20, 96, 112, - -1, 96, 112, 72, 116, -1, 21, 97, -1, 105, - -1, 34, 116, 4, 91, 35, -1, 36, 103, 116, - 4, 91, 37, -1, 36, 4, 91, 37, 103, 116, - -1, 36, 4, 91, 37, -1, 138, -1, 33, 36, - -1, 33, 39, -1, 33, 23, -1, 33, 24, -1, - 33, 22, -1, 55, 96, 112, 72, 116, -1, 50, - -1, 63, 61, 64, 62, -1, 63, 61, 65, 73, - -1, 27, 100, -1, 39, 144, 72, 116, 40, 116, - 104, 4, 91, 62, -1, 39, 42, 144, 43, 116, - 4, 91, 62, -1, 44, 45, 116, 145, 111, 31, - 44, -1, 144, -1, 130, 74, 144, -1, 98, -1, - 98, 75, 97, -1, 144, -1, 144, 76, 99, 77, - -1, 144, 6, -1, 133, -1, 133, 75, 99, -1, - 101, -1, 101, 75, 100, -1, 144, 72, 102, -1, - 131, -1, 78, 132, -1, 34, -1, 38, -1, -1, - 41, 116, -1, 28, 116, 32, 4, 91, 107, 110, - 31, 28, -1, 28, 116, 32, 94, -1, 28, 116, - 32, 94, 29, 94, 106, -1, -1, 31, 28, -1, - -1, 108, -1, 109, -1, 109, 108, -1, 30, 116, - 32, 4, 91, -1, -1, 29, 4, 91, -1, -1, - 45, 29, 145, 92, -1, 45, 115, 145, 91, 111, - -1, 114, -1, 76, 115, 77, -1, 114, -1, 115, - -1, -1, 6, -1, 116, -1, 116, 75, 115, -1, - 117, -1, 116, 14, 117, -1, 118, -1, 117, 13, - 118, -1, 119, -1, 118, 12, 119, -1, 120, -1, - 119, 11, 120, -1, 121, -1, 120, 10, 121, -1, - 122, -1, 9, 121, -1, 123, -1, 122, 72, 123, - -1, 122, 15, 123, -1, 122, 79, 123, -1, 122, - 80, 123, -1, 122, 18, 123, -1, 122, 17, 123, - -1, 122, 16, 123, -1, 124, -1, 123, 81, 124, - -1, 125, -1, 124, 82, 125, -1, 124, 78, 125, - -1, 126, -1, 125, 19, 126, -1, 127, -1, 126, - 83, 127, -1, 128, -1, 127, 84, 128, -1, 127, - 85, 128, -1, 129, -1, 128, 86, 129, -1, 131, - -1, 130, -1, 56, 144, -1, 78, 129, -1, 134, - -1, 96, 112, -1, 7, -1, 8, -1, 67, -1, - 132, -1, 52, -1, 53, -1, 51, -1, 69, -1, - 73, -1, 68, -1, 70, -1, 69, -1, 73, -1, - 68, -1, 76, 116, 77, -1, 60, -1, 54, 144, - 4, 136, 31, 54, 4, -1, -1, 138, 4, 136, - -1, 140, 66, 4, 136, -1, 21, 98, 4, 136, - -1, 137, 4, 136, -1, 139, 24, 25, 66, 114, - 4, 91, 31, 24, -1, 139, 24, 26, 66, 76, - 143, 77, 4, 91, 31, 24, -1, 139, 24, 55, - 66, 76, 143, 77, 4, 91, 31, 24, -1, 139, - 22, 144, 141, 4, 91, 31, 22, -1, 139, 23, - 144, 141, 4, 91, 31, 23, -1, -1, 140, -1, - 57, 59, -1, 57, -1, 58, -1, 114, -1, 76, - 142, 77, -1, 143, -1, 143, 75, 142, -1, 144, - 114, -1, 46, 144, 114, -1, 47, 144, 114, -1, - 66, -1, 24, -1, 4, -1, 71, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* 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, @@ -656,7 +592,7 @@ static const yytype_uint16 yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -687,13 +623,13 @@ static const char *const yytname[] = "IntegerValue", "PrimaryExpression", "ClassDeclaration", "ClassBody", "PropertyDecl", "FunctionDecl", "Storage_opt", "Storage", "ArgumentsDecl_opt", "ArgumentDeclList", "ArgumentDecl", "Identifier", - "StSep", 0 + "StSep", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -708,53 +644,59 @@ static const yytype_uint16 yytoknum[] = }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = +#define YYPACT_NINF -158 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-158))) + +#define YYTABLE_NINF -150 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = { - 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, - 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, - 120, 120, 121, 121, 122, 122, 122, 122, 122, 122, - 122, 122, 123, 123, 124, 124, 124, 125, 125, 126, - 126, 127, 127, 127, 128, 128, 129, 129, 129, 129, - 130, 130, 131, 131, 131, 131, 131, 131, 131, 132, - 132, 132, 132, 133, 133, 133, 134, 134, 135, 136, - 136, 136, 136, 136, 137, 137, 137, 138, 138, 139, - 139, 140, 140, 140, 141, 141, 142, 142, 143, 143, - 143, 144, 144, 145, 145 + -28, -18, 43, -158, 56, -158, 307, -158, -158, 6, + -2, -158, -2, 468, 184, 468, 20, 33, 32, -158, + -2, 6, 26, -158, -158, 50, -158, 557, 468, -158, + 116, 51, 388, -158, 62, -158, -158, -158, 130, -158, + -158, 8, -158, 63, 10, -158, 93, 104, -158, -158, + 468, -158, -158, -158, -2, -158, -158, -158, -158, -158, + 498, 8, 24, 166, 171, 177, 189, -158, 29, 113, + 53, 182, 122, 102, 129, -158, 62, -158, -158, -158, + -158, -158, -158, -158, 47, 598, -158, -158, 468, -2, + 145, 468, 214, 8, -158, 127, -158, 11, -158, 557, + -158, 468, 152, -158, -5, -158, 19, -2, -2, -2, + 468, 163, -158, -2, -158, 112, -2, 97, -158, -158, + -158, -158, 468, 348, 468, 468, 468, 468, 498, 498, + 498, 498, 498, 498, 498, 498, 498, 498, 498, 498, + 498, 498, 498, 651, 201, -158, 557, 48, 200, 468, + 36, 120, 173, 185, 175, -158, -158, 169, 35, 468, + 468, -158, 13, 13, -158, -158, -158, -158, 176, 179, + -158, 45, -158, -158, 166, 557, 221, 171, 177, 189, + -158, 113, 113, 113, 113, 113, 113, 113, 53, 182, + 182, 122, 102, 129, 129, -158, 217, 121, -158, 598, + 468, 25, -158, -158, 211, -2, 228, 256, 257, 150, + 196, 468, -158, -158, -158, 249, -158, -11, -158, 260, + 261, -158, 112, -158, 237, 786, -158, 468, 233, 59, + 468, 418, 240, 268, 219, 120, 120, 135, 270, 249, + -2, -2, 198, 202, 277, 692, 692, -158, 468, 247, + -158, 237, 253, 249, -158, 733, 12, 7, 7, 242, + 120, 283, -158, -158, 224, 225, 226, 120, 277, 277, + -158, -11, -158, 263, 265, 27, 293, 271, -158, 273, + -158, 243, 468, 295, 786, 557, -158, -158, -158, 13, + 231, 236, -158, -158, -158, -158, 282, 286, 310, 692, + 287, -158, -158, 249, 733, -158, 211, 312, -11, -11, + -158, -158, 557, -158, -158, 255, -158, 692, 241, 252, + -158, -158, 288, 320, 326, 308, 692, 692, -158, 302, + 305, 314, 315, -158, -158 }; -/* YYR2[YYN] -- Number of symbols composing 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, - 4, 7, 0, 2, 0, 1, 1, 2, 5, 0, - 3, 0, 4, 5, 1, 3, 1, 1, 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 -}; - -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_uint8 yydefact[] = { 3, 0, 0, 5, 0, 1, 149, 4, 2, 0, @@ -793,7 +735,18 @@ static const yytype_uint8 yydefact[] = 0, 0, 0, 145, 146 }; -/* YYDEFGOTO[NTERM-NUM]. */ + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -158, -158, -158, -158, -101, -137, 336, -23, -158, -6, + 232, 139, 125, 234, -158, -158, 151, -158, -158, -158, + -158, 98, -158, -158, 49, -13, -158, 0, -31, 55, + 238, 229, 246, 230, -40, -158, 99, 223, 60, 216, + 220, 69, -52, -4, 262, 192, -158, -158, -158, -78, + -158, -144, -139, -133, -157, 95, -96, 17, -22 +}; + + /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 2, 3, 6, 144, 145, 146, 30, 31, 61, @@ -804,102 +757,49 @@ static const yytype_int16 yydefgoto[] = 207, 37, 38, 39, 219, 242, 243, 40, 204 }; -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -146 -static const yytype_int16 yypact[] = -{ - -13, 2, 57, -146, 39, -146, 307, -146, -146, 1, - -2, -146, -2, 468, 184, 468, 20, -11, 15, -146, - -2, 1, 40, -146, -146, 62, -146, 557, 468, -146, - 59, 84, 388, -146, 94, -146, -146, -146, 109, -146, - -146, 4, -146, 101, 8, -146, 106, 111, -146, -146, - 468, -146, -146, -146, -2, -146, -146, -146, -146, -146, - 498, 4, 27, 175, 182, 188, 191, -146, 29, 124, - 38, 193, 130, 68, 129, -146, 94, -146, -146, -146, - -146, -146, -146, -146, 24, 598, -146, -146, 468, -2, - 145, 468, 214, 4, -146, 95, -146, 5, -146, 557, - -146, 468, 152, -146, 64, -146, 19, -2, -2, -2, - 468, 161, -146, -2, -146, 45, -2, 97, -146, -146, - -146, -146, 468, 348, 468, 468, 468, 468, 498, 498, - 498, 498, 498, 498, 498, 498, 498, 498, 498, 498, - 498, 498, 498, 651, 199, -146, 557, 48, 194, 468, - 16, 120, 166, 181, 172, -146, -146, 169, 35, 468, - 468, -146, 10, 10, -146, -146, -146, -146, 170, 173, - -146, 117, -146, -146, 175, 557, 221, 182, 188, 191, - -146, 124, 124, 124, 124, 124, 124, 124, 38, 193, - 193, 130, 68, 129, 129, -146, 217, 73, -146, 598, - 468, 121, -146, -146, 208, -2, 223, 252, 255, 150, - 195, 468, -146, -146, -146, 246, -146, 26, -146, 258, - 259, -146, 45, -146, 234, 786, -146, 468, 228, 61, - 468, 418, 236, 266, 218, 120, 120, 14, 267, 246, - -2, -2, 196, 200, 268, 692, 692, -146, 468, 247, - -146, 234, 253, 246, -146, 733, 12, 7, 7, 233, - 120, 279, -146, -146, 220, 224, 225, 120, 268, 268, - -146, 26, -146, 256, 261, 34, 290, 265, -146, 269, - -146, 237, 468, 297, 786, 557, -146, -146, -146, 268, - 226, 229, -146, -146, -146, -146, 282, 284, 305, 692, - 286, -146, -146, 246, 733, -146, 208, 308, 26, 26, - -146, -146, 557, -146, -146, 254, -146, 692, 238, 240, - -146, -146, 287, 315, 320, 306, 692, 692, -146, 298, - 301, 309, 312, -146, -146 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -146, -146, -146, -146, -101, -137, 332, -23, -146, -6, - 231, 134, 123, 232, -146, -146, 153, -146, -146, -146, - -146, 91, -146, -146, 41, -5, -146, 0, -31, 55, - 227, 230, 235, 245, -42, -146, 99, 239, 43, 215, - 216, 51, -53, -4, 241, 185, -146, -146, -146, -78, - -146, -145, -139, -133, 203, 88, -112, 17, -48 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -150 + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 32, 105, 34, 41, 96, 34, 208, 120, 118, 198, - 100, 202, 209, 11, 114, 93, 100, 34, 210, 122, - 202, 32, 11, 34, 85, 11, 122, 44, 143, 47, - 122, 89, 104, 122, 90, 1, 111, 92, 122, 264, - 265, 122, 196, 7, 128, 129, 130, 131, 122, 122, - 11, 4, 199, 282, 86, 26, 121, 5, 87, 123, - 91, 24, 122, 98, 26, 255, 298, 26, 62, 266, - 84, 119, 240, 241, 224, 122, 156, 28, 203, 32, - 110, 34, 155, 97, 115, 180, 217, 203, 152, 195, - 208, 208, 26, 32, 160, 34, 209, 209, 228, 94, - 176, 132, 210, 210, 48, 49, 148, 86, 133, 134, - 160, 87, 155, 165, 166, 208, 136, 32, 167, 34, - 137, 209, 208, 95, 161, 162, 163, 210, 209, 216, - 44, 108, 109, 47, 210, 122, -74, 32, -74, 34, + 32, 105, 34, 41, 96, 34, 220, 208, 120, 198, + 118, 202, 209, 11, 100, 93, 114, 34, 210, 100, + 1, 32, 11, 34, 85, 122, 122, 44, 111, 47, + 11, 4, 104, 122, 90, 240, 241, 92, 122, 122, + 202, 122, 196, 5, 128, 129, 130, 131, 121, 122, + 122, 143, 199, 282, 86, 26, 123, 11, 87, 298, + 7, 122, 122, 255, 26, 230, 24, -74, 62, -74, + 84, 119, 26, 122, 224, 89, 156, 91, 203, 32, + 152, 34, 28, 97, 110, 94, 115, 180, 155, 217, + 195, 208, 208, 32, 160, 34, 209, 209, 228, 26, + 176, 132, 210, 210, 48, 49, 148, 203, 133, 134, + 160, 95, 155, 56, 57, 58, 208, 32, 59, 34, + 98, 209, 99, 208, 161, 162, 163, 210, 209, 216, + 44, 136, 307, 47, 210, 137, 107, 32, 113, 34, 32, 205, 34, 147, 273, 274, 150, 305, 51, 52, - 53, -139, 140, 141, 281, 99, 158, 262, 263, 153, - 154, 230, 218, 218, 55, 56, 57, 58, 107, 32, - 59, 34, 108, 109, 237, 171, 113, 22, 23, 189, - 190, 116, 287, 117, 306, 56, 57, 58, 124, 292, - 59, 193, 194, 32, 125, 34, 318, 319, 313, 126, - 258, 127, 252, 315, 201, 135, 79, 80, 81, 284, - 285, 320, 138, 139, 215, 142, 322, 149, 151, 32, + 53, -139, 108, 109, 281, 86, 158, 262, 263, 87, + 264, 265, 218, 218, 55, 56, 57, 58, 116, 32, + 59, 34, 108, 109, 237, 171, 117, 22, 23, 124, + 165, 166, 287, 125, 306, 167, 140, 141, 126, 292, + 266, 153, 154, 32, 135, 34, 189, 190, 313, 127, + 258, 138, 252, 315, 201, 139, 79, 80, 81, 193, + 194, 320, 318, 319, 215, 142, 322, 149, 151, 32, 82, 34, 44, 83, 159, 329, 330, 181, 182, 183, - 184, 185, 186, 187, 244, -121, 197, 200, 211, 32, - 32, 34, 34, 212, 272, 213, 214, 221, 222, 32, - 225, 34, 226, 231, 234, 229, 235, 268, 269, 236, - 122, 238, 245, 246, 248, 254, 239, 259, 293, 294, - 260, 267, 261, 270, 100, 271, 276, 286, 32, 32, - 34, 34, 253, 288, 279, 256, 289, 296, 244, 307, - 290, 291, 297, 32, 299, 34, 300, 301, 32, 302, - 34, 304, 308, 275, 310, 309, 32, 311, 34, 312, - 8, 32, 317, 34, 314, 323, 321, 324, 325, 326, - 32, 32, 34, 34, 327, 244, 244, 9, 10, 331, - 328, 11, 332, 333, 12, 13, 334, 303, 29, 233, - 14, 15, 278, 16, 164, 247, 17, 316, 170, 174, - 227, 18, 175, 191, 177, 192, 223, 19, 173, 295, - 178, 20, 21, 0, 22, 23, 220, 24, 9, 10, - 25, 179, 11, 26, 188, 12, 13, 0, 27, 0, + 184, 185, 186, 187, 244, 284, 285, -121, 197, 32, + 32, 34, 34, 200, 272, 211, 214, 212, 213, 32, + 225, 34, 226, 221, 222, 229, 231, 268, 269, 234, + 235, 236, 238, 122, 245, 246, 239, 248, 293, 294, + 254, 259, 260, 261, 267, 270, 276, 271, 32, 32, + 34, 34, 253, 100, 279, 256, 286, 288, 244, 218, + 289, 290, 291, 32, 296, 34, 297, 299, 32, 304, + 34, 301, 300, 275, 310, 302, 32, 308, 34, 311, + 8, 32, 309, 34, 312, 314, 317, 321, 323, 325, + 32, 32, 34, 34, 326, 244, 244, 9, 10, 324, + 327, 11, 328, 331, 12, 13, 332, 303, 333, 334, + 14, 15, 29, 16, 233, 164, 17, 247, 227, 278, + 170, 18, 175, 177, 191, 316, 179, 19, 188, 192, + 174, 20, 21, 223, 22, 23, 295, 24, 9, 10, + 25, 178, 11, 26, 0, 12, 13, 0, 27, 173, 0, 14, 15, 28, 16, 0, 0, 17, 0, 0, 0, 0, 18, 0, 100, 48, 49, 50, 19, 0, 0, 0, 0, 21, 0, 22, 23, 0, 24, 0, @@ -951,52 +851,46 @@ static const yytype_int16 yytable[] = 0, 0, 28 }; -#define yypact_value_is_default(yystate) \ - ((yystate) == (-146)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - static const yytype_int16 yycheck[] = { - 6, 32, 6, 9, 27, 9, 151, 60, 50, 146, - 6, 4, 151, 24, 6, 21, 6, 21, 151, 14, - 4, 27, 24, 27, 4, 24, 14, 10, 4, 12, - 14, 42, 32, 14, 17, 48, 41, 20, 14, 25, - 26, 14, 143, 4, 15, 16, 17, 18, 14, 14, - 24, 49, 4, 41, 34, 66, 61, 0, 38, 32, - 45, 60, 14, 4, 66, 4, 32, 66, 13, 55, - 15, 54, 46, 47, 175, 14, 99, 76, 71, 85, - 76, 85, 77, 28, 76, 127, 76, 71, 93, 142, - 235, 236, 66, 99, 75, 99, 235, 236, 199, 59, - 123, 72, 235, 236, 7, 8, 89, 34, 79, 80, - 75, 38, 77, 68, 69, 260, 78, 123, 73, 123, - 82, 260, 267, 61, 107, 108, 109, 260, 267, 160, - 113, 22, 23, 116, 267, 14, 72, 143, 74, 143, + 6, 32, 6, 9, 27, 9, 163, 151, 60, 146, + 50, 4, 151, 24, 6, 21, 6, 21, 151, 6, + 48, 27, 24, 27, 4, 14, 14, 10, 41, 12, + 24, 49, 32, 14, 17, 46, 47, 20, 14, 14, + 4, 14, 143, 0, 15, 16, 17, 18, 61, 14, + 14, 4, 4, 41, 34, 66, 32, 24, 38, 32, + 4, 14, 14, 4, 66, 40, 60, 72, 13, 74, + 15, 54, 66, 14, 175, 42, 99, 45, 71, 85, + 93, 85, 76, 28, 76, 59, 76, 127, 77, 76, + 142, 235, 236, 99, 75, 99, 235, 236, 199, 66, + 123, 72, 235, 236, 7, 8, 89, 71, 79, 80, + 75, 61, 77, 68, 69, 70, 260, 123, 73, 123, + 4, 260, 71, 267, 107, 108, 109, 260, 267, 160, + 113, 78, 289, 116, 267, 82, 74, 143, 75, 143, 146, 21, 146, 88, 245, 246, 91, 284, 51, 52, - 53, 31, 84, 85, 255, 71, 101, 235, 236, 64, - 65, 40, 162, 163, 67, 68, 69, 70, 74, 175, - 73, 175, 22, 23, 24, 78, 75, 57, 58, 136, - 137, 75, 260, 72, 285, 68, 69, 70, 13, 267, - 73, 140, 141, 199, 12, 199, 308, 309, 299, 11, - 231, 10, 225, 304, 149, 81, 22, 23, 24, 257, - 258, 312, 19, 83, 159, 86, 317, 72, 4, 225, + 53, 31, 22, 23, 255, 34, 101, 235, 236, 38, + 25, 26, 162, 163, 67, 68, 69, 70, 75, 175, + 73, 175, 22, 23, 24, 78, 72, 57, 58, 13, + 68, 69, 260, 12, 285, 73, 84, 85, 11, 267, + 55, 64, 65, 199, 81, 199, 136, 137, 299, 10, + 231, 19, 225, 304, 149, 83, 22, 23, 24, 140, + 141, 312, 308, 309, 159, 86, 317, 72, 4, 225, 36, 225, 205, 39, 72, 326, 327, 128, 129, 130, - 131, 132, 133, 134, 217, 74, 37, 43, 72, 245, - 246, 245, 246, 62, 244, 73, 77, 77, 75, 255, - 29, 255, 35, 45, 31, 200, 4, 240, 241, 4, - 14, 66, 4, 4, 30, 37, 211, 31, 268, 269, - 4, 4, 54, 77, 6, 75, 29, 44, 284, 285, - 284, 285, 227, 4, 31, 230, 66, 31, 271, 289, - 66, 66, 31, 299, 4, 299, 31, 28, 304, 62, - 304, 4, 76, 248, 22, 76, 312, 23, 312, 4, - 3, 317, 4, 317, 28, 77, 62, 77, 31, 4, - 326, 327, 326, 327, 4, 308, 309, 20, 21, 31, - 24, 24, 31, 24, 27, 28, 24, 282, 6, 205, - 33, 34, 251, 36, 113, 222, 39, 306, 116, 122, - 197, 44, 4, 138, 124, 139, 171, 50, 117, 271, - 125, 54, 55, -1, 57, 58, 163, 60, 20, 21, - 63, 126, 24, 66, 135, 27, 28, -1, 71, -1, + 131, 132, 133, 134, 217, 257, 258, 74, 37, 245, + 246, 245, 246, 43, 244, 72, 77, 62, 73, 255, + 29, 255, 35, 77, 75, 200, 45, 240, 241, 31, + 4, 4, 66, 14, 4, 4, 211, 30, 268, 269, + 37, 31, 4, 54, 4, 77, 29, 75, 284, 285, + 284, 285, 227, 6, 31, 230, 44, 4, 271, 289, + 66, 66, 66, 299, 31, 299, 31, 4, 304, 4, + 304, 28, 31, 248, 22, 62, 312, 76, 312, 23, + 3, 317, 76, 317, 4, 28, 4, 62, 77, 31, + 326, 327, 326, 327, 4, 308, 309, 20, 21, 77, + 4, 24, 24, 31, 27, 28, 31, 282, 24, 24, + 33, 34, 6, 36, 205, 113, 39, 222, 197, 251, + 116, 44, 4, 124, 138, 306, 126, 50, 135, 139, + 122, 54, 55, 171, 57, 58, 271, 60, 20, 21, + 63, 125, 24, 66, -1, 27, 28, -1, 71, 117, -1, 33, 34, 76, 36, -1, -1, 39, -1, -1, -1, -1, 44, -1, 6, 7, 8, 9, 50, -1, -1, -1, -1, 55, -1, 57, 58, -1, 60, -1, @@ -1048,8 +942,8 @@ static const yytype_int16 yycheck[] = -1, -1, 76 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* 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, 3, 20, @@ -1082,100 +976,91 @@ static const yytype_uint8 yystos[] = 77, 75, 114, 91, 91, 116, 29, 110, 108, 31, 106, 91, 41, 104, 145, 145, 44, 136, 4, 66, 66, 66, 136, 114, 114, 142, 31, 31, 32, 4, - 31, 28, 62, 116, 4, 92, 91, 114, 76, 76, + 31, 28, 62, 116, 4, 92, 91, 141, 76, 76, 22, 23, 4, 91, 28, 91, 111, 4, 143, 143, 91, 62, 91, 77, 77, 31, 4, 4, 24, 91, 91, 31, 31, 24, 24 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 + /* 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, + 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, + 120, 120, 121, 121, 122, 122, 122, 122, 122, 122, + 122, 122, 123, 123, 124, 124, 124, 125, 125, 126, + 126, 127, 127, 127, 128, 128, 129, 129, 129, 129, + 130, 130, 131, 131, 131, 131, 131, 131, 131, 132, + 132, 132, 132, 133, 133, 133, 134, 134, 135, 136, + 136, 136, 136, 136, 137, 137, 137, 138, 138, 139, + 139, 140, 140, 140, 141, 141, 142, 142, 143, 143, + 143, 144, 144, 145, 145 +}; -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab + /* 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, + 4, 7, 0, 2, 0, 1, 1, 2, 5, 0, + 3, 0, 4, 5, 1, 3, 1, 1, 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 +}; -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ +#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 (YYID (0)) + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* This macro is provided for backward compatibility. */ - -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, ctx) -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -1185,56 +1070,47 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, ctx); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, ctx); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - parser_ctx_t *ctx; -#endif { + FILE *yyo = yyoutput; + YYUSE (yyo); + YYUSE (ctx); if (!yyvaluep) return; - YYUSE (ctx); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -1242,23 +1118,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, ctx) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - parser_ctx_t *ctx; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx); YYFPRINTF (yyoutput, ")"); @@ -1269,16 +1133,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, ctx) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1289,50 +1145,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule, parser_ctx_t *ctx) -#else -static void -yy_reduce_print (yyvsp, yyrule, ctx) - YYSTYPE *yyvsp; - int yyrule; - parser_ctx_t *ctx; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parser_ctx_t *ctx) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , ctx); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , ctx); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule, ctx); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule, ctx); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1346,7 +1194,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1369,15 +1217,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1393,16 +1234,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1432,27 +1265,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1475,12 +1308,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = 0; + 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 @@ -1488,10 +1320,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1540,11 +1368,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, break; } yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } } } } @@ -1564,10 +1394,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, # undef YYCASE_ } - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } if (*yymsg_alloc < yysize) { @@ -1604,83 +1436,39 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parser_ctx_t *ctx) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, ctx) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - parser_ctx_t *ctx; -#endif { YYUSE (yyvaluep); YYUSE (ctx); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (parser_ctx_t *ctx); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ /*----------. | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (parser_ctx_t *ctx) -#else -int -yyparse (ctx) - parser_ctx_t *ctx; -#endif -#endif { /* The lookahead symbol. */ int yychar; + /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Number of syntax errors so far. */ int yynerrs; @@ -1690,10 +1478,10 @@ YYSTYPE yylval; int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. - Refer to the stacks thru separate pointers, to allow yyoverflow + Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ @@ -1711,7 +1499,7 @@ YYSTYPE yylval; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ - int yytoken; + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; @@ -1729,9 +1517,8 @@ YYSTYPE yylval; Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1740,14 +1527,6 @@ YYSTYPE yylval; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - goto yysetstate; /*------------------------------------------------------------. @@ -1768,23 +1547,23 @@ YYSTYPE yylval; #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); - yyss = yyss1; - yyvs = yyvs1; + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1792,22 +1571,22 @@ YYSTYPE yylval; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1816,10 +1595,10 @@ YYSTYPE yylval; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1848,7 +1627,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (&yylval, ctx); } if (yychar <= YYEOF) @@ -1888,7 +1667,9 @@ yybackup: yychar = YYEMPTY; yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; @@ -1911,7 +1692,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1925,1104 +1706,946 @@ yyreduce: switch (yyn) { case 2: - -/* Line 1806 of yacc.c */ -#line 147 "parser.y" - { parse_complete(ctx, (yyvsp[(1) - (3)].bool)); } +#line 147 "parser.y" /* yacc.c:1646 */ + { parse_complete(ctx, (yyvsp[-2].boolean)); } +#line 1717 "parser.tab.c" /* yacc.c:1646 */ break; case 3: - -/* Line 1806 of yacc.c */ -#line 150 "parser.y" - { (yyval.bool) = FALSE; } +#line 150 "parser.y" /* yacc.c:1646 */ + { (yyval.boolean) = FALSE; } +#line 1723 "parser.tab.c" /* yacc.c:1646 */ break; case 4: - -/* Line 1806 of yacc.c */ -#line 151 "parser.y" - { (yyval.bool) = TRUE; } +#line 151 "parser.y" /* yacc.c:1646 */ + { (yyval.boolean) = TRUE; } +#line 1729 "parser.tab.c" /* yacc.c:1646 */ break; case 6: - -/* Line 1806 of yacc.c */ -#line 155 "parser.y" - { source_add_statement(ctx, (yyvsp[(2) - (2)].statement)); } +#line 155 "parser.y" /* yacc.c:1646 */ + { source_add_statement(ctx, (yyvsp[0].statement)); } +#line 1735 "parser.tab.c" /* yacc.c:1646 */ break; case 7: - -/* Line 1806 of yacc.c */ -#line 156 "parser.y" - { source_add_class(ctx, (yyvsp[(2) - (2)].class_decl)); } +#line 156 "parser.y" /* yacc.c:1646 */ + { source_add_class(ctx, (yyvsp[0].class_decl)); } +#line 1741 "parser.tab.c" /* yacc.c:1646 */ break; case 8: - -/* Line 1806 of yacc.c */ -#line 159 "parser.y" +#line 159 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = NULL; } +#line 1747 "parser.tab.c" /* yacc.c:1646 */ break; case 9: - -/* Line 1806 of yacc.c */ -#line 160 "parser.y" - { (yyval.statement) = (yyvsp[(1) - (1)].statement); } +#line 160 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].statement); } +#line 1753 "parser.tab.c" /* yacc.c:1646 */ break; case 10: - -/* Line 1806 of yacc.c */ -#line 163 "parser.y" - { (yyval.statement) = (yyvsp[(1) - (1)].statement); } +#line 163 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].statement); } +#line 1759 "parser.tab.c" /* yacc.c:1646 */ break; case 11: - -/* Line 1806 of yacc.c */ -#line 164 "parser.y" - { (yyval.statement) = link_statements((yyvsp[(1) - (2)].statement), (yyvsp[(2) - (2)].statement)); } +#line 164 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = link_statements((yyvsp[-1].statement), (yyvsp[0].statement)); } +#line 1765 "parser.tab.c" /* yacc.c:1646 */ break; case 12: - -/* Line 1806 of yacc.c */ -#line 167 "parser.y" - { (yyval.statement) = (yyvsp[(1) - (2)].statement); } +#line 167 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[-1].statement); } +#line 1771 "parser.tab.c" /* yacc.c:1646 */ break; case 13: - -/* Line 1806 of yacc.c */ -#line 170 "parser.y" +#line 170 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = NULL; } +#line 1777 "parser.tab.c" /* yacc.c:1646 */ break; case 14: - -/* Line 1806 of yacc.c */ -#line 171 "parser.y" - { (yyval.statement) = (yyvsp[(2) - (2)].statement); } +#line 171 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].statement); } +#line 1783 "parser.tab.c" /* yacc.c:1646 */ break; case 15: - -/* Line 1806 of yacc.c */ -#line 172 "parser.y" - { (yyval.statement) = (yyvsp[(1) - (1)].statement); } +#line 172 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].statement); } +#line 1789 "parser.tab.c" /* yacc.c:1646 */ break; case 16: - -/* Line 1806 of yacc.c */ -#line 173 "parser.y" - { (yyvsp[(1) - (3)].statement)->next = (yyvsp[(3) - (3)].statement); (yyval.statement) = (yyvsp[(1) - (3)].statement); } +#line 173 "parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].statement)->next = (yyvsp[0].statement); (yyval.statement) = (yyvsp[-2].statement); } +#line 1795 "parser.tab.c" /* yacc.c:1646 */ break; case 17: - -/* Line 1806 of yacc.c */ -#line 174 "parser.y" - { (yyval.statement) = (yyvsp[(1) - (2)].statement); } +#line 174 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[-1].statement); } +#line 1801 "parser.tab.c" /* yacc.c:1646 */ break; case 18: - -/* Line 1806 of yacc.c */ -#line 177 "parser.y" - { (yyvsp[(1) - (2)].member)->args = (yyvsp[(2) - (2)].expression); (yyval.statement) = new_call_statement(ctx, FALSE, (yyvsp[(1) - (2)].member)); CHECK_ERROR; } +#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 1807 "parser.tab.c" /* yacc.c:1646 */ break; case 19: - -/* Line 1806 of yacc.c */ -#line 178 "parser.y" - { (yyvsp[(2) - (3)].member)->args = (yyvsp[(3) - (3)].expression); (yyval.statement) = new_call_statement(ctx, TRUE, (yyvsp[(2) - (3)].member)); CHECK_ERROR; } +#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 1813 "parser.tab.c" /* yacc.c:1646 */ break; case 20: - -/* Line 1806 of yacc.c */ -#line 180 "parser.y" - { (yyvsp[(1) - (4)].member)->args = (yyvsp[(2) - (4)].expression); (yyval.statement) = new_assign_statement(ctx, (yyvsp[(1) - (4)].member), (yyvsp[(4) - (4)].expression)); CHECK_ERROR; } +#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 1819 "parser.tab.c" /* yacc.c:1646 */ break; case 21: - -/* Line 1806 of yacc.c */ -#line 181 "parser.y" - { (yyval.statement) = new_dim_statement(ctx, (yyvsp[(2) - (2)].dim_decl)); CHECK_ERROR; } +#line 181 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = new_dim_statement(ctx, (yyvsp[0].dim_decl)); CHECK_ERROR; } +#line 1825 "parser.tab.c" /* yacc.c:1646 */ break; case 22: - -/* Line 1806 of yacc.c */ -#line 182 "parser.y" - { (yyval.statement) = (yyvsp[(1) - (1)].statement); } +#line 182 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].statement); } +#line 1831 "parser.tab.c" /* yacc.c:1646 */ break; case 23: - -/* Line 1806 of yacc.c */ -#line 184 "parser.y" - { (yyval.statement) = new_while_statement(ctx, STAT_WHILE, (yyvsp[(2) - (5)].expression), (yyvsp[(4) - (5)].statement)); CHECK_ERROR; } +#line 184 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = new_while_statement(ctx, STAT_WHILE, (yyvsp[-3].expression), (yyvsp[-1].statement)); CHECK_ERROR; } +#line 1837 "parser.tab.c" /* yacc.c:1646 */ break; case 24: - -/* Line 1806 of yacc.c */ -#line 186 "parser.y" - { (yyval.statement) = new_while_statement(ctx, (yyvsp[(2) - (6)].bool) ? STAT_WHILELOOP : STAT_UNTIL, (yyvsp[(3) - (6)].expression), (yyvsp[(5) - (6)].statement)); +#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 1844 "parser.tab.c" /* yacc.c:1646 */ break; case 25: - -/* Line 1806 of yacc.c */ -#line 189 "parser.y" - { (yyval.statement) = new_while_statement(ctx, (yyvsp[(5) - (6)].bool) ? STAT_DOWHILE : STAT_DOUNTIL, (yyvsp[(6) - (6)].expression), (yyvsp[(3) - (6)].statement)); +#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 1851 "parser.tab.c" /* yacc.c:1646 */ break; case 26: - -/* Line 1806 of yacc.c */ -#line 191 "parser.y" - { (yyval.statement) = new_while_statement(ctx, STAT_DOWHILE, NULL, (yyvsp[(3) - (4)].statement)); CHECK_ERROR; } +#line 191 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = new_while_statement(ctx, STAT_DOWHILE, NULL, (yyvsp[-1].statement)); CHECK_ERROR; } +#line 1857 "parser.tab.c" /* yacc.c:1646 */ break; case 27: - -/* Line 1806 of yacc.c */ -#line 192 "parser.y" - { (yyval.statement) = new_function_statement(ctx, (yyvsp[(1) - (1)].func_decl)); CHECK_ERROR; } +#line 192 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = new_function_statement(ctx, (yyvsp[0].func_decl)); CHECK_ERROR; } +#line 1863 "parser.tab.c" /* yacc.c:1646 */ break; case 28: - -/* Line 1806 of yacc.c */ -#line 193 "parser.y" +#line 193 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_statement(ctx, STAT_EXITDO, 0); CHECK_ERROR; } +#line 1869 "parser.tab.c" /* yacc.c:1646 */ break; case 29: - -/* Line 1806 of yacc.c */ -#line 194 "parser.y" +#line 194 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_statement(ctx, STAT_EXITFOR, 0); CHECK_ERROR; } +#line 1875 "parser.tab.c" /* yacc.c:1646 */ break; case 30: - -/* Line 1806 of yacc.c */ -#line 195 "parser.y" +#line 195 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_statement(ctx, STAT_EXITFUNC, 0); CHECK_ERROR; } +#line 1881 "parser.tab.c" /* yacc.c:1646 */ break; case 31: - -/* Line 1806 of yacc.c */ -#line 196 "parser.y" +#line 196 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_statement(ctx, STAT_EXITPROP, 0); CHECK_ERROR; } +#line 1887 "parser.tab.c" /* yacc.c:1646 */ break; case 32: - -/* Line 1806 of yacc.c */ -#line 197 "parser.y" +#line 197 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_statement(ctx, STAT_EXITSUB, 0); CHECK_ERROR; } +#line 1893 "parser.tab.c" /* yacc.c:1646 */ break; case 33: - -/* Line 1806 of yacc.c */ -#line 199 "parser.y" - { (yyvsp[(2) - (5)].member)->args = (yyvsp[(3) - (5)].expression); (yyval.statement) = new_set_statement(ctx, (yyvsp[(2) - (5)].member), (yyvsp[(5) - (5)].expression)); CHECK_ERROR; } +#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 1899 "parser.tab.c" /* yacc.c:1646 */ break; case 34: - -/* Line 1806 of yacc.c */ -#line 200 "parser.y" +#line 200 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_statement(ctx, STAT_STOP, 0); CHECK_ERROR; } +#line 1905 "parser.tab.c" /* yacc.c:1646 */ break; case 35: - -/* Line 1806 of yacc.c */ -#line 201 "parser.y" +#line 201 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_onerror_statement(ctx, TRUE); CHECK_ERROR; } +#line 1911 "parser.tab.c" /* yacc.c:1646 */ break; case 36: - -/* Line 1806 of yacc.c */ -#line 202 "parser.y" +#line 202 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_onerror_statement(ctx, FALSE); CHECK_ERROR; } +#line 1917 "parser.tab.c" /* yacc.c:1646 */ break; case 37: - -/* Line 1806 of yacc.c */ -#line 203 "parser.y" - { (yyval.statement) = new_const_statement(ctx, (yyvsp[(2) - (2)].const_decl)); CHECK_ERROR; } +#line 203 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = new_const_statement(ctx, (yyvsp[0].const_decl)); CHECK_ERROR; } +#line 1923 "parser.tab.c" /* yacc.c:1646 */ break; case 38: - -/* Line 1806 of yacc.c */ -#line 205 "parser.y" - { (yyval.statement) = new_forto_statement(ctx, (yyvsp[(2) - (10)].string), (yyvsp[(4) - (10)].expression), (yyvsp[(6) - (10)].expression), (yyvsp[(7) - (10)].expression), (yyvsp[(9) - (10)].statement)); CHECK_ERROR; } +#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 1929 "parser.tab.c" /* yacc.c:1646 */ break; case 39: - -/* Line 1806 of yacc.c */ -#line 207 "parser.y" - { (yyval.statement) = new_foreach_statement(ctx, (yyvsp[(3) - (8)].string), (yyvsp[(5) - (8)].expression), (yyvsp[(7) - (8)].statement)); } +#line 207 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = new_foreach_statement(ctx, (yyvsp[-5].string), (yyvsp[-3].expression), (yyvsp[-1].statement)); } +#line 1935 "parser.tab.c" /* yacc.c:1646 */ break; case 40: - -/* Line 1806 of yacc.c */ -#line 209 "parser.y" - { (yyval.statement) = new_select_statement(ctx, (yyvsp[(3) - (7)].expression), (yyvsp[(5) - (7)].case_clausule)); } +#line 209 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = new_select_statement(ctx, (yyvsp[-4].expression), (yyvsp[-2].case_clausule)); } +#line 1941 "parser.tab.c" /* yacc.c:1646 */ break; case 41: - -/* Line 1806 of yacc.c */ -#line 212 "parser.y" - { (yyval.member) = new_member_expression(ctx, NULL, (yyvsp[(1) - (1)].string)); CHECK_ERROR; } +#line 212 "parser.y" /* yacc.c:1646 */ + { (yyval.member) = new_member_expression(ctx, NULL, (yyvsp[0].string)); CHECK_ERROR; } +#line 1947 "parser.tab.c" /* yacc.c:1646 */ break; case 42: - -/* Line 1806 of yacc.c */ -#line 213 "parser.y" - { (yyval.member) = new_member_expression(ctx, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].string)); CHECK_ERROR; } +#line 213 "parser.y" /* yacc.c:1646 */ + { (yyval.member) = new_member_expression(ctx, (yyvsp[-2].expression), (yyvsp[0].string)); CHECK_ERROR; } +#line 1953 "parser.tab.c" /* yacc.c:1646 */ break; case 43: - -/* Line 1806 of yacc.c */ -#line 216 "parser.y" - { (yyval.dim_decl) = (yyvsp[(1) - (1)].dim_decl); } +#line 216 "parser.y" /* yacc.c:1646 */ + { (yyval.dim_decl) = (yyvsp[0].dim_decl); } +#line 1959 "parser.tab.c" /* yacc.c:1646 */ break; case 44: - -/* Line 1806 of yacc.c */ -#line 217 "parser.y" - { (yyvsp[(1) - (3)].dim_decl)->next = (yyvsp[(3) - (3)].dim_decl); (yyval.dim_decl) = (yyvsp[(1) - (3)].dim_decl); } +#line 217 "parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].dim_decl)->next = (yyvsp[0].dim_decl); (yyval.dim_decl) = (yyvsp[-2].dim_decl); } +#line 1965 "parser.tab.c" /* yacc.c:1646 */ break; case 45: - -/* Line 1806 of yacc.c */ -#line 220 "parser.y" - { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[(1) - (1)].string), FALSE, NULL); CHECK_ERROR; } +#line 220 "parser.y" /* yacc.c:1646 */ + { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[0].string), FALSE, NULL); CHECK_ERROR; } +#line 1971 "parser.tab.c" /* yacc.c:1646 */ break; case 46: - -/* Line 1806 of yacc.c */ -#line 221 "parser.y" - { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[(1) - (4)].string), TRUE, (yyvsp[(3) - (4)].dim_list)); CHECK_ERROR; } +#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 1977 "parser.tab.c" /* yacc.c:1646 */ break; case 47: - -/* Line 1806 of yacc.c */ -#line 222 "parser.y" - { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[(1) - (2)].string), TRUE, NULL); CHECK_ERROR; } +#line 222 "parser.y" /* yacc.c:1646 */ + { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[-1].string), TRUE, NULL); CHECK_ERROR; } +#line 1983 "parser.tab.c" /* yacc.c:1646 */ break; case 48: - -/* Line 1806 of yacc.c */ -#line 225 "parser.y" - { (yyval.dim_list) = new_dim(ctx, (yyvsp[(1) - (1)].uint), NULL); } +#line 225 "parser.y" /* yacc.c:1646 */ + { (yyval.dim_list) = new_dim(ctx, (yyvsp[0].uint), NULL); } +#line 1989 "parser.tab.c" /* yacc.c:1646 */ break; case 49: - -/* Line 1806 of yacc.c */ -#line 226 "parser.y" - { (yyval.dim_list) = new_dim(ctx, (yyvsp[(1) - (3)].uint), (yyvsp[(3) - (3)].dim_list)); } +#line 226 "parser.y" /* yacc.c:1646 */ + { (yyval.dim_list) = new_dim(ctx, (yyvsp[-2].uint), (yyvsp[0].dim_list)); } +#line 1995 "parser.tab.c" /* yacc.c:1646 */ break; case 50: - -/* Line 1806 of yacc.c */ -#line 229 "parser.y" - { (yyval.const_decl) = (yyvsp[(1) - (1)].const_decl); } +#line 229 "parser.y" /* yacc.c:1646 */ + { (yyval.const_decl) = (yyvsp[0].const_decl); } +#line 2001 "parser.tab.c" /* yacc.c:1646 */ break; case 51: - -/* Line 1806 of yacc.c */ -#line 230 "parser.y" - { (yyvsp[(1) - (3)].const_decl)->next = (yyvsp[(3) - (3)].const_decl); (yyval.const_decl) = (yyvsp[(1) - (3)].const_decl); } +#line 230 "parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].const_decl)->next = (yyvsp[0].const_decl); (yyval.const_decl) = (yyvsp[-2].const_decl); } +#line 2007 "parser.tab.c" /* yacc.c:1646 */ break; case 52: - -/* Line 1806 of yacc.c */ -#line 233 "parser.y" - { (yyval.const_decl) = new_const_decl(ctx, (yyvsp[(1) - (3)].string), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 233 "parser.y" /* yacc.c:1646 */ + { (yyval.const_decl) = new_const_decl(ctx, (yyvsp[-2].string), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2013 "parser.tab.c" /* yacc.c:1646 */ break; case 53: - -/* Line 1806 of yacc.c */ -#line 236 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 236 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2019 "parser.tab.c" /* yacc.c:1646 */ break; case 54: - -/* Line 1806 of yacc.c */ -#line 237 "parser.y" - { (yyval.expression) = new_unary_expression(ctx, EXPR_NEG, (yyvsp[(2) - (2)].expression)); CHECK_ERROR; } +#line 237 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_unary_expression(ctx, EXPR_NEG, (yyvsp[0].expression)); CHECK_ERROR; } +#line 2025 "parser.tab.c" /* yacc.c:1646 */ break; case 55: - -/* Line 1806 of yacc.c */ -#line 240 "parser.y" - { (yyval.bool) = TRUE; } +#line 240 "parser.y" /* yacc.c:1646 */ + { (yyval.boolean) = TRUE; } +#line 2031 "parser.tab.c" /* yacc.c:1646 */ break; case 56: - -/* Line 1806 of yacc.c */ -#line 241 "parser.y" - { (yyval.bool) = FALSE; } +#line 241 "parser.y" /* yacc.c:1646 */ + { (yyval.boolean) = FALSE; } +#line 2037 "parser.tab.c" /* yacc.c:1646 */ break; case 57: - -/* Line 1806 of yacc.c */ -#line 244 "parser.y" +#line 244 "parser.y" /* yacc.c:1646 */ { (yyval.expression) = NULL;} +#line 2043 "parser.tab.c" /* yacc.c:1646 */ break; case 58: - -/* Line 1806 of yacc.c */ -#line 245 "parser.y" - { (yyval.expression) = (yyvsp[(2) - (2)].expression); } +#line 245 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2049 "parser.tab.c" /* yacc.c:1646 */ break; case 59: - -/* Line 1806 of yacc.c */ -#line 249 "parser.y" - { (yyval.statement) = new_if_statement(ctx, (yyvsp[(2) - (9)].expression), (yyvsp[(5) - (9)].statement), (yyvsp[(6) - (9)].elseif), (yyvsp[(7) - (9)].statement)); CHECK_ERROR; } +#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 2055 "parser.tab.c" /* yacc.c:1646 */ break; case 60: - -/* Line 1806 of yacc.c */ -#line 250 "parser.y" - { (yyval.statement) = new_if_statement(ctx, (yyvsp[(2) - (4)].expression), (yyvsp[(4) - (4)].statement), NULL, NULL); CHECK_ERROR; } +#line 250 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = new_if_statement(ctx, (yyvsp[-2].expression), (yyvsp[0].statement), NULL, NULL); CHECK_ERROR; } +#line 2061 "parser.tab.c" /* yacc.c:1646 */ break; case 61: - -/* Line 1806 of yacc.c */ -#line 252 "parser.y" - { (yyval.statement) = new_if_statement(ctx, (yyvsp[(2) - (7)].expression), (yyvsp[(4) - (7)].statement), NULL, (yyvsp[(6) - (7)].statement)); CHECK_ERROR; } +#line 252 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = new_if_statement(ctx, (yyvsp[-5].expression), (yyvsp[-3].statement), NULL, (yyvsp[-1].statement)); CHECK_ERROR; } +#line 2067 "parser.tab.c" /* yacc.c:1646 */ break; case 64: - -/* Line 1806 of yacc.c */ -#line 259 "parser.y" +#line 259 "parser.y" /* yacc.c:1646 */ { (yyval.elseif) = NULL; } +#line 2073 "parser.tab.c" /* yacc.c:1646 */ break; case 65: - -/* Line 1806 of yacc.c */ -#line 260 "parser.y" - { (yyval.elseif) = (yyvsp[(1) - (1)].elseif); } +#line 260 "parser.y" /* yacc.c:1646 */ + { (yyval.elseif) = (yyvsp[0].elseif); } +#line 2079 "parser.tab.c" /* yacc.c:1646 */ break; case 66: - -/* Line 1806 of yacc.c */ -#line 263 "parser.y" - { (yyval.elseif) = (yyvsp[(1) - (1)].elseif); } +#line 263 "parser.y" /* yacc.c:1646 */ + { (yyval.elseif) = (yyvsp[0].elseif); } +#line 2085 "parser.tab.c" /* yacc.c:1646 */ break; case 67: - -/* Line 1806 of yacc.c */ -#line 264 "parser.y" - { (yyvsp[(1) - (2)].elseif)->next = (yyvsp[(2) - (2)].elseif); (yyval.elseif) = (yyvsp[(1) - (2)].elseif); } +#line 264 "parser.y" /* yacc.c:1646 */ + { (yyvsp[-1].elseif)->next = (yyvsp[0].elseif); (yyval.elseif) = (yyvsp[-1].elseif); } +#line 2091 "parser.tab.c" /* yacc.c:1646 */ break; case 68: - -/* Line 1806 of yacc.c */ -#line 268 "parser.y" - { (yyval.elseif) = new_elseif_decl(ctx, (yyvsp[(2) - (5)].expression), (yyvsp[(5) - (5)].statement)); } +#line 268 "parser.y" /* yacc.c:1646 */ + { (yyval.elseif) = new_elseif_decl(ctx, (yyvsp[-3].expression), (yyvsp[0].statement)); } +#line 2097 "parser.tab.c" /* yacc.c:1646 */ break; case 69: - -/* Line 1806 of yacc.c */ -#line 271 "parser.y" +#line 271 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = NULL; } +#line 2103 "parser.tab.c" /* yacc.c:1646 */ break; case 70: - -/* Line 1806 of yacc.c */ -#line 272 "parser.y" - { (yyval.statement) = (yyvsp[(3) - (3)].statement); } +#line 272 "parser.y" /* yacc.c:1646 */ + { (yyval.statement) = (yyvsp[0].statement); } +#line 2109 "parser.tab.c" /* yacc.c:1646 */ break; case 71: - -/* Line 1806 of yacc.c */ -#line 275 "parser.y" +#line 275 "parser.y" /* yacc.c:1646 */ { (yyval.case_clausule) = NULL; } +#line 2115 "parser.tab.c" /* yacc.c:1646 */ break; case 72: - -/* Line 1806 of yacc.c */ -#line 276 "parser.y" - { (yyval.case_clausule) = new_case_clausule(ctx, NULL, (yyvsp[(4) - (4)].statement), NULL); } +#line 276 "parser.y" /* yacc.c:1646 */ + { (yyval.case_clausule) = new_case_clausule(ctx, NULL, (yyvsp[0].statement), NULL); } +#line 2121 "parser.tab.c" /* yacc.c:1646 */ break; case 73: - -/* Line 1806 of yacc.c */ -#line 278 "parser.y" - { (yyval.case_clausule) = new_case_clausule(ctx, (yyvsp[(2) - (5)].expression), (yyvsp[(4) - (5)].statement), (yyvsp[(5) - (5)].case_clausule)); } +#line 278 "parser.y" /* yacc.c:1646 */ + { (yyval.case_clausule) = new_case_clausule(ctx, (yyvsp[-3].expression), (yyvsp[-1].statement), (yyvsp[0].case_clausule)); } +#line 2127 "parser.tab.c" /* yacc.c:1646 */ break; case 74: - -/* Line 1806 of yacc.c */ -#line 281 "parser.y" +#line 281 "parser.y" /* yacc.c:1646 */ { (yyval.expression) = NULL; } +#line 2133 "parser.tab.c" /* yacc.c:1646 */ break; case 75: - -/* Line 1806 of yacc.c */ -#line 282 "parser.y" - { (yyval.expression) = (yyvsp[(2) - (3)].expression); } +#line 282 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[-1].expression); } +#line 2139 "parser.tab.c" /* yacc.c:1646 */ break; case 76: - -/* Line 1806 of yacc.c */ -#line 285 "parser.y" +#line 285 "parser.y" /* yacc.c:1646 */ { (yyval.expression) = NULL; } +#line 2145 "parser.tab.c" /* yacc.c:1646 */ break; case 77: - -/* Line 1806 of yacc.c */ -#line 286 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 286 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2151 "parser.tab.c" /* yacc.c:1646 */ break; case 80: - -/* Line 1806 of yacc.c */ -#line 293 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 293 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2157 "parser.tab.c" /* yacc.c:1646 */ break; case 81: - -/* Line 1806 of yacc.c */ -#line 294 "parser.y" - { (yyvsp[(1) - (3)].expression)->next = (yyvsp[(3) - (3)].expression); (yyval.expression) = (yyvsp[(1) - (3)].expression); } +#line 294 "parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].expression)->next = (yyvsp[0].expression); (yyval.expression) = (yyvsp[-2].expression); } +#line 2163 "parser.tab.c" /* yacc.c:1646 */ break; case 82: - -/* Line 1806 of yacc.c */ -#line 297 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 297 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2169 "parser.tab.c" /* yacc.c:1646 */ break; case 83: - -/* Line 1806 of yacc.c */ -#line 298 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_IMP, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 298 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_IMP, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2175 "parser.tab.c" /* yacc.c:1646 */ break; case 84: - -/* Line 1806 of yacc.c */ -#line 301 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 301 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2181 "parser.tab.c" /* yacc.c:1646 */ break; case 85: - -/* Line 1806 of yacc.c */ -#line 302 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_EQV, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 302 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_EQV, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2187 "parser.tab.c" /* yacc.c:1646 */ break; case 86: - -/* Line 1806 of yacc.c */ -#line 305 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 305 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2193 "parser.tab.c" /* yacc.c:1646 */ break; case 87: - -/* Line 1806 of yacc.c */ -#line 306 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_XOR, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 306 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_XOR, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2199 "parser.tab.c" /* yacc.c:1646 */ break; case 88: - -/* Line 1806 of yacc.c */ -#line 309 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 309 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2205 "parser.tab.c" /* yacc.c:1646 */ break; case 89: - -/* Line 1806 of yacc.c */ -#line 310 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_OR, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 310 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_OR, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2211 "parser.tab.c" /* yacc.c:1646 */ break; case 90: - -/* Line 1806 of yacc.c */ -#line 313 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 313 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2217 "parser.tab.c" /* yacc.c:1646 */ break; case 91: - -/* Line 1806 of yacc.c */ -#line 314 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_AND, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 314 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_AND, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2223 "parser.tab.c" /* yacc.c:1646 */ break; case 92: - -/* Line 1806 of yacc.c */ -#line 317 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 317 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2229 "parser.tab.c" /* yacc.c:1646 */ break; case 93: - -/* Line 1806 of yacc.c */ -#line 318 "parser.y" - { (yyval.expression) = new_unary_expression(ctx, EXPR_NOT, (yyvsp[(2) - (2)].expression)); CHECK_ERROR; } +#line 318 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_unary_expression(ctx, EXPR_NOT, (yyvsp[0].expression)); CHECK_ERROR; } +#line 2235 "parser.tab.c" /* yacc.c:1646 */ break; case 94: - -/* Line 1806 of yacc.c */ -#line 321 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 321 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2241 "parser.tab.c" /* yacc.c:1646 */ break; case 95: - -/* Line 1806 of yacc.c */ -#line 322 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_EQUAL, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 322 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_EQUAL, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2247 "parser.tab.c" /* yacc.c:1646 */ break; case 96: - -/* Line 1806 of yacc.c */ -#line 323 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_NEQUAL, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 323 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_NEQUAL, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2253 "parser.tab.c" /* yacc.c:1646 */ break; case 97: - -/* Line 1806 of yacc.c */ -#line 324 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_GT, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 324 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_GT, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2259 "parser.tab.c" /* yacc.c:1646 */ break; case 98: - -/* Line 1806 of yacc.c */ -#line 325 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_LT, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 325 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_LT, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2265 "parser.tab.c" /* yacc.c:1646 */ break; case 99: - -/* Line 1806 of yacc.c */ -#line 326 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_GTEQ, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 326 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_GTEQ, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2271 "parser.tab.c" /* yacc.c:1646 */ break; case 100: - -/* Line 1806 of yacc.c */ -#line 327 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_LTEQ, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 327 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_LTEQ, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2277 "parser.tab.c" /* yacc.c:1646 */ break; case 101: - -/* Line 1806 of yacc.c */ -#line 328 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_IS, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 328 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_IS, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2283 "parser.tab.c" /* yacc.c:1646 */ break; case 102: - -/* Line 1806 of yacc.c */ -#line 331 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 331 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2289 "parser.tab.c" /* yacc.c:1646 */ break; case 103: - -/* Line 1806 of yacc.c */ -#line 332 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_CONCAT, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 332 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_CONCAT, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2295 "parser.tab.c" /* yacc.c:1646 */ break; case 104: - -/* Line 1806 of yacc.c */ -#line 335 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 335 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2301 "parser.tab.c" /* yacc.c:1646 */ break; case 105: - -/* Line 1806 of yacc.c */ -#line 336 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_ADD, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 336 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_ADD, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2307 "parser.tab.c" /* yacc.c:1646 */ break; case 106: - -/* Line 1806 of yacc.c */ -#line 337 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_SUB, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 337 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_SUB, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2313 "parser.tab.c" /* yacc.c:1646 */ break; case 107: - -/* Line 1806 of yacc.c */ -#line 340 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 340 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2319 "parser.tab.c" /* yacc.c:1646 */ break; case 108: - -/* Line 1806 of yacc.c */ -#line 341 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_MOD, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 341 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_MOD, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2325 "parser.tab.c" /* yacc.c:1646 */ break; case 109: - -/* Line 1806 of yacc.c */ -#line 344 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 344 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2331 "parser.tab.c" /* yacc.c:1646 */ break; case 110: - -/* Line 1806 of yacc.c */ -#line 346 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_IDIV, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 346 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_IDIV, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2337 "parser.tab.c" /* yacc.c:1646 */ break; case 111: - -/* Line 1806 of yacc.c */ -#line 349 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 349 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2343 "parser.tab.c" /* yacc.c:1646 */ break; case 112: - -/* Line 1806 of yacc.c */ -#line 351 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_MUL, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 351 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_MUL, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2349 "parser.tab.c" /* yacc.c:1646 */ break; case 113: - -/* Line 1806 of yacc.c */ -#line 353 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_DIV, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 353 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_DIV, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2355 "parser.tab.c" /* yacc.c:1646 */ break; case 114: - -/* Line 1806 of yacc.c */ -#line 356 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 356 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2361 "parser.tab.c" /* yacc.c:1646 */ break; case 115: - -/* Line 1806 of yacc.c */ -#line 357 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_EXP, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); CHECK_ERROR; } +#line 357 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_binary_expression(ctx, EXPR_EXP, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2367 "parser.tab.c" /* yacc.c:1646 */ break; case 116: - -/* Line 1806 of yacc.c */ -#line 360 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 360 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2373 "parser.tab.c" /* yacc.c:1646 */ break; case 117: - -/* Line 1806 of yacc.c */ -#line 361 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 361 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2379 "parser.tab.c" /* yacc.c:1646 */ break; case 118: - -/* Line 1806 of yacc.c */ -#line 362 "parser.y" - { (yyval.expression) = new_new_expression(ctx, (yyvsp[(2) - (2)].string)); CHECK_ERROR; } +#line 362 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_new_expression(ctx, (yyvsp[0].string)); CHECK_ERROR; } +#line 2385 "parser.tab.c" /* yacc.c:1646 */ break; case 119: - -/* Line 1806 of yacc.c */ -#line 363 "parser.y" - { (yyval.expression) = new_unary_expression(ctx, EXPR_NEG, (yyvsp[(2) - (2)].expression)); CHECK_ERROR; } +#line 363 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_unary_expression(ctx, EXPR_NEG, (yyvsp[0].expression)); CHECK_ERROR; } +#line 2391 "parser.tab.c" /* yacc.c:1646 */ break; case 120: - -/* Line 1806 of yacc.c */ -#line 366 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 366 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2397 "parser.tab.c" /* yacc.c:1646 */ break; case 121: - -/* Line 1806 of yacc.c */ -#line 367 "parser.y" - { (yyvsp[(1) - (2)].member)->args = (yyvsp[(2) - (2)].expression); (yyval.expression) = &(yyvsp[(1) - (2)].member)->expr; } +#line 367 "parser.y" /* yacc.c:1646 */ + { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.expression) = &(yyvsp[-1].member)->expr; } +#line 2403 "parser.tab.c" /* yacc.c:1646 */ break; case 122: - -/* Line 1806 of yacc.c */ -#line 370 "parser.y" +#line 370 "parser.y" /* yacc.c:1646 */ { (yyval.expression) = new_bool_expression(ctx, VARIANT_TRUE); CHECK_ERROR; } +#line 2409 "parser.tab.c" /* yacc.c:1646 */ break; case 123: - -/* Line 1806 of yacc.c */ -#line 371 "parser.y" +#line 371 "parser.y" /* yacc.c:1646 */ { (yyval.expression) = new_bool_expression(ctx, VARIANT_FALSE); CHECK_ERROR; } +#line 2415 "parser.tab.c" /* yacc.c:1646 */ break; case 124: - -/* Line 1806 of yacc.c */ -#line 372 "parser.y" - { (yyval.expression) = new_string_expression(ctx, (yyvsp[(1) - (1)].string)); CHECK_ERROR; } +#line 372 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_string_expression(ctx, (yyvsp[0].string)); CHECK_ERROR; } +#line 2421 "parser.tab.c" /* yacc.c:1646 */ break; case 125: - -/* Line 1806 of yacc.c */ -#line 373 "parser.y" - { (yyval.expression) = (yyvsp[(1) - (1)].expression); } +#line 373 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = (yyvsp[0].expression); } +#line 2427 "parser.tab.c" /* yacc.c:1646 */ break; case 126: - -/* Line 1806 of yacc.c */ -#line 374 "parser.y" +#line 374 "parser.y" /* yacc.c:1646 */ { (yyval.expression) = new_expression(ctx, EXPR_EMPTY, 0); CHECK_ERROR; } +#line 2433 "parser.tab.c" /* yacc.c:1646 */ break; case 127: - -/* Line 1806 of yacc.c */ -#line 375 "parser.y" +#line 375 "parser.y" /* yacc.c:1646 */ { (yyval.expression) = new_expression(ctx, EXPR_NULL, 0); CHECK_ERROR; } +#line 2439 "parser.tab.c" /* yacc.c:1646 */ break; case 128: - -/* Line 1806 of yacc.c */ -#line 376 "parser.y" +#line 376 "parser.y" /* yacc.c:1646 */ { (yyval.expression) = new_expression(ctx, EXPR_NOTHING, 0); CHECK_ERROR; } +#line 2445 "parser.tab.c" /* yacc.c:1646 */ break; case 129: - -/* Line 1806 of yacc.c */ -#line 379 "parser.y" - { (yyval.expression) = new_long_expression(ctx, EXPR_USHORT, (yyvsp[(1) - (1)].lng)); CHECK_ERROR; } +#line 379 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_long_expression(ctx, EXPR_USHORT, (yyvsp[0].lng)); CHECK_ERROR; } +#line 2451 "parser.tab.c" /* yacc.c:1646 */ break; case 130: - -/* Line 1806 of yacc.c */ -#line 380 "parser.y" +#line 380 "parser.y" /* yacc.c:1646 */ { (yyval.expression) = new_long_expression(ctx, EXPR_USHORT, 0); CHECK_ERROR; } +#line 2457 "parser.tab.c" /* yacc.c:1646 */ break; case 131: - -/* Line 1806 of yacc.c */ -#line 381 "parser.y" - { (yyval.expression) = new_long_expression(ctx, EXPR_ULONG, (yyvsp[(1) - (1)].lng)); CHECK_ERROR; } +#line 381 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_long_expression(ctx, EXPR_ULONG, (yyvsp[0].lng)); CHECK_ERROR; } +#line 2463 "parser.tab.c" /* yacc.c:1646 */ break; case 132: - -/* Line 1806 of yacc.c */ -#line 382 "parser.y" - { (yyval.expression) = new_double_expression(ctx, (yyvsp[(1) - (1)].dbl)); CHECK_ERROR; } +#line 382 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_double_expression(ctx, (yyvsp[0].dbl)); CHECK_ERROR; } +#line 2469 "parser.tab.c" /* yacc.c:1646 */ break; case 133: - -/* Line 1806 of yacc.c */ -#line 385 "parser.y" - { (yyval.uint) = (yyvsp[(1) - (1)].lng); } +#line 385 "parser.y" /* yacc.c:1646 */ + { (yyval.uint) = (yyvsp[0].lng); } +#line 2475 "parser.tab.c" /* yacc.c:1646 */ break; case 134: - -/* Line 1806 of yacc.c */ -#line 386 "parser.y" +#line 386 "parser.y" /* yacc.c:1646 */ { (yyval.uint) = 0; } +#line 2481 "parser.tab.c" /* yacc.c:1646 */ break; case 135: - -/* Line 1806 of yacc.c */ -#line 387 "parser.y" - { (yyval.uint) = (yyvsp[(1) - (1)].lng); } +#line 387 "parser.y" /* yacc.c:1646 */ + { (yyval.uint) = (yyvsp[0].lng); } +#line 2487 "parser.tab.c" /* yacc.c:1646 */ break; case 136: - -/* Line 1806 of yacc.c */ -#line 390 "parser.y" - { (yyval.expression) = new_unary_expression(ctx, EXPR_BRACKETS, (yyvsp[(2) - (3)].expression)); } +#line 390 "parser.y" /* yacc.c:1646 */ + { (yyval.expression) = new_unary_expression(ctx, EXPR_BRACKETS, (yyvsp[-1].expression)); } +#line 2493 "parser.tab.c" /* yacc.c:1646 */ break; case 137: - -/* Line 1806 of yacc.c */ -#line 391 "parser.y" +#line 391 "parser.y" /* yacc.c:1646 */ { (yyval.expression) = new_expression(ctx, EXPR_ME, 0); CHECK_ERROR; } +#line 2499 "parser.tab.c" /* yacc.c:1646 */ break; case 138: - -/* Line 1806 of yacc.c */ -#line 394 "parser.y" - { (yyvsp[(4) - (7)].class_decl)->name = (yyvsp[(2) - (7)].string); (yyval.class_decl) = (yyvsp[(4) - (7)].class_decl); } +#line 394 "parser.y" /* yacc.c:1646 */ + { (yyvsp[-3].class_decl)->name = (yyvsp[-5].string); (yyval.class_decl) = (yyvsp[-3].class_decl); } +#line 2505 "parser.tab.c" /* yacc.c:1646 */ break; case 139: - -/* Line 1806 of yacc.c */ -#line 397 "parser.y" +#line 397 "parser.y" /* yacc.c:1646 */ { (yyval.class_decl) = new_class_decl(ctx); } +#line 2511 "parser.tab.c" /* yacc.c:1646 */ break; case 140: - -/* Line 1806 of yacc.c */ -#line 398 "parser.y" - { (yyval.class_decl) = add_class_function(ctx, (yyvsp[(3) - (3)].class_decl), (yyvsp[(1) - (3)].func_decl)); CHECK_ERROR; } +#line 398 "parser.y" /* yacc.c:1646 */ + { (yyval.class_decl) = add_class_function(ctx, (yyvsp[0].class_decl), (yyvsp[-2].func_decl)); CHECK_ERROR; } +#line 2517 "parser.tab.c" /* yacc.c:1646 */ break; case 141: - -/* Line 1806 of yacc.c */ -#line 400 "parser.y" - { dim_decl_t *dim_decl = new_dim_decl(ctx, (yyvsp[(2) - (4)].string), FALSE, NULL); CHECK_ERROR; - (yyval.class_decl) = add_dim_prop(ctx, (yyvsp[(4) - (4)].class_decl), dim_decl, (yyvsp[(1) - (4)].uint)); CHECK_ERROR; } +#line 400 "parser.y" /* yacc.c:1646 */ + { dim_decl_t *dim_decl = new_dim_decl(ctx, (yyvsp[-2].string), FALSE, NULL); CHECK_ERROR; + (yyval.class_decl) = add_dim_prop(ctx, (yyvsp[0].class_decl), dim_decl, (yyvsp[-3].uint)); CHECK_ERROR; } +#line 2524 "parser.tab.c" /* yacc.c:1646 */ break; case 142: - -/* Line 1806 of yacc.c */ -#line 402 "parser.y" - { (yyval.class_decl) = add_dim_prop(ctx, (yyvsp[(4) - (4)].class_decl), (yyvsp[(2) - (4)].dim_decl), 0); CHECK_ERROR; } +#line 402 "parser.y" /* yacc.c:1646 */ + { (yyval.class_decl) = add_dim_prop(ctx, (yyvsp[0].class_decl), (yyvsp[-2].dim_decl), 0); CHECK_ERROR; } +#line 2530 "parser.tab.c" /* yacc.c:1646 */ break; case 143: - -/* Line 1806 of yacc.c */ -#line 403 "parser.y" - { (yyval.class_decl) = add_class_function(ctx, (yyvsp[(3) - (3)].class_decl), (yyvsp[(1) - (3)].func_decl)); CHECK_ERROR; } +#line 403 "parser.y" /* yacc.c:1646 */ + { (yyval.class_decl) = add_class_function(ctx, (yyvsp[0].class_decl), (yyvsp[-2].func_decl)); CHECK_ERROR; } +#line 2536 "parser.tab.c" /* yacc.c:1646 */ break; case 144: - -/* Line 1806 of yacc.c */ -#line 407 "parser.y" - { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[(4) - (9)].string), FUNC_PROPGET, (yyvsp[(1) - (9)].uint), NULL, (yyvsp[(7) - (9)].statement)); CHECK_ERROR; } +#line 407 "parser.y" /* yacc.c:1646 */ + { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-5].string), FUNC_PROPGET, (yyvsp[-8].uint), (yyvsp[-4].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; } +#line 2542 "parser.tab.c" /* yacc.c:1646 */ break; case 145: - -/* Line 1806 of yacc.c */ -#line 409 "parser.y" - { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[(4) - (11)].string), FUNC_PROPLET, (yyvsp[(1) - (11)].uint), (yyvsp[(6) - (11)].arg_decl), (yyvsp[(9) - (11)].statement)); CHECK_ERROR; } +#line 409 "parser.y" /* yacc.c:1646 */ + { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-7].string), FUNC_PROPLET, (yyvsp[-10].uint), (yyvsp[-5].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; } +#line 2548 "parser.tab.c" /* yacc.c:1646 */ break; case 146: - -/* Line 1806 of yacc.c */ -#line 411 "parser.y" - { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[(4) - (11)].string), FUNC_PROPSET, (yyvsp[(1) - (11)].uint), (yyvsp[(6) - (11)].arg_decl), (yyvsp[(9) - (11)].statement)); CHECK_ERROR; } +#line 411 "parser.y" /* yacc.c:1646 */ + { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-7].string), FUNC_PROPSET, (yyvsp[-10].uint), (yyvsp[-5].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; } +#line 2554 "parser.tab.c" /* yacc.c:1646 */ break; case 147: - -/* Line 1806 of yacc.c */ -#line 415 "parser.y" - { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[(3) - (8)].string), FUNC_SUB, (yyvsp[(1) - (8)].uint), (yyvsp[(4) - (8)].arg_decl), (yyvsp[(6) - (8)].statement)); CHECK_ERROR; } +#line 415 "parser.y" /* yacc.c:1646 */ + { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-5].string), FUNC_SUB, (yyvsp[-7].uint), (yyvsp[-4].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; } +#line 2560 "parser.tab.c" /* yacc.c:1646 */ break; case 148: - -/* Line 1806 of yacc.c */ -#line 417 "parser.y" - { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[(3) - (8)].string), FUNC_FUNCTION, (yyvsp[(1) - (8)].uint), (yyvsp[(4) - (8)].arg_decl), (yyvsp[(6) - (8)].statement)); CHECK_ERROR; } +#line 417 "parser.y" /* yacc.c:1646 */ + { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-5].string), FUNC_FUNCTION, (yyvsp[-7].uint), (yyvsp[-4].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; } +#line 2566 "parser.tab.c" /* yacc.c:1646 */ break; case 149: - -/* Line 1806 of yacc.c */ -#line 420 "parser.y" +#line 420 "parser.y" /* yacc.c:1646 */ { (yyval.uint) = 0; } +#line 2572 "parser.tab.c" /* yacc.c:1646 */ break; case 150: - -/* Line 1806 of yacc.c */ -#line 421 "parser.y" - { (yyval.uint) = (yyvsp[(1) - (1)].uint); } +#line 421 "parser.y" /* yacc.c:1646 */ + { (yyval.uint) = (yyvsp[0].uint); } +#line 2578 "parser.tab.c" /* yacc.c:1646 */ break; case 151: - -/* Line 1806 of yacc.c */ -#line 424 "parser.y" +#line 424 "parser.y" /* yacc.c:1646 */ { (yyval.uint) = STORAGE_IS_DEFAULT; } +#line 2584 "parser.tab.c" /* yacc.c:1646 */ break; case 152: - -/* Line 1806 of yacc.c */ -#line 425 "parser.y" +#line 425 "parser.y" /* yacc.c:1646 */ { (yyval.uint) = 0; } +#line 2590 "parser.tab.c" /* yacc.c:1646 */ break; case 153: - -/* Line 1806 of yacc.c */ -#line 426 "parser.y" +#line 426 "parser.y" /* yacc.c:1646 */ { (yyval.uint) = STORAGE_IS_PRIVATE; } +#line 2596 "parser.tab.c" /* yacc.c:1646 */ break; case 154: - -/* Line 1806 of yacc.c */ -#line 429 "parser.y" +#line 429 "parser.y" /* yacc.c:1646 */ { (yyval.arg_decl) = NULL; } +#line 2602 "parser.tab.c" /* yacc.c:1646 */ break; case 155: - -/* Line 1806 of yacc.c */ -#line 430 "parser.y" - { (yyval.arg_decl) = (yyvsp[(2) - (3)].arg_decl); } +#line 430 "parser.y" /* yacc.c:1646 */ + { (yyval.arg_decl) = (yyvsp[-1].arg_decl); } +#line 2608 "parser.tab.c" /* yacc.c:1646 */ break; case 156: - -/* Line 1806 of yacc.c */ -#line 433 "parser.y" - { (yyval.arg_decl) = (yyvsp[(1) - (1)].arg_decl); } +#line 433 "parser.y" /* yacc.c:1646 */ + { (yyval.arg_decl) = (yyvsp[0].arg_decl); } +#line 2614 "parser.tab.c" /* yacc.c:1646 */ break; case 157: - -/* Line 1806 of yacc.c */ -#line 434 "parser.y" - { (yyvsp[(1) - (3)].arg_decl)->next = (yyvsp[(3) - (3)].arg_decl); (yyval.arg_decl) = (yyvsp[(1) - (3)].arg_decl); } +#line 434 "parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].arg_decl)->next = (yyvsp[0].arg_decl); (yyval.arg_decl) = (yyvsp[-2].arg_decl); } +#line 2620 "parser.tab.c" /* yacc.c:1646 */ break; case 158: - -/* Line 1806 of yacc.c */ -#line 437 "parser.y" - { (yyval.arg_decl) = new_argument_decl(ctx, (yyvsp[(1) - (2)].string), TRUE); } +#line 437 "parser.y" /* yacc.c:1646 */ + { (yyval.arg_decl) = new_argument_decl(ctx, (yyvsp[-1].string), TRUE); } +#line 2626 "parser.tab.c" /* yacc.c:1646 */ break; case 159: - -/* Line 1806 of yacc.c */ -#line 438 "parser.y" - { (yyval.arg_decl) = new_argument_decl(ctx, (yyvsp[(2) - (3)].string), TRUE); } +#line 438 "parser.y" /* yacc.c:1646 */ + { (yyval.arg_decl) = new_argument_decl(ctx, (yyvsp[-1].string), TRUE); } +#line 2632 "parser.tab.c" /* yacc.c:1646 */ break; case 160: - -/* Line 1806 of yacc.c */ -#line 439 "parser.y" - { (yyval.arg_decl) = new_argument_decl(ctx, (yyvsp[(2) - (3)].string), FALSE); } +#line 439 "parser.y" /* yacc.c:1646 */ + { (yyval.arg_decl) = new_argument_decl(ctx, (yyvsp[-1].string), FALSE); } +#line 2638 "parser.tab.c" /* yacc.c:1646 */ break; case 161: - -/* Line 1806 of yacc.c */ -#line 443 "parser.y" - { (yyval.string) = (yyvsp[(1) - (1)].string); } +#line 443 "parser.y" /* yacc.c:1646 */ + { (yyval.string) = (yyvsp[0].string); } +#line 2644 "parser.tab.c" /* yacc.c:1646 */ break; case 162: - -/* Line 1806 of yacc.c */ -#line 444 "parser.y" +#line 444 "parser.y" /* yacc.c:1646 */ { (yyval.string) = propertyW; } +#line 2650 "parser.tab.c" /* yacc.c:1646 */ break; - -/* Line 1806 of yacc.c */ -#line 3032 "parser.tab.c" +#line 2654 "parser.tab.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3044,7 +2667,7 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -3059,9 +2682,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -3112,20 +2735,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval, ctx); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval, ctx); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -3144,7 +2767,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -3157,35 +2780,37 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp, ctx); + yystos[yystate], yyvsp, ctx); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ @@ -3209,7 +2834,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -3228,14 +2853,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, ctx); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, ctx); + yystos[*yyssp], yyvsp, ctx); YYPOPSTACK (1); } #ifndef yyoverflow @@ -3246,14 +2871,9 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - - -/* Line 2067 of yacc.c */ -#line 451 "parser.y" +#line 451 "parser.y" /* yacc.c:1906 */ static int parser_error(parser_ctx_t *ctx, const char *str) @@ -3801,4 +3421,3 @@ void parser_release(parser_ctx_t *ctx) { heap_pool_free(&ctx->heap); } - diff --git a/reactos/dll/win32/vbscript/parser.tab.h b/reactos/dll/win32/vbscript/parser.tab.h index 7313fd9da58..8912eaa1904 100644 --- a/reactos/dll/win32/vbscript/parser.tab.h +++ b/reactos/dll/win32/vbscript/parser.tab.h @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,96 +26,102 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - tEOF = 258, - tNL = 259, - tREM = 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, - tDouble = 325 - }; +#ifndef YY_PARSER_PARSER_TAB_H_INCLUDED +# define YY_PARSER_PARSER_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int parser_debug; #endif +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + tEOF = 258, + tNL = 259, + tREM = 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, + tDouble = 325 + }; +#endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { - -/* Line 2068 of yacc.c */ -#line 88 "parser.y" +#line 88 "parser.y" /* yacc.c:1909 */ const WCHAR *string; statement_t *statement; @@ -131,19 +137,17 @@ typedef union YYSTYPE case_clausule_t *case_clausule; unsigned uint; LONG lng; - BOOL bool; + BOOL boolean; double dbl; - - -/* Line 2068 of yacc.c */ -#line 141 "parser.tab.h" -} YYSTYPE; +#line 144 "parser.tab.h" /* yacc.c:1909 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif +int parser_parse (parser_ctx_t *ctx); +#endif /* !YY_PARSER_PARSER_TAB_H_INCLUDED */ diff --git a/reactos/dll/win32/vbscript/parser.y b/reactos/dll/win32/vbscript/parser.y index 6bd4907c125..681a0c96e4a 100644 --- a/reactos/dll/win32/vbscript/parser.y +++ b/reactos/dll/win32/vbscript/parser.y @@ -100,7 +100,7 @@ static const WCHAR propertyW[] = {'p','r','o','p','e','r','t','y',0}; case_clausule_t *case_clausule; unsigned uint; LONG lng; - BOOL bool; + BOOL boolean; double dbl; } @@ -129,7 +129,7 @@ static const WCHAR propertyW[] = {'p','r','o','p','e','r','t','y',0}; %type ConstExpression NumericLiteralExpression %type MemberExpression %type Arguments_opt ArgumentList_opt Step_opt ExpressionList -%type OptionExplicit_opt DoType +%type OptionExplicit_opt DoType %type ArgumentsDecl_opt ArgumentDeclList ArgumentDecl %type FunctionDecl PropertyDecl %type ElseIfs_opt ElseIfs ElseIf @@ -403,8 +403,8 @@ ClassBody | PropertyDecl tNL ClassBody { $$ = add_class_function(ctx, $3, $1); CHECK_ERROR; } PropertyDecl - : Storage_opt tPROPERTY tGET tIdentifier EmptyBrackets_opt tNL StatementsNl_opt tEND tPROPERTY - { $$ = new_function_decl(ctx, $4, FUNC_PROPGET, $1, NULL, $7); CHECK_ERROR; } + : Storage_opt tPROPERTY tGET tIdentifier ArgumentsDecl_opt tNL StatementsNl_opt tEND tPROPERTY + { $$ = new_function_decl(ctx, $4, FUNC_PROPGET, $1, $5, $7); CHECK_ERROR; } | Storage_opt tPROPERTY tLET tIdentifier '(' ArgumentDecl ')' tNL StatementsNl_opt tEND tPROPERTY { $$ = new_function_decl(ctx, $4, FUNC_PROPLET, $1, $6, $9); CHECK_ERROR; } | Storage_opt tPROPERTY tSET tIdentifier '(' ArgumentDecl ')' tNL StatementsNl_opt tEND tPROPERTY diff --git a/reactos/dll/win32/vbscript/vbdisp.c b/reactos/dll/win32/vbscript/vbdisp.c index 3f8b13e3653..fbd856a655b 100644 --- a/reactos/dll/win32/vbscript/vbdisp.c +++ b/reactos/dll/win32/vbscript/vbdisp.c @@ -334,12 +334,14 @@ static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { vbdisp_t *This = impl_from_IDispatchEx(iface); - FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), + + TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); - return E_NOTIMPL; + + return IDispatchEx_InvokeEx(&This->IDispatchEx_iface, dispIdMember, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, NULL); } static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) @@ -383,6 +385,15 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc function_t *func; switch(wFlags) { + case DISPATCH_PROPERTYGET: + func = This->desc->funcs[id].entries[VBDISP_CALLGET]; + if(!func || (func->type != FUNC_PROPGET && func->type != FUNC_DEFGET)) { + WARN("no getter\n"); + return DISP_E_MEMBERNOTFOUND; + } + + return exec_script(This->desc->ctx, func, This, pdp, pvarRes); + case DISPATCH_METHOD: case DISPATCH_METHOD|DISPATCH_PROPERTYGET: func = This->desc->funcs[id].entries[VBDISP_CALLGET]; diff --git a/reactos/dll/win32/vbscript/vbscript.h b/reactos/dll/win32/vbscript/vbscript.h index 82eebc20ef1..ace5fd39cae 100644 --- a/reactos/dll/win32/vbscript/vbscript.h +++ b/reactos/dll/win32/vbscript/vbscript.h @@ -417,6 +417,7 @@ HRESULT map_hres(HRESULT) DECLSPEC_HIDDEN; #define VBSE_PERMISSION_DENIED 70 #define VBSE_PATH_FILE_ACCESS 75 #define VBSE_PATH_NOT_FOUND 76 +#define VBSE_ILLEGAL_NULL_USE 94 #define VBSE_OLE_NOT_SUPPORTED 430 #define VBSE_OLE_NO_PROP_OR_METHOD 438 #define VBSE_ACTION_NOT_SUPPORTED 445 @@ -436,8 +437,6 @@ HRESULT map_hres(HRESULT) DECLSPEC_HIDDEN; HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; HRESULT WINAPI VBScriptRegExpFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; -const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN; - static inline void *heap_alloc(size_t len) { return HeapAlloc(GetProcessHeap(), 0, len); @@ -474,6 +473,10 @@ static inline LPWSTR heap_strdupW(LPCWSTR str) return ret; } +#define VBSCRIPT_BUILD_VERSION 16978 +#define VBSCRIPT_MAJOR_VERSION 5 +#define VBSCRIPT_MINOR_VERSION 8 + #include "parse.h" #include "regexp.h" #include "vbscript_defs.h" diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 23fa2c4bd81..24c8e0622e3 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -203,7 +203,7 @@ reactos/dll/win32/url # Synced to Wine-1.7.17 reactos/dll/win32/urlmon # Synced to Wine-1.7.27 reactos/dll/win32/usp10 # Synced to Wine-1.7.27 reactos/dll/win32/uxtheme # Forked -reactos/dll/win32/vbscript # Synced to Wine-1.7.17 +reactos/dll/win32/vbscript # Synced to Wine-1.7.27 reactos/dll/win32/version # Synced to Wine-1.7.17 reactos/dll/win32/wbemdisp # Synced to Wine-1.7.17 reactos/dll/win32/wbemprox # Synced to Wine-1.7.17