Infinite loop of aritmetic expression

Keenlearner <yingun@gmail.com>
Thu, 10 Apr 2008 02:06:14 -0700 (PDT)

          From comp.compilers

Related articles
Infinite loop of aritmetic expression yingun@gmail.com (Keenlearner) (2008-04-10)
| List of all articles for this month |

From: Keenlearner <yingun@gmail.com>
Newsgroups: comp.compilers
Date: Thu, 10 Apr 2008 02:06:14 -0700 (PDT)
Organization: Compilers Central
Keywords: parse, question
Posted-Date: 10 Apr 2008 23:27:42 EDT



I have my parser generator that will generate the Earley Chart parser,
I got not idea when I gave this input it will go infinite loop, my
processor working at maximum speed and then hang. Is my grammar
correct ?


Input : 6 ^ 2 + 1 - 4 * 3 / 2


art -> art PLUS term
art -> art MINUS term
art -> term
term -> term TIMES factor
term -> term DEVIDE factor
term -> factor
factor -> factor EXPONENT primary
factor -> primary
primary -> LPAREN art RPAREN
primary -> NUMBER




^ : EXPONENT
+ : PLUS
- : MINUS
* : TIMES
/ : DEVIDE
[0-9]+ : NUMBER


Any idea why ? Thanks.



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.