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,764 of 2,753   
   Lex Yaccer to All   
   How to obtain a flattened list of tokens   
   09 Nov 09 03:24:39   
   
   From: tech.login.id@gmail.com   
      
   Hello,   
      
   I want to view a flattened list of all rules for a particular non-   
   terminal (can be the top-most one too).   
   So, for something like:   
      
   top: middle1 | middle2   
      
   middle1: leaf1 leaf2 | leaf3   
      
   leaf1: terminal1 | terminal2   
   leaf2: terminal3 | terminal4   
   leaf3: terminal5   
      
   I would like to see flattened list for middle1 as   
      
      
   middle1: terminal1 terminal3   
   | terminal2 terminal3   
   | terminal1 terminal4   
   | terminal2 terminal4   
   | terminal5   
      
   Thus, all the possible rules for middle1 are flattened out in terms of   
   its terminals.   
      
   [In general it's impossible since recursive rules have a potentially   
   infinite expansion, but for cases where there's no reference loops   
   it's just a simple macro expansion. -John]   
      
   --- 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