2 * Mesa 3-D graphics library
5 * Copyright (C) 2005-2006 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
48 version_number_110 .or version_number_120;
51 leading_zeroes .and "110" .emit 10 .emit 1;
54 leading_zeroes .and "120" .emit 20 .emit 1;
63 single_space .and .loop single_space;
75 c_style_comment_block .or cpp_style_comment_block .or space .or new_line;
78 '/' .and '*' .and 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;
87 c_style_comment_char_no_star
88 '\x2B'-'\xFF' .or '\x01'-'\x29';
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;
102 cpp_style_comment_char
103 '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';
106 cr_lf .or lf_cr .or '\n' .or '\r';
114 .string __string_filter;
117 .loop __identifier_char;
120 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';