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
d6b76df3
Commit
d6b76df3
authored
Nov 09, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Preprocess and attempt to parse provided ACF file.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1db0ad97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
5 deletions
+49
-5
parser.l
tools/widl/parser.l
+42
-3
parser.y
tools/widl/parser.y
+7
-2
No files found.
tools/widl/parser.l
View file @
d6b76df3
...
...
@@ -76,6 +76,8 @@ static int cbufalloc = 0;
static int kw_token(const char *kw);
static int attr_token(const char *kw);
static void switch_to_acf(void);
static warning_list_t *disabled_warnings = NULL;
#define MAX_IMPORT_DEPTH 20
...
...
@@ -225,9 +227,14 @@ SAFEARRAY{ws}*/\( return tSAFEARRAY;
<INITIAL,ATTR>\.\.\. return ELLIPSIS;
<INITIAL,ATTR>. return yytext[0];
<<EOF>> {
if (import_stack_ptr)
return aEOF;
else yyterminate();
if (import_stack_ptr)
return aEOF;
if (acf_name)
{
switch_to_acf();
return aACF;
}
yyterminate();
}
%%
...
...
@@ -563,6 +570,38 @@ void abort_import(void)
unlink(import_stack[ptr].temp_name);
}
static void switch_to_acf(void)
{
int ptr = import_stack_ptr;
int ret, fd;
char *name;
FILE *f;
assert(import_stack_ptr == 0);
input_name = acf_name;
acf_name = NULL;
line_number = 1;
name = xstrdup( "widl.XXXXXX" );
if((fd = mkstemps( name, 0 )) == -1)
error("Could not generate a temp name from %s\n", name);
temp_name = name;
if (!(f = fdopen(fd, "wt")))
error("Could not open fd %s for writing\n", name);
ret = wpp_parse(input_name, f);
fclose(f);
if (ret) exit(1);
if((f = fopen(temp_name, "r")) == NULL)
error_loc("Unable to open %s\n", temp_name);
import_stack[ptr].state = YY_CURRENT_BUFFER;
yy_switch_to_buffer(yy_create_buffer(f, YY_BUF_SIZE));
}
static void warning_disable(int warning)
{
warning_t *warning_entry;
...
...
tools/widl/parser.y
View file @
d6b76df3
...
...
@@ -173,7 +173,7 @@ static typelib_t *current_typelib;
%token <dbl> aDOUBLE
%token <str> aSTRING aWSTRING aSQSTRING
%token <uuid> aUUID
%token aEOF
%token aEOF
aACF
%token SHL SHR
%token MEMBERPTR
%token EQUALITY INEQUALITY
...
...
@@ -321,7 +321,7 @@ static typelib_t *current_typelib;
%%
input:
gbl_statements
{ fix_incomplete();
input:
gbl_statements m_acf
{ fix_incomplete();
check_statements($1, FALSE);
check_all_user_types($1);
write_header($1);
...
...
@@ -336,6 +336,8 @@ input: gbl_statements { fix_incomplete();
}
;
m_acf: /* empty */ | aACF acf_statements
gbl_statements: { $$ = NULL; }
| gbl_statements namespacedef '{' { push_namespace($2); } gbl_statements '}'
{ pop_namespace($2); $$ = append_statements($1, $5); }
...
...
@@ -1150,6 +1152,9 @@ version:
| aHEXNUM { $$ = $1; }
;
acf_statements
: /* empty */
%%
static void decl_builtin_basic(const char *name, enum type_basic_type type)
...
...
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