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 983 of 2,753   
   Tony Finch to Lowell Thomas   
   Re: Grammar for optional elements   
   20 Jun 07 17:08:29   
   
   From: dot@dotat.at   
      
   "Lowell Thomas"  wrote:   
   >   
   >Parsing Expression Grammars are an interesting solution to the problem,   
   >but I don't think this one quite succeeds. In the term   
   >   
   >!(attr* attr1 attr*)   
   >   
   >it is my understanding is that the "*" operator is "greedy" and   
   >will always consume the entire remainder of the string,   
   >assuming all attributes are syntactically correct. Then   
   >the concatenation with attr1 will always fail (and hence the   
   >negative syntactic predicate will always succeed.)   
      
   Oops, yes you are right. The fix is similar to the one you gave in your   
   SABNF version, i.e. replace the attr in attr* expression with an   
   expression that doesn't match attr1: (!attr1 attr)   
      
   Tony.   
   --   
   f.a.n.finch    http://dotat.at/   
      
   --- 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