jGuru Forums

infinite recursion to rule factor2 from rule factor2
0 posts in topic
Flat View
TOPIC ACTIONS:

Posted By:   Anonymous
Posted On:   Friday, October 11, 2002 01:32 AM

Untitled Document Hey all, please help with the following code....i dont understand why i am getting is error now :( any help will be greatly appriciated. expr : (term expr2) ; expr2 : (PLUS term expr2) => (PLUS term expr2) | ; // expr + term // | term ; term : factor term2 ; term2 : (MULT factor term2) => (MULT factor term2) | ; // (term MULT factor) => (term MULT factor) // | (factor mod factor) => (factor mod factor) {System.out.println("term : factor mod factor found!");} // | factor {System.   More>>
Untitled Document

Hey all,

error now :( any help will be greatly appriciated.

expr : (term expr2) ;

expr2 : (PLUS term expr2) => (PLUS term expr2)

| ;

// expr + term

// | term ;

term : factor term2 ;

term2 : (MULT factor term2) => (MULT factor term2)

| ;

// (term MULT factor) => (term MULT factor)

// | (factor mod factor) => (factor mod factor) {System.out.println("term
: factor mod factor found!");}

// | factor {System.out.println("term : factor found!");} ;

factor : (primary EXPON factor factor2) => (primary EXPON factor factor2)
{System.out.println("factor found!");}

| (primary factor2) => (primary factor2)

// | (expr) => (expr)

// factor2

;

factor2 : (term2 expr2 factor2) => (term2 expr2 factor2)

|

;

------------------------------------------------------------

here are the errors :

ANTLR Parser Generator Version 2.7.1 1989-2000 jGuru.com

grammar.g:35: infinite recursion to rule factor2 from rule factor2

grammar.g:35: infinite recursion to rule factor2 from rule factor2

grammar.g:35: infinite recursion to rule factor2 from rule factor2

grammar.g:29: infinite recursion to rule factor2 from rule factor

Exiting due to errors.

once again....thanks!!!!!

<<Less