LEFT | RIGHT |
1 %{ // -*-Fundamental-*- | 1 %{ // -*-Fundamental-*- |
2 /* | 2 /* |
3 This file is part of LilyPond, the GNU music typesetter. | 3 This file is part of LilyPond, the GNU music typesetter. |
4 | 4 |
5 Copyright (C) 1996--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> | 5 Copyright (C) 1996--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> |
6 Jan Nieuwenhuizen <janneke@gnu.org> | 6 Jan Nieuwenhuizen <janneke@gnu.org> |
7 | 7 |
8 LilyPond is free software: you can redistribute it and/or modify | 8 LilyPond is free software: you can redistribute it and/or modify |
9 it under the terms of the GNU General Public License as published by | 9 it under the terms of the GNU General Public License as published by |
10 the Free Software Foundation, either version 3 of the License, or | 10 the Free Software Foundation, either version 3 of the License, or |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 /* produce requested token */ | 176 /* produce requested token */ |
177 int type = extra_token_types_.back (); | 177 int type = extra_token_types_.back (); |
178 extra_token_types_.pop_back (); | 178 extra_token_types_.pop_back (); |
179 if (extra_token_types_.empty ()) | 179 if (extra_token_types_.empty ()) |
180 yy_pop_state (); | 180 yy_pop_state (); |
181 | 181 |
182 return type; | 182 return type; |
183 } | 183 } |
184 | 184 |
| 185 <extratoken><<EOF>> { |
| 186 /* Generate a token without swallowing anything */ |
| 187 |
| 188 /* produce requested token */ |
| 189 int type = extra_token_types_.back (); |
| 190 extra_token_types_.pop_back (); |
| 191 if (extra_token_types_.empty ()) |
| 192 yy_pop_state (); |
| 193 |
| 194 return type; |
| 195 } |
| 196 |
185 /* Use the trailing context feature. Otherwise, the BOM will not be | 197 /* Use the trailing context feature. Otherwise, the BOM will not be |
186 found if the file starts with an identifier definition. */ | 198 found if the file starts with an identifier definition. */ |
187 <INITIAL,chords,lyrics,figures,notes>{BOM_UTF8}/.* { | 199 <INITIAL,chords,lyrics,figures,notes>{BOM_UTF8}/.* { |
188 if (this->lexloc_->line_number () != 1 || this->lexloc_->column_number () != 0
) | 200 if (this->lexloc_->line_number () != 1 || this->lexloc_->column_number () != 0
) |
189 { | 201 { |
190 LexerError (_ ("stray UTF-8 BOM encountered").c_str ()); | 202 LexerError (_ ("stray UTF-8 BOM encountered").c_str ()); |
191 exit (1); | 203 exit (1); |
192 } | 204 } |
193 debug_output (_ ("Skipping UTF-8 BOM")); | 205 debug_output (_ ("Skipping UTF-8 BOM")); |
194 } | 206 } |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 yylval.scm = ly_string2scm (s); | 615 yylval.scm = ly_string2scm (s); |
604 | 616 |
605 | 617 |
606 return STRING; | 618 return STRING; |
607 } | 619 } |
608 . { | 620 . { |
609 return YYText()[0]; | 621 return YYText()[0]; |
610 } | 622 } |
611 } | 623 } |
612 | 624 |
613 <*><<EOF>> { | 625 <longcomment><<EOF>> { |
614 » if (YY_START == longcomment) | |
615 » { | |
616 LexerError (_ ("EOF found inside a comment").c_str ()); | 626 LexerError (_ ("EOF found inside a comment").c_str ()); |
617 is_main_input_ = false; // should be safe , can't have \include
in --safe. | 627 is_main_input_ = false; // should be safe , can't have \include
in --safe. |
618 if (!close_input ()) | 628 if (!close_input ()) |
619 yyterminate (); // can't move this, since it actually rets a Y
Y_NULL | 629 yyterminate (); // can't move this, since it actually rets a Y
Y_NULL |
620 } | 630 } |
621 » else if (is_main_input_) | 631 |
| 632 <<EOF>> { if (is_main_input_) |
622 { | 633 { |
623 /* 2 = init.ly + current file. | 634 /* 2 = init.ly + current file. |
624 > because we're before closing, but is_main_input_ should | 635 > because we're before closing, but is_main_input_ should |
625 reflect after. | 636 reflect after. |
626 */· | 637 */· |
627 is_main_input_ = include_stack_.size () > 2; | 638 is_main_input_ = include_stack_.size () > 2; |
628 if (!close_input ()) | 639 if (!close_input ()) |
629 /* Returns YY_NULL */ | 640 /* Returns YY_NULL */ |
630 yyterminate (); | 641 yyterminate (); |
631 } | 642 } |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 { | 1051 { |
1041 (void) yy_start_stack_ptr; | 1052 (void) yy_start_stack_ptr; |
1042 (void) yy_start_stack_depth; | 1053 (void) yy_start_stack_depth; |
1043 (void) yy_start_stack; | 1054 (void) yy_start_stack; |
1044 (void) yy_push_state; | 1055 (void) yy_push_state; |
1045 (void) yy_pop_state; | 1056 (void) yy_pop_state; |
1046 (void) yy_top_state; | 1057 (void) yy_top_state; |
1047 (void) silence_lexer_warnings; | 1058 (void) silence_lexer_warnings; |
1048 } | 1059 } |
1049 #endif | 1060 #endif |
LEFT | RIGHT |