From 4c7a515ebca97ea6a508e662633d63c8108d82c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 30 Aug 2006 19:41:09 +0000 Subject: [PATCH] Add msi_ros.diff svn path=/trunk/; revision=23812 --- reactos/dll/win32/msi/alter.c | 354 +- reactos/dll/win32/msi/msi_main.c | 362 +- reactos/dll/win32/msi/msi_ros.diff | 5352 ++++++++++++++++++++++++++++ 3 files changed, 5710 insertions(+), 358 deletions(-) create mode 100644 reactos/dll/win32/msi/msi_ros.diff diff --git a/reactos/dll/win32/msi/alter.c b/reactos/dll/win32/msi/alter.c index a6fb2ba4993..396354cefc7 100644 --- a/reactos/dll/win32/msi/alter.c +++ b/reactos/dll/win32/msi/alter.c @@ -1,177 +1,177 @@ -/* - * Implementation of the Microsoft Installer (msi.dll) - * - * Copyright 2006 Mike McCormack - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include - -#include "windef.h" -#include "winbase.h" -#include "winerror.h" -#include "wine/debug.h" -#include "msi.h" -#include "msiquery.h" -#include "objbase.h" -#include "objidl.h" -#include "msipriv.h" - -#include "query.h" - -WINE_DEFAULT_DEBUG_CHANNEL(msidb); - -typedef struct tagMSIALTERVIEW -{ - MSIVIEW view; - MSIDATABASE *db; -} MSIALTERVIEW; - -static UINT ALTER_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val ) -{ - MSIALTERVIEW *av = (MSIALTERVIEW*)view; - - TRACE("%p %d %d %p\n", av, row, col, val ); - - return ERROR_FUNCTION_FAILED; -} - -static UINT ALTER_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm) -{ - MSIALTERVIEW *av = (MSIALTERVIEW*)view; - - TRACE("%p %d %d %p\n", av, row, col, stm ); - - return ERROR_FUNCTION_FAILED; -} - -static UINT ALTER_set_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT val ) -{ - MSIALTERVIEW *av = (MSIALTERVIEW*)view; - - TRACE("%p %d %d %04x\n", av, row, col, val ); - - return ERROR_FUNCTION_FAILED; -} - -static UINT ALTER_insert_row( struct tagMSIVIEW *view, MSIRECORD *record ) -{ - MSIALTERVIEW *av = (MSIALTERVIEW*)view; - - TRACE("%p %p\n", av, record ); - - return ERROR_FUNCTION_FAILED; -} - -static UINT ALTER_execute( struct tagMSIVIEW *view, MSIRECORD *record ) -{ - MSIALTERVIEW *av = (MSIALTERVIEW*)view; - - FIXME("%p %p\n", av, record); - - return ERROR_SUCCESS; -} - -static UINT ALTER_close( struct tagMSIVIEW *view ) -{ - MSIALTERVIEW *av = (MSIALTERVIEW*)view; - - TRACE("%p\n", av ); - - return ERROR_SUCCESS; -} - -static UINT ALTER_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols ) -{ - MSIALTERVIEW *av = (MSIALTERVIEW*)view; - - TRACE("%p %p %p\n", av, rows, cols ); - - return ERROR_FUNCTION_FAILED; -} - -static UINT ALTER_get_column_info( struct tagMSIVIEW *view, - UINT n, LPWSTR *name, UINT *type ) -{ - MSIALTERVIEW *av = (MSIALTERVIEW*)view; - - TRACE("%p %d %p %p\n", av, n, name, type ); - - return ERROR_FUNCTION_FAILED; -} - -static UINT ALTER_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, - MSIRECORD *rec ) -{ - MSIALTERVIEW *av = (MSIALTERVIEW*)view; - - TRACE("%p %d %p\n", av, eModifyMode, rec ); - - return ERROR_FUNCTION_FAILED; -} - -static UINT ALTER_delete( struct tagMSIVIEW *view ) -{ - MSIALTERVIEW *av = (MSIALTERVIEW*)view; - - TRACE("%p\n", av ); - msi_free( av ); - - return ERROR_SUCCESS; -} - -static UINT ALTER_find_matching_rows( struct tagMSIVIEW *view, UINT col, - UINT val, UINT *row, MSIITERHANDLE *handle ) -{ - TRACE("%p, %d, %u, %p\n", view, col, val, *handle); - - return ERROR_FUNCTION_FAILED; -} - - -static const MSIVIEWOPS alter_ops = -{ - ALTER_fetch_int, - ALTER_fetch_stream, - ALTER_set_int, - ALTER_insert_row, - ALTER_execute, - ALTER_close, - ALTER_get_dimensions, - ALTER_get_column_info, - ALTER_modify, - ALTER_delete, - ALTER_find_matching_rows -}; - -UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, int hold ) -{ - MSIALTERVIEW *av = NULL; - - TRACE("%p\n", av ); - - av = msi_alloc_zero( sizeof *av ); - if( !av ) - return ERROR_FUNCTION_FAILED; - - /* fill the structure */ - av->view.ops = &alter_ops; - av->db = db; - - *view = &av->view; - - return ERROR_SUCCESS; -} +/* + * Implementation of the Microsoft Installer (msi.dll) + * + * Copyright 2006 Mike McCormack + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "wine/debug.h" +#include "msi.h" +#include "msiquery.h" +#include "objbase.h" +#include "objidl.h" +#include "msipriv.h" + +#include "query.h" + +WINE_DEFAULT_DEBUG_CHANNEL(msidb); + +typedef struct tagMSIALTERVIEW +{ + MSIVIEW view; + MSIDATABASE *db; +} MSIALTERVIEW; + +static UINT ALTER_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val ) +{ + MSIALTERVIEW *av = (MSIALTERVIEW*)view; + + TRACE("%p %d %d %p\n", av, row, col, val ); + + return ERROR_FUNCTION_FAILED; +} + +static UINT ALTER_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm) +{ + MSIALTERVIEW *av = (MSIALTERVIEW*)view; + + TRACE("%p %d %d %p\n", av, row, col, stm ); + + return ERROR_FUNCTION_FAILED; +} + +static UINT ALTER_set_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT val ) +{ + MSIALTERVIEW *av = (MSIALTERVIEW*)view; + + TRACE("%p %d %d %04x\n", av, row, col, val ); + + return ERROR_FUNCTION_FAILED; +} + +static UINT ALTER_insert_row( struct tagMSIVIEW *view, MSIRECORD *record ) +{ + MSIALTERVIEW *av = (MSIALTERVIEW*)view; + + TRACE("%p %p\n", av, record ); + + return ERROR_FUNCTION_FAILED; +} + +static UINT ALTER_execute( struct tagMSIVIEW *view, MSIRECORD *record ) +{ + MSIALTERVIEW *av = (MSIALTERVIEW*)view; + + FIXME("%p %p\n", av, record); + + return ERROR_SUCCESS; +} + +static UINT ALTER_close( struct tagMSIVIEW *view ) +{ + MSIALTERVIEW *av = (MSIALTERVIEW*)view; + + TRACE("%p\n", av ); + + return ERROR_SUCCESS; +} + +static UINT ALTER_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols ) +{ + MSIALTERVIEW *av = (MSIALTERVIEW*)view; + + TRACE("%p %p %p\n", av, rows, cols ); + + return ERROR_FUNCTION_FAILED; +} + +static UINT ALTER_get_column_info( struct tagMSIVIEW *view, + UINT n, LPWSTR *name, UINT *type ) +{ + MSIALTERVIEW *av = (MSIALTERVIEW*)view; + + TRACE("%p %d %p %p\n", av, n, name, type ); + + return ERROR_FUNCTION_FAILED; +} + +static UINT ALTER_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, + MSIRECORD *rec ) +{ + MSIALTERVIEW *av = (MSIALTERVIEW*)view; + + TRACE("%p %d %p\n", av, eModifyMode, rec ); + + return ERROR_FUNCTION_FAILED; +} + +static UINT ALTER_delete( struct tagMSIVIEW *view ) +{ + MSIALTERVIEW *av = (MSIALTERVIEW*)view; + + TRACE("%p\n", av ); + msi_free( av ); + + return ERROR_SUCCESS; +} + +static UINT ALTER_find_matching_rows( struct tagMSIVIEW *view, UINT col, + UINT val, UINT *row, MSIITERHANDLE *handle ) +{ + TRACE("%p, %d, %u, %p\n", view, col, val, *handle); + + return ERROR_FUNCTION_FAILED; +} + + +static const MSIVIEWOPS alter_ops = +{ + ALTER_fetch_int, + ALTER_fetch_stream, + ALTER_set_int, + ALTER_insert_row, + ALTER_execute, + ALTER_close, + ALTER_get_dimensions, + ALTER_get_column_info, + ALTER_modify, + ALTER_delete, + ALTER_find_matching_rows +}; + +UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, int hold ) +{ + MSIALTERVIEW *av = NULL; + + TRACE("%p\n", av ); + + av = msi_alloc_zero( sizeof *av ); + if( !av ) + return ERROR_FUNCTION_FAILED; + + /* fill the structure */ + av->view.ops = &alter_ops; + av->db = db; + + *view = &av->view; + + return ERROR_SUCCESS; +} diff --git a/reactos/dll/win32/msi/msi_main.c b/reactos/dll/win32/msi/msi_main.c index 870ed7dceb9..294de714dd8 100644 --- a/reactos/dll/win32/msi/msi_main.c +++ b/reactos/dll/win32/msi/msi_main.c @@ -1,181 +1,181 @@ -/* - * Implementation of the Microsoft Installer (msi.dll) - * - * Copyright 2006 Mike McCormack for CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include - -#define COBJMACROS -#define NONAMELESSUNION - -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "shlwapi.h" -#include "msipriv.h" - -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(msi); - -static LONG dll_count; - -/* the UI level */ -INSTALLUILEVEL gUILevel = INSTALLUILEVEL_BASIC; -HWND gUIhwnd = 0; -INSTALLUI_HANDLERA gUIHandlerA = NULL; -INSTALLUI_HANDLERW gUIHandlerW = NULL; -DWORD gUIFilter = 0; -LPVOID gUIContext = NULL; -WCHAR gszLogFile[MAX_PATH]; -HINSTANCE msi_hInstance; - -/* - * Dll lifetime tracking declaration - */ -static void LockModule(void) -{ - InterlockedIncrement(&dll_count); -} - -static void UnlockModule(void) -{ - InterlockedDecrement(&dll_count); -} - -/****************************************************************** - * DllMain - */ -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) -{ - switch (fdwReason) - { - case DLL_PROCESS_ATTACH: - msi_hInstance = hinstDLL; - DisableThreadLibraryCalls(hinstDLL); - msi_dialog_register_class(); - break; - case DLL_PROCESS_DETACH: - msi_dialog_unregister_class(); - msi_free_handle_table(); - break; - } - return TRUE; -} - -typedef struct tagIClassFactoryImpl -{ - const IClassFactoryVtbl *lpVtbl; -} IClassFactoryImpl; - -static HRESULT WINAPI MsiCF_QueryInterface(LPCLASSFACTORY iface, - REFIID riid,LPVOID *ppobj) -{ - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; - FIXME("%p %s %p\n",This,debugstr_guid(riid),ppobj); - return E_NOINTERFACE; -} - -static ULONG WINAPI MsiCF_AddRef(LPCLASSFACTORY iface) -{ - LockModule(); - return 2; -} - -static ULONG WINAPI MsiCF_Release(LPCLASSFACTORY iface) -{ - UnlockModule(); - return 1; -} - -static HRESULT WINAPI MsiCF_CreateInstance(LPCLASSFACTORY iface, - LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) -{ - IClassFactoryImpl *This = (IClassFactoryImpl *)iface; - - FIXME("%p %p %s %p\n", This, pOuter, debugstr_guid(riid), ppobj); - return E_FAIL; -} - -static HRESULT WINAPI MsiCF_LockServer(LPCLASSFACTORY iface, BOOL dolock) -{ - TRACE("%p %d\n", iface, dolock); - - if (dolock) - LockModule(); - else - UnlockModule(); - - return S_OK; -} - -static const IClassFactoryVtbl MsiCF_Vtbl = -{ - MsiCF_QueryInterface, - MsiCF_AddRef, - MsiCF_Release, - MsiCF_CreateInstance, - MsiCF_LockServer -}; - -static IClassFactoryImpl Msi_CF = { &MsiCF_Vtbl }; - -/****************************************************************** - * DllGetClassObject [MSI.@] - */ -HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) -{ - TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); - - if( IsEqualCLSID (rclsid, &CLSID_IMsiServer) || - IsEqualCLSID (rclsid, &CLSID_IMsiServerMessage) || - IsEqualCLSID (rclsid, &CLSID_IMsiServerX1) || - IsEqualCLSID (rclsid, &CLSID_IMsiServerX2) || - IsEqualCLSID (rclsid, &CLSID_IMsiServerX3) ) - { - *ppv = (LPVOID) &Msi_CF; - return S_OK; - } - return CLASS_E_CLASSNOTAVAILABLE; -} - -/****************************************************************** - * DllGetVersion [MSI.@] - */ -HRESULT WINAPI DllGetVersion(DLLVERSIONINFO *pdvi) -{ - TRACE("%p\n",pdvi); - - if (pdvi->cbSize < sizeof(DLLVERSIONINFO)) - return E_INVALIDARG; - - pdvi->dwMajorVersion = MSI_MAJORVERSION; - pdvi->dwMinorVersion = MSI_MINORVERSION; - pdvi->dwBuildNumber = MSI_BUILDNUMBER; - pdvi->dwPlatformID = DLLVER_PLATFORM_WINDOWS; - - return S_OK; -} - -/****************************************************************** - * DllCanUnloadNow [MSI.@] - */ -HRESULT WINAPI DllCanUnloadNow(void) -{ - return dll_count == 0 ? S_OK : S_FALSE; -} +/* + * Implementation of the Microsoft Installer (msi.dll) + * + * Copyright 2006 Mike McCormack for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#define COBJMACROS +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "winreg.h" +#include "shlwapi.h" +#include "msipriv.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(msi); + +static LONG dll_count; + +/* the UI level */ +INSTALLUILEVEL gUILevel = INSTALLUILEVEL_BASIC; +HWND gUIhwnd = 0; +INSTALLUI_HANDLERA gUIHandlerA = NULL; +INSTALLUI_HANDLERW gUIHandlerW = NULL; +DWORD gUIFilter = 0; +LPVOID gUIContext = NULL; +WCHAR gszLogFile[MAX_PATH]; +HINSTANCE msi_hInstance; + +/* + * Dll lifetime tracking declaration + */ +static void LockModule(void) +{ + InterlockedIncrement(&dll_count); +} + +static void UnlockModule(void) +{ + InterlockedDecrement(&dll_count); +} + +/****************************************************************** + * DllMain + */ +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + msi_hInstance = hinstDLL; + DisableThreadLibraryCalls(hinstDLL); + msi_dialog_register_class(); + break; + case DLL_PROCESS_DETACH: + msi_dialog_unregister_class(); + msi_free_handle_table(); + break; + } + return TRUE; +} + +typedef struct tagIClassFactoryImpl +{ + const IClassFactoryVtbl *lpVtbl; +} IClassFactoryImpl; + +static HRESULT WINAPI MsiCF_QueryInterface(LPCLASSFACTORY iface, + REFIID riid,LPVOID *ppobj) +{ + IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + FIXME("%p %s %p\n",This,debugstr_guid(riid),ppobj); + return E_NOINTERFACE; +} + +static ULONG WINAPI MsiCF_AddRef(LPCLASSFACTORY iface) +{ + LockModule(); + return 2; +} + +static ULONG WINAPI MsiCF_Release(LPCLASSFACTORY iface) +{ + UnlockModule(); + return 1; +} + +static HRESULT WINAPI MsiCF_CreateInstance(LPCLASSFACTORY iface, + LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) +{ + IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + + FIXME("%p %p %s %p\n", This, pOuter, debugstr_guid(riid), ppobj); + return E_FAIL; +} + +static HRESULT WINAPI MsiCF_LockServer(LPCLASSFACTORY iface, BOOL dolock) +{ + TRACE("%p %d\n", iface, dolock); + + if (dolock) + LockModule(); + else + UnlockModule(); + + return S_OK; +} + +static const IClassFactoryVtbl MsiCF_Vtbl = +{ + MsiCF_QueryInterface, + MsiCF_AddRef, + MsiCF_Release, + MsiCF_CreateInstance, + MsiCF_LockServer +}; + +static IClassFactoryImpl Msi_CF = { &MsiCF_Vtbl }; + +/****************************************************************** + * DllGetClassObject [MSI.@] + */ +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) +{ + TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); + + if( IsEqualCLSID (rclsid, &CLSID_IMsiServer) || + IsEqualCLSID (rclsid, &CLSID_IMsiServerMessage) || + IsEqualCLSID (rclsid, &CLSID_IMsiServerX1) || + IsEqualCLSID (rclsid, &CLSID_IMsiServerX2) || + IsEqualCLSID (rclsid, &CLSID_IMsiServerX3) ) + { + *ppv = (LPVOID) &Msi_CF; + return S_OK; + } + return CLASS_E_CLASSNOTAVAILABLE; +} + +/****************************************************************** + * DllGetVersion [MSI.@] + */ +HRESULT WINAPI DllGetVersion(DLLVERSIONINFO *pdvi) +{ + TRACE("%p\n",pdvi); + + if (pdvi->cbSize < sizeof(DLLVERSIONINFO)) + return E_INVALIDARG; + + pdvi->dwMajorVersion = MSI_MAJORVERSION; + pdvi->dwMinorVersion = MSI_MINORVERSION; + pdvi->dwBuildNumber = MSI_BUILDNUMBER; + pdvi->dwPlatformID = DLLVER_PLATFORM_WINDOWS; + + return S_OK; +} + +/****************************************************************** + * DllCanUnloadNow [MSI.@] + */ +HRESULT WINAPI DllCanUnloadNow(void) +{ + return dll_count == 0 ? S_OK : S_FALSE; +} diff --git a/reactos/dll/win32/msi/msi_ros.diff b/reactos/dll/win32/msi/msi_ros.diff new file mode 100644 index 00000000000..47c970dacdc --- /dev/null +++ b/reactos/dll/win32/msi/msi_ros.diff @@ -0,0 +1,5352 @@ +Index: action.c +=================================================================== +--- action.c (revision 23808) ++++ action.c (working copy) +@@ -30,6 +30,7 @@ + + #define COBJMACROS + ++#include "stdio.h" + #include "windef.h" + #include "winbase.h" + #include "winerror.h" +Index: appsearch.c +=================================================================== +--- appsearch.c (revision 23782) ++++ appsearch.c (working copy) +@@ -21,6 +21,7 @@ + + #define COBJMACROS + ++#include "stdio.h" + #include "windef.h" + #include "winbase.h" + #include "winreg.h" +Index: classes.c +=================================================================== +--- classes.c (revision 23808) ++++ classes.c (working copy) +@@ -31,6 +31,7 @@ + + #include + ++#include "stdio.h" + #include "windef.h" + #include "winbase.h" + #include "winerror.h" +Index: cond.tab.c +=================================================================== +--- cond.tab.c (revision 23782) ++++ cond.tab.c (working copy) +@@ -0,0 +1,2239 @@ ++/* A Bison parser, made by GNU Bison 1.875c. */ ++ ++/* Skeleton parser for Yacc-like parsing with Bison, ++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, ++ Boston, MA 02111-1307, USA. */ ++ ++/* As a special exception, when this file is copied by Bison into a ++ Bison output file, you may use that output file without restriction. ++ This special exception was added by the Free Software Foundation ++ in version 1.24 of Bison. */ ++ ++/* Written by Richard Stallman by simplifying the original so called ++ ``semantic'' parser. */ ++ ++/* All symbols defined below should begin with yy or YY, to avoid ++ infringing on user name space. This should be done even for local ++ variables, as they might otherwise be expanded by user macros. ++ There are some unavoidable exceptions within include files to ++ define necessary library symbols; they are noted "INFRINGES ON ++ USER NAME SPACE" below. */ ++ ++/* Identify Bison output. */ ++#define YYBISON 1 ++ ++/* Skeleton name. */ ++#define YYSKELETON_NAME "yacc.c" ++ ++/* Pure parsers. */ ++#define YYPURE 1 ++ ++/* Using locations. */ ++#define YYLSP_NEEDED 0 ++ ++/* If NAME_PREFIX is specified substitute the variables and functions ++ names. */ ++#define yyparse COND_parse ++#define yylex COND_lex ++#define yyerror COND_error ++#define yylval COND_lval ++#define yychar COND_char ++#define yydebug COND_debug ++#define yynerrs COND_nerrs ++ ++ ++/* Tokens. */ ++#ifndef YYTOKENTYPE ++# define YYTOKENTYPE ++ /* Put the tokens into the symbol table, so that GDB and other debuggers ++ know about them. */ ++ enum yytokentype { ++ COND_SPACE = 258, ++ COND_EOF = 259, ++ COND_OR = 260, ++ COND_AND = 261, ++ COND_NOT = 262, ++ COND_LT = 263, ++ COND_GT = 264, ++ COND_EQ = 265, ++ COND_LPAR = 266, ++ COND_RPAR = 267, ++ COND_TILDA = 268, ++ COND_PERCENT = 269, ++ COND_DOLLARS = 270, ++ COND_QUESTION = 271, ++ COND_AMPER = 272, ++ COND_EXCLAM = 273, ++ COND_IDENT = 274, ++ COND_NUMBER = 275, ++ COND_LITER = 276, ++ COND_ERROR = 277 ++ }; ++#endif ++#define COND_SPACE 258 ++#define COND_EOF 259 ++#define COND_OR 260 ++#define COND_AND 261 ++#define COND_NOT 262 ++#define COND_LT 263 ++#define COND_GT 264 ++#define COND_EQ 265 ++#define COND_LPAR 266 ++#define COND_RPAR 267 ++#define COND_TILDA 268 ++#define COND_PERCENT 269 ++#define COND_DOLLARS 270 ++#define COND_QUESTION 271 ++#define COND_AMPER 272 ++#define COND_EXCLAM 273 ++#define COND_IDENT 274 ++#define COND_NUMBER 275 ++#define COND_LITER 276 ++#define COND_ERROR 277 ++ ++ ++ ++ ++/* Copy the first part of user declarations. */ ++#line 1 "./cond.y" ++ ++ ++/* ++ * Implementation of the Microsoft Installer (msi.dll) ++ * ++ * Copyright 2003 Mike McCormack for CodeWeavers ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#include "config.h" ++ ++#include ++#include ++#include ++ ++#include "windef.h" ++#include "winbase.h" ++#include "wine/debug.h" ++#include "wine/unicode.h" ++ ++#include "msi.h" ++#include "msiquery.h" ++#include "msipriv.h" ++ ++#define YYLEX_PARAM info ++#define YYPARSE_PARAM info ++ ++static int COND_error(const char *str); ++ ++WINE_DEFAULT_DEBUG_CHANNEL(msi); ++ ++typedef struct tag_yyinput ++{ ++ MSIPACKAGE *package; ++ LPCWSTR str; ++ INT n; ++ MSICONDITION result; ++} COND_input; ++ ++struct cond_str { ++ LPCWSTR data; ++ INT len; ++}; ++ ++static LPWSTR COND_GetString( struct cond_str *str ); ++static LPWSTR COND_GetLiteral( struct cond_str *str ); ++static int COND_lex( void *COND_lval, COND_input *info); ++ ++typedef INT (*comp_int)(INT a, INT b); ++typedef INT (*comp_str)(LPWSTR a, LPWSTR b, BOOL caseless); ++typedef INT (*comp_m1)(LPWSTR a,int b); ++typedef INT (*comp_m2)(int a,LPWSTR b); ++ ++static INT comp_lt_i(INT a, INT b); ++static INT comp_gt_i(INT a, INT b); ++static INT comp_le_i(INT a, INT b); ++static INT comp_ge_i(INT a, INT b); ++static INT comp_eq_i(INT a, INT b); ++static INT comp_ne_i(INT a, INT b); ++static INT comp_bitand(INT a, INT b); ++static INT comp_highcomp(INT a, INT b); ++static INT comp_lowcomp(INT a, INT b); ++ ++static INT comp_eq_s(LPWSTR a, LPWSTR b, BOOL casless); ++static INT comp_ne_s(LPWSTR a, LPWSTR b, BOOL casless); ++static INT comp_lt_s(LPWSTR a, LPWSTR b, BOOL casless); ++static INT comp_gt_s(LPWSTR a, LPWSTR b, BOOL casless); ++static INT comp_le_s(LPWSTR a, LPWSTR b, BOOL casless); ++static INT comp_ge_s(LPWSTR a, LPWSTR b, BOOL casless); ++static INT comp_substring(LPWSTR a, LPWSTR b, BOOL casless); ++static INT comp_start(LPWSTR a, LPWSTR b, BOOL casless); ++static INT comp_end(LPWSTR a, LPWSTR b, BOOL casless); ++ ++static INT comp_eq_m1(LPWSTR a, INT b); ++static INT comp_ne_m1(LPWSTR a, INT b); ++static INT comp_lt_m1(LPWSTR a, INT b); ++static INT comp_gt_m1(LPWSTR a, INT b); ++static INT comp_le_m1(LPWSTR a, INT b); ++static INT comp_ge_m1(LPWSTR a, INT b); ++ ++static INT comp_eq_m2(INT a, LPWSTR b); ++static INT comp_ne_m2(INT a, LPWSTR b); ++static INT comp_lt_m2(INT a, LPWSTR b); ++static INT comp_gt_m2(INT a, LPWSTR b); ++static INT comp_le_m2(INT a, LPWSTR b); ++static INT comp_ge_m2(INT a, LPWSTR b); ++ ++ ++ ++/* Enabling traces. */ ++#ifndef YYDEBUG ++# define YYDEBUG 0 ++#endif ++ ++/* Enabling verbose error messages. */ ++#ifdef YYERROR_VERBOSE ++# undef YYERROR_VERBOSE ++# define YYERROR_VERBOSE 1 ++#else ++# define YYERROR_VERBOSE 0 ++#endif ++ ++#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) ++#line 106 "./cond.y" ++typedef union YYSTYPE { ++ struct cond_str str; ++ LPWSTR string; ++ INT value; ++ comp_int fn_comp_int; ++ comp_str fn_comp_str; ++ comp_m1 fn_comp_m1; ++ comp_m2 fn_comp_m2; ++} YYSTYPE; ++/* Line 191 of yacc.c. */ ++#line 241 "cond.tab.c" ++# define yystype YYSTYPE /* obsolescent; will be withdrawn */ ++# define YYSTYPE_IS_DECLARED 1 ++# define YYSTYPE_IS_TRIVIAL 1 ++#endif ++ ++ ++ ++/* Copy the second part of user declarations. */ ++ ++ ++/* Line 214 of yacc.c. */ ++#line 253 "cond.tab.c" ++ ++#if ! defined (yyoverflow) || YYERROR_VERBOSE ++ ++# ifndef YYFREE ++# define YYFREE free ++# endif ++# ifndef YYMALLOC ++# define YYMALLOC malloc ++# endif ++ ++/* The parser invokes alloca or malloc; define the necessary symbols. */ ++ ++# ifdef YYSTACK_USE_ALLOCA ++# if YYSTACK_USE_ALLOCA ++# define YYSTACK_ALLOC alloca ++# endif ++# else ++# if defined (alloca) || defined (_ALLOCA_H) ++# define YYSTACK_ALLOC alloca ++# else ++# ifdef __GNUC__ ++# define YYSTACK_ALLOC __builtin_alloca ++# endif ++# endif ++# endif ++ ++# ifdef YYSTACK_ALLOC ++ /* Pacify GCC's `empty if-body' warning. */ ++# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) ++# else ++# if defined (__STDC__) || defined (__cplusplus) ++# include /* INFRINGES ON USER NAME SPACE */ ++# define YYSIZE_T size_t ++# endif ++# define YYSTACK_ALLOC YYMALLOC ++# define YYSTACK_FREE YYFREE ++# endif ++#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ ++ ++ ++#if (! defined (yyoverflow) \ ++ && (! defined (__cplusplus) \ ++ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) ++ ++/* A type that is properly aligned for any stack member. */ ++union yyalloc ++{ ++ short yyss; ++ YYSTYPE yyvs; ++ }; ++ ++/* The size of the maximum gap between one aligned stack and the next. */ ++# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) ++ ++/* The size of an array large to enough to hold all stacks, each with ++ N elements. */ ++# define YYSTACK_BYTES(N) \ ++ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ ++ + YYSTACK_GAP_MAXIMUM) ++ ++/* Copy COUNT objects from FROM to TO. 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))) ++# else ++# define YYCOPY(To, From, Count) \ ++ do \ ++ { \ ++ register YYSIZE_T yyi; \ ++ for (yyi = 0; yyi < (Count); yyi++) \ ++ (To)[yyi] = (From)[yyi]; \ ++ } \ ++ while (0) ++# endif ++# endif ++ ++/* Relocate STACK from its old location to the new one. The ++ local variables YYSIZE and YYSTACKSIZE give the old and new number of ++ 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) \ ++ do \ ++ { \ ++ YYSIZE_T yynewbytes; \ ++ YYCOPY (&yyptr->Stack, Stack, yysize); \ ++ Stack = &yyptr->Stack; \ ++ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ ++ yyptr += yynewbytes / sizeof (*yyptr); \ ++ } \ ++ while (0) ++ ++#endif ++ ++#if defined (__STDC__) || defined (__cplusplus) ++ typedef signed char yysigned_char; ++#else ++ typedef short yysigned_char; ++#endif ++ ++/* YYFINAL -- State number of the termination state. */ ++#define YYFINAL 30 ++/* YYLAST -- Last index in YYTABLE. */ ++#define YYLAST 146 ++ ++/* YYNTOKENS -- Number of terminals. */ ++#define YYNTOKENS 23 ++/* YYNNTS -- Number of nonterminals. */ ++#define YYNNTS 17 ++/* YYNRULES -- Number of rules. */ ++#define YYNRULES 65 ++/* YYNRULES -- Number of states. */ ++#define YYNSTATES 74 ++ ++/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ ++#define YYUNDEFTOK 2 ++#define YYMAXUTOK 277 ++ ++#define YYTRANSLATE(YYX) \ ++ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) ++ ++/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ ++static const unsigned char yytranslate[] = ++{ ++ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, ++ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ++ 15, 16, 17, 18, 19, 20, 21, 22 ++}; ++ ++#if YYDEBUG ++/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in ++ YYRHS. */ ++static const unsigned char yyprhs[] = ++{ ++ 0, 0, 3, 5, 7, 11, 13, 17, 19, 22, ++ 24, 26, 30, 34, 39, 43, 47, 51, 53, 56, ++ 58, 60, 63, 66, 69, 72, 75, 77, 80, 82, ++ 84, 87, 90, 93, 96, 99, 101, 104, 106, 108, ++ 111, 114, 117, 120, 123, 125, 128, 130, 132, 135, ++ 138, 141, 144, 147, 149, 151, 153, 155, 157, 160, ++ 163, 166, 169, 171, 174, 176 ++}; ++ ++/* YYRHS -- A `-1'-separated list of the rules' RHS. */ ++static const yysigned_char yyrhs[] = ++{ ++ 24, 0, -1, 25, -1, 26, -1, 26, 5, 25, ++ -1, 27, -1, 26, 6, 27, -1, 28, -1, 7, ++ 28, -1, 33, -1, 34, -1, 33, 29, 33, -1, ++ 34, 30, 34, -1, 34, 13, 30, 34, -1, 34, ++ 31, 33, -1, 33, 32, 34, -1, 11, 25, 12, ++ -1, 10, -1, 8, 9, -1, 8, -1, 9, -1, ++ 8, 10, -1, 9, 10, -1, 9, 8, -1, 8, ++ 8, -1, 9, 9, -1, 10, -1, 8, 9, -1, ++ 8, -1, 9, -1, 8, 10, -1, 9, 10, -1, ++ 9, 8, -1, 8, 8, -1, 9, 9, -1, 10, ++ -1, 8, 9, -1, 8, -1, 9, -1, 8, 10, ++ -1, 9, 10, -1, 9, 8, -1, 8, 8, -1, ++ 9, 9, -1, 10, -1, 8, 9, -1, 8, -1, ++ 9, -1, 8, 10, -1, 9, 10, -1, 9, 8, ++ -1, 8, 8, -1, 9, 9, -1, 36, -1, 39, ++ -1, 37, -1, 35, -1, 21, -1, 15, 38, -1, ++ 16, 38, -1, 17, 38, -1, 18, 38, -1, 38, ++ -1, 14, 38, -1, 19, -1, 20, -1 ++}; ++ ++/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ ++static const unsigned short yyrline[] = ++{ ++ 0, 136, 136, 144, 148, 155, 159, 166, 170, 178, ++ 182, 187, 191, 197, 203, 208, 213, 221, 225, 229, ++ 233, 237, 241, 246, 250, 254, 262, 266, 270, 274, ++ 278, 282, 287, 291, 295, 303, 307, 311, 315, 319, ++ 323, 328, 332, 336, 344, 348, 352, 356, 360, 364, ++ 369, 373, 377, 384, 388, 395, 399, 406, 415, 424, ++ 433, 442, 454, 477, 491, 500 ++}; ++#endif ++ ++#if YYDEBUG || YYERROR_VERBOSE ++/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. ++ First, the terminals, then, starting at YYNTOKENS, nonterminals. */ ++static const char *const yytname[] = ++{ ++ "$end", "error", "$undefined", "COND_SPACE", "COND_EOF", "COND_OR", ++ "COND_AND", "COND_NOT", "COND_LT", "COND_GT", "COND_EQ", "COND_LPAR", ++ "COND_RPAR", "COND_TILDA", "COND_PERCENT", "COND_DOLLARS", ++ "COND_QUESTION", "COND_AMPER", "COND_EXCLAM", "COND_IDENT", ++ "COND_NUMBER", "COND_LITER", "COND_ERROR", "$accept", "condition", ++ "expression", "boolean_term", "boolean_factor", "term", "comp_op_i", ++ "comp_op_s", "comp_op_m1", "comp_op_m2", "value_i", "value_s", "literal", ++ "symbol_i", "symbol_s", "identifier", "integer", 0 ++}; ++#endif ++ ++# ifdef YYPRINT ++/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to ++ token YYLEX-NUM. */ ++static const unsigned short yytoknum[] = ++{ ++ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, ++ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, ++ 275, 276, 277 ++}; ++# endif ++ ++/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ ++static const unsigned char yyr1[] = ++{ ++ 0, 23, 24, 25, 25, 26, 26, 27, 27, 28, ++ 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, ++ 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, ++ 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, ++ 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, ++ 32, 32, 32, 33, 33, 34, 34, 35, 36, 36, ++ 36, 36, 37, 37, 38, 39 ++}; ++ ++/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ ++static const unsigned char yyr2[] = ++{ ++ 0, 2, 1, 1, 3, 1, 3, 1, 2, 1, ++ 1, 3, 3, 4, 3, 3, 3, 1, 2, 1, ++ 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, ++ 2, 2, 2, 2, 2, 1, 2, 1, 1, 2, ++ 2, 2, 2, 2, 1, 2, 1, 1, 2, 2, ++ 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, ++ 2, 2, 1, 2, 1, 1 ++}; ++ ++/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state ++ STATE-NUM when YYTABLE doesn't specify something else to do. Zero ++ means the default is an error. */ ++static const unsigned char yydefact[] = ++{ ++ 0, 0, 0, 0, 0, 0, 0, 0, 64, 65, ++ 57, 0, 2, 3, 5, 7, 9, 10, 56, 53, ++ 55, 62, 54, 8, 0, 63, 58, 59, 60, 61, ++ 1, 0, 0, 19, 20, 17, 0, 0, 37, 38, ++ 35, 0, 0, 0, 16, 4, 6, 24, 18, 21, ++ 23, 25, 22, 11, 15, 42, 36, 39, 41, 43, ++ 40, 28, 29, 26, 0, 12, 14, 33, 27, 30, ++ 32, 34, 31, 13 ++}; ++ ++/* YYDEFGOTO[NTERM-NUM]. */ ++static const yysigned_char yydefgoto[] = ++{ ++ -1, 11, 12, 13, 14, 15, 36, 42, 43, 37, ++ 16, 17, 18, 19, 20, 21, 22 ++}; ++ ++/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing ++ STATE-NUM. */ ++#define YYPACT_NINF -37 ++static const short yypact[] = ++{ ++ -4, 51, -4, -11, -11, -11, -11, -11, -37, -37, ++ -37, 18, -37, -1, -37, -37, 49, 14, -37, -37, ++ -37, -37, -37, -37, 19, -37, -37, -37, -37, -37, ++ -37, -4, -4, 11, 25, 34, 111, 59, 28, 42, ++ 60, 130, 59, 111, -37, -37, -37, 63, 69, 72, ++ 73, 81, 82, -37, -37, 85, 91, 94, 95, 103, ++ 104, 133, 136, -37, 59, -37, -37, -37, -37, -37, ++ -37, -37, -37, -37 ++}; ++ ++/* YYPGOTO[NTERM-NUM]. */ ++static const short yypgoto[] = ++{ ++ -37, -37, -2, -37, -6, 39, -37, 0, -37, -37, ++ -34, -36, -37, -37, -37, 129, -37 ++}; ++ ++/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If ++ positive, shift that token. If negative, reduce the rule which ++ number is the opposite. If zero, do what YYDEFACT says. ++ If YYTABLE_NINF, syntax error. */ ++#define YYTABLE_NINF -53 ++static const yysigned_char yytable[] = ++{ ++ 24, 54, 53, 1, 31, 32, 65, 2, 8, 66, ++ 3, 4, 5, 6, 7, 8, 9, 10, 30, 47, ++ 48, 49, 38, 39, 40, -46, 46, 41, 73, 45, ++ -46, 44, -46, 50, 51, 52, 55, 56, 57, -47, ++ 23, 64, -28, 0, -47, 0, -47, -28, -44, -28, ++ 58, 59, 60, -44, 0, -44, -29, 33, 34, 35, ++ 0, -29, 2, -29, 0, 3, 4, 5, 6, 7, ++ 8, 9, 10, 3, -26, 0, 0, -51, 8, -26, ++ 10, -26, -51, -45, -51, 0, -48, -50, -45, 0, ++ -45, -48, -50, -48, -50, -52, -49, 0, 0, -33, ++ -52, -49, -52, -49, -33, -27, -33, 0, -30, -32, ++ -27, 0, -27, -30, -32, -30, -32, -34, -31, 0, ++ 0, 0, -34, -31, -34, -31, 4, 5, 6, 7, ++ 0, 9, 25, 26, 27, 28, 29, 0, 61, 62, ++ 63, 67, 68, 69, 70, 71, 72 ++}; ++ ++static const yysigned_char yycheck[] = ++{ ++ 2, 37, 36, 7, 5, 6, 42, 11, 19, 43, ++ 14, 15, 16, 17, 18, 19, 20, 21, 0, 8, ++ 9, 10, 8, 9, 10, 14, 32, 13, 64, 31, ++ 19, 12, 21, 8, 9, 10, 8, 9, 10, 14, ++ 1, 41, 14, -1, 19, -1, 21, 19, 14, 21, ++ 8, 9, 10, 19, -1, 21, 14, 8, 9, 10, ++ -1, 19, 11, 21, -1, 14, 15, 16, 17, 18, ++ 19, 20, 21, 14, 14, -1, -1, 14, 19, 19, ++ 21, 21, 19, 14, 21, -1, 14, 14, 19, -1, ++ 21, 19, 19, 21, 21, 14, 14, -1, -1, 14, ++ 19, 19, 21, 21, 19, 14, 21, -1, 14, 14, ++ 19, -1, 21, 19, 19, 21, 21, 14, 14, -1, ++ -1, -1, 19, 19, 21, 21, 15, 16, 17, 18, ++ -1, 20, 3, 4, 5, 6, 7, -1, 8, 9, ++ 10, 8, 9, 10, 8, 9, 10 ++}; ++ ++/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing ++ symbol of state STATE-NUM. */ ++static const unsigned char yystos[] = ++{ ++ 0, 7, 11, 14, 15, 16, 17, 18, 19, 20, ++ 21, 24, 25, 26, 27, 28, 33, 34, 35, 36, ++ 37, 38, 39, 28, 25, 38, 38, 38, 38, 38, ++ 0, 5, 6, 8, 9, 10, 29, 32, 8, 9, ++ 10, 13, 30, 31, 12, 25, 27, 8, 9, 10, ++ 8, 9, 10, 33, 34, 8, 9, 10, 8, 9, ++ 10, 8, 9, 10, 30, 34, 33, 8, 9, 10, ++ 8, 9, 10, 34 ++}; ++ ++#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) ++# define YYSIZE_T __SIZE_TYPE__ ++#endif ++#if ! defined (YYSIZE_T) && defined (size_t) ++# define YYSIZE_T size_t ++#endif ++#if ! defined (YYSIZE_T) ++# if defined (__STDC__) || defined (__cplusplus) ++# include /* INFRINGES ON USER NAME SPACE */ ++# define YYSIZE_T size_t ++# endif ++#endif ++#if ! defined (YYSIZE_T) ++# define YYSIZE_T unsigned int ++#endif ++ ++#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 ++ ++ ++/* 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. */ ++ ++#define YYFAIL goto yyerrlab ++ ++#define YYRECOVERING() (!!yyerrstatus) ++ ++#define YYBACKUP(Token, Value) \ ++do \ ++ if (yychar == YYEMPTY && yylen == 1) \ ++ { \ ++ yychar = (Token); \ ++ yylval = (Value); \ ++ yytoken = YYTRANSLATE (yychar); \ ++ YYPOPSTACK; \ ++ goto yybackup; \ ++ } \ ++ else \ ++ { \ ++ yyerror ("syntax error: cannot back up");\ ++ YYERROR; \ ++ } \ ++while (0) ++ ++#define YYTERROR 1 ++#define YYERRCODE 256 ++ ++/* YYLLOC_DEFAULT -- Compute the default location (before the actions ++ are run). */ ++ ++#ifndef YYLLOC_DEFAULT ++# define YYLLOC_DEFAULT(Current, Rhs, N) \ ++ ((Current).first_line = (Rhs)[1].first_line, \ ++ (Current).first_column = (Rhs)[1].first_column, \ ++ (Current).last_line = (Rhs)[N].last_line, \ ++ (Current).last_column = (Rhs)[N].last_column) ++#endif ++ ++/* YYLEX -- calling `yylex' with the right arguments. */ ++ ++#ifdef YYLEX_PARAM ++# define YYLEX yylex (&yylval, YYLEX_PARAM) ++#else ++# define YYLEX yylex (&yylval) ++#endif ++ ++/* Enable debugging if requested. */ ++#if YYDEBUG ++ ++# ifndef YYFPRINTF ++# include /* INFRINGES ON USER NAME SPACE */ ++# define YYFPRINTF fprintf ++# endif ++ ++# define YYDPRINTF(Args) \ ++do { \ ++ if (yydebug) \ ++ YYFPRINTF Args; \ ++} while (0) ++ ++# define YYDSYMPRINT(Args) \ ++do { \ ++ if (yydebug) \ ++ yysymprint Args; \ ++} while (0) ++ ++# define YYDSYMPRINTF(Title, Token, Value, Location) \ ++do { \ ++ if (yydebug) \ ++ { \ ++ YYFPRINTF (stderr, "%s ", Title); \ ++ yysymprint (stderr, \ ++ Token, Value); \ ++ YYFPRINTF (stderr, "\n"); \ ++ } \ ++} while (0) ++ ++/*------------------------------------------------------------------. ++| yy_stack_print -- Print the state stack from its BOTTOM up to its | ++| TOP (included). | ++`------------------------------------------------------------------*/ ++ ++#if defined (__STDC__) || defined (__cplusplus) ++static void ++yy_stack_print (short *bottom, short *top) ++#else ++static void ++yy_stack_print (bottom, top) ++ short *bottom; ++ short *top; ++#endif ++{ ++ YYFPRINTF (stderr, "Stack now"); ++ for (/* Nothing. */; bottom <= top; ++bottom) ++ YYFPRINTF (stderr, " %d", *bottom); ++ YYFPRINTF (stderr, "\n"); ++} ++ ++# 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 (__cplusplus) ++static void ++yy_reduce_print (int yyrule) ++#else ++static void ++yy_reduce_print (yyrule) ++ int yyrule; ++#endif ++{ ++ int yyi; ++ unsigned int yylno = yyrline[yyrule]; ++ YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", ++ yyrule - 1, yylno); ++ /* Print the symbols being reduced, and their result. */ ++ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) ++ YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); ++ YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); ++} ++ ++# define YY_REDUCE_PRINT(Rule) \ ++do { \ ++ if (yydebug) \ ++ yy_reduce_print (Rule); \ ++} while (0) ++ ++/* Nonzero means print parse trace. It is left uninitialized so that ++ multiple parsers can coexist. */ ++int yydebug; ++#else /* !YYDEBUG */ ++# define YYDPRINTF(Args) ++# define YYDSYMPRINT(Args) ++# define YYDSYMPRINTF(Title, Token, Value, Location) ++# define YY_STACK_PRINT(Bottom, Top) ++# define YY_REDUCE_PRINT(Rule) ++#endif /* !YYDEBUG */ ++ ++ ++/* YYINITDEPTH -- initial size of the parser's stacks. */ ++#ifndef YYINITDEPTH ++# define YYINITDEPTH 200 ++#endif ++ ++/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only ++ if the built-in stack extension method is used). ++ ++ Do not make this value too large; the results are undefined if ++ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) ++ evaluated with infinite-precision integer arithmetic. */ ++ ++#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 ++# undef YYMAXDEPTH ++#endif ++ ++#ifndef YYMAXDEPTH ++# define YYMAXDEPTH 10000 ++#endif ++ ++ ++ ++#if YYERROR_VERBOSE ++ ++# ifndef yystrlen ++# if defined (__GLIBC__) && defined (_STRING_H) ++# define yystrlen strlen ++# else ++/* Return the length of YYSTR. */ ++static YYSIZE_T ++# if defined (__STDC__) || defined (__cplusplus) ++yystrlen (const char *yystr) ++# else ++yystrlen (yystr) ++ const char *yystr; ++# endif ++{ ++ register const char *yys = yystr; ++ ++ while (*yys++ != '\0') ++ continue; ++ ++ return yys - yystr - 1; ++} ++# endif ++# endif ++ ++# ifndef yystpcpy ++# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) ++# define yystpcpy stpcpy ++# else ++/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in ++ YYDEST. */ ++static char * ++# if defined (__STDC__) || defined (__cplusplus) ++yystpcpy (char *yydest, const char *yysrc) ++# else ++yystpcpy (yydest, yysrc) ++ char *yydest; ++ const char *yysrc; ++# endif ++{ ++ register char *yyd = yydest; ++ register const char *yys = yysrc; ++ ++ while ((*yyd++ = *yys++) != '\0') ++ continue; ++ ++ return yyd - 1; ++} ++# endif ++# endif ++ ++#endif /* !YYERROR_VERBOSE */ ++ ++ ++ ++#if YYDEBUG ++/*--------------------------------. ++| Print this symbol on YYOUTPUT. | ++`--------------------------------*/ ++ ++#if defined (__STDC__) || defined (__cplusplus) ++static void ++yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) ++#else ++static void ++yysymprint (yyoutput, yytype, yyvaluep) ++ FILE *yyoutput; ++ int yytype; ++ YYSTYPE *yyvaluep; ++#endif ++{ ++ /* Pacify ``unused variable'' warnings. */ ++ (void) yyvaluep; ++ ++ if (yytype < YYNTOKENS) ++ { ++ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); ++# ifdef YYPRINT ++ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); ++# endif ++ } ++ else ++ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); ++ ++ switch (yytype) ++ { ++ default: ++ break; ++ } ++ YYFPRINTF (yyoutput, ")"); ++} ++ ++#endif /* ! YYDEBUG */ ++/*-----------------------------------------------. ++| Release the memory associated to this symbol. | ++`-----------------------------------------------*/ ++ ++#if defined (__STDC__) || defined (__cplusplus) ++static void ++yydestruct (int yytype, YYSTYPE *yyvaluep) ++#else ++static void ++yydestruct (yytype, yyvaluep) ++ int yytype; ++ YYSTYPE *yyvaluep; ++#endif ++{ ++ /* Pacify ``unused variable'' warnings. */ ++ (void) yyvaluep; ++ ++ switch (yytype) ++ { ++ ++ default: ++ break; ++ } ++} ++ ++ ++/* 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 (void); ++#else ++int yyparse (); ++#endif ++#endif /* ! YYPARSE_PARAM */ ++ ++ ++ ++ ++ ++ ++/*----------. ++| yyparse. | ++`----------*/ ++ ++#ifdef YYPARSE_PARAM ++# if defined (__STDC__) || defined (__cplusplus) ++int yyparse (void *YYPARSE_PARAM) ++# else ++int yyparse (YYPARSE_PARAM) ++ void *YYPARSE_PARAM; ++# endif ++#else /* ! YYPARSE_PARAM */ ++#if defined (__STDC__) || defined (__cplusplus) ++int ++yyparse (void) ++#else ++int ++yyparse () ++ ++#endif ++#endif ++{ ++ /* The lookahead symbol. */ ++int yychar; ++ ++/* The semantic value of the lookahead symbol. */ ++YYSTYPE yylval; ++ ++/* Number of syntax errors so far. */ ++int yynerrs; ++ ++ register int yystate; ++ register int yyn; ++ int yyresult; ++ /* Number of tokens to shift before error messages enabled. */ ++ int yyerrstatus; ++ /* Lookahead token as an internal (translated) token number. */ ++ int yytoken = 0; ++ ++ /* Three stacks and their tools: ++ `yyss': related to states, ++ `yyvs': related to semantic values, ++ `yyls': related to locations. ++ ++ Refer to the stacks thru separate pointers, to allow yyoverflow ++ to reallocate them elsewhere. */ ++ ++ /* The state stack. */ ++ short yyssa[YYINITDEPTH]; ++ short *yyss = yyssa; ++ register short *yyssp; ++ ++ /* The semantic value stack. */ ++ YYSTYPE yyvsa[YYINITDEPTH]; ++ YYSTYPE *yyvs = yyvsa; ++ register YYSTYPE *yyvsp; ++ ++ ++ ++#define YYPOPSTACK (yyvsp--, yyssp--) ++ ++ YYSIZE_T yystacksize = YYINITDEPTH; ++ ++ /* The variables used to return semantic value and location from the ++ action routines. */ ++ YYSTYPE yyval; ++ ++ ++ /* When reducing, the number of symbols on the RHS of the reduced ++ rule. */ ++ int yylen; ++ ++ YYDPRINTF ((stderr, "Starting parse\n")); ++ ++ yystate = 0; ++ 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; ++ ++/*------------------------------------------------------------. ++| yynewstate -- Push a new state, which is found in yystate. | ++`------------------------------------------------------------*/ ++ yynewstate: ++ /* In all cases, when you get here, the value and location stacks ++ have just been pushed. so pushing a state here evens the stacks. ++ */ ++ yyssp++; ++ ++ yysetstate: ++ *yyssp = yystate; ++ ++ if (yyss + yystacksize - 1 <= yyssp) ++ { ++ /* Get the current used size of the three stacks, in elements. */ ++ YYSIZE_T yysize = yyssp - yyss + 1; ++ ++#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; ++ short *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 ("parser stack overflow", ++ &yyss1, yysize * sizeof (*yyssp), ++ &yyvs1, yysize * sizeof (*yyvsp), ++ ++ &yystacksize); ++ ++ yyss = yyss1; ++ yyvs = yyvs1; ++ } ++#else /* no yyoverflow */ ++# ifndef YYSTACK_RELOCATE ++ goto yyoverflowlab; ++# else ++ /* Extend the stack our own way. */ ++ if (YYMAXDEPTH <= yystacksize) ++ goto yyoverflowlab; ++ yystacksize *= 2; ++ if (YYMAXDEPTH < yystacksize) ++ yystacksize = YYMAXDEPTH; ++ ++ { ++ short *yyss1 = yyss; ++ union yyalloc *yyptr = ++ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); ++ if (! yyptr) ++ goto yyoverflowlab; ++ YYSTACK_RELOCATE (yyss); ++ YYSTACK_RELOCATE (yyvs); ++ ++# undef YYSTACK_RELOCATE ++ if (yyss1 != yyssa) ++ YYSTACK_FREE (yyss1); ++ } ++# endif ++#endif /* no yyoverflow */ ++ ++ yyssp = yyss + yysize - 1; ++ yyvsp = yyvs + yysize - 1; ++ ++ ++ YYDPRINTF ((stderr, "Stack size increased to %lu\n", ++ (unsigned long int) yystacksize)); ++ ++ if (yyss + yystacksize - 1 <= yyssp) ++ YYABORT; ++ } ++ ++ YYDPRINTF ((stderr, "Entering state %d\n", yystate)); ++ ++ goto yybackup; ++ ++/*-----------. ++| yybackup. | ++`-----------*/ ++yybackup: ++ ++/* Do appropriate processing given the current state. */ ++/* Read a lookahead token if we need one and don't already have one. */ ++/* yyresume: */ ++ ++ /* First try to decide what to do without reference to lookahead token. */ ++ ++ yyn = yypact[yystate]; ++ if (yyn == YYPACT_NINF) ++ goto yydefault; ++ ++ /* Not known => get a lookahead token if don't already have one. */ ++ ++ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ ++ if (yychar == YYEMPTY) ++ { ++ YYDPRINTF ((stderr, "Reading a token: ")); ++ yychar = YYLEX; ++ } ++ ++ if (yychar <= YYEOF) ++ { ++ yychar = yytoken = YYEOF; ++ YYDPRINTF ((stderr, "Now at end of input.\n")); ++ } ++ else ++ { ++ yytoken = YYTRANSLATE (yychar); ++ YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); ++ } ++ ++ /* If the proper action on seeing token YYTOKEN is to reduce or to ++ detect an error, take that action. */ ++ yyn += yytoken; ++ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) ++ goto yydefault; ++ yyn = yytable[yyn]; ++ if (yyn <= 0) ++ { ++ if (yyn == 0 || yyn == YYTABLE_NINF) ++ goto yyerrlab; ++ yyn = -yyn; ++ goto yyreduce; ++ } ++ ++ if (yyn == YYFINAL) ++ YYACCEPT; ++ ++ /* Shift the lookahead token. */ ++ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); ++ ++ /* Discard the token being shifted unless it is eof. */ ++ if (yychar != YYEOF) ++ yychar = YYEMPTY; ++ ++ *++yyvsp = yylval; ++ ++ ++ /* Count tokens shifted since error; after three, turn off error ++ status. */ ++ if (yyerrstatus) ++ yyerrstatus--; ++ ++ yystate = yyn; ++ goto yynewstate; ++ ++ ++/*-----------------------------------------------------------. ++| yydefault -- do the default action for the current state. | ++`-----------------------------------------------------------*/ ++yydefault: ++ yyn = yydefact[yystate]; ++ if (yyn == 0) ++ goto yyerrlab; ++ goto yyreduce; ++ ++ ++/*-----------------------------. ++| yyreduce -- Do a reduction. | ++`-----------------------------*/ ++yyreduce: ++ /* yyn is the number of a rule to reduce with. */ ++ yylen = yyr2[yyn]; ++ ++ /* If YYLEN is nonzero, implement the default value of the action: ++ `$$ = $1'. ++ ++ Otherwise, the following line sets YYVAL to garbage. ++ This behavior is undocumented and Bison ++ users should not rely upon it. Assigning to YYVAL ++ unconditionally makes the parser a bit smaller, and it avoids a ++ GCC warning that YYVAL may be used uninitialized. */ ++ yyval = yyvsp[1-yylen]; ++ ++ ++ YY_REDUCE_PRINT (yyn); ++ switch (yyn) ++ { ++ case 2: ++#line 137 "./cond.y" ++ { ++ COND_input* cond = (COND_input*) info; ++ cond->result = yyvsp[0].value; ++ ;} ++ break; ++ ++ case 3: ++#line 145 "./cond.y" ++ { ++ yyval.value = yyvsp[0].value; ++ ;} ++ break; ++ ++ case 4: ++#line 149 "./cond.y" ++ { ++ yyval.value = yyvsp[-2].value || yyvsp[0].value; ++ ;} ++ break; ++ ++ case 5: ++#line 156 "./cond.y" ++ { ++ yyval.value = yyvsp[0].value; ++ ;} ++ break; ++ ++ case 6: ++#line 160 "./cond.y" ++ { ++ yyval.value = yyvsp[-2].value && yyvsp[0].value; ++ ;} ++ break; ++ ++ case 7: ++#line 167 "./cond.y" ++ { ++ yyval.value = yyvsp[0].value; ++ ;} ++ break; ++ ++ case 8: ++#line 171 "./cond.y" ++ { ++ yyval.value = ! yyvsp[0].value; ++ ;} ++ break; ++ ++ case 9: ++#line 179 "./cond.y" ++ { ++ yyval.value = yyvsp[0].value; ++ ;} ++ break; ++ ++ case 10: ++#line 183 "./cond.y" ++ { ++ yyval.value = (yyvsp[0].string && yyvsp[0].string[0]) ? MSICONDITION_TRUE : MSICONDITION_FALSE; ++ msi_free( yyvsp[0].string ); ++ ;} ++ break; ++ ++ case 11: ++#line 188 "./cond.y" ++ { ++ yyval.value = yyvsp[-1].fn_comp_int( yyvsp[-2].value, yyvsp[0].value ); ++ ;} ++ break; ++ ++ case 12: ++#line 192 "./cond.y" ++ { ++ yyval.value = yyvsp[-1].fn_comp_str( yyvsp[-2].string, yyvsp[0].string, FALSE ); ++ msi_free( yyvsp[-2].string ); ++ msi_free( yyvsp[0].string ); ++ ;} ++ break; ++ ++ case 13: ++#line 198 "./cond.y" ++ { ++ yyval.value = yyvsp[-1].fn_comp_str( yyvsp[-3].string, yyvsp[0].string, TRUE ); ++ msi_free( yyvsp[-3].string ); ++ msi_free( yyvsp[0].string ); ++ ;} ++ break; ++ ++ case 14: ++#line 204 "./cond.y" ++ { ++ yyval.value = yyvsp[-1].fn_comp_m1( yyvsp[-2].string, yyvsp[0].value ); ++ msi_free( yyvsp[-2].string ); ++ ;} ++ break; ++ ++ case 15: ++#line 209 "./cond.y" ++ { ++ yyval.value = yyvsp[-1].fn_comp_m2( yyvsp[-2].value, yyvsp[0].string ); ++ msi_free( yyvsp[0].string ); ++ ;} ++ break; ++ ++ case 16: ++#line 214 "./cond.y" ++ { ++ yyval.value = yyvsp[-1].value; ++ ;} ++ break; ++ ++ case 17: ++#line 222 "./cond.y" ++ { ++ yyval.fn_comp_int = comp_eq_i; ++ ;} ++ break; ++ ++ case 18: ++#line 226 "./cond.y" ++ { ++ yyval.fn_comp_int = comp_ne_i; ++ ;} ++ break; ++ ++ case 19: ++#line 230 "./cond.y" ++ { ++ yyval.fn_comp_int = comp_lt_i; ++ ;} ++ break; ++ ++ case 20: ++#line 234 "./cond.y" ++ { ++ yyval.fn_comp_int = comp_gt_i; ++ ;} ++ break; ++ ++ case 21: ++#line 238 "./cond.y" ++ { ++ yyval.fn_comp_int = comp_le_i; ++ ;} ++ break; ++ ++ case 22: ++#line 242 "./cond.y" ++ { ++ yyval.fn_comp_int = comp_ge_i; ++ ;} ++ break; ++ ++ case 23: ++#line 247 "./cond.y" ++ { ++ yyval.fn_comp_int = comp_bitand; ++ ;} ++ break; ++ ++ case 24: ++#line 251 "./cond.y" ++ { ++ yyval.fn_comp_int = comp_highcomp; ++ ;} ++ break; ++ ++ case 25: ++#line 255 "./cond.y" ++ { ++ yyval.fn_comp_int = comp_lowcomp; ++ ;} ++ break; ++ ++ case 26: ++#line 263 "./cond.y" ++ { ++ yyval.fn_comp_str = comp_eq_s; ++ ;} ++ break; ++ ++ case 27: ++#line 267 "./cond.y" ++ { ++ yyval.fn_comp_str = comp_ne_s; ++ ;} ++ break; ++ ++ case 28: ++#line 271 "./cond.y" ++ { ++ yyval.fn_comp_str = comp_lt_s; ++ ;} ++ break; ++ ++ case 29: ++#line 275 "./cond.y" ++ { ++ yyval.fn_comp_str = comp_gt_s; ++ ;} ++ break; ++ ++ case 30: ++#line 279 "./cond.y" ++ { ++ yyval.fn_comp_str = comp_le_s; ++ ;} ++ break; ++ ++ case 31: ++#line 283 "./cond.y" ++ { ++ yyval.fn_comp_str = comp_ge_s; ++ ;} ++ break; ++ ++ case 32: ++#line 288 "./cond.y" ++ { ++ yyval.fn_comp_str = comp_substring; ++ ;} ++ break; ++ ++ case 33: ++#line 292 "./cond.y" ++ { ++ yyval.fn_comp_str = comp_start; ++ ;} ++ break; ++ ++ case 34: ++#line 296 "./cond.y" ++ { ++ yyval.fn_comp_str = comp_end; ++ ;} ++ break; ++ ++ case 35: ++#line 304 "./cond.y" ++ { ++ yyval.fn_comp_m1 = comp_eq_m1; ++ ;} ++ break; ++ ++ case 36: ++#line 308 "./cond.y" ++ { ++ yyval.fn_comp_m1 = comp_ne_m1; ++ ;} ++ break; ++ ++ case 37: ++#line 312 "./cond.y" ++ { ++ yyval.fn_comp_m1 = comp_lt_m1; ++ ;} ++ break; ++ ++ case 38: ++#line 316 "./cond.y" ++ { ++ yyval.fn_comp_m1 = comp_gt_m1; ++ ;} ++ break; ++ ++ case 39: ++#line 320 "./cond.y" ++ { ++ yyval.fn_comp_m1 = comp_le_m1; ++ ;} ++ break; ++ ++ case 40: ++#line 324 "./cond.y" ++ { ++ yyval.fn_comp_m1 = comp_ge_m1; ++ ;} ++ break; ++ ++ case 41: ++#line 329 "./cond.y" ++ { ++ yyval.fn_comp_m1 = 0; ++ ;} ++ break; ++ ++ case 42: ++#line 333 "./cond.y" ++ { ++ yyval.fn_comp_m1 = 0; ++ ;} ++ break; ++ ++ case 43: ++#line 337 "./cond.y" ++ { ++ yyval.fn_comp_m1 = 0; ++ ;} ++ break; ++ ++ case 44: ++#line 345 "./cond.y" ++ { ++ yyval.fn_comp_m2 = comp_eq_m2; ++ ;} ++ break; ++ ++ case 45: ++#line 349 "./cond.y" ++ { ++ yyval.fn_comp_m2 = comp_ne_m2; ++ ;} ++ break; ++ ++ case 46: ++#line 353 "./cond.y" ++ { ++ yyval.fn_comp_m2 = comp_lt_m2; ++ ;} ++ break; ++ ++ case 47: ++#line 357 "./cond.y" ++ { ++ yyval.fn_comp_m2 = comp_gt_m2; ++ ;} ++ break; ++ ++ case 48: ++#line 361 "./cond.y" ++ { ++ yyval.fn_comp_m2 = comp_le_m2; ++ ;} ++ break; ++ ++ case 49: ++#line 365 "./cond.y" ++ { ++ yyval.fn_comp_m2 = comp_ge_m2; ++ ;} ++ break; ++ ++ case 50: ++#line 370 "./cond.y" ++ { ++ yyval.fn_comp_m2 = 0; ++ ;} ++ break; ++ ++ case 51: ++#line 374 "./cond.y" ++ { ++ yyval.fn_comp_m2 = 0; ++ ;} ++ break; ++ ++ case 52: ++#line 378 "./cond.y" ++ { ++ yyval.fn_comp_m2 = 0; ++ ;} ++ break; ++ ++ case 53: ++#line 385 "./cond.y" ++ { ++ yyval.value = yyvsp[0].value; ++ ;} ++ break; ++ ++ case 54: ++#line 389 "./cond.y" ++ { ++ yyval.value = yyvsp[0].value; ++ ;} ++ break; ++ ++ case 55: ++#line 396 "./cond.y" ++ { ++ yyval.string = yyvsp[0].string; ++ ;} ++ break; ++ ++ case 56: ++#line 400 "./cond.y" ++ { ++ yyval.string = yyvsp[0].string; ++ ;} ++ break; ++ ++ case 57: ++#line 407 "./cond.y" ++ { ++ yyval.string = COND_GetLiteral(&yyvsp[0].str); ++ if( !yyval.string ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 58: ++#line 416 "./cond.y" ++ { ++ COND_input* cond = (COND_input*) info; ++ INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; ++ ++ MSI_GetComponentStateW(cond->package, yyvsp[0].string, &install, &action ); ++ yyval.value = action; ++ msi_free( yyvsp[0].string ); ++ ;} ++ break; ++ ++ case 59: ++#line 425 "./cond.y" ++ { ++ COND_input* cond = (COND_input*) info; ++ INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; ++ ++ MSI_GetComponentStateW(cond->package, yyvsp[0].string, &install, &action ); ++ yyval.value = install; ++ msi_free( yyvsp[0].string ); ++ ;} ++ break; ++ ++ case 60: ++#line 434 "./cond.y" ++ { ++ COND_input* cond = (COND_input*) info; ++ INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; ++ ++ MSI_GetFeatureStateW(cond->package, yyvsp[0].string, &install, &action ); ++ yyval.value = action; ++ msi_free( yyvsp[0].string ); ++ ;} ++ break; ++ ++ case 61: ++#line 443 "./cond.y" ++ { ++ COND_input* cond = (COND_input*) info; ++ INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; ++ ++ MSI_GetFeatureStateW(cond->package, yyvsp[0].string, &install, &action ); ++ yyval.value = install; ++ msi_free( yyvsp[0].string ); ++ ;} ++ break; ++ ++ case 62: ++#line 455 "./cond.y" ++ { ++ DWORD sz; ++ COND_input* cond = (COND_input*) info; ++ ++ sz = 0; ++ MSI_GetPropertyW(cond->package, yyvsp[0].string, NULL, &sz); ++ if (sz == 0) ++ { ++ yyval.string = msi_alloc( sizeof(WCHAR)); ++ yyval.string[0] = 0; ++ } ++ else ++ { ++ sz ++; ++ yyval.string = msi_alloc( sz*sizeof (WCHAR) ); ++ ++ /* Lookup the identifier */ ++ ++ MSI_GetPropertyW(cond->package,yyvsp[0].string,yyval.string,&sz); ++ } ++ msi_free( yyvsp[0].string ); ++ ;} ++ break; ++ ++ case 63: ++#line 478 "./cond.y" ++ { ++ UINT len = GetEnvironmentVariableW( yyvsp[0].string, NULL, 0 ); ++ if( len++ ) ++ { ++ yyval.string = msi_alloc( len*sizeof (WCHAR) ); ++ if( yyval.string ) ++ GetEnvironmentVariableW( yyvsp[0].string, yyval.string, len ); ++ } ++ msi_free( yyvsp[0].string ); ++ ;} ++ break; ++ ++ case 64: ++#line 492 "./cond.y" ++ { ++ yyval.string = COND_GetString(&yyvsp[0].str); ++ if( !yyval.string ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 65: ++#line 501 "./cond.y" ++ { ++ LPWSTR szNum = COND_GetString(&yyvsp[0].str); ++ if( !szNum ) ++ YYABORT; ++ yyval.value = atoiW( szNum ); ++ msi_free( szNum ); ++ ;} ++ break; ++ ++ ++ } ++ ++/* Line 1000 of yacc.c. */ ++#line 1733 "cond.tab.c" ++ ++ yyvsp -= yylen; ++ yyssp -= yylen; ++ ++ ++ YY_STACK_PRINT (yyss, yyssp); ++ ++ *++yyvsp = yyval; ++ ++ ++ /* 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. */ ++ ++ yyn = yyr1[yyn]; ++ ++ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; ++ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) ++ yystate = yytable[yystate]; ++ else ++ yystate = yydefgoto[yyn - YYNTOKENS]; ++ ++ goto yynewstate; ++ ++ ++/*------------------------------------. ++| yyerrlab -- here on detecting error | ++`------------------------------------*/ ++yyerrlab: ++ /* If not already recovering from an error, report this error. */ ++ if (!yyerrstatus) ++ { ++ ++yynerrs; ++#if YYERROR_VERBOSE ++ yyn = yypact[yystate]; ++ ++ if (YYPACT_NINF < yyn && yyn < YYLAST) ++ { ++ YYSIZE_T yysize = 0; ++ int yytype = YYTRANSLATE (yychar); ++ const char* yyprefix; ++ char *yymsg; ++ int yyx; ++ ++ /* Start YYX at -YYN if negative to avoid negative indexes in ++ YYCHECK. */ ++ int yyxbegin = yyn < 0 ? -yyn : 0; ++ ++ /* Stay within bounds of both yycheck and yytname. */ ++ int yychecklim = YYLAST - yyn; ++ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; ++ int yycount = 0; ++ ++ yyprefix = ", expecting "; ++ for (yyx = yyxbegin; yyx < yyxend; ++yyx) ++ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) ++ { ++ yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); ++ yycount += 1; ++ if (yycount == 5) ++ { ++ yysize = 0; ++ break; ++ } ++ } ++ yysize += (sizeof ("syntax error, unexpected ") ++ + yystrlen (yytname[yytype])); ++ yymsg = (char *) YYSTACK_ALLOC (yysize); ++ if (yymsg != 0) ++ { ++ char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); ++ yyp = yystpcpy (yyp, yytname[yytype]); ++ ++ if (yycount < 5) ++ { ++ yyprefix = ", expecting "; ++ for (yyx = yyxbegin; yyx < yyxend; ++yyx) ++ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) ++ { ++ yyp = yystpcpy (yyp, yyprefix); ++ yyp = yystpcpy (yyp, yytname[yyx]); ++ yyprefix = " or "; ++ } ++ } ++ yyerror (yymsg); ++ YYSTACK_FREE (yymsg); ++ } ++ else ++ yyerror ("syntax error; also virtual memory exhausted"); ++ } ++ else ++#endif /* YYERROR_VERBOSE */ ++ yyerror ("syntax error"); ++ } ++ ++ ++ ++ if (yyerrstatus == 3) ++ { ++ /* If just tried and failed to reuse lookahead token after an ++ error, discard it. */ ++ ++ if (yychar <= YYEOF) ++ { ++ /* If at end of input, pop the error token, ++ then the rest of the stack, then return failure. */ ++ if (yychar == YYEOF) ++ for (;;) ++ { ++ YYPOPSTACK; ++ if (yyssp == yyss) ++ YYABORT; ++ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); ++ yydestruct (yystos[*yyssp], yyvsp); ++ } ++ } ++ else ++ { ++ YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); ++ yydestruct (yytoken, &yylval); ++ yychar = YYEMPTY; ++ ++ } ++ } ++ ++ /* Else will try to reuse lookahead token after shifting the error ++ token. */ ++ goto yyerrlab1; ++ ++ ++/*---------------------------------------------------. ++| yyerrorlab -- error raised explicitly by YYERROR. | ++`---------------------------------------------------*/ ++yyerrorlab: ++ ++#ifdef __GNUC__ ++ /* Pacify GCC when the user code never invokes YYERROR and the label ++ yyerrorlab therefore never appears in user code. */ ++ if (0) ++ goto yyerrorlab; ++#endif ++ ++ yyvsp -= yylen; ++ yyssp -= yylen; ++ yystate = *yyssp; ++ goto yyerrlab1; ++ ++ ++/*-------------------------------------------------------------. ++| yyerrlab1 -- common code for both syntax error and YYERROR. | ++`-------------------------------------------------------------*/ ++yyerrlab1: ++ yyerrstatus = 3; /* Each real token shifted decrements this. */ ++ ++ for (;;) ++ { ++ yyn = yypact[yystate]; ++ if (yyn != YYPACT_NINF) ++ { ++ 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; ++ ++ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); ++ yydestruct (yystos[yystate], yyvsp); ++ YYPOPSTACK; ++ yystate = *yyssp; ++ YY_STACK_PRINT (yyss, yyssp); ++ } ++ ++ if (yyn == YYFINAL) ++ YYACCEPT; ++ ++ YYDPRINTF ((stderr, "Shifting error token, ")); ++ ++ *++yyvsp = yylval; ++ ++ ++ yystate = yyn; ++ goto yynewstate; ++ ++ ++/*-------------------------------------. ++| yyacceptlab -- YYACCEPT comes here. | ++`-------------------------------------*/ ++yyacceptlab: ++ yyresult = 0; ++ goto yyreturn; ++ ++/*-----------------------------------. ++| yyabortlab -- YYABORT comes here. | ++`-----------------------------------*/ ++yyabortlab: ++ yyresult = 1; ++ goto yyreturn; ++ ++#ifndef yyoverflow ++/*----------------------------------------------. ++| yyoverflowlab -- parser overflow comes here. | ++`----------------------------------------------*/ ++yyoverflowlab: ++ yyerror ("parser stack overflow"); ++ yyresult = 2; ++ /* Fall through. */ ++#endif ++ ++yyreturn: ++#ifndef yyoverflow ++ if (yyss != yyssa) ++ YYSTACK_FREE (yyss); ++#endif ++ return yyresult; ++} ++ ++ ++#line 510 "./cond.y" ++ ++ ++ ++static int COND_IsAlpha( WCHAR x ) ++{ ++ return( ( ( x >= 'A' ) && ( x <= 'Z' ) ) || ++ ( ( x >= 'a' ) && ( x <= 'z' ) ) || ++ ( ( x == '_' ) ) ); ++} ++ ++static int COND_IsNumber( WCHAR x ) ++{ ++ return( (( x >= '0' ) && ( x <= '9' )) || (x =='-') || (x =='.') ); ++} ++ ++ ++/* the mess of comparison functions */ ++ ++static INT comp_lt_i(INT a, INT b) ++{ return (a < b); } ++static INT comp_gt_i(INT a, INT b) ++{ return (a > b); } ++static INT comp_le_i(INT a, INT b) ++{ return (a <= b); } ++static INT comp_ge_i(INT a, INT b) ++{ return (a >= b); } ++static INT comp_eq_i(INT a, INT b) ++{ return (a == b); } ++static INT comp_ne_i(INT a, INT b) ++{ return (a != b); } ++static INT comp_bitand(INT a, INT b) ++{ return a & b;} ++static INT comp_highcomp(INT a, INT b) ++{ return HIWORD(a)==b; } ++static INT comp_lowcomp(INT a, INT b) ++{ return LOWORD(a)==b; } ++ ++static INT comp_eq_s(LPWSTR a, LPWSTR b, BOOL casless) ++{ if (casless) return !strcmpiW(a,b); else return !strcmpW(a,b);} ++static INT comp_ne_s(LPWSTR a, LPWSTR b, BOOL casless) ++{ if (casless) return strcmpiW(a,b); else return strcmpW(a,b);} ++static INT comp_lt_s(LPWSTR a, LPWSTR b, BOOL casless) ++{ if (casless) return strcmpiW(a,b)<0; else return strcmpW(a,b)<0;} ++static INT comp_gt_s(LPWSTR a, LPWSTR b, BOOL casless) ++{ if (casless) return strcmpiW(a,b)>0; else return strcmpW(a,b)>0;} ++static INT comp_le_s(LPWSTR a, LPWSTR b, BOOL casless) ++{ if (casless) return strcmpiW(a,b)<=0; else return strcmpW(a,b)<=0;} ++static INT comp_ge_s(LPWSTR a, LPWSTR b, BOOL casless) ++{ if (casless) return strcmpiW(a,b)>=0; else return strcmpW(a,b)>=0;} ++static INT comp_substring(LPWSTR a, LPWSTR b, BOOL casless) ++/* ERROR NOT WORKING REWRITE */ ++{ if (casless) return strstrW(a,b)!=NULL; else return strstrW(a,b)!=NULL;} ++static INT comp_start(LPWSTR a, LPWSTR b, BOOL casless) ++{ if (casless) return strncmpiW(a,b,strlenW(b))==0; ++ else return strncmpW(a,b,strlenW(b))==0;} ++static INT comp_end(LPWSTR a, LPWSTR b, BOOL casless) ++{ ++ int i = strlenW(a); ++ int j = strlenW(b); ++ if (j>i) ++ return 0; ++ if (casless) return (!strcmpiW(&a[i-j-1],b)); ++ else return (!strcmpW(&a[i-j-1],b)); ++} ++ ++ ++static INT comp_eq_m1(LPWSTR a, INT b) ++{ if (COND_IsNumber(a[0])) return atoiW(a)==b; else return 0;} ++static INT comp_ne_m1(LPWSTR a, INT b) ++{ if (COND_IsNumber(a[0])) return atoiW(a)!=b; else return 1;} ++static INT comp_lt_m1(LPWSTR a, INT b) ++{ if (COND_IsNumber(a[0])) return atoiW(a)b; else return 0;} ++static INT comp_le_m1(LPWSTR a, INT b) ++{ if (COND_IsNumber(a[0])) return atoiW(a)<=b; else return 0;} ++static INT comp_ge_m1(LPWSTR a, INT b) ++{ if (COND_IsNumber(a[0])) return atoiW(a)>=b; else return 0;} ++ ++static INT comp_eq_m2(INT a, LPWSTR b) ++{ if (COND_IsNumber(b[0])) return a == atoiW(b); else return 0;} ++static INT comp_ne_m2(INT a, LPWSTR b) ++{ if (COND_IsNumber(b[0])) return a != atoiW(b); else return 1;} ++static INT comp_lt_m2(INT a, LPWSTR b) ++{ if (COND_IsNumber(b[0])) return a < atoiW(b); else return 0;} ++static INT comp_gt_m2(INT a, LPWSTR b) ++{ if (COND_IsNumber(b[0])) return a > atoiW(b); else return 0;} ++static INT comp_le_m2(INT a, LPWSTR b) ++{ if (COND_IsNumber(b[0])) return a <= atoiW(b); else return 0;} ++static INT comp_ge_m2(INT a, LPWSTR b) ++{ if (COND_IsNumber(b[0])) return a >= atoiW(b); else return 0;} ++ ++ ++ ++static int COND_IsIdent( WCHAR x ) ++{ ++ return( COND_IsAlpha( x ) || COND_IsNumber( x ) || ( x == '_' ) ++ || ( x == '#' ) || (x == '.') ); ++} ++ ++static int COND_GetOne( struct cond_str *str, COND_input *cond ) ++{ ++ static const WCHAR szNot[] = {'N','O','T',0}; ++ static const WCHAR szAnd[] = {'A','N','D',0}; ++ static const WCHAR szOr[] = {'O','R',0}; ++ WCHAR ch; ++ int rc, len = 1; ++ ++ str->data = &cond->str[cond->n]; ++ ++ ch = str->data[0]; ++ switch( ch ) ++ { ++ case 0: return 0; ++ case '(': rc = COND_LPAR; break; ++ case ')': rc = COND_RPAR; break; ++ case '&': rc = COND_AMPER; break; ++ case '!': rc = COND_EXCLAM; break; ++ case '$': rc = COND_DOLLARS; break; ++ case '?': rc = COND_QUESTION; break; ++ case '%': rc = COND_PERCENT; break; ++ case ' ': rc = COND_SPACE; break; ++ case '=': rc = COND_EQ; break; ++ case '~': rc = COND_TILDA; break; ++ case '<': rc = COND_LT; break; ++ case '>': rc = COND_GT; break; ++ case '"': ++ { ++ const WCHAR *ch2 = str->data + 1; ++ ++ ++ while ( *ch2 && *ch2 != '"' ) ++ ++ch2; ++ if (*ch2 == '"') ++ { ++ len = ch2 - str->data + 1; ++ rc = COND_LITER; ++ break; ++ } ++ } ++ ERR("Unterminated string\n"); ++ rc = COND_ERROR; ++ break; ++ default: ++ if( COND_IsAlpha( ch ) ) ++ { ++ while( COND_IsIdent( str->data[len] ) ) ++ len++; ++ rc = COND_IDENT; ++ break; ++ } ++ ++ if( COND_IsNumber( ch ) ) ++ { ++ while( COND_IsNumber( str->data[len] ) ) ++ len++; ++ rc = COND_NUMBER; ++ break; ++ } ++ ++ ERR("Got unknown character %c(%x)\n",ch,ch); ++ rc = COND_ERROR; ++ break; ++ } ++ ++ /* keyword identifiers */ ++ if( rc == COND_IDENT ) ++ { ++ if( (len==3) && (strncmpiW(str->data,szNot,len)==0) ) ++ rc = COND_NOT; ++ else if( (len==3) && (strncmpiW(str->data,szAnd,len)==0) ) ++ rc = COND_AND; ++ else if( (len==2) && (strncmpiW(str->data,szOr,len)==0) ) ++ rc = COND_OR; ++ } ++ ++ cond->n += len; ++ str->len = len; ++ ++ return rc; ++} ++ ++static int COND_lex( void *COND_lval, COND_input *cond ) ++{ ++ int rc; ++ struct cond_str *str = COND_lval; ++ ++ do { ++ rc = COND_GetOne( str, cond ); ++ } while (rc == COND_SPACE); ++ ++ return rc; ++} ++ ++static LPWSTR COND_GetString( struct cond_str *str ) ++{ ++ LPWSTR ret; ++ ++ ret = msi_alloc( (str->len+1) * sizeof (WCHAR) ); ++ if( ret ) ++ { ++ memcpy( ret, str->data, str->len * sizeof(WCHAR)); ++ ret[str->len]=0; ++ } ++ TRACE("Got identifier %s\n",debugstr_w(ret)); ++ return ret; ++} ++ ++static LPWSTR COND_GetLiteral( struct cond_str *str ) ++{ ++ LPWSTR ret; ++ ++ ret = msi_alloc( (str->len-1) * sizeof (WCHAR) ); ++ if( ret ) ++ { ++ memcpy( ret, str->data+1, (str->len-2) * sizeof(WCHAR) ); ++ ret[str->len - 2]=0; ++ } ++ TRACE("Got literal %s\n",debugstr_w(ret)); ++ return ret; ++} ++ ++static int COND_error(const char *str) ++{ ++ return 0; ++} ++ ++MSICONDITION MSI_EvaluateConditionW( MSIPACKAGE *package, LPCWSTR szCondition ) ++{ ++ COND_input cond; ++ MSICONDITION r; ++ ++ cond.package = package; ++ cond.str = szCondition; ++ cond.n = 0; ++ cond.result = -1; ++ ++ TRACE("Evaluating %s\n",debugstr_w(szCondition)); ++ ++ if ( szCondition == NULL || szCondition[0] == 0) ++ r = MSICONDITION_NONE; ++ else if ( !COND_parse( &cond ) ) ++ r = cond.result; ++ else ++ r = MSICONDITION_ERROR; ++ ++ TRACE("Evaluates to %i\n",r); ++ return r; ++} ++ ++MSICONDITION WINAPI MsiEvaluateConditionW( MSIHANDLE hInstall, LPCWSTR szCondition ) ++{ ++ MSIPACKAGE *package; ++ UINT ret; ++ ++ package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE); ++ if( !package) ++ return ERROR_INVALID_HANDLE; ++ ret = MSI_EvaluateConditionW( package, szCondition ); ++ msiobj_release( &package->hdr ); ++ return ret; ++} ++ ++MSICONDITION WINAPI MsiEvaluateConditionA( MSIHANDLE hInstall, LPCSTR szCondition ) ++{ ++ LPWSTR szwCond = NULL; ++ MSICONDITION r; ++ ++ if( szCondition ) ++ { ++ UINT len = MultiByteToWideChar( CP_ACP, 0, szCondition, -1, NULL, 0 ); ++ szwCond = msi_alloc( len * sizeof (WCHAR) ); ++ MultiByteToWideChar( CP_ACP, 0, szCondition, -1, szwCond, len ); ++ } ++ ++ r = MsiEvaluateConditionW( hInstall, szwCond ); ++ ++ msi_free( szwCond ); ++ ++ return r; ++} ++ +Index: cond.tab.h +=================================================================== +--- cond.tab.h (revision 23782) ++++ cond.tab.h (working copy) +@@ -0,0 +1,99 @@ ++/* A Bison parser, made by GNU Bison 1.875c. */ ++ ++/* Skeleton parser for Yacc-like parsing with Bison, ++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, ++ Boston, MA 02111-1307, USA. */ ++ ++/* As a special exception, when this file is copied by Bison into a ++ Bison output file, you may use that output file without restriction. ++ This special exception was added by the Free Software Foundation ++ in version 1.24 of Bison. */ ++ ++/* Tokens. */ ++#ifndef YYTOKENTYPE ++# define YYTOKENTYPE ++ /* Put the tokens into the symbol table, so that GDB and other debuggers ++ know about them. */ ++ enum yytokentype { ++ COND_SPACE = 258, ++ COND_EOF = 259, ++ COND_OR = 260, ++ COND_AND = 261, ++ COND_NOT = 262, ++ COND_LT = 263, ++ COND_GT = 264, ++ COND_EQ = 265, ++ COND_LPAR = 266, ++ COND_RPAR = 267, ++ COND_TILDA = 268, ++ COND_PERCENT = 269, ++ COND_DOLLARS = 270, ++ COND_QUESTION = 271, ++ COND_AMPER = 272, ++ COND_EXCLAM = 273, ++ COND_IDENT = 274, ++ COND_NUMBER = 275, ++ COND_LITER = 276, ++ COND_ERROR = 277 ++ }; ++#endif ++#define COND_SPACE 258 ++#define COND_EOF 259 ++#define COND_OR 260 ++#define COND_AND 261 ++#define COND_NOT 262 ++#define COND_LT 263 ++#define COND_GT 264 ++#define COND_EQ 265 ++#define COND_LPAR 266 ++#define COND_RPAR 267 ++#define COND_TILDA 268 ++#define COND_PERCENT 269 ++#define COND_DOLLARS 270 ++#define COND_QUESTION 271 ++#define COND_AMPER 272 ++#define COND_EXCLAM 273 ++#define COND_IDENT 274 ++#define COND_NUMBER 275 ++#define COND_LITER 276 ++#define COND_ERROR 277 ++ ++ ++ ++ ++#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) ++#line 106 "./cond.y" ++typedef union YYSTYPE { ++ struct cond_str str; ++ LPWSTR string; ++ INT value; ++ comp_int fn_comp_int; ++ comp_str fn_comp_str; ++ comp_m1 fn_comp_m1; ++ comp_m2 fn_comp_m2; ++} YYSTYPE; ++/* Line 1275 of yacc.c. */ ++#line 91 "cond.tab.h" ++# define yystype YYSTYPE /* obsolescent; will be withdrawn */ ++# define YYSTYPE_IS_DECLARED 1 ++# define YYSTYPE_IS_TRIVIAL 1 ++#endif ++ ++ ++ ++ ++ +Index: helpers.c +=================================================================== +--- helpers.c (revision 23808) ++++ helpers.c (working copy) +@@ -25,6 +25,7 @@ + + #include + ++#include "stdio.h" + #include "windef.h" + #include "winbase.h" + #include "winerror.h" +Index: install.c +=================================================================== +--- install.c (revision 23808) ++++ install.c (working copy) +@@ -22,6 +22,7 @@ + + #include + ++#include "stdio.h" + #include "windef.h" + #include "winbase.h" + #include "winerror.h" +Index: msi.c +=================================================================== +--- msi.c (revision 23808) ++++ msi.c (working copy) +@@ -23,6 +23,7 @@ + #define COBJMACROS + #define NONAMELESSUNION + ++#include "stdio.h" + #include "windef.h" + #include "winbase.h" + #include "winreg.h" +Index: msi.rbuild +=================================================================== +--- msi.rbuild (revision 23808) ++++ msi.rbuild (working copy) +@@ -1,4 +1,5 @@ + ++ + + . + include/reactos/wine +@@ -28,6 +29,7 @@ + alter.c + appsearch.c + classes.c ++ cond.tab.c + create.c + custom.c + database.c +@@ -53,6 +55,7 @@ + regsvr.c + select.c + source.c ++ sql.tab.c + string.c + suminfo.c + table.c +Index: msi_Ja.rc +=================================================================== +--- msi_Ja.rc (revision 23782) ++++ msi_Ja.rc (working copy) +@@ -0,0 +1,13 @@ ++LANGUAGE LANG_JAPANESE, SUBLANG_NEUTRAL ++ ++STRINGTABLE DISCARDABLE ++{ ++ 5 "ƒpƒX %s ‚ª‚݂‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½" ++ 9 "ƒfƒBƒXƒN %s ‚ð‘}“ü‚µ‚Ä‚­‚¾‚³‚¢" ++ 10 "–³Œø‚ȃpƒ‰ƒ[ƒ^‚Å‚·" ++ 11 "%s ‚Ì‚ ‚éƒtƒHƒ‹ƒ_‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢" ++ 12 "‹@”\\‚̃Cƒ“ƒXƒg[ƒ‹Œ³‚ª‚ ‚è‚Ü‚¹‚ñ" ++ 13 "‹@”\\‚ª‚ ‚éƒlƒbƒgƒ[ƒN ƒhƒ‰ƒCƒu‚ª‚ ‚è‚Ü‚¹‚ñ" ++ 14 "‹@”\\‚ÌêŠ:" ++ 15 "%s ‚Ì‚ ‚éƒtƒHƒ‹ƒ_‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢" ++} +Index: msiquery.c +=================================================================== +--- msiquery.c (revision 23808) ++++ msiquery.c (working copy) +@@ -22,6 +22,7 @@ + + #define COBJMACROS + ++#include "stdio.h" + #include "windef.h" + #include "winbase.h" + #include "winerror.h" +Index: registry.c +=================================================================== +--- registry.c (revision 23808) ++++ registry.c (working copy) +@@ -24,6 +24,7 @@ + #define COBJMACROS + #define NONAMELESSUNION + ++#include "stdio.h" + #include "windef.h" + #include "winbase.h" + #include "winreg.h" +Index: source.c +=================================================================== +--- source.c (revision 23808) ++++ source.c (working copy) +@@ -23,6 +23,7 @@ + #define COBJMACROS + #define NONAMELESSUNION + ++#include "stdio.h" + #include "windef.h" + #include "winbase.h" + #include "winreg.h" +Index: sql.tab.c +=================================================================== +--- sql.tab.c (revision 23782) ++++ sql.tab.c (working copy) +@@ -0,0 +1,2484 @@ ++/* A Bison parser, made by GNU Bison 1.875c. */ ++ ++/* Skeleton parser for Yacc-like parsing with Bison, ++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, ++ Boston, MA 02111-1307, USA. */ ++ ++/* As a special exception, when this file is copied by Bison into a ++ Bison output file, you may use that output file without restriction. ++ This special exception was added by the Free Software Foundation ++ in version 1.24 of Bison. */ ++ ++/* Written by Richard Stallman by simplifying the original so called ++ ``semantic'' parser. */ ++ ++/* All symbols defined below should begin with yy or YY, to avoid ++ infringing on user name space. This should be done even for local ++ variables, as they might otherwise be expanded by user macros. ++ There are some unavoidable exceptions within include files to ++ define necessary library symbols; they are noted "INFRINGES ON ++ USER NAME SPACE" below. */ ++ ++/* Identify Bison output. */ ++#define YYBISON 1 ++ ++/* Skeleton name. */ ++#define YYSKELETON_NAME "yacc.c" ++ ++/* Pure parsers. */ ++#define YYPURE 1 ++ ++/* Using locations. */ ++#define YYLSP_NEEDED 0 ++ ++/* If NAME_PREFIX is specified substitute the variables and functions ++ names. */ ++#define yyparse SQL_parse ++#define yylex SQL_lex ++#define yyerror SQL_error ++#define yylval SQL_lval ++#define yychar SQL_char ++#define yydebug SQL_debug ++#define yynerrs SQL_nerrs ++ ++ ++/* Tokens. */ ++#ifndef YYTOKENTYPE ++# define YYTOKENTYPE ++ /* Put the tokens into the symbol table, so that GDB and other debuggers ++ know about them. */ ++ enum yytokentype { ++ TK_ABORT = 258, ++ TK_AFTER = 259, ++ TK_AGG_FUNCTION = 260, ++ TK_ALL = 261, ++ TK_AND = 262, ++ TK_AS = 263, ++ TK_ASC = 264, ++ TK_BEFORE = 265, ++ TK_BEGIN = 266, ++ TK_BETWEEN = 267, ++ TK_BITAND = 268, ++ TK_BITNOT = 269, ++ TK_BITOR = 270, ++ TK_BY = 271, ++ TK_CASCADE = 272, ++ TK_CASE = 273, ++ TK_CHAR = 274, ++ TK_CHECK = 275, ++ TK_CLUSTER = 276, ++ TK_COLLATE = 277, ++ TK_COLUMN = 278, ++ TK_COMMA = 279, ++ TK_COMMENT = 280, ++ TK_COMMIT = 281, ++ TK_CONCAT = 282, ++ TK_CONFLICT = 283, ++ TK_CONSTRAINT = 284, ++ TK_COPY = 285, ++ TK_CREATE = 286, ++ TK_DEFAULT = 287, ++ TK_DEFERRABLE = 288, ++ TK_DEFERRED = 289, ++ TK_DELETE = 290, ++ TK_DELIMITERS = 291, ++ TK_DESC = 292, ++ TK_DISTINCT = 293, ++ TK_DOT = 294, ++ TK_DROP = 295, ++ TK_EACH = 296, ++ TK_ELSE = 297, ++ TK_END = 298, ++ TK_END_OF_FILE = 299, ++ TK_EQ = 300, ++ TK_EXCEPT = 301, ++ TK_EXPLAIN = 302, ++ TK_FAIL = 303, ++ TK_FLOAT = 304, ++ TK_FOR = 305, ++ TK_FOREIGN = 306, ++ TK_FROM = 307, ++ TK_FUNCTION = 308, ++ TK_GE = 309, ++ TK_GLOB = 310, ++ TK_GROUP = 311, ++ TK_GT = 312, ++ TK_HAVING = 313, ++ TK_HOLD = 314, ++ TK_IGNORE = 315, ++ TK_ILLEGAL = 316, ++ TK_IMMEDIATE = 317, ++ TK_IN = 318, ++ TK_INDEX = 319, ++ TK_INITIALLY = 320, ++ TK_ID = 321, ++ TK_INSERT = 322, ++ TK_INSTEAD = 323, ++ TK_INT = 324, ++ TK_INTEGER = 325, ++ TK_INTERSECT = 326, ++ TK_INTO = 327, ++ TK_IS = 328, ++ TK_ISNULL = 329, ++ TK_JOIN = 330, ++ TK_JOIN_KW = 331, ++ TK_KEY = 332, ++ TK_LE = 333, ++ TK_LIKE = 334, ++ TK_LIMIT = 335, ++ TK_LONG = 336, ++ TK_LONGCHAR = 337, ++ TK_LP = 338, ++ TK_LSHIFT = 339, ++ TK_LT = 340, ++ TK_LOCALIZABLE = 341, ++ TK_MATCH = 342, ++ TK_MINUS = 343, ++ TK_NE = 344, ++ TK_NOT = 345, ++ TK_NOTNULL = 346, ++ TK_NULL = 347, ++ TK_OBJECT = 348, ++ TK_OF = 349, ++ TK_OFFSET = 350, ++ TK_ON = 351, ++ TK_OR = 352, ++ TK_ORACLE_OUTER_JOIN = 353, ++ TK_ORDER = 354, ++ TK_PLUS = 355, ++ TK_PRAGMA = 356, ++ TK_PRIMARY = 357, ++ TK_RAISE = 358, ++ TK_REFERENCES = 359, ++ TK_REM = 360, ++ TK_REPLACE = 361, ++ TK_RESTRICT = 362, ++ TK_ROLLBACK = 363, ++ TK_ROW = 364, ++ TK_RP = 365, ++ TK_RSHIFT = 366, ++ TK_SELECT = 367, ++ TK_SEMI = 368, ++ TK_SET = 369, ++ TK_SHORT = 370, ++ TK_SLASH = 371, ++ TK_SPACE = 372, ++ TK_STAR = 373, ++ TK_STATEMENT = 374, ++ TK_STRING = 375, ++ TK_TABLE = 376, ++ TK_TEMP = 377, ++ TK_THEN = 378, ++ TK_TRANSACTION = 379, ++ TK_TRIGGER = 380, ++ TK_UMINUS = 381, ++ TK_UNCLOSED_STRING = 382, ++ TK_UNION = 383, ++ TK_UNIQUE = 384, ++ TK_UPDATE = 385, ++ TK_UPLUS = 386, ++ TK_USING = 387, ++ TK_VACUUM = 388, ++ TK_VALUES = 389, ++ TK_VIEW = 390, ++ TK_WHEN = 391, ++ TK_WHERE = 392, ++ TK_WILDCARD = 393, ++ COLUMN = 395, ++ FUNCTION = 396, ++ COMMENT = 397, ++ UNCLOSED_STRING = 398, ++ SPACE = 399, ++ ILLEGAL = 400, ++ END_OF_FILE = 401 ++ }; ++#endif ++#define TK_ABORT 258 ++#define TK_AFTER 259 ++#define TK_AGG_FUNCTION 260 ++#define TK_ALL 261 ++#define TK_AND 262 ++#define TK_AS 263 ++#define TK_ASC 264 ++#define TK_BEFORE 265 ++#define TK_BEGIN 266 ++#define TK_BETWEEN 267 ++#define TK_BITAND 268 ++#define TK_BITNOT 269 ++#define TK_BITOR 270 ++#define TK_BY 271 ++#define TK_CASCADE 272 ++#define TK_CASE 273 ++#define TK_CHAR 274 ++#define TK_CHECK 275 ++#define TK_CLUSTER 276 ++#define TK_COLLATE 277 ++#define TK_COLUMN 278 ++#define TK_COMMA 279 ++#define TK_COMMENT 280 ++#define TK_COMMIT 281 ++#define TK_CONCAT 282 ++#define TK_CONFLICT 283 ++#define TK_CONSTRAINT 284 ++#define TK_COPY 285 ++#define TK_CREATE 286 ++#define TK_DEFAULT 287 ++#define TK_DEFERRABLE 288 ++#define TK_DEFERRED 289 ++#define TK_DELETE 290 ++#define TK_DELIMITERS 291 ++#define TK_DESC 292 ++#define TK_DISTINCT 293 ++#define TK_DOT 294 ++#define TK_DROP 295 ++#define TK_EACH 296 ++#define TK_ELSE 297 ++#define TK_END 298 ++#define TK_END_OF_FILE 299 ++#define TK_EQ 300 ++#define TK_EXCEPT 301 ++#define TK_EXPLAIN 302 ++#define TK_FAIL 303 ++#define TK_FLOAT 304 ++#define TK_FOR 305 ++#define TK_FOREIGN 306 ++#define TK_FROM 307 ++#define TK_FUNCTION 308 ++#define TK_GE 309 ++#define TK_GLOB 310 ++#define TK_GROUP 311 ++#define TK_GT 312 ++#define TK_HAVING 313 ++#define TK_HOLD 314 ++#define TK_IGNORE 315 ++#define TK_ILLEGAL 316 ++#define TK_IMMEDIATE 317 ++#define TK_IN 318 ++#define TK_INDEX 319 ++#define TK_INITIALLY 320 ++#define TK_ID 321 ++#define TK_INSERT 322 ++#define TK_INSTEAD 323 ++#define TK_INT 324 ++#define TK_INTEGER 325 ++#define TK_INTERSECT 326 ++#define TK_INTO 327 ++#define TK_IS 328 ++#define TK_ISNULL 329 ++#define TK_JOIN 330 ++#define TK_JOIN_KW 331 ++#define TK_KEY 332 ++#define TK_LE 333 ++#define TK_LIKE 334 ++#define TK_LIMIT 335 ++#define TK_LONG 336 ++#define TK_LONGCHAR 337 ++#define TK_LP 338 ++#define TK_LSHIFT 339 ++#define TK_LT 340 ++#define TK_LOCALIZABLE 341 ++#define TK_MATCH 342 ++#define TK_MINUS 343 ++#define TK_NE 344 ++#define TK_NOT 345 ++#define TK_NOTNULL 346 ++#define TK_NULL 347 ++#define TK_OBJECT 348 ++#define TK_OF 349 ++#define TK_OFFSET 350 ++#define TK_ON 351 ++#define TK_OR 352 ++#define TK_ORACLE_OUTER_JOIN 353 ++#define TK_ORDER 354 ++#define TK_PLUS 355 ++#define TK_PRAGMA 356 ++#define TK_PRIMARY 357 ++#define TK_RAISE 358 ++#define TK_REFERENCES 359 ++#define TK_REM 360 ++#define TK_REPLACE 361 ++#define TK_RESTRICT 362 ++#define TK_ROLLBACK 363 ++#define TK_ROW 364 ++#define TK_RP 365 ++#define TK_RSHIFT 366 ++#define TK_SELECT 367 ++#define TK_SEMI 368 ++#define TK_SET 369 ++#define TK_SHORT 370 ++#define TK_SLASH 371 ++#define TK_SPACE 372 ++#define TK_STAR 373 ++#define TK_STATEMENT 374 ++#define TK_STRING 375 ++#define TK_TABLE 376 ++#define TK_TEMP 377 ++#define TK_THEN 378 ++#define TK_TRANSACTION 379 ++#define TK_TRIGGER 380 ++#define TK_UMINUS 381 ++#define TK_UNCLOSED_STRING 382 ++#define TK_UNION 383 ++#define TK_UNIQUE 384 ++#define TK_UPDATE 385 ++#define TK_UPLUS 386 ++#define TK_USING 387 ++#define TK_VACUUM 388 ++#define TK_VALUES 389 ++#define TK_VIEW 390 ++#define TK_WHEN 391 ++#define TK_WHERE 392 ++#define TK_WILDCARD 393 ++#define COLUMN 395 ++#define FUNCTION 396 ++#define COMMENT 397 ++#define UNCLOSED_STRING 398 ++#define SPACE 399 ++#define ILLEGAL 400 ++#define END_OF_FILE 401 ++ ++ ++ ++ ++/* Copy the first part of user declarations. */ ++#line 1 "./sql.y" ++ ++ ++/* ++ * Implementation of the Microsoft Installer (msi.dll) ++ * ++ * Copyright 2002-2004 Mike McCormack for CodeWeavers ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++ ++#include "config.h" ++ ++#include ++#include ++#include ++ ++#include "windef.h" ++#include "winbase.h" ++#include "query.h" ++#include "wine/list.h" ++#include "wine/debug.h" ++ ++#define YYLEX_PARAM info ++#define YYPARSE_PARAM info ++ ++extern int SQL_error(const char *str); ++ ++WINE_DEFAULT_DEBUG_CHANNEL(msi); ++ ++typedef struct tag_SQL_input ++{ ++ MSIDATABASE *db; ++ LPCWSTR command; ++ DWORD n, len; ++ MSIVIEW **view; /* view structure for the resulting query */ ++ struct list *mem; ++} SQL_input; ++ ++static LPWSTR SQL_getstring( void *info, struct sql_str *str ); ++static INT SQL_getint( void *info ); ++static int SQL_lex( void *SQL_lval, SQL_input *info ); ++ ++static void *parser_alloc( void *info, unsigned int sz ); ++static column_info *parser_alloc_column( void *info, LPCWSTR table, LPCWSTR column ); ++ ++static BOOL SQL_MarkPrimaryKeys( column_info *cols, column_info *keys); ++ ++static struct expr * EXPR_complex( void *info, struct expr *l, UINT op, struct expr *r ); ++static struct expr * EXPR_column( void *info, column_info *column ); ++static struct expr * EXPR_ival( void *info, int val ); ++static struct expr * EXPR_sval( void *info, struct sql_str * ); ++static struct expr * EXPR_wildcard( void *info ); ++ ++ ++ ++/* Enabling traces. */ ++#ifndef YYDEBUG ++# define YYDEBUG 0 ++#endif ++ ++/* Enabling verbose error messages. */ ++#ifdef YYERROR_VERBOSE ++# undef YYERROR_VERBOSE ++# define YYERROR_VERBOSE 1 ++#else ++# define YYERROR_VERBOSE 0 ++#endif ++ ++#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) ++#line 72 "./sql.y" ++typedef union YYSTYPE { ++ struct sql_str str; ++ LPWSTR string; ++ column_info *column_list; ++ MSIVIEW *query; ++ struct expr *expr; ++ USHORT column_type; ++ int integer; ++} YYSTYPE; ++/* Line 191 of yacc.c. */ ++#line 453 "sql.tab.c" ++# define yystype YYSTYPE /* obsolescent; will be withdrawn */ ++# define YYSTYPE_IS_DECLARED 1 ++# define YYSTYPE_IS_TRIVIAL 1 ++#endif ++ ++ ++ ++/* Copy the second part of user declarations. */ ++ ++ ++/* Line 214 of yacc.c. */ ++#line 465 "sql.tab.c" ++ ++#if ! defined (yyoverflow) || YYERROR_VERBOSE ++ ++# ifndef YYFREE ++# define YYFREE free ++# endif ++# ifndef YYMALLOC ++# define YYMALLOC malloc ++# endif ++ ++/* The parser invokes alloca or malloc; define the necessary symbols. */ ++ ++# ifdef YYSTACK_USE_ALLOCA ++# if YYSTACK_USE_ALLOCA ++# define YYSTACK_ALLOC alloca ++# endif ++# else ++# if defined (alloca) || defined (_ALLOCA_H) ++# define YYSTACK_ALLOC alloca ++# else ++# ifdef __GNUC__ ++# define YYSTACK_ALLOC __builtin_alloca ++# endif ++# endif ++# endif ++ ++# ifdef YYSTACK_ALLOC ++ /* Pacify GCC's `empty if-body' warning. */ ++# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) ++# else ++# if defined (__STDC__) || defined (__cplusplus) ++# include /* INFRINGES ON USER NAME SPACE */ ++# define YYSIZE_T size_t ++# endif ++# define YYSTACK_ALLOC YYMALLOC ++# define YYSTACK_FREE YYFREE ++# endif ++#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ ++ ++ ++#if (! defined (yyoverflow) \ ++ && (! defined (__cplusplus) \ ++ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) ++ ++/* A type that is properly aligned for any stack member. */ ++union yyalloc ++{ ++ short yyss; ++ YYSTYPE yyvs; ++ }; ++ ++/* The size of the maximum gap between one aligned stack and the next. */ ++# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) ++ ++/* The size of an array large to enough to hold all stacks, each with ++ N elements. */ ++# define YYSTACK_BYTES(N) \ ++ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ ++ + YYSTACK_GAP_MAXIMUM) ++ ++/* Copy COUNT objects from FROM to TO. 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))) ++# else ++# define YYCOPY(To, From, Count) \ ++ do \ ++ { \ ++ register YYSIZE_T yyi; \ ++ for (yyi = 0; yyi < (Count); yyi++) \ ++ (To)[yyi] = (From)[yyi]; \ ++ } \ ++ while (0) ++# endif ++# endif ++ ++/* Relocate STACK from its old location to the new one. The ++ local variables YYSIZE and YYSTACKSIZE give the old and new number of ++ 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) \ ++ do \ ++ { \ ++ YYSIZE_T yynewbytes; \ ++ YYCOPY (&yyptr->Stack, Stack, yysize); \ ++ Stack = &yyptr->Stack; \ ++ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ ++ yyptr += yynewbytes / sizeof (*yyptr); \ ++ } \ ++ while (0) ++ ++#endif ++ ++#if defined (__STDC__) || defined (__cplusplus) ++ typedef signed char yysigned_char; ++#else ++ typedef short yysigned_char; ++#endif ++ ++/* YYFINAL -- State number of the termination state. */ ++#define YYFINAL 29 ++/* YYLAST -- Last index in YYTABLE. */ ++#define YYLAST 124 ++ ++/* YYNTOKENS -- Number of terminals. */ ++#define YYNTOKENS 147 ++/* YYNNTS -- Number of nonterminals. */ ++#define YYNNTS 31 ++/* YYNRULES -- Number of rules. */ ++#define YYNRULES 69 ++/* YYNRULES -- Number of states. */ ++#define YYNSTATES 127 ++ ++/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ ++#define YYUNDEFTOK 2 ++#define YYMAXUTOK 401 ++ ++#define YYTRANSLATE(YYX) \ ++ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) ++ ++/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ ++static const unsigned char yytranslate[] = ++{ ++ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, ++ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ++ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, ++ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, ++ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, ++ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, ++ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, ++ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ++ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, ++ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, ++ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, ++ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, ++ 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, ++ 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, ++ 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, ++ 145, 146 ++}; ++ ++#if YYDEBUG ++/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in ++ YYRHS. */ ++static const unsigned char yyprhs[] = ++{ ++ 0, 0, 3, 5, 7, 9, 11, 13, 15, 26, ++ 38, 45, 53, 60, 63, 68, 72, 74, 77, 79, ++ 82, 84, 88, 90, 95, 97, 99, 101, 103, 105, ++ 107, 112, 114, 117, 121, 124, 126, 130, 132, 134, ++ 138, 141, 145, 149, 153, 157, 161, 165, 169, 173, ++ 177, 181, 185, 190, 192, 194, 196, 200, 202, 206, ++ 210, 212, 215, 217, 219, 221, 225, 227, 229, 231 ++}; ++ ++/* YYRHS -- A `-1'-separated list of the rules' RHS. */ ++static const short yyrhs[] = ++{ ++ 148, 0, -1, 149, -1, 161, -1, 151, -1, 150, ++ -1, 152, -1, 153, -1, 67, 72, 175, 83, 164, ++ 110, 134, 83, 169, 110, -1, 67, 72, 175, 83, ++ 164, 110, 134, 83, 169, 110, 122, -1, 31, 121, ++ 175, 83, 154, 110, -1, 31, 121, 175, 83, 154, ++ 110, 59, -1, 130, 175, 114, 170, 137, 167, -1, ++ 35, 165, -1, 155, 102, 77, 164, -1, 155, 24, ++ 156, -1, 156, -1, 174, 157, -1, 158, -1, 158, ++ 86, -1, 159, -1, 159, 90, 92, -1, 19, -1, ++ 19, 83, 160, 110, -1, 82, -1, 115, -1, 69, ++ -1, 81, -1, 93, -1, 177, -1, 162, 99, 16, ++ 164, -1, 162, -1, 112, 163, -1, 112, 38, 163, ++ -1, 164, 165, -1, 174, -1, 174, 24, 164, -1, ++ 118, -1, 166, -1, 166, 137, 167, -1, 52, 175, ++ -1, 83, 167, 110, -1, 173, 45, 173, -1, 167, ++ 7, 167, -1, 167, 97, 167, -1, 173, 45, 168, ++ -1, 173, 57, 168, -1, 173, 85, 168, -1, 173, ++ 78, 168, -1, 173, 54, 168, -1, 173, 89, 168, ++ -1, 173, 73, 92, -1, 173, 73, 90, 92, -1, ++ 173, -1, 172, -1, 172, -1, 172, 24, 169, -1, ++ 171, -1, 171, 24, 170, -1, 174, 45, 172, -1, ++ 177, -1, 88, 177, -1, 120, -1, 138, -1, 174, ++ -1, 175, 39, 176, -1, 176, -1, 176, -1, 66, ++ -1, 70, -1 ++}; ++ ++/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ ++static const unsigned short yyrline[] = ++{ ++ 0, 138, 138, 146, 147, 148, 149, 150, 154, 165, ++ 178, 190, 205, 218, 231, 241, 251, 258, 266, 270, ++ 277, 281, 288, 292, 296, 300, 304, 308, 312, 319, ++ 328, 340, 344, 348, 364, 385, 386, 390, 397, 398, ++ 414, 427, 433, 439, 445, 451, 457, 463, 469, 475, ++ 481, 487, 493, 502, 503, 507, 514, 525, 526, 534, ++ 542, 548, 554, 560, 569, 578, 584, 593, 600, 609 ++}; ++#endif ++ ++#if YYDEBUG || YYERROR_VERBOSE ++/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. ++ First, the terminals, then, starting at YYNTOKENS, nonterminals. */ ++static const char *const yytname[] = ++{ ++ "$end", "error", "$undefined", "TK_ABORT", "TK_AFTER", ++ "TK_AGG_FUNCTION", "TK_ALL", "TK_AND", "TK_AS", "TK_ASC", "TK_BEFORE", ++ "TK_BEGIN", "TK_BETWEEN", "TK_BITAND", "TK_BITNOT", "TK_BITOR", "TK_BY", ++ "TK_CASCADE", "TK_CASE", "TK_CHAR", "TK_CHECK", "TK_CLUSTER", ++ "TK_COLLATE", "TK_COLUMN", "TK_COMMA", "TK_COMMENT", "TK_COMMIT", ++ "TK_CONCAT", "TK_CONFLICT", "TK_CONSTRAINT", "TK_COPY", "TK_CREATE", ++ "TK_DEFAULT", "TK_DEFERRABLE", "TK_DEFERRED", "TK_DELETE", ++ "TK_DELIMITERS", "TK_DESC", "TK_DISTINCT", "TK_DOT", "TK_DROP", ++ "TK_EACH", "TK_ELSE", "TK_END", "TK_END_OF_FILE", "TK_EQ", "TK_EXCEPT", ++ "TK_EXPLAIN", "TK_FAIL", "TK_FLOAT", "TK_FOR", "TK_FOREIGN", "TK_FROM", ++ "TK_FUNCTION", "TK_GE", "TK_GLOB", "TK_GROUP", "TK_GT", "TK_HAVING", ++ "TK_HOLD", "TK_IGNORE", "TK_ILLEGAL", "TK_IMMEDIATE", "TK_IN", ++ "TK_INDEX", "TK_INITIALLY", "TK_ID", "TK_INSERT", "TK_INSTEAD", "TK_INT", ++ "TK_INTEGER", "TK_INTERSECT", "TK_INTO", "TK_IS", "TK_ISNULL", "TK_JOIN", ++ "TK_JOIN_KW", "TK_KEY", "TK_LE", "TK_LIKE", "TK_LIMIT", "TK_LONG", ++ "TK_LONGCHAR", "TK_LP", "TK_LSHIFT", "TK_LT", "TK_LOCALIZABLE", ++ "TK_MATCH", "TK_MINUS", "TK_NE", "TK_NOT", "TK_NOTNULL", "TK_NULL", ++ "TK_OBJECT", "TK_OF", "TK_OFFSET", "TK_ON", "TK_OR", ++ "TK_ORACLE_OUTER_JOIN", "TK_ORDER", "TK_PLUS", "TK_PRAGMA", "TK_PRIMARY", ++ "TK_RAISE", "TK_REFERENCES", "TK_REM", "TK_REPLACE", "TK_RESTRICT", ++ "TK_ROLLBACK", "TK_ROW", "TK_RP", "TK_RSHIFT", "TK_SELECT", "TK_SEMI", ++ "TK_SET", "TK_SHORT", "TK_SLASH", "TK_SPACE", "TK_STAR", "TK_STATEMENT", ++ "TK_STRING", "TK_TABLE", "TK_TEMP", "TK_THEN", "TK_TRANSACTION", ++ "TK_TRIGGER", "TK_UMINUS", "TK_UNCLOSED_STRING", "TK_UNION", "TK_UNIQUE", ++ "TK_UPDATE", "TK_UPLUS", "TK_USING", "TK_VACUUM", "TK_VALUES", "TK_VIEW", ++ "TK_WHEN", "TK_WHERE", "TK_WILDCARD", "AGG_FUNCTION.", "COLUMN", ++ "FUNCTION", "COMMENT", "UNCLOSED_STRING", "SPACE", "ILLEGAL", ++ "END_OF_FILE", "$accept", "query", "onequery", "oneinsert", "onecreate", ++ "oneupdate", "onedelete", "table_def", "column_def", "column_and_type", ++ "column_type", "data_type_l", "data_type", "data_count", "oneselect", ++ "unorderedsel", "selectfrom", "selcollist", "from", "fromtable", "expr", ++ "val", "constlist", "update_assign_list", "column_assignment", ++ "const_val", "column_val", "column", "table", "id", "number", 0 ++}; ++#endif ++ ++# ifdef YYPRINT ++/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to ++ token YYLEX-NUM. */ ++static const unsigned short yytoknum[] = ++{ ++ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, ++ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, ++ 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, ++ 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, ++ 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, ++ 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, ++ 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, ++ 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, ++ 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, ++ 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, ++ 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, ++ 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, ++ 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, ++ 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, ++ 395, 396, 397, 398, 399, 400, 401 ++}; ++# endif ++ ++/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ ++static const unsigned char yyr1[] = ++{ ++ 0, 147, 148, 149, 149, 149, 149, 149, 150, 150, ++ 151, 151, 152, 153, 154, 155, 155, 156, 157, 157, ++ 158, 158, 159, 159, 159, 159, 159, 159, 159, 160, ++ 161, 161, 162, 162, 163, 164, 164, 164, 165, 165, ++ 166, 167, 167, 167, 167, 167, 167, 167, 167, 167, ++ 167, 167, 167, 168, 168, 169, 169, 170, 170, 171, ++ 172, 172, 172, 172, 173, 174, 174, 175, 176, 177 ++}; ++ ++/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ ++static const unsigned char yyr2[] = ++{ ++ 0, 2, 1, 1, 1, 1, 1, 1, 10, 11, ++ 6, 7, 6, 2, 4, 3, 1, 2, 1, 2, ++ 1, 3, 1, 4, 1, 1, 1, 1, 1, 1, ++ 4, 1, 2, 3, 2, 1, 3, 1, 1, 3, ++ 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, ++ 3, 3, 4, 1, 1, 1, 3, 1, 3, 3, ++ 1, 2, 1, 1, 1, 3, 1, 1, 1, 1 ++}; ++ ++/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state ++ STATE-NUM when YYTABLE doesn't specify something else to do. Zero ++ means the default is an error. */ ++static const unsigned char yydefact[] = ++{ ++ 0, 0, 0, 0, 0, 0, 0, 2, 5, 4, ++ 6, 7, 3, 31, 0, 0, 13, 38, 0, 0, ++ 68, 37, 32, 0, 35, 0, 66, 0, 67, 1, ++ 0, 0, 40, 0, 0, 33, 34, 0, 0, 0, ++ 0, 0, 0, 39, 0, 64, 0, 36, 65, 0, ++ 57, 0, 30, 0, 0, 16, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 10, 0, 0, 22, 26, 27, 24, 28, 25, ++ 17, 18, 20, 41, 43, 44, 69, 0, 62, 63, ++ 45, 54, 42, 60, 49, 53, 46, 0, 51, 48, ++ 47, 50, 0, 12, 58, 59, 11, 15, 0, 0, ++ 19, 0, 61, 52, 0, 14, 0, 29, 21, 0, ++ 23, 0, 55, 8, 0, 9, 56 ++}; ++ ++/* YYDEFGOTO[NTERM-NUM]. */ ++static const yysigned_char yydefgoto[] = ++{ ++ -1, 6, 7, 8, 9, 10, 11, 53, 54, 55, ++ 80, 81, 82, 116, 12, 13, 22, 23, 16, 17, ++ 43, 90, 121, 49, 50, 91, 44, 45, 25, 26, ++ 93 ++}; ++ ++/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing ++ STATE-NUM. */ ++#define YYPACT_NINF -111 ++static const yysigned_char yypact[] = ++{ ++ -28, -110, -38, -46, -32, -42, 29, -111, -111, -111, ++ -111, -111, -111, -67, -42, -42, -111, -99, -42, -48, ++ -111, -111, -111, -38, 17, 7, 11, -62, -111, -111, ++ 37, -22, -111, -43, -16, -111, -111, -48, -42, -42, ++ -48, -42, -43, -3, -29, -111, -48, -111, -111, -68, ++ 48, 28, -111, -36, -19, -111, -18, -5, -43, -43, ++ -58, -58, -58, -70, -58, -58, -58, -34, -43, -42, ++ -61, 20, -42, 5, 2, -111, -111, -111, -111, -111, ++ -111, 1, -2, -111, -3, -3, -111, 19, -111, -111, ++ -111, -111, -111, -111, -111, -111, -111, -1, -111, -111, ++ -111, -111, -41, -3, -111, -111, -111, -111, -48, 19, ++ -111, 3, -111, -111, 13, -111, -12, -111, -111, -61, ++ -111, -9, 91, -13, -61, -111, -111 ++}; ++ ++/* YYPGOTO[NTERM-NUM]. */ ++static const yysigned_char yypgoto[] = ++{ ++ -111, -111, -111, -111, -111, -111, -111, -111, -111, 47, ++ -111, -111, -111, -111, -111, -111, 101, -27, 98, -111, ++ -11, 52, 0, 53, -111, -53, 46, -4, 85, 40, ++ -66 ++}; ++ ++/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If ++ positive, shift that token. If negative, reduce the rule which ++ number is the opposite. If zero, do what YYDEFACT says. ++ If YYTABLE_NINF, syntax error. */ ++#define YYTABLE_NINF -68 ++static const yysigned_char yytable[] = ++{ ++ 24, 74, 58, 1, 58, 72, 19, 2, 20, 86, ++ 47, 14, 86, 52, 15, 24, 60, 105, 20, 67, ++ 97, 112, 98, 20, 20, 61, 18, 87, 62, 29, ++ 87, 57, 30, 24, 20, 51, 24, 56, 33, 3, ++ 42, 37, 24, 117, 63, 28, 38, 84, 85, 64, ++ -67, 75, 39, 40, 28, 28, 65, 103, 28, 88, ++ 66, 41, 88, 76, 77, 51, 122, 46, 56, 68, ++ 21, 122, 69, 70, 71, 78, 102, 89, 48, 106, ++ 89, 115, 108, 73, 4, 109, 21, 110, 111, 86, ++ 27, 113, 59, 114, 59, 118, 119, 79, 120, 31, ++ 32, 123, 5, 34, 24, 83, 92, 95, 95, 125, ++ 95, 95, 95, 94, 96, 124, 99, 100, 101, 107, ++ 35, 36, 104, 0, 126 ++}; ++ ++static const short yycheck[] = ++{ ++ 4, 19, 7, 31, 7, 24, 38, 35, 66, 70, ++ 37, 121, 70, 40, 52, 19, 45, 70, 66, 46, ++ 90, 87, 92, 66, 66, 54, 72, 88, 57, 0, ++ 88, 42, 99, 37, 66, 39, 40, 41, 137, 67, ++ 83, 24, 46, 109, 73, 5, 39, 58, 59, 78, ++ 39, 69, 114, 16, 14, 15, 85, 68, 18, 120, ++ 89, 83, 120, 81, 82, 69, 119, 83, 72, 137, ++ 118, 124, 24, 45, 110, 93, 110, 138, 38, 59, ++ 138, 108, 77, 102, 112, 83, 118, 86, 90, 70, ++ 5, 92, 97, 134, 97, 92, 83, 115, 110, 14, ++ 15, 110, 130, 18, 108, 110, 60, 61, 62, 122, ++ 64, 65, 66, 61, 62, 24, 64, 65, 66, 72, ++ 19, 23, 69, -1, 124 ++}; ++ ++/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing ++ symbol of state STATE-NUM. */ ++static const unsigned char yystos[] = ++{ ++ 0, 31, 35, 67, 112, 130, 148, 149, 150, 151, ++ 152, 153, 161, 162, 121, 52, 165, 166, 72, 38, ++ 66, 118, 163, 164, 174, 175, 176, 175, 176, 0, ++ 99, 175, 175, 137, 175, 163, 165, 24, 39, 114, ++ 16, 83, 83, 167, 173, 174, 83, 164, 176, 170, ++ 171, 174, 164, 154, 155, 156, 174, 167, 7, 97, ++ 45, 54, 57, 73, 78, 85, 89, 164, 137, 24, ++ 45, 110, 24, 102, 19, 69, 81, 82, 93, 115, ++ 157, 158, 159, 110, 167, 167, 70, 88, 120, 138, ++ 168, 172, 173, 177, 168, 173, 168, 90, 92, 168, ++ 168, 168, 110, 167, 170, 172, 59, 156, 77, 83, ++ 86, 90, 177, 92, 134, 164, 160, 177, 92, 83, ++ 110, 169, 172, 110, 24, 122, 169 ++}; ++ ++#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) ++# define YYSIZE_T __SIZE_TYPE__ ++#endif ++#if ! defined (YYSIZE_T) && defined (size_t) ++# define YYSIZE_T size_t ++#endif ++#if ! defined (YYSIZE_T) ++# if defined (__STDC__) || defined (__cplusplus) ++# include /* INFRINGES ON USER NAME SPACE */ ++# define YYSIZE_T size_t ++# endif ++#endif ++#if ! defined (YYSIZE_T) ++# define YYSIZE_T unsigned int ++#endif ++ ++#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 ++ ++ ++/* 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. */ ++ ++#define YYFAIL goto yyerrlab ++ ++#define YYRECOVERING() (!!yyerrstatus) ++ ++#define YYBACKUP(Token, Value) \ ++do \ ++ if (yychar == YYEMPTY && yylen == 1) \ ++ { \ ++ yychar = (Token); \ ++ yylval = (Value); \ ++ yytoken = YYTRANSLATE (yychar); \ ++ YYPOPSTACK; \ ++ goto yybackup; \ ++ } \ ++ else \ ++ { \ ++ yyerror ("syntax error: cannot back up");\ ++ YYERROR; \ ++ } \ ++while (0) ++ ++#define YYTERROR 1 ++#define YYERRCODE 256 ++ ++/* YYLLOC_DEFAULT -- Compute the default location (before the actions ++ are run). */ ++ ++#ifndef YYLLOC_DEFAULT ++# define YYLLOC_DEFAULT(Current, Rhs, N) \ ++ ((Current).first_line = (Rhs)[1].first_line, \ ++ (Current).first_column = (Rhs)[1].first_column, \ ++ (Current).last_line = (Rhs)[N].last_line, \ ++ (Current).last_column = (Rhs)[N].last_column) ++#endif ++ ++/* YYLEX -- calling `yylex' with the right arguments. */ ++ ++#ifdef YYLEX_PARAM ++# define YYLEX yylex (&yylval, YYLEX_PARAM) ++#else ++# define YYLEX yylex (&yylval) ++#endif ++ ++/* Enable debugging if requested. */ ++#if YYDEBUG ++ ++# ifndef YYFPRINTF ++# include /* INFRINGES ON USER NAME SPACE */ ++# define YYFPRINTF fprintf ++# endif ++ ++# define YYDPRINTF(Args) \ ++do { \ ++ if (yydebug) \ ++ YYFPRINTF Args; \ ++} while (0) ++ ++# define YYDSYMPRINT(Args) \ ++do { \ ++ if (yydebug) \ ++ yysymprint Args; \ ++} while (0) ++ ++# define YYDSYMPRINTF(Title, Token, Value, Location) \ ++do { \ ++ if (yydebug) \ ++ { \ ++ YYFPRINTF (stderr, "%s ", Title); \ ++ yysymprint (stderr, \ ++ Token, Value); \ ++ YYFPRINTF (stderr, "\n"); \ ++ } \ ++} while (0) ++ ++/*------------------------------------------------------------------. ++| yy_stack_print -- Print the state stack from its BOTTOM up to its | ++| TOP (included). | ++`------------------------------------------------------------------*/ ++ ++#if defined (__STDC__) || defined (__cplusplus) ++static void ++yy_stack_print (short *bottom, short *top) ++#else ++static void ++yy_stack_print (bottom, top) ++ short *bottom; ++ short *top; ++#endif ++{ ++ YYFPRINTF (stderr, "Stack now"); ++ for (/* Nothing. */; bottom <= top; ++bottom) ++ YYFPRINTF (stderr, " %d", *bottom); ++ YYFPRINTF (stderr, "\n"); ++} ++ ++# 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 (__cplusplus) ++static void ++yy_reduce_print (int yyrule) ++#else ++static void ++yy_reduce_print (yyrule) ++ int yyrule; ++#endif ++{ ++ int yyi; ++ unsigned int yylno = yyrline[yyrule]; ++ YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", ++ yyrule - 1, yylno); ++ /* Print the symbols being reduced, and their result. */ ++ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) ++ YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); ++ YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); ++} ++ ++# define YY_REDUCE_PRINT(Rule) \ ++do { \ ++ if (yydebug) \ ++ yy_reduce_print (Rule); \ ++} while (0) ++ ++/* Nonzero means print parse trace. It is left uninitialized so that ++ multiple parsers can coexist. */ ++int yydebug; ++#else /* !YYDEBUG */ ++# define YYDPRINTF(Args) ++# define YYDSYMPRINT(Args) ++# define YYDSYMPRINTF(Title, Token, Value, Location) ++# define YY_STACK_PRINT(Bottom, Top) ++# define YY_REDUCE_PRINT(Rule) ++#endif /* !YYDEBUG */ ++ ++ ++/* YYINITDEPTH -- initial size of the parser's stacks. */ ++#ifndef YYINITDEPTH ++# define YYINITDEPTH 200 ++#endif ++ ++/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only ++ if the built-in stack extension method is used). ++ ++ Do not make this value too large; the results are undefined if ++ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) ++ evaluated with infinite-precision integer arithmetic. */ ++ ++#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 ++# undef YYMAXDEPTH ++#endif ++ ++#ifndef YYMAXDEPTH ++# define YYMAXDEPTH 10000 ++#endif ++ ++ ++ ++#if YYERROR_VERBOSE ++ ++# ifndef yystrlen ++# if defined (__GLIBC__) && defined (_STRING_H) ++# define yystrlen strlen ++# else ++/* Return the length of YYSTR. */ ++static YYSIZE_T ++# if defined (__STDC__) || defined (__cplusplus) ++yystrlen (const char *yystr) ++# else ++yystrlen (yystr) ++ const char *yystr; ++# endif ++{ ++ register const char *yys = yystr; ++ ++ while (*yys++ != '\0') ++ continue; ++ ++ return yys - yystr - 1; ++} ++# endif ++# endif ++ ++# ifndef yystpcpy ++# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) ++# define yystpcpy stpcpy ++# else ++/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in ++ YYDEST. */ ++static char * ++# if defined (__STDC__) || defined (__cplusplus) ++yystpcpy (char *yydest, const char *yysrc) ++# else ++yystpcpy (yydest, yysrc) ++ char *yydest; ++ const char *yysrc; ++# endif ++{ ++ register char *yyd = yydest; ++ register const char *yys = yysrc; ++ ++ while ((*yyd++ = *yys++) != '\0') ++ continue; ++ ++ return yyd - 1; ++} ++# endif ++# endif ++ ++#endif /* !YYERROR_VERBOSE */ ++ ++ ++ ++#if YYDEBUG ++/*--------------------------------. ++| Print this symbol on YYOUTPUT. | ++`--------------------------------*/ ++ ++#if defined (__STDC__) || defined (__cplusplus) ++static void ++yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) ++#else ++static void ++yysymprint (yyoutput, yytype, yyvaluep) ++ FILE *yyoutput; ++ int yytype; ++ YYSTYPE *yyvaluep; ++#endif ++{ ++ /* Pacify ``unused variable'' warnings. */ ++ (void) yyvaluep; ++ ++ if (yytype < YYNTOKENS) ++ { ++ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); ++# ifdef YYPRINT ++ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); ++# endif ++ } ++ else ++ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); ++ ++ switch (yytype) ++ { ++ default: ++ break; ++ } ++ YYFPRINTF (yyoutput, ")"); ++} ++ ++#endif /* ! YYDEBUG */ ++/*-----------------------------------------------. ++| Release the memory associated to this symbol. | ++`-----------------------------------------------*/ ++ ++#if defined (__STDC__) || defined (__cplusplus) ++static void ++yydestruct (int yytype, YYSTYPE *yyvaluep) ++#else ++static void ++yydestruct (yytype, yyvaluep) ++ int yytype; ++ YYSTYPE *yyvaluep; ++#endif ++{ ++ /* Pacify ``unused variable'' warnings. */ ++ (void) yyvaluep; ++ ++ switch (yytype) ++ { ++ ++ default: ++ break; ++ } ++} ++ ++ ++/* 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 (void); ++#else ++int yyparse (); ++#endif ++#endif /* ! YYPARSE_PARAM */ ++ ++ ++ ++ ++ ++ ++/*----------. ++| yyparse. | ++`----------*/ ++ ++#ifdef YYPARSE_PARAM ++# if defined (__STDC__) || defined (__cplusplus) ++int yyparse (void *YYPARSE_PARAM) ++# else ++int yyparse (YYPARSE_PARAM) ++ void *YYPARSE_PARAM; ++# endif ++#else /* ! YYPARSE_PARAM */ ++#if defined (__STDC__) || defined (__cplusplus) ++int ++yyparse (void) ++#else ++int ++yyparse () ++ ++#endif ++#endif ++{ ++ /* The lookahead symbol. */ ++int yychar; ++ ++/* The semantic value of the lookahead symbol. */ ++YYSTYPE yylval; ++ ++/* Number of syntax errors so far. */ ++int yynerrs; ++ ++ register int yystate; ++ register int yyn; ++ int yyresult; ++ /* Number of tokens to shift before error messages enabled. */ ++ int yyerrstatus; ++ /* Lookahead token as an internal (translated) token number. */ ++ int yytoken = 0; ++ ++ /* Three stacks and their tools: ++ `yyss': related to states, ++ `yyvs': related to semantic values, ++ `yyls': related to locations. ++ ++ Refer to the stacks thru separate pointers, to allow yyoverflow ++ to reallocate them elsewhere. */ ++ ++ /* The state stack. */ ++ short yyssa[YYINITDEPTH]; ++ short *yyss = yyssa; ++ register short *yyssp; ++ ++ /* The semantic value stack. */ ++ YYSTYPE yyvsa[YYINITDEPTH]; ++ YYSTYPE *yyvs = yyvsa; ++ register YYSTYPE *yyvsp; ++ ++ ++ ++#define YYPOPSTACK (yyvsp--, yyssp--) ++ ++ YYSIZE_T yystacksize = YYINITDEPTH; ++ ++ /* The variables used to return semantic value and location from the ++ action routines. */ ++ YYSTYPE yyval; ++ ++ ++ /* When reducing, the number of symbols on the RHS of the reduced ++ rule. */ ++ int yylen; ++ ++ YYDPRINTF ((stderr, "Starting parse\n")); ++ ++ yystate = 0; ++ 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; ++ ++/*------------------------------------------------------------. ++| yynewstate -- Push a new state, which is found in yystate. | ++`------------------------------------------------------------*/ ++ yynewstate: ++ /* In all cases, when you get here, the value and location stacks ++ have just been pushed. so pushing a state here evens the stacks. ++ */ ++ yyssp++; ++ ++ yysetstate: ++ *yyssp = yystate; ++ ++ if (yyss + yystacksize - 1 <= yyssp) ++ { ++ /* Get the current used size of the three stacks, in elements. */ ++ YYSIZE_T yysize = yyssp - yyss + 1; ++ ++#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; ++ short *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 ("parser stack overflow", ++ &yyss1, yysize * sizeof (*yyssp), ++ &yyvs1, yysize * sizeof (*yyvsp), ++ ++ &yystacksize); ++ ++ yyss = yyss1; ++ yyvs = yyvs1; ++ } ++#else /* no yyoverflow */ ++# ifndef YYSTACK_RELOCATE ++ goto yyoverflowlab; ++# else ++ /* Extend the stack our own way. */ ++ if (YYMAXDEPTH <= yystacksize) ++ goto yyoverflowlab; ++ yystacksize *= 2; ++ if (YYMAXDEPTH < yystacksize) ++ yystacksize = YYMAXDEPTH; ++ ++ { ++ short *yyss1 = yyss; ++ union yyalloc *yyptr = ++ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); ++ if (! yyptr) ++ goto yyoverflowlab; ++ YYSTACK_RELOCATE (yyss); ++ YYSTACK_RELOCATE (yyvs); ++ ++# undef YYSTACK_RELOCATE ++ if (yyss1 != yyssa) ++ YYSTACK_FREE (yyss1); ++ } ++# endif ++#endif /* no yyoverflow */ ++ ++ yyssp = yyss + yysize - 1; ++ yyvsp = yyvs + yysize - 1; ++ ++ ++ YYDPRINTF ((stderr, "Stack size increased to %lu\n", ++ (unsigned long int) yystacksize)); ++ ++ if (yyss + yystacksize - 1 <= yyssp) ++ YYABORT; ++ } ++ ++ YYDPRINTF ((stderr, "Entering state %d\n", yystate)); ++ ++ goto yybackup; ++ ++/*-----------. ++| yybackup. | ++`-----------*/ ++yybackup: ++ ++/* Do appropriate processing given the current state. */ ++/* Read a lookahead token if we need one and don't already have one. */ ++/* yyresume: */ ++ ++ /* First try to decide what to do without reference to lookahead token. */ ++ ++ yyn = yypact[yystate]; ++ if (yyn == YYPACT_NINF) ++ goto yydefault; ++ ++ /* Not known => get a lookahead token if don't already have one. */ ++ ++ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ ++ if (yychar == YYEMPTY) ++ { ++ YYDPRINTF ((stderr, "Reading a token: ")); ++ yychar = YYLEX; ++ } ++ ++ if (yychar <= YYEOF) ++ { ++ yychar = yytoken = YYEOF; ++ YYDPRINTF ((stderr, "Now at end of input.\n")); ++ } ++ else ++ { ++ yytoken = YYTRANSLATE (yychar); ++ YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); ++ } ++ ++ /* If the proper action on seeing token YYTOKEN is to reduce or to ++ detect an error, take that action. */ ++ yyn += yytoken; ++ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) ++ goto yydefault; ++ yyn = yytable[yyn]; ++ if (yyn <= 0) ++ { ++ if (yyn == 0 || yyn == YYTABLE_NINF) ++ goto yyerrlab; ++ yyn = -yyn; ++ goto yyreduce; ++ } ++ ++ if (yyn == YYFINAL) ++ YYACCEPT; ++ ++ /* Shift the lookahead token. */ ++ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); ++ ++ /* Discard the token being shifted unless it is eof. */ ++ if (yychar != YYEOF) ++ yychar = YYEMPTY; ++ ++ *++yyvsp = yylval; ++ ++ ++ /* Count tokens shifted since error; after three, turn off error ++ status. */ ++ if (yyerrstatus) ++ yyerrstatus--; ++ ++ yystate = yyn; ++ goto yynewstate; ++ ++ ++/*-----------------------------------------------------------. ++| yydefault -- do the default action for the current state. | ++`-----------------------------------------------------------*/ ++yydefault: ++ yyn = yydefact[yystate]; ++ if (yyn == 0) ++ goto yyerrlab; ++ goto yyreduce; ++ ++ ++/*-----------------------------. ++| yyreduce -- Do a reduction. | ++`-----------------------------*/ ++yyreduce: ++ /* yyn is the number of a rule to reduce with. */ ++ yylen = yyr2[yyn]; ++ ++ /* If YYLEN is nonzero, implement the default value of the action: ++ `$$ = $1'. ++ ++ Otherwise, the following line sets YYVAL to garbage. ++ This behavior is undocumented and Bison ++ users should not rely upon it. Assigning to YYVAL ++ unconditionally makes the parser a bit smaller, and it avoids a ++ GCC warning that YYVAL may be used uninitialized. */ ++ yyval = yyvsp[1-yylen]; ++ ++ ++ YY_REDUCE_PRINT (yyn); ++ switch (yyn) ++ { ++ case 2: ++#line 139 "./sql.y" ++ { ++ SQL_input* sql = (SQL_input*) info; ++ *sql->view = yyvsp[0].query; ++ ;} ++ break; ++ ++ case 8: ++#line 155 "./sql.y" ++ { ++ SQL_input *sql = (SQL_input*) info; ++ MSIVIEW *insert = NULL; ++ UINT r; ++ ++ r = INSERT_CreateView( sql->db, &insert, yyvsp[-7].string, yyvsp[-5].column_list, yyvsp[-1].column_list, FALSE ); ++ if( !insert ) ++ YYABORT; ++ yyval.query = insert; ++ ;} ++ break; ++ ++ case 9: ++#line 166 "./sql.y" ++ { ++ SQL_input *sql = (SQL_input*) info; ++ MSIVIEW *insert = NULL; ++ ++ INSERT_CreateView( sql->db, &insert, yyvsp[-8].string, yyvsp[-6].column_list, yyvsp[-2].column_list, TRUE ); ++ if( !insert ) ++ YYABORT; ++ yyval.query = insert; ++ ;} ++ break; ++ ++ case 10: ++#line 179 "./sql.y" ++ { ++ SQL_input* sql = (SQL_input*) info; ++ MSIVIEW *create = NULL; ++ ++ if( !yyvsp[-1].column_list ) ++ YYABORT; ++ CREATE_CreateView( sql->db, &create, yyvsp[-3].string, yyvsp[-1].column_list, FALSE ); ++ if( !create ) ++ YYABORT; ++ yyval.query = create; ++ ;} ++ break; ++ ++ case 11: ++#line 191 "./sql.y" ++ { ++ SQL_input* sql = (SQL_input*) info; ++ MSIVIEW *create = NULL; ++ ++ if( !yyvsp[-2].column_list ) ++ YYABORT; ++ CREATE_CreateView( sql->db, &create, yyvsp[-4].string, yyvsp[-2].column_list, TRUE ); ++ if( !create ) ++ YYABORT; ++ yyval.query = create; ++ ;} ++ break; ++ ++ case 12: ++#line 206 "./sql.y" ++ { ++ SQL_input* sql = (SQL_input*) info; ++ MSIVIEW *update = NULL; ++ ++ UPDATE_CreateView( sql->db, &update, yyvsp[-4].string, yyvsp[-2].column_list, yyvsp[0].expr ); ++ if( !update ) ++ YYABORT; ++ yyval.query = update; ++ ;} ++ break; ++ ++ case 13: ++#line 219 "./sql.y" ++ { ++ SQL_input* sql = (SQL_input*) info; ++ MSIVIEW *delete = NULL; ++ ++ DELETE_CreateView( sql->db, &delete, yyvsp[0].query ); ++ if( !delete ) ++ YYABORT; ++ yyval.query = delete; ++ ;} ++ break; ++ ++ case 14: ++#line 232 "./sql.y" ++ { ++ if( SQL_MarkPrimaryKeys( yyvsp[-3].column_list, yyvsp[0].column_list ) ) ++ yyval.column_list = yyvsp[-3].column_list; ++ else ++ yyval.column_list = NULL; ++ ;} ++ break; ++ ++ case 15: ++#line 242 "./sql.y" ++ { ++ column_info *ci; ++ ++ for( ci = yyvsp[-2].column_list; ci->next; ci = ci->next ) ++ ; ++ ++ ci->next = yyvsp[0].column_list; ++ yyval.column_list = yyvsp[-2].column_list; ++ ;} ++ break; ++ ++ case 16: ++#line 252 "./sql.y" ++ { ++ yyval.column_list = yyvsp[0].column_list; ++ ;} ++ break; ++ ++ case 17: ++#line 259 "./sql.y" ++ { ++ yyval.column_list = yyvsp[-1].column_list; ++ yyval.column_list->type = yyvsp[0].column_type | MSITYPE_VALID; ++ ;} ++ break; ++ ++ case 18: ++#line 267 "./sql.y" ++ { ++ yyval.column_type = yyvsp[0].column_type; ++ ;} ++ break; ++ ++ case 19: ++#line 271 "./sql.y" ++ { ++ yyval.column_type = yyvsp[-1].column_type | MSITYPE_LOCALIZABLE; ++ ;} ++ break; ++ ++ case 20: ++#line 278 "./sql.y" ++ { ++ yyval.column_type |= MSITYPE_NULLABLE; ++ ;} ++ break; ++ ++ case 21: ++#line 282 "./sql.y" ++ { ++ yyval.column_type = yyvsp[-2].column_type; ++ ;} ++ break; ++ ++ case 22: ++#line 289 "./sql.y" ++ { ++ yyval.column_type = MSITYPE_STRING | 1; ++ ;} ++ break; ++ ++ case 23: ++#line 293 "./sql.y" ++ { ++ yyval.column_type = MSITYPE_STRING | 0x400 | yyvsp[-1].column_type; ++ ;} ++ break; ++ ++ case 24: ++#line 297 "./sql.y" ++ { ++ yyval.column_type = 2; ++ ;} ++ break; ++ ++ case 25: ++#line 301 "./sql.y" ++ { ++ yyval.column_type = 2; ++ ;} ++ break; ++ ++ case 26: ++#line 305 "./sql.y" ++ { ++ yyval.column_type = 2; ++ ;} ++ break; ++ ++ case 27: ++#line 309 "./sql.y" ++ { ++ yyval.column_type = 4; ++ ;} ++ break; ++ ++ case 28: ++#line 313 "./sql.y" ++ { ++ yyval.column_type = MSITYPE_STRING | MSITYPE_VALID; ++ ;} ++ break; ++ ++ case 29: ++#line 320 "./sql.y" ++ { ++ if( ( yyvsp[0].integer > 255 ) || ( yyvsp[0].integer < 0 ) ) ++ YYABORT; ++ yyval.column_type = yyvsp[0].integer; ++ ;} ++ break; ++ ++ case 30: ++#line 329 "./sql.y" ++ { ++ SQL_input* sql = (SQL_input*) info; ++ ++ yyval.query = NULL; ++ if( yyvsp[0].column_list ) ++ ORDER_CreateView( sql->db, &yyval.query, yyvsp[-3].query, yyvsp[0].column_list ); ++ else ++ yyval.query = yyvsp[-3].query; ++ if( !yyval.query ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 32: ++#line 345 "./sql.y" ++ { ++ yyval.query = yyvsp[0].query; ++ ;} ++ break; ++ ++ case 33: ++#line 349 "./sql.y" ++ { ++ SQL_input* sql = (SQL_input*) info; ++ UINT r; ++ ++ yyval.query = NULL; ++ r = DISTINCT_CreateView( sql->db, &yyval.query, yyvsp[0].query ); ++ if (r != ERROR_SUCCESS) ++ { ++ yyvsp[0].query->ops->delete(yyvsp[0].query); ++ YYABORT; ++ } ++ ;} ++ break; ++ ++ case 34: ++#line 365 "./sql.y" ++ { ++ SQL_input* sql = (SQL_input*) info; ++ UINT r; ++ ++ yyval.query = NULL; ++ if( yyvsp[-1].column_list ) ++ { ++ r = SELECT_CreateView( sql->db, &yyval.query, yyvsp[0].query, yyvsp[-1].column_list ); ++ if (r != ERROR_SUCCESS) ++ { ++ yyvsp[0].query->ops->delete(yyvsp[0].query); ++ YYABORT; ++ } ++ } ++ else ++ yyval.query = yyvsp[0].query; ++ ;} ++ break; ++ ++ case 36: ++#line 387 "./sql.y" ++ { ++ yyvsp[-2].column_list->next = yyvsp[0].column_list; ++ ;} ++ break; ++ ++ case 37: ++#line 391 "./sql.y" ++ { ++ yyval.column_list = NULL; ++ ;} ++ break; ++ ++ case 39: ++#line 399 "./sql.y" ++ { ++ SQL_input* sql = (SQL_input*) info; ++ UINT r; ++ ++ yyval.query = NULL; ++ r = WHERE_CreateView( sql->db, &yyval.query, yyvsp[-2].query, yyvsp[0].expr ); ++ if( r != ERROR_SUCCESS ) ++ { ++ yyvsp[-2].query->ops->delete( yyvsp[-2].query ); ++ YYABORT; ++ } ++ ;} ++ break; ++ ++ case 40: ++#line 415 "./sql.y" ++ { ++ SQL_input* sql = (SQL_input*) info; ++ UINT r; ++ ++ yyval.query = NULL; ++ r = TABLE_CreateView( sql->db, yyvsp[0].string, &yyval.query ); ++ if( r != ERROR_SUCCESS || !yyval.query ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 41: ++#line 428 "./sql.y" ++ { ++ yyval.expr = yyvsp[-1].expr; ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 42: ++#line 434 "./sql.y" ++ { ++ yyval.expr = EXPR_complex( info, yyvsp[-2].expr, OP_EQ, yyvsp[0].expr ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 43: ++#line 440 "./sql.y" ++ { ++ yyval.expr = EXPR_complex( info, yyvsp[-2].expr, OP_AND, yyvsp[0].expr ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 44: ++#line 446 "./sql.y" ++ { ++ yyval.expr = EXPR_complex( info, yyvsp[-2].expr, OP_OR, yyvsp[0].expr ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 45: ++#line 452 "./sql.y" ++ { ++ yyval.expr = EXPR_complex( info, yyvsp[-2].expr, OP_EQ, yyvsp[0].expr ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 46: ++#line 458 "./sql.y" ++ { ++ yyval.expr = EXPR_complex( info, yyvsp[-2].expr, OP_GT, yyvsp[0].expr ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 47: ++#line 464 "./sql.y" ++ { ++ yyval.expr = EXPR_complex( info, yyvsp[-2].expr, OP_LT, yyvsp[0].expr ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 48: ++#line 470 "./sql.y" ++ { ++ yyval.expr = EXPR_complex( info, yyvsp[-2].expr, OP_LE, yyvsp[0].expr ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 49: ++#line 476 "./sql.y" ++ { ++ yyval.expr = EXPR_complex( info, yyvsp[-2].expr, OP_GE, yyvsp[0].expr ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 50: ++#line 482 "./sql.y" ++ { ++ yyval.expr = EXPR_complex( info, yyvsp[-2].expr, OP_NE, yyvsp[0].expr ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 51: ++#line 488 "./sql.y" ++ { ++ yyval.expr = EXPR_complex( info, yyvsp[-2].expr, OP_ISNULL, NULL ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 52: ++#line 494 "./sql.y" ++ { ++ yyval.expr = EXPR_complex( info, yyvsp[-3].expr, OP_NOTNULL, NULL ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 55: ++#line 508 "./sql.y" ++ { ++ yyval.column_list = parser_alloc_column( info, NULL, NULL ); ++ if( !yyval.column_list ) ++ YYABORT; ++ yyval.column_list->val = yyvsp[0].expr; ++ ;} ++ break; ++ ++ case 56: ++#line 515 "./sql.y" ++ { ++ yyval.column_list = parser_alloc_column( info, NULL, NULL ); ++ if( !yyval.column_list ) ++ YYABORT; ++ yyval.column_list->val = yyvsp[-2].expr; ++ yyval.column_list->next = yyvsp[0].column_list; ++ ;} ++ break; ++ ++ case 58: ++#line 527 "./sql.y" ++ { ++ yyval.column_list = yyvsp[-2].column_list; ++ yyval.column_list->next = yyvsp[0].column_list; ++ ;} ++ break; ++ ++ case 59: ++#line 535 "./sql.y" ++ { ++ yyval.column_list = yyvsp[-2].column_list; ++ yyval.column_list->val = yyvsp[0].expr; ++ ;} ++ break; ++ ++ case 60: ++#line 543 "./sql.y" ++ { ++ yyval.expr = EXPR_ival( info, yyvsp[0].integer ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 61: ++#line 549 "./sql.y" ++ { ++ yyval.expr = EXPR_ival( info, -yyvsp[0].integer ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 62: ++#line 555 "./sql.y" ++ { ++ yyval.expr = EXPR_sval( info, &yyvsp[0].str ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 63: ++#line 561 "./sql.y" ++ { ++ yyval.expr = EXPR_wildcard( info ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 64: ++#line 570 "./sql.y" ++ { ++ yyval.expr = EXPR_column( info, yyvsp[0].column_list ); ++ if( !yyval.expr ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 65: ++#line 579 "./sql.y" ++ { ++ yyval.column_list = parser_alloc_column( info, yyvsp[-2].string, yyvsp[0].string ); ++ if( !yyval.column_list ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 66: ++#line 585 "./sql.y" ++ { ++ yyval.column_list = parser_alloc_column( info, NULL, yyvsp[0].string ); ++ if( !yyval.column_list ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 67: ++#line 594 "./sql.y" ++ { ++ yyval.string = yyvsp[0].string; ++ ;} ++ break; ++ ++ case 68: ++#line 601 "./sql.y" ++ { ++ yyval.string = SQL_getstring( info, &yyvsp[0].str ); ++ if( !yyval.string ) ++ YYABORT; ++ ;} ++ break; ++ ++ case 69: ++#line 610 "./sql.y" ++ { ++ yyval.integer = SQL_getint( info ); ++ ;} ++ break; ++ ++ ++ } ++ ++/* Line 1000 of yacc.c. */ ++#line 2054 "sql.tab.c" ++ ++ yyvsp -= yylen; ++ yyssp -= yylen; ++ ++ ++ YY_STACK_PRINT (yyss, yyssp); ++ ++ *++yyvsp = yyval; ++ ++ ++ /* 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. */ ++ ++ yyn = yyr1[yyn]; ++ ++ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; ++ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) ++ yystate = yytable[yystate]; ++ else ++ yystate = yydefgoto[yyn - YYNTOKENS]; ++ ++ goto yynewstate; ++ ++ ++/*------------------------------------. ++| yyerrlab -- here on detecting error | ++`------------------------------------*/ ++yyerrlab: ++ /* If not already recovering from an error, report this error. */ ++ if (!yyerrstatus) ++ { ++ ++yynerrs; ++#if YYERROR_VERBOSE ++ yyn = yypact[yystate]; ++ ++ if (YYPACT_NINF < yyn && yyn < YYLAST) ++ { ++ YYSIZE_T yysize = 0; ++ int yytype = YYTRANSLATE (yychar); ++ const char* yyprefix; ++ char *yymsg; ++ int yyx; ++ ++ /* Start YYX at -YYN if negative to avoid negative indexes in ++ YYCHECK. */ ++ int yyxbegin = yyn < 0 ? -yyn : 0; ++ ++ /* Stay within bounds of both yycheck and yytname. */ ++ int yychecklim = YYLAST - yyn; ++ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; ++ int yycount = 0; ++ ++ yyprefix = ", expecting "; ++ for (yyx = yyxbegin; yyx < yyxend; ++yyx) ++ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) ++ { ++ yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); ++ yycount += 1; ++ if (yycount == 5) ++ { ++ yysize = 0; ++ break; ++ } ++ } ++ yysize += (sizeof ("syntax error, unexpected ") ++ + yystrlen (yytname[yytype])); ++ yymsg = (char *) YYSTACK_ALLOC (yysize); ++ if (yymsg != 0) ++ { ++ char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); ++ yyp = yystpcpy (yyp, yytname[yytype]); ++ ++ if (yycount < 5) ++ { ++ yyprefix = ", expecting "; ++ for (yyx = yyxbegin; yyx < yyxend; ++yyx) ++ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) ++ { ++ yyp = yystpcpy (yyp, yyprefix); ++ yyp = yystpcpy (yyp, yytname[yyx]); ++ yyprefix = " or "; ++ } ++ } ++ yyerror (yymsg); ++ YYSTACK_FREE (yymsg); ++ } ++ else ++ yyerror ("syntax error; also virtual memory exhausted"); ++ } ++ else ++#endif /* YYERROR_VERBOSE */ ++ yyerror ("syntax error"); ++ } ++ ++ ++ ++ if (yyerrstatus == 3) ++ { ++ /* If just tried and failed to reuse lookahead token after an ++ error, discard it. */ ++ ++ if (yychar <= YYEOF) ++ { ++ /* If at end of input, pop the error token, ++ then the rest of the stack, then return failure. */ ++ if (yychar == YYEOF) ++ for (;;) ++ { ++ YYPOPSTACK; ++ if (yyssp == yyss) ++ YYABORT; ++ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); ++ yydestruct (yystos[*yyssp], yyvsp); ++ } ++ } ++ else ++ { ++ YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); ++ yydestruct (yytoken, &yylval); ++ yychar = YYEMPTY; ++ ++ } ++ } ++ ++ /* Else will try to reuse lookahead token after shifting the error ++ token. */ ++ goto yyerrlab1; ++ ++ ++/*---------------------------------------------------. ++| yyerrorlab -- error raised explicitly by YYERROR. | ++`---------------------------------------------------*/ ++yyerrorlab: ++ ++#ifdef __GNUC__ ++ /* Pacify GCC when the user code never invokes YYERROR and the label ++ yyerrorlab therefore never appears in user code. */ ++ if (0) ++ goto yyerrorlab; ++#endif ++ ++ yyvsp -= yylen; ++ yyssp -= yylen; ++ yystate = *yyssp; ++ goto yyerrlab1; ++ ++ ++/*-------------------------------------------------------------. ++| yyerrlab1 -- common code for both syntax error and YYERROR. | ++`-------------------------------------------------------------*/ ++yyerrlab1: ++ yyerrstatus = 3; /* Each real token shifted decrements this. */ ++ ++ for (;;) ++ { ++ yyn = yypact[yystate]; ++ if (yyn != YYPACT_NINF) ++ { ++ 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; ++ ++ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); ++ yydestruct (yystos[yystate], yyvsp); ++ YYPOPSTACK; ++ yystate = *yyssp; ++ YY_STACK_PRINT (yyss, yyssp); ++ } ++ ++ if (yyn == YYFINAL) ++ YYACCEPT; ++ ++ YYDPRINTF ((stderr, "Shifting error token, ")); ++ ++ *++yyvsp = yylval; ++ ++ ++ yystate = yyn; ++ goto yynewstate; ++ ++ ++/*-------------------------------------. ++| yyacceptlab -- YYACCEPT comes here. | ++`-------------------------------------*/ ++yyacceptlab: ++ yyresult = 0; ++ goto yyreturn; ++ ++/*-----------------------------------. ++| yyabortlab -- YYABORT comes here. | ++`-----------------------------------*/ ++yyabortlab: ++ yyresult = 1; ++ goto yyreturn; ++ ++#ifndef yyoverflow ++/*----------------------------------------------. ++| yyoverflowlab -- parser overflow comes here. | ++`----------------------------------------------*/ ++yyoverflowlab: ++ yyerror ("parser stack overflow"); ++ yyresult = 2; ++ /* Fall through. */ ++#endif ++ ++yyreturn: ++#ifndef yyoverflow ++ if (yyss != yyssa) ++ YYSTACK_FREE (yyss); ++#endif ++ return yyresult; ++} ++ ++ ++#line 615 "./sql.y" ++ ++ ++static void *parser_alloc( void *info, unsigned int sz ) ++{ ++ SQL_input* sql = (SQL_input*) info; ++ struct list *mem; ++ ++ mem = msi_alloc( sizeof (struct list) + sz ); ++ list_add_tail( sql->mem, mem ); ++ return &mem[1]; ++} ++ ++static column_info *parser_alloc_column( void *info, LPCWSTR table, LPCWSTR column ) ++{ ++ column_info *col; ++ ++ col = parser_alloc( info, sizeof (*col) ); ++ if( col ) ++ { ++ col->table = table; ++ col->column = column; ++ col->val = NULL; ++ col->type = 0; ++ col->next = NULL; ++ } ++ ++ return col; ++} ++ ++int SQL_lex( void *SQL_lval, SQL_input *sql ) ++{ ++ int token; ++ struct sql_str * str = SQL_lval; ++ ++ do ++ { ++ sql->n += sql->len; ++ if( ! sql->command[sql->n] ) ++ return 0; /* end of input */ ++ ++ /* TRACE("string : %s\n", debugstr_w(&sql->command[sql->n])); */ ++ sql->len = sqliteGetToken( &sql->command[sql->n], &token ); ++ if( sql->len==0 ) ++ break; ++ str->data = &sql->command[sql->n]; ++ str->len = sql->len; ++ } ++ while( token == TK_SPACE ); ++ ++ /* TRACE("token : %d (%s)\n", token, debugstr_wn(&sql->command[sql->n], sql->len)); */ ++ ++ return token; ++} ++ ++LPWSTR SQL_getstring( void *info, struct sql_str *strdata ) ++{ ++ LPCWSTR p = strdata->data; ++ UINT len = strdata->len; ++ LPWSTR str; ++ ++ /* if there's quotes, remove them */ ++ if( ( (p[0]=='`') && (p[len-1]=='`') ) || ++ ( (p[0]=='\'') && (p[len-1]=='\'') ) ) ++ { ++ p++; ++ len -= 2; ++ } ++ str = parser_alloc( info, (len + 1)*sizeof(WCHAR) ); ++ if( !str ) ++ return str; ++ memcpy( str, p, len*sizeof(WCHAR) ); ++ str[len]=0; ++ ++ return str; ++} ++ ++INT SQL_getint( void *info ) ++{ ++ SQL_input* sql = (SQL_input*) info; ++ LPCWSTR p = &sql->command[sql->n]; ++ INT i, r = 0; ++ ++ for( i=0; ilen; i++ ) ++ { ++ if( '0' > p[i] || '9' < p[i] ) ++ { ++ ERR("should only be numbers here!\n"); ++ break; ++ } ++ r = (p[i]-'0') + r*10; ++ } ++ ++ return r; ++} ++ ++int SQL_error( const char *str ) ++{ ++ return 0; ++} ++ ++static struct expr * EXPR_wildcard( void *info ) ++{ ++ struct expr *e = parser_alloc( info, sizeof *e ); ++ if( e ) ++ { ++ e->type = EXPR_WILDCARD; ++ } ++ return e; ++} ++ ++static struct expr * EXPR_complex( void *info, struct expr *l, UINT op, struct expr *r ) ++{ ++ struct expr *e = parser_alloc( info, sizeof *e ); ++ if( e ) ++ { ++ e->type = EXPR_COMPLEX; ++ e->u.expr.left = l; ++ e->u.expr.op = op; ++ e->u.expr.right = r; ++ } ++ return e; ++} ++ ++static struct expr * EXPR_column( void *info, column_info *column ) ++{ ++ struct expr *e = parser_alloc( info, sizeof *e ); ++ if( e ) ++ { ++ e->type = EXPR_COLUMN; ++ e->u.sval = column->column; ++ } ++ return e; ++} ++ ++static struct expr * EXPR_ival( void *info, int val ) ++{ ++ struct expr *e = parser_alloc( info, sizeof *e ); ++ if( e ) ++ { ++ e->type = EXPR_IVAL; ++ e->u.ival = val; ++ } ++ return e; ++} ++ ++static struct expr * EXPR_sval( void *info, struct sql_str *str ) ++{ ++ struct expr *e = parser_alloc( info, sizeof *e ); ++ if( e ) ++ { ++ e->type = EXPR_SVAL; ++ e->u.sval = SQL_getstring( info, str ); ++ } ++ return e; ++} ++ ++static BOOL SQL_MarkPrimaryKeys( column_info *cols, ++ column_info *keys ) ++{ ++ column_info *k; ++ BOOL found = TRUE; ++ ++ for( k = keys; k && found; k = k->next ) ++ { ++ column_info *c; ++ ++ found = FALSE; ++ for( c = cols; c && !found; c = c->next ) ++ { ++ if( lstrcmpW( k->column, c->column ) ) ++ continue; ++ c->type |= MSITYPE_KEY; ++ found = TRUE; ++ } ++ } ++ ++ return found; ++} ++ ++UINT MSI_ParseSQL( MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview, ++ struct list *mem ) ++{ ++ SQL_input sql; ++ int r; ++ ++ *phview = NULL; ++ ++ sql.db = db; ++ sql.command = command; ++ sql.n = 0; ++ sql.len = 0; ++ sql.view = phview; ++ sql.mem = mem; ++ ++ r = SQL_parse(&sql); ++ ++ TRACE("Parse returned %d\n", r); ++ if( r ) ++ { ++ *sql.view = NULL; ++ return ERROR_BAD_QUERY_SYNTAX; ++ } ++ ++ return ERROR_SUCCESS; ++} ++ +Index: sql.tab.h +=================================================================== +--- sql.tab.h (revision 23782) ++++ sql.tab.h (working copy) +@@ -0,0 +1,345 @@ ++/* A Bison parser, made by GNU Bison 1.875c. */ ++ ++/* Skeleton parser for Yacc-like parsing with Bison, ++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, ++ Boston, MA 02111-1307, USA. */ ++ ++/* As a special exception, when this file is copied by Bison into a ++ Bison output file, you may use that output file without restriction. ++ This special exception was added by the Free Software Foundation ++ in version 1.24 of Bison. */ ++ ++/* Tokens. */ ++#ifndef YYTOKENTYPE ++# define YYTOKENTYPE ++ /* Put the tokens into the symbol table, so that GDB and other debuggers ++ know about them. */ ++ enum yytokentype { ++ TK_ABORT = 258, ++ TK_AFTER = 259, ++ TK_AGG_FUNCTION = 260, ++ TK_ALL = 261, ++ TK_AND = 262, ++ TK_AS = 263, ++ TK_ASC = 264, ++ TK_BEFORE = 265, ++ TK_BEGIN = 266, ++ TK_BETWEEN = 267, ++ TK_BITAND = 268, ++ TK_BITNOT = 269, ++ TK_BITOR = 270, ++ TK_BY = 271, ++ TK_CASCADE = 272, ++ TK_CASE = 273, ++ TK_CHAR = 274, ++ TK_CHECK = 275, ++ TK_CLUSTER = 276, ++ TK_COLLATE = 277, ++ TK_COLUMN = 278, ++ TK_COMMA = 279, ++ TK_COMMENT = 280, ++ TK_COMMIT = 281, ++ TK_CONCAT = 282, ++ TK_CONFLICT = 283, ++ TK_CONSTRAINT = 284, ++ TK_COPY = 285, ++ TK_CREATE = 286, ++ TK_DEFAULT = 287, ++ TK_DEFERRABLE = 288, ++ TK_DEFERRED = 289, ++ TK_DELETE = 290, ++ TK_DELIMITERS = 291, ++ TK_DESC = 292, ++ TK_DISTINCT = 293, ++ TK_DOT = 294, ++ TK_DROP = 295, ++ TK_EACH = 296, ++ TK_ELSE = 297, ++ TK_END = 298, ++ TK_END_OF_FILE = 299, ++ TK_EQ = 300, ++ TK_EXCEPT = 301, ++ TK_EXPLAIN = 302, ++ TK_FAIL = 303, ++ TK_FLOAT = 304, ++ TK_FOR = 305, ++ TK_FOREIGN = 306, ++ TK_FROM = 307, ++ TK_FUNCTION = 308, ++ TK_GE = 309, ++ TK_GLOB = 310, ++ TK_GROUP = 311, ++ TK_GT = 312, ++ TK_HAVING = 313, ++ TK_HOLD = 314, ++ TK_IGNORE = 315, ++ TK_ILLEGAL = 316, ++ TK_IMMEDIATE = 317, ++ TK_IN = 318, ++ TK_INDEX = 319, ++ TK_INITIALLY = 320, ++ TK_ID = 321, ++ TK_INSERT = 322, ++ TK_INSTEAD = 323, ++ TK_INT = 324, ++ TK_INTEGER = 325, ++ TK_INTERSECT = 326, ++ TK_INTO = 327, ++ TK_IS = 328, ++ TK_ISNULL = 329, ++ TK_JOIN = 330, ++ TK_JOIN_KW = 331, ++ TK_KEY = 332, ++ TK_LE = 333, ++ TK_LIKE = 334, ++ TK_LIMIT = 335, ++ TK_LONG = 336, ++ TK_LONGCHAR = 337, ++ TK_LP = 338, ++ TK_LSHIFT = 339, ++ TK_LT = 340, ++ TK_LOCALIZABLE = 341, ++ TK_MATCH = 342, ++ TK_MINUS = 343, ++ TK_NE = 344, ++ TK_NOT = 345, ++ TK_NOTNULL = 346, ++ TK_NULL = 347, ++ TK_OBJECT = 348, ++ TK_OF = 349, ++ TK_OFFSET = 350, ++ TK_ON = 351, ++ TK_OR = 352, ++ TK_ORACLE_OUTER_JOIN = 353, ++ TK_ORDER = 354, ++ TK_PLUS = 355, ++ TK_PRAGMA = 356, ++ TK_PRIMARY = 357, ++ TK_RAISE = 358, ++ TK_REFERENCES = 359, ++ TK_REM = 360, ++ TK_REPLACE = 361, ++ TK_RESTRICT = 362, ++ TK_ROLLBACK = 363, ++ TK_ROW = 364, ++ TK_RP = 365, ++ TK_RSHIFT = 366, ++ TK_SELECT = 367, ++ TK_SEMI = 368, ++ TK_SET = 369, ++ TK_SHORT = 370, ++ TK_SLASH = 371, ++ TK_SPACE = 372, ++ TK_STAR = 373, ++ TK_STATEMENT = 374, ++ TK_STRING = 375, ++ TK_TABLE = 376, ++ TK_TEMP = 377, ++ TK_THEN = 378, ++ TK_TRANSACTION = 379, ++ TK_TRIGGER = 380, ++ TK_UMINUS = 381, ++ TK_UNCLOSED_STRING = 382, ++ TK_UNION = 383, ++ TK_UNIQUE = 384, ++ TK_UPDATE = 385, ++ TK_UPLUS = 386, ++ TK_USING = 387, ++ TK_VACUUM = 388, ++ TK_VALUES = 389, ++ TK_VIEW = 390, ++ TK_WHEN = 391, ++ TK_WHERE = 392, ++ TK_WILDCARD = 393, ++ COLUMN = 395, ++ FUNCTION = 396, ++ COMMENT = 397, ++ UNCLOSED_STRING = 398, ++ SPACE = 399, ++ ILLEGAL = 400, ++ END_OF_FILE = 401 ++ }; ++#endif ++#define TK_ABORT 258 ++#define TK_AFTER 259 ++#define TK_AGG_FUNCTION 260 ++#define TK_ALL 261 ++#define TK_AND 262 ++#define TK_AS 263 ++#define TK_ASC 264 ++#define TK_BEFORE 265 ++#define TK_BEGIN 266 ++#define TK_BETWEEN 267 ++#define TK_BITAND 268 ++#define TK_BITNOT 269 ++#define TK_BITOR 270 ++#define TK_BY 271 ++#define TK_CASCADE 272 ++#define TK_CASE 273 ++#define TK_CHAR 274 ++#define TK_CHECK 275 ++#define TK_CLUSTER 276 ++#define TK_COLLATE 277 ++#define TK_COLUMN 278 ++#define TK_COMMA 279 ++#define TK_COMMENT 280 ++#define TK_COMMIT 281 ++#define TK_CONCAT 282 ++#define TK_CONFLICT 283 ++#define TK_CONSTRAINT 284 ++#define TK_COPY 285 ++#define TK_CREATE 286 ++#define TK_DEFAULT 287 ++#define TK_DEFERRABLE 288 ++#define TK_DEFERRED 289 ++#define TK_DELETE 290 ++#define TK_DELIMITERS 291 ++#define TK_DESC 292 ++#define TK_DISTINCT 293 ++#define TK_DOT 294 ++#define TK_DROP 295 ++#define TK_EACH 296 ++#define TK_ELSE 297 ++#define TK_END 298 ++#define TK_END_OF_FILE 299 ++#define TK_EQ 300 ++#define TK_EXCEPT 301 ++#define TK_EXPLAIN 302 ++#define TK_FAIL 303 ++#define TK_FLOAT 304 ++#define TK_FOR 305 ++#define TK_FOREIGN 306 ++#define TK_FROM 307 ++#define TK_FUNCTION 308 ++#define TK_GE 309 ++#define TK_GLOB 310 ++#define TK_GROUP 311 ++#define TK_GT 312 ++#define TK_HAVING 313 ++#define TK_HOLD 314 ++#define TK_IGNORE 315 ++#define TK_ILLEGAL 316 ++#define TK_IMMEDIATE 317 ++#define TK_IN 318 ++#define TK_INDEX 319 ++#define TK_INITIALLY 320 ++#define TK_ID 321 ++#define TK_INSERT 322 ++#define TK_INSTEAD 323 ++#define TK_INT 324 ++#define TK_INTEGER 325 ++#define TK_INTERSECT 326 ++#define TK_INTO 327 ++#define TK_IS 328 ++#define TK_ISNULL 329 ++#define TK_JOIN 330 ++#define TK_JOIN_KW 331 ++#define TK_KEY 332 ++#define TK_LE 333 ++#define TK_LIKE 334 ++#define TK_LIMIT 335 ++#define TK_LONG 336 ++#define TK_LONGCHAR 337 ++#define TK_LP 338 ++#define TK_LSHIFT 339 ++#define TK_LT 340 ++#define TK_LOCALIZABLE 341 ++#define TK_MATCH 342 ++#define TK_MINUS 343 ++#define TK_NE 344 ++#define TK_NOT 345 ++#define TK_NOTNULL 346 ++#define TK_NULL 347 ++#define TK_OBJECT 348 ++#define TK_OF 349 ++#define TK_OFFSET 350 ++#define TK_ON 351 ++#define TK_OR 352 ++#define TK_ORACLE_OUTER_JOIN 353 ++#define TK_ORDER 354 ++#define TK_PLUS 355 ++#define TK_PRAGMA 356 ++#define TK_PRIMARY 357 ++#define TK_RAISE 358 ++#define TK_REFERENCES 359 ++#define TK_REM 360 ++#define TK_REPLACE 361 ++#define TK_RESTRICT 362 ++#define TK_ROLLBACK 363 ++#define TK_ROW 364 ++#define TK_RP 365 ++#define TK_RSHIFT 366 ++#define TK_SELECT 367 ++#define TK_SEMI 368 ++#define TK_SET 369 ++#define TK_SHORT 370 ++#define TK_SLASH 371 ++#define TK_SPACE 372 ++#define TK_STAR 373 ++#define TK_STATEMENT 374 ++#define TK_STRING 375 ++#define TK_TABLE 376 ++#define TK_TEMP 377 ++#define TK_THEN 378 ++#define TK_TRANSACTION 379 ++#define TK_TRIGGER 380 ++#define TK_UMINUS 381 ++#define TK_UNCLOSED_STRING 382 ++#define TK_UNION 383 ++#define TK_UNIQUE 384 ++#define TK_UPDATE 385 ++#define TK_UPLUS 386 ++#define TK_USING 387 ++#define TK_VACUUM 388 ++#define TK_VALUES 389 ++#define TK_VIEW 390 ++#define TK_WHEN 391 ++#define TK_WHERE 392 ++#define TK_WILDCARD 393 ++#define COLUMN 395 ++#define FUNCTION 396 ++#define COMMENT 397 ++#define UNCLOSED_STRING 398 ++#define SPACE 399 ++#define ILLEGAL 400 ++#define END_OF_FILE 401 ++ ++ ++ ++ ++#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) ++#line 72 "./sql.y" ++typedef union YYSTYPE { ++ struct sql_str str; ++ LPWSTR string; ++ column_info *column_list; ++ MSIVIEW *query; ++ struct expr *expr; ++ USHORT column_type; ++ int integer; ++} YYSTYPE; ++/* Line 1275 of yacc.c. */ ++#line 337 "sql.tab.h" ++# define yystype YYSTYPE /* obsolescent; will be withdrawn */ ++# define YYSTYPE_IS_DECLARED 1 ++# define YYSTYPE_IS_TRIVIAL 1 ++#endif ++ ++ ++ ++ ++ +Index: tokenize.c +=================================================================== +--- tokenize.c (revision 23808) ++++ tokenize.c (working copy) +@@ -154,7 +154,7 @@ + static const Keyword aKeywordTable[] = { + { ABORT_W, TK_ABORT }, + { AFTER_W, TK_AFTER }, ++ /*{ ALTER_W, TK_ALTER },*/ +- { ALTER_W, TK_ALTER }, + { ALL_W, TK_ALL }, + { AND_W, TK_AND }, + { AS_W, TK_AS },