Exemplo n.º 1
0
 def FilterExpr(self):
     PrimaryExpr = self.PrimaryExpr()
     if self._peek("r'\\['", "r'\\/'", "r'\\/\\/'", "'\\|'", 'MUL_COMP',
                   'ADD_COMP', 'REL_COMP', 'EQ_COMP', "r'and'", "r'or'",
                   'END', "r'\\]'", "r'\\)'", "r'\\,'") == "r'\\['":
         PredicateList = self.PredicateList()
         PrimaryExpr = X.PredicateList(PrimaryExpr, PredicateList)
     return PrimaryExpr
Exemplo n.º 2
0
 def AxisStep(self):
     _token_ = self._peek('FORWARD_AXIS_NAME', "r'@'", 'REVERSE_AXIS_NAME', "r'\\.\\.'", "r'processing-instruction'", "r'comment'", "r'text'", "r'node'", "r'\\*'", 'NCNAME')
     if _token_ not in ['REVERSE_AXIS_NAME', "r'\\.\\.'"]:
         ForwardStep = self.ForwardStep()
         step = ForwardStep
     else:# in ['REVERSE_AXIS_NAME', "r'\\.\\.'"]
         ReverseStep = self.ReverseStep()
         step = ReverseStep
     expr = X.AxisStep(*step)
     if self._peek("r'\\['", "r'\\/'", "r'\\/\\/'", "'\\|'", 'MUL_COMP', 'ADD_COMP', 'REL_COMP', 'EQ_COMP', "r'and'", "r'or'", 'END', "r'\\]'", "r'\\)'", "r'\\,'") == "r'\\['":
         PredicateList = self.PredicateList()
         expr = X.PredicateList(expr, PredicateList, step[0])
     return expr
Exemplo n.º 3
0
 def StepPattern(self):
     _token_ = self._peek("r'@'", "'child'", "'attribute'",
                          "r'processing-instruction'", "r'comment'",
                          "r'text'", "r'node'", "r'\\*'", 'NCNAME')
     if _token_ not in ["'child'", "'attribute'"]:
         AbbrevForwardStep = self.AbbrevForwardStep()
         step = AbbrevForwardStep
     else:  # in ["'child'", "'attribute'"]
         ChildOrAttributeAxisStep = self.ChildOrAttributeAxisStep()
         step = ChildOrAttributeAxisStep
     expr = X.AxisStep(*step)
     if self._peek("r'\\['", "r'\\/'", "r'\\/\\/'", "'\\|'",
                   'END') == "r'\\['":
         PredicateList = self.PredicateList()
         expr = X.PredicateList(expr, PredicateList, step[0])
     return expr