def IdKeyPattern(self): _token_ = self._peek("r'id'", "r'key'") if _token_ == "r'id'": self._scan("r'id'") self._scan("r'\\('") Literal = self.Literal() self._scan("r'\\)'") return X.Function('id', [Literal]) else: # == "r'key'" self._scan("r'key'") self._scan("r'\\('") Literal = self.Literal() arg1 = Literal self._scan("r'\\,'") Literal = self.Literal() self._scan("r'\\)'") return X.Function('id', [arg1, Literal])
def FunctionCall(self): FUNCNAME = self._scan('FUNCNAME') self._scan("r'\\('") args = [] if self._peek("r'\\,'", "r'\\)'", "r'\\-'", "r'\\/'", "r'\\/\\/'", "r'\\('", 'FORWARD_AXIS_NAME', "r'@'", 'REVERSE_AXIS_NAME', "r'\\.\\.'", "r'\\$'", "r'\\.'", 'FUNCNAME', 'NUMBER', 'DQUOTE', 'SQUOTE', "r'processing-instruction'", "r'comment'", "r'text'", "r'node'", "r'\\*'", 'NCNAME') not in ["r'\\,'", "r'\\)'"]: Expr = self.Expr() args.append(Expr) while self._peek("r'\\,'", "r'\\)'") == "r'\\,'": self._scan("r'\\,'") Expr = self.Expr() args.append(Expr) self._scan("r'\\)'") return X.Function(FUNCNAME, args)
def AttributeValueTemplate(self): LITERALTEXT = self._scan('LITERALTEXT') args = [X.LiteralExpr(LITERALTEXT)] while self._peek("r'\\{'", 'LITERALTEXT', 'END') != 'END': if self._peek("r'\\{'", 'LITERALTEXT') == "r'\\{'": self._scan("r'\\{'") Expr = self.Expr() args.append(Expr) self._scan("r'\\}'") LITERALTEXT = self._scan('LITERALTEXT') args.append(X.LiteralExpr(LITERALTEXT)) END = self._scan('END') return X.Function('concat', args)