\r
PcdPattern = re.compile(r'[_a-zA-Z][0-9A-Za-z_]*\.[_a-zA-Z][0-9A-Za-z_]*$')\r
HexPattern = re.compile(r'0[xX][0-9a-fA-F]+')\r
- RegGuidPattern = re.compile(r'[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}')\r
- ExRegGuidPattern = re.compile(r'[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')\r
\r
RangePattern = re.compile(r'[0-9]+ - [0-9]+')\r
\r
def Eval(self, Operator, Oprand1, Oprand2 = None):\r
\r
if Operator in ["!", "NOT", "not"]:\r
- if not self.RegGuidPattern.match(Oprand1.strip()):\r
+ if not gGuidPattern.match(Oprand1.strip()):\r
raise BadExpression(ERR_STRING_EXPR % Operator)\r
return self.NegtiveRange(Oprand1)\r
else:\r
if Operator in ["==", ">=", "<=", ">", "<", '^']:\r
return self.EvalRange(Operator, Oprand1)\r
elif Operator == 'and' :\r
- if not self.ExRegGuidPattern.match(Oprand1.strip()) or not self.ExRegGuidPattern.match(Oprand2.strip()):\r
+ if not gGuidPatternEnd.match(Oprand1.strip()) or not gGuidPatternEnd.match(Oprand2.strip()):\r
raise BadExpression(ERR_STRING_EXPR % Operator)\r
return self.Rangeintersection(Oprand1, Oprand2) \r
elif Operator == 'or':\r
- if not self.ExRegGuidPattern.match(Oprand1.strip()) or not self.ExRegGuidPattern.match(Oprand2.strip()):\r
+ if not gGuidPatternEnd.match(Oprand1.strip()) or not gGuidPatternEnd.match(Oprand2.strip()):\r
raise BadExpression(ERR_STRING_EXPR % Operator)\r
return self.Rangecollections(Oprand1, Oprand2)\r
else:\r
# check if the expression does not need to evaluate\r
if RealValue and Depth == 0:\r
self._Token = self._Expr\r
- if self.ExRegGuidPattern.match(self._Expr):\r
+ if gGuidPatternEnd.match(self._Expr):\r
return [self.operanddict[self._Expr] ]\r
\r
self._Idx = 0\r
self._Token = ''\r
if Expr:\r
Ch = Expr[0]\r
- Match = self.RegGuidPattern.match(Expr)\r
+ Match = gGuidPattern.match(Expr)\r
if Match and not Expr[Match.end():Match.end() + 1].isalnum() \\r
and Expr[Match.end():Match.end() + 1] != '_':\r
self._Idx += Match.end()\r