Share

LALR Parser Generator

Subscribe

PHP new if else grammar

You are viewing a single message from this topic. View all messages.

  1. 2009-10-28 02:00:06 UTC

    for example, code

    if (true) :
      if (true)
            ;
    elseif (true) :
    
    endif;
    

    and code

    if (true) :
        if (true)
            ;
        else
            ;
    elseif (true) :
    
    endif;
    

    should both valid, but php.exe is unable to parse the first one, the grammar is conflict on 'elseif' and it using wrong shift, you have to lookahead for ':' token.

< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.