]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/Func.java
MsaOwner usable
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / Func.java
index d51412c970f3fbe11be72d4db5df7763460c3e7b..0154fc83dd126ed814c5942e81b46aa7ecfee3a6 100644 (file)
@@ -15,49 +15,52 @@ package org.tianocore.migration;
 import java.util.regex.*;\r
 \r
 public class Func {\r
-       Func(String r8func,String r8lib,String r9func,String r9lib) {\r
-               r8funcname = r8func;\r
-               r8libname = r8lib;\r
-               r9funcname = r9func;\r
-               r9libname = r9lib;\r
-       }\r
-       Func(String[] linecontext) {\r
-               r8funcname = linecontext[1];\r
-               r8libname = linecontext[0];\r
-               r9funcname = linecontext[2];\r
-               r9libname = linecontext[3];\r
-       }\r
-       public String r8funcname;\r
-       public String r8libname;\r
-       public String r9funcname;\r
-       public String r9libname;\r
+    Func(String r8func,String r8lib,String r9func,String r9lib) {\r
+        r8funcname = r8func;\r
+        r8libname = r8lib;\r
+        r9funcname = r9func;\r
+        r9libname = r9lib;\r
+    }\r
+    Func(String[] linecontext) {\r
+        r8funcname = linecontext[1];\r
+        r8libname  = linecontext[0];\r
+        r9funcname = linecontext[2];\r
+        if (r9funcname.contains("n/a")) {\r
+            r9funcname = "#error Unknown or missing library function in EDKII: " + r8funcname;\r
+        }\r
+        r9libname = linecontext[3];\r
+    }\r
+    public String r8funcname;\r
+    public String r8libname;\r
+    public String r9funcname;\r
+    public String r9libname;\r
 \r
-       public static Pattern ptnbrace = Pattern.compile("\\{[^\\{\\}]*\\}",Pattern.MULTILINE);\r
-       public static Pattern ptnfuncc = Pattern.compile("([a-zA-Z_]\\w*)\\s*\\([^\\)\\(]*\\)",Pattern.MULTILINE);\r
-       public static Pattern ptnfuncd = Pattern.compile("([a-zA-Z_]\\w*)\\s*\\([^\\)\\(]*\\)\\s*@",Pattern.MULTILINE);\r
-       public static Pattern ptnlowcase = Pattern.compile("[a-z]");                            // must be removed\r
-       \r
-       private static String reservedwords = "if for pack while switch return sizeof";\r
-       \r
-       public static String register(Matcher mtr, ModuleInfo mi, Database db) {\r
-               String temp = null;\r
+    public static Pattern ptnbrace = Pattern.compile("\\{[^\\{\\}]*\\}",Pattern.MULTILINE);\r
+    public static Pattern ptnfuncc = Pattern.compile("(?<!->)([a-zA-Z_]\\w*)\\s*\\(",Pattern.MULTILINE);\r
+    public static Pattern ptnfuncd = Pattern.compile("([a-zA-Z_]\\w*)\\s*\\([^\\)\\(]*\\)\\s*@",Pattern.MULTILINE);\r
+    public static Pattern ptnlowcase = Pattern.compile("[a-z]");                // must be removed\r
+    \r
+    private static String reservedwords = "if for pack while switch return sizeof";\r
+    \r
+    public static String register(Matcher mtr, ModuleInfo mi, Database db) {\r
+        String temp = null;\r
 \r
-               temp = mtr.group(1);                                                                    // both changed and not changed funcc are registered , for finding all the non-local function calls\r
-               Matcher mtrlowcase = ptnlowcase.matcher(temp);                  // must be removed , so the two funcs can be merged\r
-               if (!reservedwords.contains(temp) && mtrlowcase.find()) {\r
-                       mi.hashfuncc.add(temp);\r
-               }\r
-               return temp;\r
-       }\r
-       /*\r
-       public static String registerFuncD(Matcher mtr, ModuleInfo mi, Database db) {\r
-               String temp = null;\r
+        temp = mtr.group(1);                                    // both changed and not changed funcc are registered , for finding all the non-local function calls\r
+        Matcher mtrlowcase = ptnlowcase.matcher(temp);            // must be removed , so the two funcs can be merged\r
+        if (!reservedwords.contains(temp) && mtrlowcase.find()) {\r
+            mi.hashfuncc.add(temp);\r
+        }\r
+        return temp;\r
+    }\r
+    /*\r
+    public static String registerFuncD(Matcher mtr, ModuleInfo mi, Database db) {\r
+        String temp = null;\r
 \r
-               temp = mtr.group(1);                                                                    // both changed and not changed funcd are registered , for finding all the non-local function calls\r
-               if (!reservedwords.contains(temp)) {\r
-                       mi.hashfuncd.add(temp);\r
-               }\r
-               return temp;\r
-       }\r
-       */\r
+        temp = mtr.group(1);                                    // both changed and not changed funcd are registered , for finding all the non-local function calls\r
+        if (!reservedwords.contains(temp)) {\r
+            mi.hashfuncd.add(temp);\r
+        }\r
+        return temp;\r
+    }\r
+    */\r
 }\r