gallium: fix refcount bug introduced in eb20e2984
[mesa.git] / src / mesa / shader / slang / library / slang_version.syn
1 /*
2 * Mesa 3-D graphics library
3 * Version: 6.3
4 *
5 * Copyright (C) 2005 Brian Paul All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 /**
26 * \file slang_version.syn
27 * slang #version directive syntax
28 * \author Michal Krol
29 */
30
31 .syntax version_directive;
32
33 version_directive
34 version_directive_1 .and .loop version_directive_2;
35 version_directive_1
36 prior_optional_spaces .and optional_version_directive .and .true .emit $;
37 version_directive_2
38 prior_optional_spaces .and version_directive_body .and .true .emit $;
39
40 optional_version_directive
41 version_directive_body .or .true .emit 10 .emit 1;
42
43 version_directive_body
44 '#' .and optional_space .and "version" .and space .and version_number .and optional_space .and
45 new_line;
46
47 version_number
48 version_number_110;
49
50 version_number_110
51 leading_zeroes .and "110" .emit 10 .emit 1;
52
53 leading_zeroes
54 .loop zero;
55
56 zero
57 '0';
58
59 space
60 single_space .and .loop single_space;
61
62 optional_space
63 .loop single_space;
64
65 single_space
66 ' ' .or '\t';
67
68 prior_optional_spaces
69 .loop prior_space;
70
71 prior_space
72 c_style_comment_block .or cpp_style_comment_block .or space .or new_line;
73
74 c_style_comment_block
75 '/' .and '*' .and c_style_comment_rest;
76
77 c_style_comment_rest
78 .loop c_style_comment_char_no_star .and c_style_comment_rest_1;
79 c_style_comment_rest_1
80 c_style_comment_end .or c_style_comment_rest_2;
81 c_style_comment_rest_2
82 '*' .and c_style_comment_rest;
83
84 c_style_comment_char_no_star
85 '\x2B'-'\xFF' .or '\x01'-'\x29';
86
87 c_style_comment_end
88 '*' .and '/';
89
90 cpp_style_comment_block
91 '/' .and '/' .and cpp_style_comment_block_1;
92 cpp_style_comment_block_1
93 cpp_style_comment_block_2 .or cpp_style_comment_block_3;
94 cpp_style_comment_block_2
95 .loop cpp_style_comment_char .and new_line;
96 cpp_style_comment_block_3
97 .loop cpp_style_comment_char;
98
99 cpp_style_comment_char
100 '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';
101
102 new_line
103 cr_lf .or lf_cr .or '\n' .or '\r';
104
105 cr_lf
106 '\r' .and '\n';
107
108 lf_cr
109 '\n' .and '\r';
110
111 .string __string_filter;
112
113 __string_filter
114 .loop __identifier_char;
115
116 __identifier_char
117 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';
118