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,388 of 2,753   
   Paul B Mann to All   
   Re: Intricate problem with scannerless L   
   26 Jun 08 23:14:08   
   
   From: paul@paulbmann.com   
      
   >>>start: a   
   >>>a: b 'XX'   
   >>>b: c | '[' b ']'   
   >>>c: 'X' | c 'X'   
   >   
   >> XX is valid, but ambiguous, either a keyword or two X's.   
      
   > Are you sure it is ambiguous?  Maybe it isn't LALR(1), though.   
   > Since there is no a in b or c, it looks to me that it only matches   
   > strings ending in 'XX'.  If b is 'XX' then it still must be followed   
   > by another 'XX'.   
      
   You are right.  I was wrong.   
      
   X  XX is valid   
   XX  XX is valid   
   XXX  XX is valid.   
      
   The parser needs 2 characters of lookahead to correctly   
   parse this language, depending on how spaces are processed.   
      
      
   Paul B Mann   
      
   --- 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