Commit 3f98185f authored by Alexandre Julliard's avatar Alexandre Julliard

msi: Use bison directives instead of defines to specify extra lexer parameters.

parent ffbe1ca9
...@@ -42,11 +42,6 @@ ...@@ -42,11 +42,6 @@
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/list.h" #include "wine/list.h"
#define YYLEX_PARAM info
#define YYPARSE_PARAM info
static int cond_error(const char *str);
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
typedef struct tag_yyinput typedef struct tag_yyinput
...@@ -66,6 +61,7 @@ struct cond_str { ...@@ -66,6 +61,7 @@ struct cond_str {
static LPWSTR COND_GetString( COND_input *info, const struct cond_str *str ); static LPWSTR COND_GetString( COND_input *info, const struct cond_str *str );
static LPWSTR COND_GetLiteral( COND_input *info, const struct cond_str *str ); static LPWSTR COND_GetLiteral( COND_input *info, const struct cond_str *str );
static int cond_lex( void *COND_lval, COND_input *info); static int cond_lex( void *COND_lval, COND_input *info);
static int cond_error( COND_input *info, const char *str);
static void *cond_alloc( COND_input *cond, unsigned int sz ); static void *cond_alloc( COND_input *cond, unsigned int sz );
static void *cond_track_mem( COND_input *cond, void *ptr, unsigned int sz ); static void *cond_track_mem( COND_input *cond, void *ptr, unsigned int sz );
...@@ -110,6 +106,8 @@ static BOOL num_from_prop( LPCWSTR p, INT *val ) ...@@ -110,6 +106,8 @@ static BOOL num_from_prop( LPCWSTR p, INT *val )
%} %}
%lex-param { COND_input *info }
%parse-param { COND_input *info }
%pure-parser %pure-parser
%union %union
...@@ -798,7 +796,7 @@ static void cond_free( void *ptr ) ...@@ -798,7 +796,7 @@ static void cond_free( void *ptr )
} }
} }
static int cond_error(const char *str) static int cond_error( COND_input *info, const char *str )
{ {
TRACE("%s\n", str ); TRACE("%s\n", str );
return 0; return 0;
......
...@@ -96,6 +96,19 @@ struct expr ...@@ -96,6 +96,19 @@ struct expr
} u; } u;
}; };
typedef struct
{
MSIDATABASE *db;
LPCWSTR command;
DWORD n, len;
UINT r;
MSIVIEW **view; /* View structure for the resulting query. This value
* tracks the view currently being created so we can free
* this view on syntax error.
*/
struct list *mem;
} SQL_input;
UINT MSI_ParseSQL( MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview, UINT MSI_ParseSQL( MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview,
struct list *mem ) DECLSPEC_HIDDEN; struct list *mem ) DECLSPEC_HIDDEN;
......
...@@ -34,29 +34,12 @@ ...@@ -34,29 +34,12 @@
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#define YYLEX_PARAM info
#define YYPARSE_PARAM info
static int sql_error(const char *str);
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
typedef struct tag_SQL_input
{
MSIDATABASE *db;
LPCWSTR command;
DWORD n, len;
UINT r;
MSIVIEW **view; /* View structure for the resulting query. This value
* tracks the view currently being created so we can free
* this view on syntax error.
*/
struct list *mem;
} SQL_input;
static UINT SQL_getstring( void *info, const struct sql_str *strdata, LPWSTR *str ); static UINT SQL_getstring( void *info, const struct sql_str *strdata, LPWSTR *str );
static INT SQL_getint( void *info ); static INT SQL_getint( void *info );
static int sql_lex( void *SQL_lval, SQL_input *info ); static int sql_lex( void *SQL_lval, SQL_input *info );
static int sql_error( SQL_input *info, const char *str);
static LPWSTR parser_add_table( void *info, LPCWSTR list, LPCWSTR table ); static LPWSTR parser_add_table( void *info, LPCWSTR list, LPCWSTR table );
static void *parser_alloc( void *info, unsigned int sz ); static void *parser_alloc( void *info, unsigned int sz );
...@@ -77,6 +60,8 @@ static struct expr * EXPR_wildcard( void *info ); ...@@ -77,6 +60,8 @@ static struct expr * EXPR_wildcard( void *info );
%} %}
%lex-param { SQL_input *info }
%parse-param { SQL_input *info }
%pure-parser %pure-parser
%union %union
...@@ -866,7 +851,7 @@ INT SQL_getint( void *info ) ...@@ -866,7 +851,7 @@ INT SQL_getint( void *info )
return r; return r;
} }
static int sql_error( const char *str ) static int sql_error( SQL_input *info, const char *str )
{ {
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment