
Hi there,
I'm hacking together a small parser for a subset of C++.
I'm in trouble with left recursion as you may guess.
What is the best way to write a parser for the part of grammar below in
Parsec?
Declarator
-> Name
-> PtrOper Declarator
-> Declarator '(' ArgDeclarationList ')' [CvQualifierList]
-> Declarator '[' [ConstantExp] ']'
-> '(' Declarator ')'
Here [X] denotes an optional non-terminal X, and all symbols starting with a
capital letter are non-terminals.
The remedies I thought of were using chainl or eliminating left recursion in
the grammar. What do you think should be done in such a case?
Regards,
--
Eray Ozkural