home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.compilers      Compiler construction, theory, etc. (Mod      2,753 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,175 of 2,753   
   Anton Ertl to Carl Barron   
   Re: ANSI C grammar without shift-reduce    
   10 Dec 07 10:08:51   
   
   From: anton@mips.complang.tuwien.ac.at   
      
   cbarron3@ix.netcom.com (Carl Barron) writes:   
   >See bison.info-3.   
   >--quote--   
   [...]   
   >   But if the parser chose to reduce when possible rather than shift,   
   >the result would be to attach the else-clause to the outermost   
   >if-statement, making these two inputs equivalent:   
   >   
   >     if x then if y then win (); else lose;   
   >   
   >     if x then do; if y then win (); end; else lose;   
   >--end quote   
      
   I believe that this is incorrect: If the parser chose to reduce, it   
   would never shift an ELSE, and therefore would report a syntax error   
   when confronted with an IF statement containing an ELSE clause.   
      
   - anton   
   --   
   M. Anton Ertl   
   anton@mips.complang.tuwien.ac.at   
   http://www.complang.tuwien.ac.at/anton/   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca