X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=Tools%2FSource%2FMigrationTools%2Forg%2Ftianocore%2Fmigration%2FFunc.java;h=1858066840a5cf34dbacbc0abf6cb7d2b1354490;hb=0e9d14c4e7c0373272dbbf258aa269886f27852d;hp=843995a7084588536cfd0e41a2341880116cfbeb;hpb=0dc8c5893276cf6638727060d31bca322eba2805;p=mirror_edk2.git diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/Func.java b/Tools/Source/MigrationTools/org/tianocore/migration/Func.java index 843995a708..1858066840 100644 --- a/Tools/Source/MigrationTools/org/tianocore/migration/Func.java +++ b/Tools/Source/MigrationTools/org/tianocore/migration/Func.java @@ -1,51 +1,63 @@ +/** @file + + Copyright (c) 2006, Intel Corporation + All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + + **/ package org.tianocore.migration; import java.util.regex.*; public class Func { - Func(String r8func,String r8lib,String r9func,String r9lib) { - r8funcname = r8func; - r8libname = r8lib; - r9funcname = r9func; - r9libname = r9lib; - } - Func(String[] linecontext) { - r8funcname = linecontext[1]; - r8libname = linecontext[0]; - r9funcname = linecontext[2]; - r9libname = linecontext[3]; - } - public String r8funcname; - public String r8libname; - public String r9funcname; - public String r9libname; + Func(String r8func,String r8lib,String r9func,String r9lib) { + r8funcname = r8func; + r8libname = r8lib; + r9funcname = r9func; + r9libname = r9lib; + } + Func(String[] linecontext) { + r8funcname = linecontext[1]; + r8libname = linecontext[0]; + r9funcname = linecontext[2]; + r9libname = linecontext[3]; + } + public String r8funcname; + public String r8libname; + public String r9funcname; + public String r9libname; - public static Pattern ptnbrace = Pattern.compile("\\{[^\\{\\}]*\\}",Pattern.MULTILINE); - public static Pattern ptnfuncc = Pattern.compile("([a-zA-Z_]\\w*)\\s*\\([^\\)\\(]*\\)",Pattern.MULTILINE); - public static Pattern ptnfuncd = Pattern.compile("([a-zA-Z_]\\w*)\\s*\\([^\\)\\(]*\\)\\s*@",Pattern.MULTILINE); - public static Pattern ptnlowcase = Pattern.compile("[a-z]"); // must be removed - - private static String reservedwords = "if for pack while switch return sizeof"; - - public static String register(Matcher mtr, ModuleInfo mi, Database db) { - String temp = null; + public static Pattern ptnbrace = Pattern.compile("\\{[^\\{\\}]*\\}",Pattern.MULTILINE); + public static Pattern ptnfuncc = Pattern.compile("(?)([a-zA-Z_]\\w*)\\s*\\(",Pattern.MULTILINE); + public static Pattern ptnfuncd = Pattern.compile("([a-zA-Z_]\\w*)\\s*\\([^\\)\\(]*\\)\\s*@",Pattern.MULTILINE); + public static Pattern ptnlowcase = Pattern.compile("[a-z]"); // must be removed + + private static String reservedwords = "if for pack while switch return sizeof"; + + public static String register(Matcher mtr, ModuleInfo mi, Database db) { + String temp = null; - temp = mtr.group(1); // both changed and not changed funcc are registered , for finding all the non-local function calls - Matcher mtrlowcase = ptnlowcase.matcher(temp); // must be removed , so the two funcs can be merged - if (!reservedwords.contains(temp) && mtrlowcase.find()) { - mi.hashfuncc.add(temp); - } - return temp; - } - /* - public static String registerFuncD(Matcher mtr, ModuleInfo mi, Database db) { - String temp = null; + temp = mtr.group(1); // both changed and not changed funcc are registered , for finding all the non-local function calls + Matcher mtrlowcase = ptnlowcase.matcher(temp); // must be removed , so the two funcs can be merged + if (!reservedwords.contains(temp) && mtrlowcase.find()) { + mi.hashfuncc.add(temp); + } + return temp; + } + /* + public static String registerFuncD(Matcher mtr, ModuleInfo mi, Database db) { + String temp = null; - temp = mtr.group(1); // both changed and not changed funcd are registered , for finding all the non-local function calls - if (!reservedwords.contains(temp)) { - mi.hashfuncd.add(temp); - } - return temp; - } - */ + temp = mtr.group(1); // both changed and not changed funcd are registered , for finding all the non-local function calls + if (!reservedwords.contains(temp)) { + mi.hashfuncd.add(temp); + } + return temp; + } + */ }