usp10: Insert dotted circle (U+25CC) for invalid combining sequences in Hebrew.
[wine.git] / dlls / d3dcompiler_43 / hlsl.y
blobc9aa94c28bc20b92e090328c69274810882d7305
1 /*
2 * HLSL parser
4 * Copyright 2008 Stefan Dösinger
5 * Copyright 2012 Matteo Bruni for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "config.h"
23 #include "wine/debug.h"
25 #include <stdio.h>
27 #include "d3dcompiler_private.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(hlsl_parser);
31 int hlsl_lex(void);
33 struct hlsl_parse_ctx hlsl_ctx;
35 void hlsl_message(const char *fmt, ...)
37 va_list args;
39 va_start(args, fmt);
40 compilation_message(&hlsl_ctx.messages, fmt, args);
41 va_end(args);
44 static void hlsl_error(const char *s)
46 hlsl_message("Line %u: %s\n", hlsl_ctx.line_no, s);
47 set_parse_status(&hlsl_ctx.status, PARSE_ERR);
52 %error-verbose
54 %union
56 char *name;
57 INT intval;
60 %token <intval> PRE_LINE
62 %token <name> STRING
65 hlsl_prog: /* empty */
68 | hlsl_prog preproc_directive
72 preproc_directive: PRE_LINE STRING
74 TRACE("Updating line information to file %s, line %u\n", debugstr_a($2), $1);
75 hlsl_ctx.line_no = $1 - 1;
76 d3dcompiler_free(hlsl_ctx.source_file);
77 hlsl_ctx.source_file = $2;
82 struct bwriter_shader *parse_hlsl(enum shader_type type, DWORD version, const char *entrypoint, char **messages)
84 hlsl_ctx.line_no = 1;
85 hlsl_ctx.source_file = d3dcompiler_strdup("");
86 hlsl_ctx.matrix_majority = HLSL_COLUMN_MAJOR;
88 hlsl_parse();
90 d3dcompiler_free(hlsl_ctx.source_file);
92 return NULL;