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 865 of 2,753   
   Hans-Peter Diettrich to George Neuner   
   Re: parsing C and C++, Generating a simp   
   22 Dec 06 01:08:33   
   
   From: DrDiettrich1@aol.com   
      
   George Neuner wrote:   
      
   > I would think that it is always possible to delay categorizing an   
   > identifier until after parsing.  The difficulty lies in designing an   
   > initial IR which incorporates the ambiguities in addition to the   
   > unambiguous canon IR.   
   >   
   > For example, in the case of "a = (b)-c", the parser could construct an   
   > AST like the following   
   [...]   
      
   IMO you disregard the amount of postprocessing, or error recovery   
   (backtracking), when the first assumption was wrong. Argument binding,   
   operator precedence, and more, might be different for typecasts and   
   binary "-" or other operators like "(". When a tree has to be   
   reorganized later, why construct an tree in the first pass at all?   
   Weren't a multi-level grammar the simpler approach to (such) ambiguities?   
      
   DoDi   
      
   --- 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