Re: How to read an understand the bison report file ?

2012-06-28 Thread Akim Demaille
Le 27 juin 2012 à 13:26, Timothy Madden a écrit : On 06/27/2012 09:44 AM, Akim Demaille wrote: [...] Either you need to completely change the way you handle the spaces/comments, or you have to use GLR, as Hans suggested. I would hate to find that I have to push all whitespace/comments

Re: How to read and understand the bison report file ?

2012-06-28 Thread Timothy Madden
On 06/28/2012 04:55 PM, Akim Demaille wrote: Le 28 juin 2012 à 14:51, Timothy Madden a écrit : On 06/28/2012 10:09 AM, Akim Demaille wrote: On the other hand, I could not get GLR with C++ yet… I have it working, but it's based on horrible hacks. And I really mean horrible. If PHP in

Re: How to read and understand the bison report file ?

2012-06-28 Thread Akim Demaille
Le 28 juin 2012 à 16:47, Timothy Madden a écrit : I would try to include my spaces in the lexer tokens, and I have updated the lexer input for that, but I have some things I should understand first, like how does that help the grammar ? Well, are you familiar with LR parsers? You should,

Re: How to read an understand the bison report file ?

2012-06-28 Thread Timothy Madden
On 06/28/2012 10:09 AM, Akim Demaille wrote: On the other hand, I could not get GLR with C++ yet… I have it working, but it's based on horrible hacks. And I really mean horrible. If PHP in itself does not need it, I would avoid it. That is what I was afraid of. I see the real php parser

Re: How to read an understand the bison report file ?

2012-06-27 Thread Akim Demaille
Le 26 juin 2012 à 13:23, Timothy Madden a écrit : Hello Hi! I wrote a grammar file for an approximation of the php language (with the purpose of adding braces to single-statements under if, for, while, but that is not included yet), that simply outputs the found tokens back to an output

Re: How to read an understand the bison report file ?

2012-06-27 Thread Akim Demaille
Le 27 juin 2012 à 08:00, Akim Demaille a écrit : For instance, you have: state 88 1 t_comment_or_whitespace: . T_WHITESPACE 2| . T_COMMENT 3 plain_comment_or_whitespace: . t_comment_or_whitespace 4| .

Re: How to read an understand the bison report file ?

2012-06-27 Thread Timothy Madden
On 06/26/2012 11:58 PM, Hans Aberg wrote: On 26 Jun 2012, at 13:23, Timothy Madden wrote: I wrote a grammar file for an approximation of the php language (with the purpose of adding braces to single-statements under if, for, while, but that is not included yet), that simply outputs the found

Re: How to read an understand the bison report file ?

2012-06-27 Thread Hans Aberg
On 27 Jun 2012, at 13:18, Timothy Madden wrote: I wrote a grammar file for an approximation of the php language (with the purpose of adding braces to single-statements under if, for, while, but that is not included yet), that simply outputs the found tokens back to an output stream. If

Re: How to read an understand the bison report file ?

2012-06-27 Thread Hans Aberg
On 27 Jun 2012, at 13:26, Timothy Madden wrote: Either you need to completely change the way you handle the spaces/comments, or you have to use GLR, as Hans suggested. I would hate to find that I have to push all whitespace/comments into the content (semantic value) of the lexer tokens, so