NonLetterOpLst = ['+', '-', '*', '/', '%', '&', '|', '^', '~', '<<', '>>', '!', '=', '>', '<', '?', ':']\r
\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
\r
SymbolPattern = re.compile("("\r
"\$\([A-Z][A-Z0-9_]*\)|\$\(\w+\.\w+\)|\w+\.\w+|"\r
self._LiteralToken.endswith('}'):\r
return True\r
\r
- if self.HexPattern.match(self._LiteralToken):\r
+ if gHexPattern.match(self._LiteralToken):\r
Token = self._LiteralToken[2:]\r
if not Token:\r
self._LiteralToken = '0x0'\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
Item = '0x%x' % TmpValue if type(TmpValue) != type('') else TmpValue\r
if ItemSize == 0:\r
ItemValue, ItemSize = ParseFieldValue(Item)\r
- if not (Item.startswith('"') or Item.startswith('L') or Item.startswith('{')) and ItemSize > 1:\r
+ if Item[0] not in ['"','L','{'] and ItemSize > 1:\r
raise BadExpression("Byte array number %s should less than 0xFF." % Item)\r
else:\r
ItemValue = ParseFieldValue(Item)[0]\r