2 * Mesa 3-D graphics library
5 * Copyright (C) 2005 Brian Paul All Rights Reserved.
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:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
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.
26 * \file slang_version.syn
27 * slang #version directive syntax
31 .syntax version_directive;
34 version_directive_1 .and .loop version_directive_2;
36 prior_optional_spaces .and optional_version_directive .and .true .emit $;
38 prior_optional_spaces .and version_directive_body .and .true .emit $;
40 optional_version_directive
41 version_directive_body .or .true .emit 10 .emit 1;
43 version_directive_body
44 '#' .and optional_space .and "version" .and space .and version_number .and optional_space .and
51 leading_zeroes .and "110" .emit 10 .emit 1;
60 single_space .and .loop single_space;
72 c_style_comment_block .or cpp_style_comment_block .or space .or new_line;
75 '/' .and '*' .and 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;
84 c_style_comment_char_no_star
85 '\x2B'-'\xFF' .or '\x01'-'\x29';
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;
99 cpp_style_comment_char
100 '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';
103 cr_lf .or lf_cr .or '\n' .or '\r';
111 .string __string_filter;
114 .loop __identifier_char;
117 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';