def createVariableReference(self, prefix, localName): if prefix: return ParsedExpr.ParsedVariableReferenceExpr( "$" + prefix + ":" + localName ) else: return ParsedExpr.ParsedVariableReferenceExpr("$" + localName)
def unionExpr2(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 409 unionExpr: unionExpr '|' pathExpr """ __val = ParsedExpr.ParsedUnionExpr(__stack[__ptr + 1], __stack[__ptr + 3]) return __val
def andExpr2(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 495 andExpr: andExpr AND equalityExpr """ __val = ParsedExpr.ParsedAndExpr(__stack[__ptr + 1], __stack[__ptr + 3]) return __val
def filterExpr2(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 460 filterExpr: primaryExpr predicateList """ __val = ParsedExpr.ParsedFilterExpr(__stack[__ptr + 1], __stack[__ptr + 2]) return __val
def functionCall1(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 339 functionCall: FUNCTION_NAME '(' ')' """ __val = ParsedExpr.ParsedFunctionCallExpr(__stack[__ptr + 1], []) return __val
def primaryExpr4(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 322 primaryExpr: NLITERAL """ __val = ParsedExpr.ParsedNLiteralExpr(__stack[__ptr + 1]) return __val
def primaryExpr1(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 292 primaryExpr: VARIABLE_REFERENCE """ __val = ParsedExpr.ParsedVariableReferenceExpr(__stack[__ptr + 1]) return __val
def unaryExpr2(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 634 unaryExpr: '-' unionExpr """ __val = ParsedExpr.ParsedUnaryExpr(__stack[__ptr + 2]) return __val
def createNumericExpr(self, operator, left, right): if operator == MINUS_OPERATOR and right is None: return ParsedExpr.ParsedUnaryExpr(left) cl = self.opMap[operator] if type(cl) is tuple: return cl[0](cl[1], left, right) return cl(left, right)
def orExpr2(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 477 orExpr: orExpr OR andExpr """ __val = ParsedExpr.ParsedOrExpr(__stack[__ptr + 1], __stack[__ptr + 3]) return __val
def additiveExpr3(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 580 additiveExpr: additiveExpr '-' multiplicativeExpr """ __val = ParsedExpr.ParsedAdditiveExpr(-1, __stack[__ptr + 1], __stack[__ptr + 3]) return __val
def pathExpr4(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 441 pathExpr: filterExpr DOUBLE_SLASH relativeLocationPath """ __val = ParsedExpr.ParsedPathExpr(__stack[__ptr + 2], __stack[__ptr + 1], __stack[__ptr + 3]) return __val
def pathExpr3(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 430 pathExpr: filterExpr '/' relativeLocationPath """ __val = ParsedExpr.ParsedPathExpr(__stack[__ptr + 2], __stack[__ptr + 1], __stack[__ptr + 3]) return __val
def functionCall2(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 352 functionCall: FUNCTION_NAME '(' argumentList ')' """ __val = ParsedExpr.ParsedFunctionCallExpr(__stack[__ptr + 1], __stack[__ptr + 3]) return __val
def equalityExpr2(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 513 equalityExpr: equalityExpr EQUALITY_OP relationalExpr """ __val = ParsedExpr.ParsedEqualityExpr(__stack[__ptr + 2], __stack[__ptr + 1], __stack[__ptr + 3]) return __val
def multiplicativeExpr2(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 598 multiplicativeExpr: multiplicativeExpr MULTIPLY_OPERATOR unaryExpr """ ops = {"*": 0, "div": 1, "mod": 2} __val = ParsedExpr.ParsedMultiplicativeExpr(ops[__stack[__ptr + 2]], __stack[__ptr + 1], __stack[__ptr + 3]) return __val
def relationalExpr2(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 531 relationalExpr: relationalExpr RELATIONAL_OP additiveExpr """ ops = {"<": 0, ">": 2, "<=": 1, ">=": 3} __val = ParsedExpr.ParsedRelationalExpr(ops[__stack[__ptr + 2]], __stack[__ptr + 1], __stack[__ptr + 3]) return __val
def relationalExpr2(self, __stack, __ptr): """ from XPath/XPathBase.bgen.frag, line 531 relationalExpr: relationalExpr RELATIONAL_OP additiveExpr """ ops = { '<': 0, '>': 2, '<=': 1, '>=': 3, } __val = ParsedExpr.ParsedRelationalExpr(ops[__stack[__ptr + 2]], __stack[__ptr + 1], __stack[__ptr + 3]) return __val
def createFunctionCall(self, prefix, localName, args): if prefix: return ParsedExpr.ParsedFunctionCallExpr(prefix + ":" + localName, args) else: return ParsedExpr.ParsedFunctionCallExpr(localName, args)
def createAbbreviatedPathExpr(self, left, right): return ParsedExpr.ParsedPathExpr(XPATH.DOUBLE_SLASH, left, right)
def createFilterExpr(self, filter, predicates): return ParsedExpr.ParsedFilterExpr(filter, ParsedPredicateList(predicates))
def createPathExpr(self, left, right): return ParsedExpr.ParsedPathExpr("/", left, right)