fix w component of glsl vec4 asin
[mesa.git] / src / mesa / shader / slang / library / slang_pp_version.syn
1 /*
2 * Mesa 3-D graphics library
3 * Version: 6.6
4 *
5 * Copyright (C) 2005-2006 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_pp_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 .or version_number_120;
49
50 version_number_110
51 leading_zeroes .and "110" .emit 10 .emit 1;
52
53 version_number_120
54 leading_zeroes .and "120" .emit 20 .emit 1;
55
56 leading_zeroes
57 .loop zero;
58
59 zero
60 '0';
61
62 space
63 single_space .and .loop single_space;
64
65 optional_space
66 .loop single_space;
67
68 single_space
69 ' ' .or '\t';
70
71 prior_optional_spaces
72 .loop prior_space;
73
74 prior_space
75 c_style_comment_block .or cpp_style_comment_block .or space .or new_line;
76
77 c_style_comment_block
78 '/' .and '*' .and c_style_comment_rest;
79
80 c_style_comment_rest
81 .loop c_style_comment_char_no_star .and c_style_comment_rest_1;
82 c_style_comment_rest_1
83 c_style_comment_end .or c_style_comment_rest_2;
84 c_style_comment_rest_2
85 '*' .and c_style_comment_rest;
86
87 c_style_comment_char_no_star
88 '\x2B'-'\xFF' .or '\x01'-'\x29';
89
90 c_style_comment_end
91 '*' .and '/';
92
93 cpp_style_comment_block
94 '/' .and '/' .and cpp_style_comment_block_1;
95 cpp_style_comment_block_1
96 cpp_style_comment_block_2 .or cpp_style_comment_block_3;
97 cpp_style_comment_block_2
98 .loop cpp_style_comment_char .and new_line;
99 cpp_style_comment_block_3
100 .loop cpp_style_comment_char;
101
102 cpp_style_comment_char
103 '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';
104
105 new_line
106 cr_lf .or lf_cr .or '\n' .or '\r';
107
108 cr_lf
109 '\r' .and '\n';
110
111 lf_cr
112 '\n' .and '\r';
113
114 .string __string_filter;
115
116 __string_filter
117 .loop __identifier_char;
118
119 __identifier_char
120 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';
121