Operator precedence with empty operator

2010-03-23 Thread Пётр Прохоренков
Hi, I'm trying to write a grammar file for parsing expressions. The main part goes as following: %left '-' '+'; expr: expr '+' expr | expr '-' expr // Other operators... | expr expr | const | id ; "expr expr" here is function application, former expr is the function and latte

Re: Operator precedence with empty operator

2010-03-23 Thread Hans Aberg
On 23 Mar 2010, at 20:32, Пётр Прохоренков wrote: I'm trying to write a grammar file for parsing expressions. The main part goes as following: %left '-' '+'; expr: expr '+' expr | expr '-' expr // Other operators... | expr expr | const | id ; "expr expr" here is function appli

Re: Operator precedence with empty operator

2010-03-23 Thread Пётр Прохоренков
Thanks for the quick reply! Hugs code hepled. (That is weird how they never use bison precedence annotations and just use multiple levels of non-terminals.) -- Regards, Petr. 2010/3/23 Hans Aberg > On 23 Mar 2010, at 20:32, Пётр Прохоренков wrote: > > I'm trying to write a grammar file for p

Re: Operator precedence with empty operator

2010-03-23 Thread Hans Aberg
On 23 Mar 2010, at 22:32, Пётр Прохоренков wrote: Thanks for the quick reply! You are welcome. Hugs code hepled. (That is weird how they never use bison precedence annotations and just use multiple levels of non-terminals.) Think of isn't the function expression rule a bit too general.