]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/MigrationTools/org/tianocore/migration/Func.java
843995a7084588536cfd0e41a2341880116cfbeb
1 package org
.tianocore
.migration
;
3 import java
.util
.regex
.*;
6 Func(String r8func
,String r8lib
,String r9func
,String r9lib
) {
12 Func(String
[] linecontext
) {
13 r8funcname
= linecontext
[1];
14 r8libname
= linecontext
[0];
15 r9funcname
= linecontext
[2];
16 r9libname
= linecontext
[3];
18 public String r8funcname
;
19 public String r8libname
;
20 public String r9funcname
;
21 public String r9libname
;
23 public static Pattern ptnbrace
= Pattern
.compile("\\{[^\\{\\}]*\\}",Pattern
.MULTILINE
);
24 public static Pattern ptnfuncc
= Pattern
.compile("([a-zA-Z_]\\w*)\\s*\\([^\\)\\(]*\\)",Pattern
.MULTILINE
);
25 public static Pattern ptnfuncd
= Pattern
.compile("([a-zA-Z_]\\w*)\\s*\\([^\\)\\(]*\\)\\s*@",Pattern
.MULTILINE
);
26 public static Pattern ptnlowcase
= Pattern
.compile("[a-z]"); // must be removed
28 private static String reservedwords
= "if for pack while switch return sizeof";
30 public static String
register(Matcher mtr
, ModuleInfo mi
, Database db
) {
33 temp
= mtr
.group(1); // both changed and not changed funcc are registered , for finding all the non-local function calls
34 Matcher mtrlowcase
= ptnlowcase
.matcher(temp
); // must be removed , so the two funcs can be merged
35 if (!reservedwords
.contains(temp
) && mtrlowcase
.find()) {
36 mi
.hashfuncc
.add(temp
);
41 public static String registerFuncD(Matcher mtr, ModuleInfo mi, Database db) {
44 temp = mtr.group(1); // both changed and not changed funcd are registered , for finding all the non-local function calls
45 if (!reservedwords.contains(temp)) {
46 mi.hashfuncd.add(temp);