]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/Macro.java
re
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / Macro.java
index 2e8356e4d1f5a0ca12b099e41c6771c9bd8ca417..bd10b5a251b80129730d89c06d4bef2966f422f0 100644 (file)
@@ -1,34 +1,47 @@
+/** @file\r
\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution.  The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
+ **/\r
 package org.tianocore.migration;\r
 \r
 import java.util.regex.*;\r
 \r
 public class Macro {\r
-       Macro(String r8, String r9) {\r
-               r8name = r8;\r
-               r9name = r9;\r
-       }\r
-       Macro(String[] linecontext) {\r
-               r8name = linecontext[0];\r
-               r9name = linecontext[1];\r
-       }\r
-       \r
-       public String r8name;\r
-       public String r9name;\r
+    Macro(String r8, String r9) {\r
+        r8name = r8;\r
+        r9name = r9;\r
+    }\r
+    Macro(String[] linecontext) {\r
+        r8name = linecontext[0];\r
+        r9name = linecontext[1];\r
+    }\r
+    \r
+    public String r8name;\r
+    public String r9name;\r
 \r
-       public static Pattern ptntmacro = Pattern.compile("\\b[A-Z_]+\\s*?\\(?\\b",Pattern.MULTILINE);\r
+    public static Pattern ptntmacro = Pattern.compile("\\b[A-Z_]+\\s*?\\(?\\b",Pattern.MULTILINE);\r
 \r
-       private static String unmacro = "VOID UINTN BOOLEAN ASSERT OPTIONAL STATIC NULL TRUE IN OUT FALSE";\r
+    private static String unmacro = "VOID UINTN BOOLEAN ASSERT OPTIONAL STATIC NULL TRUE IN OUT FALSE";\r
 \r
-       public static String register(Matcher mtr, ModuleInfo mi, Database db) {\r
-               String temp = null;\r
-               \r
-               temp = mtr.group();\r
-               if (db.hasMacro(temp)) {                                        // only changed macros registered, because the database of macro has only changed ones\r
-                       if (!unmacro.contains(temp)) {\r
-                               mi.hashnonlocalmacro.add(temp);\r
-                       }\r
-                       return temp;\r
-               }\r
-               return null;\r
-       }\r
+    public static String register(Matcher mtr, ModuleInfo mi, Database db) {\r
+        String temp = null;\r
+        \r
+        temp = mtr.group();\r
+        mi.hashmacro.add(temp);\r
+        if (MigrationTool.db.hasMacro(temp)) {                    // only changed macros registered, because the database of macro has only changed ones\r
+            if (!unmacro.contains(temp)) {\r
+                mi.hashnonlocalmacro.add(temp);\r
+            }\r
+            return temp;\r
+        }\r
+        return null;\r
+    }\r
 }
\ No newline at end of file