[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bison and $ (dollarsign) token at the end
From: |
Akim Demaille |
Subject: |
Re: Bison and $ (dollarsign) token at the end |
Date: |
09 Jul 2002 12:12:50 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) |
| Hello,
| I run bison -v "myfile.y" and got output where last two rules I can't
| understand:
| ----------------------------------------
| state 15
|
| $ go to state 16
|
|
|
| state 16
|
| $ go to state 17
|
|
|
| state 17
|
| $default accept
| -----------------------------------------
|
| If parser is in state 15 it needs two $ to accept... huh what $ is for? Is
| it some kind of "end of input"?
| How can I make yylex (flex++) make returns twice (-1)?
Fortunately, no, once is enough.
Still, the presence of these two steps (instead of one) was a bug in
pre 1.30. Bison 1.35 has one only.
And, yes, as answered by Hans, $ = EOF.
I'm fine with renaming $ to something else. BYacc names it `$end'.
Avoiding `$eof' is not a bad idea, given that we may be scanning a
string.