[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Useless nonterminals - what and why?
From: |
Hans Aberg |
Subject: |
Re: Useless nonterminals - what and why? |
Date: |
Sun, 26 Nov 2000 10:53:48 +0100 |
At 11:26 +0100 0-11-20, Hans Aberg wrote:
>Think of the rule as written (as when debugging is turned on)
> http_proxy_list <- http_proxy_list http_proxy
>withe the ":" replaced by an arrow "<". Then in order to find a LHS (left
>hand side) http_proxy_list, you need to first find a RHS http_proxy_list
>followed by a http_proxy.
I have noticed that some books on compilers write the rules with the arrow
the other direction
(*) http_proxy_list -> http_proxy_list http_proxy
I think this is because one can think of a language as all sentences that
can be generated from LHS side rules into RHS side rules. -- By contrast,
Bison has a given sentence and tries to reduce it to the sentence symbol.
Then the reasoning becomes: In order to apply (*), one must first generate
a http_proxy_list. But there is no other rule by which a http_proxy_list
can be generated; so the rule is useless.
Hans Aberg
Re: Useless nonterminals - what and why?, Akim Demaille, 2000/11/21