0

I'd like to be able to treat:

int(int, int)

As a function type. How do I normalize this (stripped down) grammar?

type : classOrInterfaceType | primitiveType | functionType;
functionType : type '(' (type (',' type)*)? ')';

classOrInterfaceType : ;
primitiveType : ;
Brent
  • 4,153
  • 4
  • 30
  • 63

1 Answers1

0

There's an algorithm for eliminating left recursion. http://web.cs.wpi.edu/~kal/PLT/PLT4.1.2.html

Brent
  • 4,153
  • 4
  • 30
  • 63