Alex_Gaynor
unread,Nov 23, 2009, 8:26:35 PM11/23/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ply-hack
I've got a grammar with precedence:
precedence = (
("nonassoc", "COMPARISON"),
("left", "AMPER", "VBAR", "CIRCUMFLEX"),
("left", "PLUS", "MINUS"),
("left", "STAR", "SLASH", "PERCENT"),
("right", "UNARY"),
("right", "POWER"),
)
Which I believe is correct. However given: a ** b ** c; it parses it
as:
[('BinOpNode', ('BinOpNode', ('NameNode', 'a'), ('NameNode', 'b'),
'**'), ('NameNode', 'c'), '**')]
Whereas I would expect:
[('BinOpNode', ('NameNode', 'a'), ('BinOpNode', ('NameNode', 'b'),
('NameNode', 'c'), '**'), '**')]
Hopefully that syntax is clear. Any suggestions as to why I'm getting
an incorrect parse.
Alex