]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/GlobalData.py
BaseTools: use set instead of list for a variable to be used with in
[mirror_edk2.git] / BaseTools / Source / Python / Common / GlobalData.py
index 83ba3d19961ae1b896fb49813baf32cc40562d9a..f58dc5a8dda225a973f57c20abdb2508c28e866c 100644 (file)
@@ -51,6 +51,21 @@ gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern), re.UNICODE
 gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")\r
 gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))\r
 \r
+# definition for a GUID.  used to create regular expressions below.\r
+_HexChar = r"[0-9a-fA-F]"\r
+_GuidPattern = r"{Hex}{{8}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{12}}".format(Hex=_HexChar)\r
+\r
+## Regular expressions for GUID matching\r
+gGuidPattern = re.compile(r'{}'.format(_GuidPattern))\r
+gGuidPatternEnd = re.compile(r'{}$'.format(_GuidPattern))\r
+\r
+## Regular expressions for HEX matching\r
+g4HexChar = re.compile(r'{}{{4}}'.format(_HexChar))\r
+gHexPattern = re.compile(r'0[xX]{}+'.format(_HexChar))\r
+\r
+## Regular expressions for string identifier checking\r
+gIdentifierPattern = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$', re.UNICODE)\r
+\r
 #\r
 # A global variable for whether current build in AutoGen phase or not.\r
 #\r