[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: |
Mon, 20 Nov 2000 11:26:27 +0100 |
At 10.30 +1100 0-11-20, Matthew Palmer wrote:
>> >http_proxy_list: http_proxy_list http_proxy { ... }
; <-- Don't forget ending the rule!
...
>Interesting. Even though I'll get a hit with http_proxy, I still need the
>empty list?
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.
But there is not any other rule for finding a http_proxy_list, so you can
never find the RHS http_proxy_list.
>I seem to have fixed it now, anyway. Made it a requirement to have a comma
>between entries, as in
>
>http_proxy_list: http_proxy_list COMMA_TOK http_proxy
>
>and then make the opt_port required, as in
>
>http_proxy: host COLON_TOK PORTNUM_TOK
>
>and it compiles and parses fine.
Note that you forgot terminate the rules with ";" in the original post.
Have you done it now?
Hans Aberg
Re: Useless nonterminals - what and why?, Akim Demaille, 2000/11/21