]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/MigrationTools/org/tianocore/migration/Macro.java
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1247 6f19259b...
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / Macro.java
1 package org.tianocore.migration;
2
3 import java.util.regex.*;
4
5 public class Macro {
6 Macro(String r8, String r9) {
7 r8name = r8;
8 r9name = r9;
9 }
10 Macro(String[] linecontext) {
11 r8name = linecontext[0];
12 r9name = linecontext[1];
13 }
14
15 public String r8name;
16 public String r9name;
17
18 public static Pattern ptntmacro = Pattern.compile("\\b[A-Z_]+\\s*?\\(?\\b",Pattern.MULTILINE);
19
20 private static String unmacro = "VOID UINTN BOOLEAN ASSERT OPTIONAL STATIC NULL TRUE IN OUT FALSE";
21
22 public static String register(Matcher mtr, ModuleInfo mi, Database db) {
23 String temp = null;
24
25 temp = mtr.group();
26 if (db.hasMacro(temp)) { // only changed macros registered, because the database of macro has only changed ones
27 if (!unmacro.contains(temp)) {
28 mi.hashnonlocalmacro.add(temp);
29 }
30 return temp;
31 }
32 return null;
33 }
34 }