I use PLY to create a parser for my language, however, I have a shift / reduction conflict that causes me some problems. My language has common types with the syntax ala C ++ templates. Therefore, right now I have rules such as:
expression : expression LESS expression %prec COMPARISON
expression : template
template : NAME
| NAME LESS templates GREATER
templates : template
| templates COMMA template
However, I found that it could not parse:
a < 2
(which is an obvious problem). Below is the debug output:
PLY: PARSE DEBUG START
State : 0
Stack : . <Token: 'NAME' 'a'>
Action : Shift and goto state 42
State : 42
Stack : NAME . <Token: 'LESS' '<'>
Action : Shift and goto state 81
State : 81
Stack : NAME LESS . <Token: 'NUMBER' '2'>
ERROR: Error : NAME LESS . <Token: 'NUMBER' '2'>
If more than my analyzer is required, I can provide it. Thanks.
EDIT: , , , . , , , C/++, , , , .