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 2,335 of 2,753   
   Stefan Monnier to All   
   Re: Grammar with low-precedence postfix    
   08 Feb 15 12:34:27   
   
   From: monnier@iro.umontreal.ca   
      
   > term   
   > 	:	INT   
   > 	|	'(' expr ')' //parentheses   
   > 	|	 term '^' term //exponentiation   
   > 	|	term term //implicit multiplication   
   > 	;   
      
   > expr   
   > 	:	term   
   > 	|	('+' | '-') expr //unary plus/minus   
   > 	|	expr ('/' | '*') expr //division and explicit multiplication   
   > 	|	expr ('+' | '-') expr //addition/subtraction   
   > 	|	expr '++' //increment   
   > 	;   
      
   This last production rule is wrong: "expr ++" should produce a "term", not   
   an "expr".   
      
      
           Stefan   
      
   --- 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