]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Java/Source/MigrationTools/org/tianocore/migration/Macro.java
Coding Style
[mirror_edk2.git] / Tools / Java / Source / MigrationTools / org / tianocore / migration / Macro.java
CommitLineData
b0282412 1/** @file\r
2 \r
3 Copyright (c) 2006, Intel Corporation\r
4 All rights reserved. This program and the accompanying materials\r
5 are licensed and made available under the terms and conditions of the BSD License\r
6 which accompanies this distribution. The full text of the license may be found at\r
7 http://opensource.org/licenses/bsd-license.php\r
8 \r
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11 \r
12 **/\r
0dc8c589 13package org.tianocore.migration;\r
14\r
71f30e51 15import java.util.regex.Matcher;\r
16import java.util.regex.Pattern;\r
0dc8c589 17\r
18public class Macro {\r
71f30e51 19 Macro(String r8, String r9) {\r
20 r8name = r8;\r
21 r9name = r9;\r
22 }\r
23\r
24 Macro(String[] linecontext) {\r
25 r8name = linecontext[0];\r
26 r9name = linecontext[1];\r
27 }\r
28\r
29 public String r8name;\r
30\r
31 public String r9name;\r
32\r
33 public static Pattern ptntmacro = Pattern.compile("\\b\\w(\\w|\\d)*",\r
34 Pattern.MULTILINE);\r
35\r
36 private static String unmacro = "VOID UINTN BOOLEAN ASSERT OPTIONAL STATIC NULL TRUE IN OUT FALSE";\r
37\r
38 public static String register(Matcher mtr, ModuleInfo mi, Database db) {\r
39 String temp = null;\r
40\r
41 temp = mtr.group();\r
42 mi.hashmacro.add(temp);\r
43 if (MigrationTool.db.hasMacro(temp)) { // only changed macros\r
44 // registered, because the\r
45 // database of macro has only\r
46 // changed ones\r
47 if (!unmacro.contains(temp)) {\r
48 mi.hashnonlocalmacro.add(temp);\r
49 }\r
50 return temp;\r
51 }\r
52 return null;\r
53 }\r
0dc8c589 54}