Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
cc02e152
Commit
cc02e152
authored
Nov 04, 2013
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Add support for #pragma directives.
parent
1f3e3fa4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
1 deletion
+19
-1
header.c
tools/widl/header.c
+3
-0
parser.l
tools/widl/parser.l
+4
-0
parser.y
tools/widl/parser.y
+10
-1
widltypes.h
tools/widl/widltypes.h
+1
-0
write_msft.c
tools/widl/write_msft.c
+1
-0
No files found.
tools/widl/header.c
View file @
cc02e152
...
@@ -1342,6 +1342,7 @@ static void write_imports(FILE *header, const statement_list_t *stmts)
...
@@ -1342,6 +1342,7 @@ static void write_imports(FILE *header, const statement_list_t *stmts)
case
STMT_TYPEDEF
:
case
STMT_TYPEDEF
:
case
STMT_MODULE
:
case
STMT_MODULE
:
case
STMT_CPPQUOTE
:
case
STMT_CPPQUOTE
:
case
STMT_PRAGMA
:
case
STMT_DECLARATION
:
case
STMT_DECLARATION
:
/* not processed here */
/* not processed here */
break
;
break
;
...
@@ -1376,6 +1377,7 @@ static void write_forward_decls(FILE *header, const statement_list_t *stmts)
...
@@ -1376,6 +1377,7 @@ static void write_forward_decls(FILE *header, const statement_list_t *stmts)
case
STMT_TYPEDEF
:
case
STMT_TYPEDEF
:
case
STMT_MODULE
:
case
STMT_MODULE
:
case
STMT_CPPQUOTE
:
case
STMT_CPPQUOTE
:
case
STMT_PRAGMA
:
case
STMT_DECLARATION
:
case
STMT_DECLARATION
:
/* not processed here */
/* not processed here */
break
;
break
;
...
@@ -1428,6 +1430,7 @@ static void write_header_stmts(FILE *header, const statement_list_t *stmts, cons
...
@@ -1428,6 +1430,7 @@ static void write_header_stmts(FILE *header, const statement_list_t *stmts, cons
break
;
break
;
case
STMT_IMPORTLIB
:
case
STMT_IMPORTLIB
:
case
STMT_MODULE
:
case
STMT_MODULE
:
case
STMT_PRAGMA
:
/* not included in header */
/* not included in header */
break
;
break
;
case
STMT_IMPORT
:
case
STMT_IMPORT
:
...
...
tools/widl/parser.l
View file @
cc02e152
...
@@ -37,6 +37,7 @@ double [0-9]+\.[0-9]+([eE][+-]?[0-9]+)*
...
@@ -37,6 +37,7 @@ double [0-9]+\.[0-9]+([eE][+-]?[0-9]+)*
%x WSTRQUOTE
%x WSTRQUOTE
%x ATTR
%x ATTR
%x PP_LINE
%x PP_LINE
%x PP_PRAGMA
%x SQUOTE
%x SQUOTE
%{
%{
...
@@ -125,6 +126,7 @@ UUID *parse_uuid(const char *u)
...
@@ -125,6 +126,7 @@ UUID *parse_uuid(const char *u)
**************************************************************************
**************************************************************************
*/
*/
%%
%%
<INITIAL>^{ws}*\#{ws}*pragma{ws}+ yy_push_state(PP_PRAGMA);
<INITIAL,ATTR>^{ws}*\#{ws}* yy_push_state(PP_LINE);
<INITIAL,ATTR>^{ws}*\#{ws}* yy_push_state(PP_LINE);
<PP_LINE>[^\n]* {
<PP_LINE>[^\n]* {
int lineno;
int lineno;
...
@@ -144,6 +146,8 @@ UUID *parse_uuid(const char *u)
...
@@ -144,6 +146,8 @@ UUID *parse_uuid(const char *u)
line_number = lineno - 1; /* We didn't read the newline */
line_number = lineno - 1; /* We didn't read the newline */
input_name = xstrdup(fname);
input_name = xstrdup(fname);
}
}
<PP_PRAGMA>midl_echo[^\n]* yyless(9); yy_pop_state(); return tCPPQUOTE;
<PP_PRAGMA>[^\n]* parser_lval.str = xstrdup(yytext); yy_pop_state(); return aPRAGMA;
<INITIAL,ATTR>\" yy_push_state(QUOTE); cbufidx = 0;
<INITIAL,ATTR>\" yy_push_state(QUOTE); cbufidx = 0;
<QUOTE>\" {
<QUOTE>\" {
yy_pop_state();
yy_pop_state();
...
...
tools/widl/parser.y
View file @
cc02e152
...
@@ -114,6 +114,7 @@ static statement_t *make_statement_type_decl(type_t *type);
...
@@ -114,6 +114,7 @@ static statement_t *make_statement_type_decl(type_t *type);
static statement_t *make_statement_reference(type_t *type);
static statement_t *make_statement_reference(type_t *type);
static statement_t *make_statement_declaration(var_t *var);
static statement_t *make_statement_declaration(var_t *var);
static statement_t *make_statement_library(typelib_t *typelib);
static statement_t *make_statement_library(typelib_t *typelib);
static statement_t *make_statement_pragma(const char *str);
static statement_t *make_statement_cppquote(const char *str);
static statement_t *make_statement_cppquote(const char *str);
static statement_t *make_statement_importlib(const char *str);
static statement_t *make_statement_importlib(const char *str);
static statement_t *make_statement_module(type_t *type);
static statement_t *make_statement_module(type_t *type);
...
@@ -152,7 +153,7 @@ static attr_list_t *append_attribs(attr_list_t *, attr_list_t *);
...
@@ -152,7 +153,7 @@ static attr_list_t *append_attribs(attr_list_t *, attr_list_t *);
enum storage_class stgclass;
enum storage_class stgclass;
}
}
%token <str> aIDENTIFIER
%token <str> aIDENTIFIER
aPRAGMA
%token <str> aKNOWNTYPE
%token <str> aKNOWNTYPE
%token <num> aNUM aHEXNUM
%token <num> aNUM aHEXNUM
%token <dbl> aDOUBLE
%token <dbl> aDOUBLE
...
@@ -363,6 +364,7 @@ statement:
...
@@ -363,6 +364,7 @@ statement:
| declaration ';' { $$ = make_statement_declaration($1); }
| declaration ';' { $$ = make_statement_declaration($1); }
| import { $$ = make_statement_import($1); }
| import { $$ = make_statement_import($1); }
| typedef ';' { $$ = $1; }
| typedef ';' { $$ = $1; }
| aPRAGMA { $$ = make_statement_pragma($1); }
;
;
typedecl:
typedecl:
...
@@ -2744,6 +2746,13 @@ static statement_t *make_statement_library(typelib_t *typelib)
...
@@ -2744,6 +2746,13 @@ static statement_t *make_statement_library(typelib_t *typelib)
return stmt;
return stmt;
}
}
static statement_t *make_statement_pragma(const char *str)
{
statement_t *stmt = make_statement(STMT_PRAGMA);
stmt->u.str = str;
return stmt;
}
static statement_t *make_statement_cppquote(const char *str)
static statement_t *make_statement_cppquote(const char *str)
{
{
statement_t *stmt = make_statement(STMT_CPPQUOTE);
statement_t *stmt = make_statement(STMT_CPPQUOTE);
...
...
tools/widl/widltypes.h
View file @
cc02e152
...
@@ -243,6 +243,7 @@ enum statement_type
...
@@ -243,6 +243,7 @@ enum statement_type
STMT_TYPEDEF
,
STMT_TYPEDEF
,
STMT_IMPORT
,
STMT_IMPORT
,
STMT_IMPORTLIB
,
STMT_IMPORTLIB
,
STMT_PRAGMA
,
STMT_CPPQUOTE
STMT_CPPQUOTE
};
};
...
...
tools/widl/write_msft.c
View file @
cc02e152
...
@@ -2266,6 +2266,7 @@ static void add_entry(msft_typelib_t *typelib, const statement_t *stmt)
...
@@ -2266,6 +2266,7 @@ static void add_entry(msft_typelib_t *typelib, const statement_t *stmt)
switch
(
stmt
->
type
)
{
switch
(
stmt
->
type
)
{
case
STMT_LIBRARY
:
case
STMT_LIBRARY
:
case
STMT_IMPORT
:
case
STMT_IMPORT
:
case
STMT_PRAGMA
:
case
STMT_CPPQUOTE
:
case
STMT_CPPQUOTE
:
case
STMT_DECLARATION
:
case
STMT_DECLARATION
:
/* not included in typelib */
/* not included in typelib */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment