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
2ad2c5fa
Commit
2ad2c5fa
authored
Jun 04, 2012
by
Matteo Bruni
Committed by
Alexandre Julliard
Jun 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler: Add identifiers parsing.
parent
5e82c397
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
0 deletions
+35
-0
d3dcompiler_private.h
dlls/d3dcompiler_43/d3dcompiler_private.h
+3
-0
hlsl.l
dlls/d3dcompiler_43/hlsl.l
+12
-0
hlsl.y
dlls/d3dcompiler_43/hlsl.y
+1
-0
utils.c
dlls/d3dcompiler_43/utils.c
+19
-0
No files found.
dlls/d3dcompiler_43/d3dcompiler_private.h
View file @
2ad2c5fa
...
...
@@ -614,6 +614,9 @@ struct hlsl_parse_ctx
extern
struct
hlsl_parse_ctx
hlsl_ctx
DECLSPEC_HIDDEN
;
void
hlsl_message
(
const
char
*
fmt
,
...)
PRINTF_ATTR
(
1
,
2
)
DECLSPEC_HIDDEN
;
struct
hlsl_ir_var
*
get_variable
(
struct
hlsl_scope
*
scope
,
const
char
*
name
)
DECLSPEC_HIDDEN
;
struct
hlsl_type
*
get_type
(
struct
hlsl_scope
*
scope
,
const
char
*
name
,
BOOL
recursive
)
DECLSPEC_HIDDEN
;
BOOL
find_function
(
const
char
*
name
)
DECLSPEC_HIDDEN
;
struct
bwriter_shader
*
parse_hlsl_shader
(
const
char
*
text
,
enum
shader_type
type
,
DWORD
version
,
const
char
*
entrypoint
,
char
**
messages
)
DECLSPEC_HIDDEN
;
...
...
dlls/d3dcompiler_43/hlsl.l
View file @
2ad2c5fa
...
...
@@ -45,6 +45,7 @@ WS [ \t]
NEWLINE (\n)|(\r\n)
DOUBLESLASHCOMMENT "//"[^\n]*
STRING \"[^\"]*\"
IDENTIFIER [A-Za-z_][A-Za-z0-9_]*
ANY (.)
...
...
@@ -166,6 +167,17 @@ while {return KW_WHILE; }
column_major {return KW_COLUMN_MAJOR; }
row_major {return KW_ROW_MAJOR; }
{IDENTIFIER} {
hlsl_lval.name = d3dcompiler_strdup(yytext);
if (get_variable(hlsl_ctx.cur_scope, yytext)
|| find_function(yytext))
return VAR_IDENTIFIER;
else if (get_type(hlsl_ctx.cur_scope, yytext, TRUE))
return TYPE_IDENTIFIER;
else
return NEW_IDENTIFIER;
}
[+-]?[0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[h|H|f|F]? {
hlsl_lval.floatval = atof(yytext);
return C_FLOAT;
...
...
dlls/d3dcompiler_43/hlsl.y
View file @
2ad2c5fa
...
...
@@ -159,6 +159,7 @@ static void hlsl_error(const char *s)
%token <intval> PRE_LINE
%token <name> VAR_IDENTIFIER TYPE_IDENTIFIER NEW_IDENTIFIER
%token <name> STRING
%token <floatval> C_FLOAT
%token <intval> C_INTEGER
...
...
dlls/d3dcompiler_43/utils.c
View file @
2ad2c5fa
...
...
@@ -3,6 +3,7 @@
* Copyright 2009 Matteo Bruni
* Copyright 2008-2009 Henri Verbeet for CodeWeavers
* Copyright 2010 Rico Schüller
* Copyright 2012 Matteo Bruni for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -759,3 +760,21 @@ void compilation_message(struct compilation_messages *msg, const char *fmt, va_l
}
}
}
struct
hlsl_ir_var
*
get_variable
(
struct
hlsl_scope
*
scope
,
const
char
*
name
)
{
FIXME
(
"stub.
\n
"
);
return
NULL
;
}
struct
hlsl_type
*
get_type
(
struct
hlsl_scope
*
scope
,
const
char
*
name
,
BOOL
recursive
)
{
FIXME
(
"stub.
\n
"
);
return
NULL
;
}
BOOL
find_function
(
const
char
*
name
)
{
FIXME
(
"stub.
\n
"
);
return
FALSE
;
}
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