Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* -*- mode: c++; c-file-style: "linux"; indent-tabs-mode: t -*- */ | 1 /* -*- mode: c++; c-file-style: "linux"; indent-tabs-mode: t -*- */ |
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) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl> | 5 Copyright (C) 1997--2015 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 // the value of the lookahead token. That implies that the lookahead | 151 // the value of the lookahead token. That implies that the lookahead |
152 // token must not yet have made an impact on the state stack other | 152 // token must not yet have made an impact on the state stack other |
153 // than causing the reduction of the current rule, or switching the | 153 // than causing the reduction of the current rule, or switching the |
154 // lookahead token while Bison is mulling it over will cause trouble. | 154 // lookahead token while Bison is mulling it over will cause trouble. |
155 | 155 |
156 #define MYBACKUP(Token, Value, Location) \ | 156 #define MYBACKUP(Token, Value, Location) \ |
157 do { \ | 157 do { \ |
158 if (yychar != YYEMPTY) \ | 158 if (yychar != YYEMPTY) \ |
159 parser->lexer_->push_extra_token \ | 159 parser->lexer_->push_extra_token \ |
160 (yylloc, yychar, yylval); \ | 160 (yylloc, yychar, yylval); \ |
161 » » if (Token != END_OF_FILE)» » » » \ | 161 » » parser->lexer_->push_extra_token» » » \ |
dak
2018/09/09 09:45:53
This isn't really about END_OF_FILE at all but abo
Dan Eble
2018/09/09 17:44:12
Will do. Thanks.
| |
162 » » » parser->lexer_->push_extra_token» » \ | 162 » » » (Location, Token, Value);» » » \ |
163 » » » » (Location, Token, Value);» » \ | |
164 parser->lexer_->push_extra_token (Location, BACKUP); \ | 163 parser->lexer_->push_extra_token (Location, BACKUP); \ |
165 yychar = YYEMPTY; \ | 164 yychar = YYEMPTY; \ |
166 } while (0) | 165 } while (0) |
167 | 166 |
168 | 167 |
169 #define MYREPARSE(Location, Pred, Token, Value) \ | 168 #define MYREPARSE(Location, Pred, Token, Value) \ |
170 do { \ | 169 do { \ |
171 if (yychar != YYEMPTY) \ | 170 if (yychar != YYEMPTY) \ |
172 parser->lexer_->push_extra_token \ | 171 parser->lexer_->push_extra_token \ |
173 (yylloc, yychar, yylval); \ | 172 (yylloc, yychar, yylval); \ |
(...skipping 4570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4744 Lily_lexer *lex = parser->lexer_; | 4743 Lily_lexer *lex = parser->lexer_; |
4745 | 4744 |
4746 lex->lexval_ = s; | 4745 lex->lexval_ = s; |
4747 lex->lexloc_ = loc; | 4746 lex->lexloc_ = loc; |
4748 int tok = lex->pop_extra_token (); | 4747 int tok = lex->pop_extra_token (); |
4749 if (tok >= 0) | 4748 if (tok >= 0) |
4750 return tok; | 4749 return tok; |
4751 lex->prepare_for_next_token (); | 4750 lex->prepare_for_next_token (); |
4752 return lex->yylex (); | 4751 return lex->yylex (); |
4753 } | 4752 } |
LEFT | RIGHT |