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