Re: When to use a token yacc_EOF instead of relying on 0 return value of yylex()?

Peng Yu <[email protected]>
Newsgroups gmane.comp.parsers.bison.general
Message-ID <CABrM6wnq8B7s9UkryzQtwr9D9VwUD7NSoR8D6ky58ia+k17vPg@mail.gmail.com>
> I have no idea.  You'd have to study the grammar to see if there
> are doing fancy things around yacc_EOF.

declare -p BASH_SOURCE

Here is what I got with the above one line bash code (with the newline
at the end).

The lines with -> are the parsing rules activated. The rest lines are
yylex() results.

WORD
WORD
simple_command_element -> WORD
simple_command -> simple_command_element
simple_command_element -> WORD
simple_command -> simple_command simple_command_element
WORD
simple_command_element -> WORD
simple_command -> simple_command simple_command_element
\n
command -> simple_command
pipeline -> command
pipeline_command -> pipeline
simple_list1 -> pipeline_command
simple_list -> simple_list1
simple_list_terminator -> '\n'
inputunit -> simple_list simple_list_terminator
yacc_EOF
inputunit -> yacc_EOF

If yacc_EOF were to be removed, do you see how to redesigned this
subset of grammar rules? Thanks. (Since this subset is much smaller
than the full grammar, I think it should be easy to see how to remove
yacc_EOF, yet maintain the same functionality of the grammar?)

-- 
Regards,
Peng

_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.