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
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
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,
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
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
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| .
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
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
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