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 819 of 2,753   
   =?iso-8859-1?q?Torben_=C6gidius_Mog to Andreas Ravnestad   
   Re: The $ in predictive parsing tables   
   11 Oct 06 23:19:08   
   
   From: torbenm@app-6.diku.dk   
      
   Andreas Ravnestad  writes:   
      
   > In predictive parsing tables there is often a column designated '$'. I   
   > can't find any explanations for this column in my notes. Can someone   
   > shed a light on what this means?   
      
   You should find an explanation in most compiler textbooks.  '$' is the   
   end-of-input marker.  To the original grammar, you add a new   
   production S' -> S $, where S is the original start symbol.  S' is the   
   new start symbol and will recognize w$ whenever the original grammar   
   recognizes w.   
      
   Using '$' reduces the number of conflicts in the table and simplifies   
   end-of-input treatment.  If you use LL(2) parsing, you will use two   
   end-of-input markers, and so on.   
      
   '$' is also used in LR parsing.   
      
   	Torben   
      
   --- 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