Re: [Pyparsing] Operator Precedence and Associativity.
Brought to you by:
ptmcg
From: Ralph C. <ra...@in...> - 2006-10-11 12:09:38
|
Hi Paul, > Well, why not?! Check this out! > > def operatorGrammar( baseExpr, opList ): > ret = Forward() > lastExpr = baseExpr | ( Suppress('(') + ret + Suppress(')') ) > ... That's impressive and exactly what I was after. You may want to consider formalising it as part of pyparsing since recursive descent parsers often use operator precedence parsers for that part of things. Thanks! Ralph. |