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 the grammar does not get to 
> see it.

As Vincent pointed out, the normal way is to strip whitespace and comments in 
the lexer, only retaining it in the cases it would be needed in actions. 
Grammars are typically written so this is possible.

Searching for "php yacc grammar" gave several hits, including one saying that 
this compiler uses a Yacc, that is, LALR(1), grammar:
  http://www.phpcompiler.org/

Hans



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

Reply via email to