help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FW: I can't make sure it's a bug. But I think it's important.


From: Valentin Tolmer
Subject: Re: FW: I can't make sure it's a bug. But I think it's important.
Date: Fri, 13 Sep 2013 18:35:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8

On Fri 13 Sep 2013 10:42:02 AM CEST, 王波 wrote:
Hi,

    This email I also sent to address@hidden But It's really a question, I 
don't know Bison how to deal with it.

     The following is my description.

Thanks,

Best regards,
Andy

From: address@hidden
To: address@hidden
Subject: I can't make sure it's a bug. But I think it's important.
Date: Fri, 13 Sep 2013 15:30:00 +0800




Hi,

     Flex/Bison is powerful.  As a developer, I love them.

     Now, I meet with a problem and can't find a good way to resolve it.
     when Flex read "\n", I add my line number, then ignore it. Flex will read 
another word, then return to bison as a token. Bison will start to reduce and action my 
function. But in my function, I will use the line number which is wrong obviously.

     I have a way to resolve it. When Flex read "\n", I think it can return 
some special character(key word) to make Bison to reduce the statement, then Bison can 
ignore the special character.

    I think Bison should support this way.

    welcome to comment,

    Thanks,

Best regards,
Andy



                                                                                
_______________________________________________
address@hidden https://lists.gnu.org/mailman/listinfo/help-bison

Hi,

If the newline is a separator in your grammar (meaning that an expression cannot be spread on two lines), then it should be present in your grammar as a newline token, explicitly. E. g.
list-exp:
 exp newline
| exp newline list-exp
;

Valentin Tolmer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]