From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868385901477.1642675601198; Fri, 27 Apr 2018 15:33:05 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A6D102034C8C9; Fri, 27 Apr 2018 15:33:01 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 135872034C8BC for ; Fri, 27 Apr 2018 15:33:00 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:32:59 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252773" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:15 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 01/42] BaseTools: FdfParser - update to remove duplicate constant value X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" PCD size by type is shared so this change both removes duplication and makes the function work for all numeric PCD types. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/GenFds/FdfParser.py | 29 ++++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source= /Python/GenFds/FdfParser.py index 25755a9778f2..80ff3ece43b4 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -1134,21 +1134,20 @@ class FdfParser: =20 @staticmethod def __Verify(Name, Value, Scope): - if Scope in [TAB_UINT64, TAB_UINT8]: - ValueNumber =3D 0 - try: - ValueNumber =3D int (Value, 0) - except: - EdkLogger.error("FdfParser", FORMAT_INVALID, "The value is= not valid dec or hex number for %s." % Name) - if ValueNumber < 0: - EdkLogger.error("FdfParser", FORMAT_INVALID, "The value ca= n't be set to negative value for %s." % Name) - if Scope =3D=3D TAB_UINT64: - if ValueNumber >=3D 0x10000000000000000: - EdkLogger.error("FdfParser", FORMAT_INVALID, "Too larg= e value for %s." % Name) - if Scope =3D=3D TAB_UINT8: - if ValueNumber >=3D 0x100: - EdkLogger.error("FdfParser", FORMAT_INVALID, "Too larg= e value for %s." % Name) - return True + # value verification only applies to numeric values. + if scope not in TAB_PCD_NUMERIC_TYPES: + return + + ValueNumber =3D 0 + try: + ValueNumber =3D int(Value, 0) + except: + EdkLogger.error("FdfParser", FORMAT_INVALID, "The value is not= valid dec or hex number for %s." % Name) + if ValueNumber < 0: + EdkLogger.error("FdfParser", FORMAT_INVALID, "The value can't = be set to negative value for %s." % Name) + if ValueNumber > MAX_VAL_TYPE[Scope]: + EdkLogger.error("FdfParser", FORMAT_INVALID, "Too large value = for %s." % Name) + return True =20 ## __UndoToken() method # --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868387421908.8921857121547; Fri, 27 Apr 2018 15:33:07 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D5FB72034C8CD; Fri, 27 Apr 2018 15:33:01 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 384B22034C8AD for ; Fri, 27 Apr 2018 15:33:00 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:32:59 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252776" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:16 -0700 Message-Id: <03f3498178d3c8b40db39063af8df431401e1076.1524868033.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 02/42] BaseTools: AutoGen - update to remove duplicate constant value X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" PCD size by type is shared. just use it. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py | 13 ++++------= --- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py b/B= aseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py index df7a9b889aa4..602c90b3fe08 100644 --- a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py +++ b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py @@ -250,16 +250,11 @@ class VAR_CHECK_PCD_VALID_OBJ(object): self.data =3D set() self.ValidData =3D True self.updateStorageWidth() + def updateStorageWidth(self): - if self.PcdDataType =3D=3D TAB_UINT8 or self.PcdDataType =3D=3D "B= OOLEAN": - self.StorageWidth =3D 1 - elif self.PcdDataType =3D=3D TAB_UINT16: - self.StorageWidth =3D 2 - elif self.PcdDataType =3D=3D TAB_UINT32: - self.StorageWidth =3D 4 - elif self.PcdDataType =3D=3D TAB_UINT64: - self.StorageWidth =3D 8 - else: + try: + self.StorageWidth =3D int(MAX_SIZE_TYPE[self.PcdDataType]) + except: self.StorageWidth =3D 0 self.ValidData =3D False =20 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868390421265.3671780786866; Fri, 27 Apr 2018 15:33:10 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0D18321F2E16E; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5CFFC2034C8BC for ; Fri, 27 Apr 2018 15:33:00 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:32:59 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252779" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:17 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 03/42] BaseTools: check before accessing members in __eq__ X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" minimize risk for exceptions. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py | 5 +---- BaseTools/Source/Python/build/build.py | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py b/B= aseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py index 602c90b3fe08..1328dddf1a10 100644 --- a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py +++ b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py @@ -259,10 +259,7 @@ class VAR_CHECK_PCD_VALID_OBJ(object): self.ValidData =3D False =20 def __eq__(self, validObj): =20 - if self.VarOffset =3D=3D validObj.VarOffset: - return True - else: - return False + return validObj and self.VarOffset =3D=3D validObj.VarOffset =20 class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OBJ): def __init__(self, VarOffset, validlist, PcdDataType): diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/build/build.py index 36bb1fecf7e5..1c26e72feb6b 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -377,7 +377,8 @@ class BuildUnit: # @param Other The other BuildUnit object compared to # def __eq__(self, Other): - return Other is not None and self.BuildObject =3D=3D Other.BuildOb= ject \ + return Other and self.BuildObject =3D=3D Other.BuildObject \ + and Other.BuildObject \ and self.BuildObject.Arch =3D=3D Other.BuildObject.Arch =20 ## hash() method --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868393660264.73169602115263; Fri, 27 Apr 2018 15:33:13 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 37BA32034C8D6; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 81C2B2034C8AD for ; Fri, 27 Apr 2018 15:33:00 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:32:59 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252782" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:18 -0700 Message-Id: <98cd3e6cd3fbf10fbd1748c0c0ad7d056e511508.1524868033.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 04/42] BaseTools: this function has no purpose. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" it looks like a old POC of the concepts then used to make the classes in the file. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py | 17 ----------= ------- 1 file changed, 17 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py b/B= aseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py index 1328dddf1a10..dd78dc520075 100644 --- a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py +++ b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py @@ -324,20 +324,3 @@ class VAR_VALID_OBJECT_FACTORY(object): return VAR_CHECK_PCD_VALID_LIST(VarOffset, PcdClass.validlists= , PcdClass.DatumType) else: return None - -if __name__ =3D=3D "__main__": - class TestObj(object): - def __init__(self, number1): - self.number_1 =3D number1 - def __eq__(self, testobj): - if self.number_1 =3D=3D testobj.number_1: - return True - else: - return False - test1 =3D TestObj(1) - test2 =3D TestObj(2) - =20 - testarr =3D [test1, test2] - print TestObj(2) in testarr - print TestObj(2) =3D=3D test2 - =20 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868398951399.6881739453727; Fri, 27 Apr 2018 15:33:18 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 652032034C8DA; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9D0072034C8BD for ; Fri, 27 Apr 2018 15:33:00 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:00 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252785" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:19 -0700 Message-Id: <46338d013d52598c94f5fb831068cffaa745c661.1524868033.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 05/42] BaseTools: AutoGen - refactor assemble_variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" make this function @staticmethod since self parameter is not used. change valuelist to valuedict since it is a dictionary. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenVar.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/P= ython/AutoGen/GenVar.py index 13bcf99b2627..b8f40da9a39c 100644 --- a/BaseTools/Source/Python/AutoGen/GenVar.py +++ b/BaseTools/Source/Python/AutoGen/GenVar.py @@ -113,9 +113,10 @@ class VariableMgr(object): indexedvarinfo[key] =3D [var_info(n.pcdindex,n.pcdname,n.defa= ultstoragename,n.skuname,n.var_name, n.var_guid, "0x00",n.var_attribute,new= valuestr , newvaluestr , DataType.TAB_VOID)] self.VarInfo =3D [item[0] for item in indexedvarinfo.values()] =20 - def assemble_variable(self, valuelist): - ordered_offset =3D sorted(valuelist.keys()) - ordered_value =3D [valuelist[k] for k in ordered_offset] + @staticmethod + def assemble_variable(valuedict): + ordered_offset =3D sorted(valuedict.keys()) + ordered_value =3D [valuedict[k] for k in ordered_offset] var_value =3D [] num =3D 0 for offset in ordered_offset: @@ -126,6 +127,7 @@ class VariableMgr(object): var_value +=3D ordered_value[num] num +=3D1 return var_value + def process_variable_data(self): =20 var_data =3D collections.defaultdict(collections.OrderedDict) --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868400238391.4954451784346; Fri, 27 Apr 2018 15:33:20 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8FA0C2034C8DF; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C2FFC2034C8AD for ; Fri, 27 Apr 2018 15:33:00 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:00 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252788" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:20 -0700 Message-Id: <946ee586375bd5e490e59fa98a2357e7e068ec68.1524868033.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 06/42] BaseTools: AutoGen - refactor dictionary access X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" dont use dict.get() inside loops of dictionary contents. its not needed. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenVar.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/P= ython/AutoGen/GenVar.py index b8f40da9a39c..b9517d84c690 100644 --- a/BaseTools/Source/Python/AutoGen/GenVar.py +++ b/BaseTools/Source/Python/AutoGen/GenVar.py @@ -144,7 +144,7 @@ class VariableMgr(object): default_data_buffer =3D "" others_data_buffer =3D "" tail =3D None - default_sku_default =3D indexedvarinfo.get(index).get((DataTyp= e.TAB_DEFAULT,DataType.TAB_DEFAULT_STORES_DEFAULT)) + default_sku_default =3D indexedvarinfo[index].get((DataType.TA= B_DEFAULT,DataType.TAB_DEFAULT_STORES_DEFAULT)) =20 if default_sku_default.data_type not in DataType.TAB_PCD_NUMER= IC_TYPES: var_max_len =3D max([len(var_item.default_value.split(",")= ) for var_item in sku_var_info.values()]) @@ -159,11 +159,11 @@ class VariableMgr(object): =20 var_data[(DataType.TAB_DEFAULT,DataType.TAB_DEFAULT_STORES_DEF= AULT)][index] =3D (default_data_buffer,sku_var_info[(DataType.TAB_DEFAULT,D= ataType.TAB_DEFAULT_STORES_DEFAULT)]) =20 - for (skuid,defaultstoragename) in indexedvarinfo.get(index): + for (skuid,defaultstoragename) in indexedvarinfo[index]: tail =3D None if (skuid,defaultstoragename) =3D=3D (DataType.TAB_DEFAULT= ,DataType.TAB_DEFAULT_STORES_DEFAULT): continue - other_sku_other =3D indexedvarinfo.get(index).get((skuid,d= efaultstoragename)) + other_sku_other =3D indexedvarinfo[index][(skuid,defaultst= oragename)] =20 if default_sku_default.data_type not in DataType.TAB_PCD_N= UMERIC_TYPES: if len(other_sku_other.default_value.split(",")) < var= _max_len: @@ -220,7 +220,7 @@ class VariableMgr(object): for skuname,defaultstore in var_data: if (skuname,defaultstore) =3D=3D (DataType.TAB_DEFAULT,DataTyp= e.TAB_DEFAULT_STORES_DEFAULT): continue - pcds_sku_data =3D var_data.get((skuname,defaultstore)) + pcds_sku_data =3D var_data[(skuname,defaultstore)] delta_data_set =3D [] for pcdindex in pcds_sku_data: offset =3D var_data_offset[pcdindex] --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 152486840312299.07435038025699; Fri, 27 Apr 2018 15:33:23 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C5903203B8C90; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D457E2034C8BC for ; Fri, 27 Apr 2018 15:33:00 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:00 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252791" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:21 -0700 Message-Id: <8dbe25ca00dae2502b89467a1e2efd47f6069d59.1524868033.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 07/42] BaseTools: AutoGen - GenVar refactor static methods X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" change methods which do not use self to @staticmethod change their calls to use class name instead of instance Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenVar.py | 61 ++++++++++++-------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/P= ython/AutoGen/GenVar.py index b9517d84c690..9d226d0f4567 100644 --- a/BaseTools/Source/Python/AutoGen/GenVar.py +++ b/BaseTools/Source/Python/AutoGen/GenVar.py @@ -71,7 +71,7 @@ class VariableMgr(object): if not self.NVHeaderBuff: return "" self.NVHeaderBuff =3D self.NVHeaderBuff[:8] + pack("=3DQ",maxsize) - default_var_bin =3D self.format_data(self.NVHeaderBuff + self.VarD= efaultBuff + self.VarDeltaBuff) + default_var_bin =3D VariableMgr.format_data(self.NVHeaderBuff + se= lf.VarDefaultBuff + self.VarDeltaBuff) value_str =3D "{" default_var_bin_strip =3D [ data.strip("""'""") for data in defaul= t_var_bin] value_str +=3D ",".join(default_var_bin_strip) @@ -106,7 +106,7 @@ class VariableMgr(object): value_list +=3D [hex(unpack("B",data_byte)[0])] newvalue[int(item.var_offset,16) if item.var_offset.upper(= ).startswith("0X") else int(item.var_offset)] =3D value_list try: - newvaluestr =3D "{" + ",".join(self.assemble_variable(newv= alue)) +"}" + newvaluestr =3D "{" + ",".join(VariableMgr.assemble_variab= le(newvalue)) +"}" except: EdkLogger.error("build", AUTOGEN_ERROR, "Variable offset c= onflict in PCDs: %s \n" % (" and ".join([item.pcdname for item in sku_var_i= nfo_offset_list]))) n =3D sku_var_info_offset_list[0] @@ -151,7 +151,7 @@ class VariableMgr(object): if len(default_sku_default.default_value.split(",")) < var= _max_len: tail =3D ",".join([ "0x00" for i in range(var_max_len-= len(default_sku_default.default_value.split(",")))]) =20 - default_data_buffer =3D self.PACK_VARIABLES_DATA(default_sku_d= efault.default_value,default_sku_default.data_type,tail) + default_data_buffer =3D VariableMgr.PACK_VARIABLES_DATA(defaul= t_sku_default.default_value,default_sku_default.data_type,tail) =20 default_data_array =3D () for item in default_data_buffer: @@ -169,13 +169,13 @@ class VariableMgr(object): if len(other_sku_other.default_value.split(",")) < var= _max_len: tail =3D ",".join([ "0x00" for i in range(var_max_= len-len(other_sku_other.default_value.split(",")))]) =20 - others_data_buffer =3D self.PACK_VARIABLES_DATA(other_sku_= other.default_value,other_sku_other.data_type,tail) + others_data_buffer =3D VariableMgr.PACK_VARIABLES_DATA(oth= er_sku_other.default_value,other_sku_other.data_type,tail) =20 others_data_array =3D () for item in others_data_buffer: others_data_array +=3D unpack("B",item) =20 - data_delta =3D self.calculate_delta(default_data_array, ot= hers_data_array) + data_delta =3D VariableMgr.calculate_delta(default_data_ar= ray, others_data_array) =20 var_data[(skuid,defaultstoragename)][index] =3D (data_delt= a,sku_var_info[(skuid,defaultstoragename)]) return var_data @@ -193,7 +193,7 @@ class VariableMgr(object): var_data_offset =3D collections.OrderedDict() offset =3D NvStorageHeaderSize for default_data,default_info in pcds_default_data.values(): - var_name_buffer =3D self.PACK_VARIABLE_NAME(default_info.var_n= ame) + var_name_buffer =3D VariableMgr.PACK_VARIABLE_NAME(default_inf= o.var_name) =20 vendorguid =3D default_info.var_guid.split('-') =20 @@ -202,19 +202,19 @@ class VariableMgr(object): else: var_attr_value =3D 0x07 =20 - DataBuffer =3D self.AlignData(var_name_buffer + default_data) + DataBuffer =3D VariableMgr.AlignData(var_name_buffer + default= _data) =20 data_size =3D len(DataBuffer) offset +=3D VariableHeaderSize + len(default_info.var_name.spl= it(",")) var_data_offset[default_info.pcdindex] =3D offset offset +=3D data_size - len(default_info.var_name.split(",")) =20 - var_header_buffer =3D self.PACK_VARIABLE_HEADER(var_attr_value= , len(default_info.var_name.split(",")), len (default_data), vendorguid) + var_header_buffer =3D VariableMgr.PACK_VARIABLE_HEADER(var_att= r_value, len(default_info.var_name.split(",")), len (default_data), vendorg= uid) NvStoreDataBuffer +=3D (var_header_buffer + DataBuffer) =20 - variable_storage_header_buffer =3D self.PACK_VARIABLE_STORE_HEADER= (len(NvStoreDataBuffer) + 28) + variable_storage_header_buffer =3D VariableMgr.PACK_VARIABLE_STORE= _HEADER(len(NvStoreDataBuffer) + 28) =20 - nv_default_part =3D self.AlignData(self.PACK_DEFAULT_DATA(0, 0, se= lf.unpack_data(variable_storage_header_buffer+NvStoreDataBuffer)), 8) + nv_default_part =3D VariableMgr.AlignData(VariableMgr.PACK_DEFAULT= _DATA(0, 0, VariableMgr.unpack_data(variable_storage_header_buffer+NvStoreD= ataBuffer)), 8) =20 data_delta_structure_buffer =3D "" for skuname,defaultstore in var_data: @@ -228,29 +228,31 @@ class VariableMgr(object): delta_data =3D [(item[0] + offset, item[1]) for item in de= lta_data] delta_data_set.extend(delta_data) =20 - data_delta_structure_buffer +=3D self.AlignData(self.PACK_DELT= A_DATA(skuname,defaultstore,delta_data_set), 8) + data_delta_structure_buffer +=3D VariableMgr.AlignData(self.PA= CK_DELTA_DATA(skuname,defaultstore,delta_data_set), 8) =20 size =3D len(nv_default_part + data_delta_structure_buffer) + 16 maxsize =3D self.VpdRegionSize if self.VpdRegionSize else size - NV_Store_Default_Header =3D self.PACK_NV_STORE_DEFAULT_HEADER(size= ,maxsize) + NV_Store_Default_Header =3D VariableMgr.PACK_NV_STORE_DEFAULT_HEAD= ER(size,maxsize) =20 self.NVHeaderBuff =3D NV_Store_Default_Header self.VarDefaultBuff =3Dnv_default_part self.VarDeltaBuff =3D data_delta_structure_buffer - return self.format_data(NV_Store_Default_Header + nv_default_part = + data_delta_structure_buffer) + return VariableMgr.format_data(NV_Store_Default_Header + nv_defaul= t_part + data_delta_structure_buffer) =20 =20 - def format_data(self,data): + @staticmethod + def format_data(data): + return [hex(item) for item in VariableMgr.unpack_data(data)] =20 - return [hex(item) for item in self.unpack_data(data)] - - def unpack_data(self,data): + @staticmethod + def unpack_data(data): final_data =3D () for item in data: final_data +=3D unpack("B",item) return final_data =20 - def calculate_delta(self, default, theother): + @staticmethod + def calculate_delta(default, theother): if len(default) - len(theother) !=3D 0: EdkLogger.error("build", FORMAT_INVALID, 'The variable data le= ngth is not the same for the same PCD.') data_delta =3D [] @@ -270,7 +272,8 @@ class VariableMgr(object): return value_str return "" =20 - def PACK_VARIABLE_STORE_HEADER(self,size): + @staticmethod + def PACK_VARIABLE_STORE_HEADER(size): #Signature: gEfiVariableGuid Guid =3D "{ 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, = 0x70, 0x7f, 0xfe, 0x7d }}" Guid =3D GuidStructureStringToGuidString(Guid) @@ -284,7 +287,8 @@ class VariableMgr(object): =20 return GuidBuffer + SizeBuffer + FormatBuffer + StateBuffer + rese= rvedBuffer =20 - def PACK_NV_STORE_DEFAULT_HEADER(self,size,maxsize): + @staticmethod + def PACK_NV_STORE_DEFAULT_HEADER(size,maxsize): Signature =3D pack('=3DB',ord('N')) Signature +=3D pack("=3DB",ord('S')) Signature +=3D pack("=3DB",ord('D')) @@ -295,7 +299,8 @@ class VariableMgr(object): =20 return Signature + SizeBuffer + MaxSizeBuffer =20 - def PACK_VARIABLE_HEADER(self,attribute,namesize,datasize,vendorguid): + @staticmethod + def PACK_VARIABLE_HEADER(attribute,namesize,datasize,vendorguid): =20 Buffer =3D pack('=3DH',0x55AA) # pack StartID Buffer +=3D pack('=3DB',0x3F) # pack State @@ -309,7 +314,8 @@ class VariableMgr(object): =20 return Buffer =20 - def PACK_VARIABLES_DATA(self, var_value,data_type, tail =3D None): + @staticmethod + def PACK_VARIABLES_DATA(var_value,data_type, tail =3D None): Buffer =3D "" data_len =3D 0 if data_type =3D=3D DataType.TAB_VOID: @@ -338,7 +344,8 @@ class VariableMgr(object): =20 return Buffer =20 - def PACK_DEFAULT_DATA(self, defaultstoragename,skuid,var_value): + @staticmethod + def PACK_DEFAULT_DATA(defaultstoragename,skuid,var_value): Buffer =3D "" Buffer +=3D pack("=3DL",4+8+8) Buffer +=3D pack("=3DQ",int(skuid)) @@ -355,10 +362,12 @@ class VariableMgr(object): if skuname not in self.SkuIdMap: return None return self.SkuIdMap.get(skuname)[0] + def GetDefaultStoreId(self,dname): if dname not in self.DefaultStoreMap: return None return self.DefaultStoreMap.get(dname)[0] + def PACK_DELTA_DATA(self,skuname,defaultstoragename,delta_list): skuid =3D self.GetSkuId(skuname) defaultstorageid =3D self.GetDefaultStoreId(defaultstoragename) @@ -374,7 +383,8 @@ class VariableMgr(object): =20 return Buffer =20 - def AlignData(self,data, align =3D 4): + @staticmethod + def AlignData(data, align =3D 4): mybuffer =3D data if (len(data) % align) > 0: for i in range(align - (len(data) % align)): @@ -382,7 +392,8 @@ class VariableMgr(object): =20 return mybuffer =20 - def PACK_VARIABLE_NAME(self, var_name): + @staticmethod + def PACK_VARIABLE_NAME(var_name): Buffer =3D "" for name_char in var_name.strip("{").strip("}").split(","): Buffer +=3D pack("=3DB",int(name_char,16)) --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868415975428.0030578367382; Fri, 27 Apr 2018 15:33:35 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 74AAB203B9251; Fri, 27 Apr 2018 15:33:06 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 23F5C2034C8BC for ; Fri, 27 Apr 2018 15:33:00 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:00 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252795" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:22 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 08/42] BaseTools: AutoGen - share StripComments API X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" add the API root in one class file. delete the static API out of both classes. share it in the single location. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/IdfClassObject.py | 19 ++----------- BaseTools/Source/Python/AutoGen/UniClassObject.py | 29 ++++++++++---------- 2 files changed, 16 insertions(+), 32 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/IdfClassObject.py b/BaseTools/= Source/Python/AutoGen/IdfClassObject.py index 6953854a5247..82396d3744d5 100644 --- a/BaseTools/Source/Python/AutoGen/IdfClassObject.py +++ b/BaseTools/Source/Python/AutoGen/IdfClassObject.py @@ -22,6 +22,7 @@ from Common.LongFilePathSupport import LongFilePath import re import os from Common.GlobalData import gIdentifierPattern +from UniClassObject import StripComments =20 IMAGE_TOKEN =3D re.compile('IMAGE_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE= | re.UNICODE) =20 @@ -91,7 +92,7 @@ class IdfFileClassObject(object): ImageFileList =3D [] for Line in FileIn.splitlines(): Line =3D Line.strip() - Line =3D self.StripComments(Line) + Line =3D StripComments(Line) if len(Line) =3D=3D 0: continue =20 @@ -121,22 +122,6 @@ class IdfFileClassObject(object): if ImageFileList: self.ImageFilesDict[File] =3D ImageFileList =20 - def StripComments(self, Line): - Comment =3D '//' - CommentPos =3D Line.find(Comment) - while CommentPos >=3D 0: - # if there are non matched quotes before the comment header - # then we are in the middle of a string - # but we need to ignore the escaped quotes and backslashes. - if ((Line.count('"', 0, CommentPos) - Line.count('\\"', 0, Com= mentPos)) & 1) =3D=3D 1: - CommentPos =3D Line.find (Comment, CommentPos + 1) - else: - return Line[:CommentPos].strip() - return Line.strip() - - def ImageDecoder(self, File): - pass - def SearchImageID(ImageFileObject, FileList): if FileList =3D=3D []: return ImageFileObject diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/= Source/Python/AutoGen/UniClassObject.py index 5b879d784d9c..4e16afec5c28 100644 --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py @@ -218,6 +218,19 @@ class StringDefClassObject(object): self.StringValueByteList =3D UniToHexList(self.StringValue) self.Length =3D len(self.StringValueByteList) =20 +def StripComments(Line): + Comment =3D u'//' + CommentPos =3D Line.find(Comment) + while CommentPos >=3D 0: + # if there are non matched quotes before the comment header + # then we are in the middle of a string + # but we need to ignore the escaped quotes and backslashes. + if ((Line.count(u'"', 0, CommentPos) - Line.count(u'\\"', 0, Comme= ntPos)) & 1) =3D=3D 1: + CommentPos =3D Line.find (Comment, CommentPos + 1) + else: + return Line[:CommentPos].strip() + return Line.strip() + ## UniFileClassObject # # A structure for .uni file definition @@ -371,20 +384,6 @@ class UniFileClassObject(object): FileName =3D Item[Item.find(u'#include ') + len(u'#include ') :Ite= m.find(u' ', len(u'#include '))][1:-1] self.LoadUniFile(FileName) =20 - def StripComments(self, Line): - Comment =3D u'//' - CommentPos =3D Line.find(Comment) - while CommentPos >=3D 0: - # if there are non matched quotes before the comment header - # then we are in the middle of a string - # but we need to ignore the escaped quotes and backslashes. - if ((Line.count(u'"', 0, CommentPos) - Line.count(u'\\"', 0, C= ommentPos)) & 1) =3D=3D 1: - CommentPos =3D Line.find (Comment, CommentPos + 1) - else: - return Line[:CommentPos].strip() - return Line.strip() - =20 - # # Pre-process before parse .uni file # @@ -406,7 +405,7 @@ class UniFileClassObject(object): for Line in FileIn: Line =3D Line.strip() Line =3D Line.replace(u'\\\\', BACK_SLASH_PLACEHOLDER) - Line =3D self.StripComments(Line) + Line =3D StripComments(Line) =20 # # Ignore empty line --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868406658994.0830513011795; Fri, 27 Apr 2018 15:33:26 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id F0D5422742A8C; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E6DBD2034C8BD for ; Fri, 27 Apr 2018 15:33:00 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:00 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252797" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:23 -0700 Message-Id: <755feb575a1c2453e37ce80cbe7d9db8d126db6e.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 09/42] BaseTools: AutoGen - refactor class factory X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" since instances are not added to cache, the factory does nothing. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/BuildEngine.py | 23 ++++---------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Sou= rce/Python/AutoGen/BuildEngine.py index bbd1a4d5b257..2c823797d7c5 100644 --- a/BaseTools/Source/Python/AutoGen/BuildEngine.py +++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py @@ -47,21 +47,10 @@ def ListFileMacro(FileType): return "%s_LIST" % FileListMacro(FileType) =20 class TargetDescBlock(object): - _Cache_ =3D {} # {TargetFile : TargetDescBlock object} + def __init__(self, Inputs, Outputs, Commands, Dependencies): + self.InitWorker(Inputs, Outputs, Commands, Dependencies) =20 - # Factory method - def __new__(Class, Inputs, Outputs, Commands, Dependencies): - if Outputs[0] in Class._Cache_: - Tdb =3D Class._Cache_[Outputs[0]] - for File in Inputs: - Tdb.AddInput(File) - else: - Tdb =3D super(TargetDescBlock, Class).__new__(Class) - Tdb._Init(Inputs, Outputs, Commands, Dependencies) - #Class._Cache_[Outputs[0]] =3D Tdb - return Tdb - - def _Init(self, Inputs, Outputs, Commands, Dependencies): + def InitWorker(self, Inputs, Outputs, Commands, Dependencies): self.Inputs =3D Inputs self.Outputs =3D Outputs self.Commands =3D Commands @@ -90,10 +79,6 @@ class TargetDescBlock(object): def IsMultipleInput(self): return len(self.Inputs) > 1 =20 - @staticmethod - def Renew(): - TargetDescBlock._Cache_ =3D {} - ## Class for one build rule # # This represents a build rule which can give out corresponding command li= st for @@ -278,7 +263,7 @@ class FileBuildRule: # Command line should be regenerated since some ma= cros are different # CommandList =3D self._BuildCommand(BuildRulePlaceh= olderDict) - TargetDesc._Init([SourceFile], DstFile, CommandLis= t, self.ExtraSourceFileList) + TargetDesc.InitWorker([SourceFile], DstFile, Comma= ndList, self.ExtraSourceFileList) break else: TargetDesc.AddInput(SourceFile) --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868409835648.9094568857028; Fri, 27 Apr 2018 15:33:29 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2624B2034C8D1; Fri, 27 Apr 2018 15:33:06 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0545E2034C8BF for ; Fri, 27 Apr 2018 15:33:00 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:00 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252800" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:24 -0700 Message-Id: <5b02e90e7a5baeb6f44f5dc87138ac6ea49ab252.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 10/42] BaseTools: Eot - remove unused lists X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/Eot/EotGlobalData.py | 29 -------------------- 1 file changed, 29 deletions(-) diff --git a/BaseTools/Source/Python/Eot/EotGlobalData.py b/BaseTools/Sourc= e/Python/Eot/EotGlobalData.py index 7689b76da9d6..da224a7ee3e3 100644 --- a/BaseTools/Source/Python/Eot/EotGlobalData.py +++ b/BaseTools/Source/Python/Eot/EotGlobalData.py @@ -104,32 +104,3 @@ gConsumedProtocolLibrary['EfiHandleProtocol'] =3D 1 # Dict for callback PROTOCOL function callling gCallbackProtocolLibrary =3D OrderedDict() gCallbackProtocolLibrary['EfiRegisterProtocolCallback'] =3D 2 - -# Dict for ARCH PROTOCOL -gArchProtocols =3D ['gEfiBdsArchProtocolGuid', - 'gEfiCapsuleArchProtocolGuid', - 'gEfiCpuArchProtocolGuid', #5053697e-2cbc-4819-90d9-058= 0deee5754 - 'gEfiMetronomeArchProtocolGuid', - 'gEfiMonotonicCounterArchProtocolGuid', - 'gEfiRealTimeClockArchProtocolGuid', - 'gEfiResetArchProtocolGuid', - 'gEfiRuntimeArchProtocolGuid', - 'gEfiSecurityArchProtocolGuid', - 'gEfiStatusCodeRuntimeProtocolGuid', - 'gEfiTimerArchProtocolGuid', - 'gEfiVariableArchProtocolGuid', - 'gEfiVariableWriteArchProtocolGuid', - 'gEfiWatchdogTimerArchProtocolGuid'] -gArchProtocolGuids =3D ['665e3ff6-46cc-11d4-9a38-0090273fc14d', - '26baccb1-6f42-11d4-bce7-0080c73c8881', - '26baccb2-6f42-11d4-bce7-0080c73c8881', - '1da97072-bddc-4b30-99f1-72a0b56fff2a', - '27cfac87-46cc-11d4-9a38-0090273fc14d', - '27cfac88-46cc-11d4-9a38-0090273fc14d', - 'b7dfb4e1-052f-449f-87be-9818fc91b733', - 'a46423e3-4617-49f1-b9ff-d1bfa9115839', - 'd2b2b828-0826-48a7-b3df-983c006024f0', - '26baccb3-6f42-11d4-bce7-0080c73c8881', - '1e5668e2-8481-11d4-bcf1-0080c73c8881', - '6441f818-6362-4e44-b570-7dba31dd2453', - '665e3ff5-46cc-11d4-9a38-0090273fc14d'] --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868412839508.1314791365651; Fri, 27 Apr 2018 15:33:32 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 4DFF522839318; Fri, 27 Apr 2018 15:33:06 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 183A02034C8AD for ; Fri, 27 Apr 2018 15:33:01 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:00 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252804" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:25 -0700 Message-Id: <73b2e80325aaaadcf3a2d14fda64feaac7594263.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 11/42] BaseTools: Eot - refactor global data X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" remove unused lists, dicts, and duplicate variables Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/Eot/Eot.py | 5 ----- BaseTools/Source/Python/Eot/EotGlobalData.py | 12 ------------ 2 files changed, 17 deletions(-) diff --git a/BaseTools/Source/Python/Eot/Eot.py b/BaseTools/Source/Python/E= ot/Eot.py index 15de822d69c2..fcde8fd3e22f 100644 --- a/BaseTools/Source/Python/Eot/Eot.py +++ b/BaseTools/Source/Python/Eot/Eot.py @@ -302,9 +302,6 @@ class Eot(object): EotGlobalData.gINF_FILES =3D mFileList EotGlobalData.gOP_INF.close() =20 - EotGlobalData.gDEC_FILES =3D mDecFileList - - ## GenerateReport() method # # Generate final HTML report @@ -393,8 +390,6 @@ class Eot(object): SqlCommand =3D """select DISTINCT GuidValue, ItemType from Report = where ModuleID =3D -2 and ItemMode =3D 'Produced'""" RecordSet =3D EotGlobalData.gDb.TblReport.Exec(SqlCommand) for Record in RecordSet: - if Record[1] =3D=3D 'Ppi': - EotGlobalData.gPpiList[Record[0].lower()] =3D -2 if Record[1] =3D=3D 'Protocol': EotGlobalData.gProtocolList[Record[0].lower()] =3D -2 =20 diff --git a/BaseTools/Source/Python/Eot/EotGlobalData.py b/BaseTools/Sourc= e/Python/Eot/EotGlobalData.py index da224a7ee3e3..a9f51189c1eb 100644 --- a/BaseTools/Source/Python/Eot/EotGlobalData.py +++ b/BaseTools/Source/Python/Eot/EotGlobalData.py @@ -36,11 +36,6 @@ gMACRO['EDK_SOURCE'] =3D gEDK_SOURCE gMACRO['SHELL_INF'] =3D gSHELL_INF gMACRO['CAPSULE_INF'] =3D '' =20 -gNOT_FOUND_FILES =3D [] -gSOURCE_FILES =3D [] -gINF_FILES =3D {} -gDEC_FILES =3D [] - # Log file for unmatched variables gUN_MATCHED_LOG =3D 'Log_UnMatched.log' gOP_UN_MATCHED =3D open(gUN_MATCHED_LOG, 'w+') @@ -61,10 +56,6 @@ gOP_UN_MATCHED_IN_LIBRARY_CALLING =3D open(gUN_MATCHED_I= N_LIBRARY_CALLING_LOG, 'w+ gDISPATCH_ORDER_LOG =3D 'Log_DispatchOrder.log' gOP_DISPATCH_ORDER =3D open(gDISPATCH_ORDER_LOG, 'w+') =20 -# Log file for source files not found -gUN_FOUND_FILES =3D 'Log_UnFoundSourceFiles.log' -gOP_UN_FOUND_FILES =3D open(gUN_FOUND_FILES, 'w+') - # Log file for found source files gSOURCE_FILES =3D 'Log_SourceFiles.log' gOP_SOURCE_FILES =3D open(gSOURCE_FILES, 'w+') @@ -72,9 +63,6 @@ gOP_SOURCE_FILES =3D open(gSOURCE_FILES, 'w+') # Dict for GUID found in DEC files gGuidDict =3D dict() =20 -# Dict for PPI -gPpiList =3D {} - # Dict for PROTOCOL gProtocolList =3D {} =20 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868423009157.0079690709341; Fri, 27 Apr 2018 15:33:43 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C0C52203B9259; Fri, 27 Apr 2018 15:33:06 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 489CB2034C8C9 for ; Fri, 27 Apr 2018 15:33:01 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:00 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252803" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:26 -0700 Message-Id: <7c674b4b926f3c4408377976860a3cb73f8137df.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 12/42] BaseTools: AutoGen - remove global line X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" this serves no purpose since we dont change the global or assign to it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/UniClassObject.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/= Source/Python/AutoGen/UniClassObject.py index 4e16afec5c28..aa97f19e55b4 100644 --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py @@ -118,8 +118,6 @@ LangConvTable =3D {'eng':'en', 'fra':'fr', \ # @retval LangName: Valid lanugage code in RFC 4646 format or None # def GetLanguageCode(LangName, IsCompatibleMode, File): - global LangConvTable - length =3D len(LangName) if IsCompatibleMode: if length =3D=3D 3 and LangName.isalpha(): --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868427058796.1527014128326; Fri, 27 Apr 2018 15:33:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E9660203B925D; Fri, 27 Apr 2018 15:33:06 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 63A8D2034C8AD for ; Fri, 27 Apr 2018 15:33:01 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:00 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252807" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:27 -0700 Message-Id: <859e0069bcf632a0993dbb8b868138ecddf0711b.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 13/42] BaseTools: AutoGen - UniClassObject refactor static methods X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" change methods which do not use self to @staticmethod change their calls to use class name instead of instance Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/UniClassObject.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/= Source/Python/AutoGen/UniClassObject.py index aa97f19e55b4..54b6fb22a08a 100644 --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py @@ -253,7 +253,7 @@ class UniFileClassObject(object): Lang =3D distutils.util.split_quoted((Line.split(u"//")[0])) if len(Lang) !=3D 3: try: - FileIn =3D self.OpenUniFile(LongFilePath(File.Path)) + FileIn =3D UniFileClassObject.OpenUniFile(LongFilePath(Fil= e.Path)) except UnicodeError, X: EdkLogger.error("build", FILE_READ_FAILURE, "File read fai= lure: %s" % str(X), ExtraData=3DFile); except: @@ -297,7 +297,8 @@ class UniFileClassObject(object): self.OrderedStringDict[LangName][Item.StringName] =3D = len(self.OrderedStringList[LangName]) - 1 return True =20 - def OpenUniFile(self, FileName): + @staticmethod + def OpenUniFile(FileName): # # Read file # @@ -316,14 +317,15 @@ class UniFileClassObject(object): FileIn.startswith(codecs.BOM_UTF16_LE)): Encoding =3D 'utf-16' =20 - self.VerifyUcs2Data(FileIn, FileName, Encoding) + UniFileClassObject.VerifyUcs2Data(FileIn, FileName, Encoding) =20 UniFile =3D StringIO.StringIO(FileIn) Info =3D codecs.lookup(Encoding) (Reader, Writer) =3D (Info.streamreader, Info.streamwriter) return codecs.StreamReaderWriter(UniFile, Reader, Writer) =20 - def VerifyUcs2Data(self, FileIn, FileName, Encoding): + @staticmethod + def VerifyUcs2Data(FileIn, FileName, Encoding): Ucs2Info =3D codecs.lookup('ucs-2') # # Convert to unicode @@ -390,7 +392,7 @@ class UniFileClassObject(object): EdkLogger.error("Unicode File Parser", FILE_NOT_FOUND, ExtraDa= ta=3DFile.Path) =20 try: - FileIn =3D self.OpenUniFile(LongFilePath(File.Path)) + FileIn =3D UniFileClassObject.OpenUniFile(LongFilePath(File.Pa= th)) except UnicodeError, X: EdkLogger.error("build", FILE_READ_FAILURE, "File read failure= : %s" % str(X), ExtraData=3DFile.Path); except: --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868419204789.7205312086951; Fri, 27 Apr 2018 15:33:39 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9C211203B9255; Fri, 27 Apr 2018 15:33:06 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 29F4C2034C8C2 for ; Fri, 27 Apr 2018 15:33:01 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:00 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252810" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:28 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 14/42] BaseTools: refactor to use list not dict X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" since we never access the values in the copied dict, just use a list instea= d. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/Common/ToolDefClassObject.py | 5 +++-- BaseTools/Source/Python/GenFds/GenFds.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/Common/ToolDefClassObject.py b/BaseToo= ls/Source/Python/Common/ToolDefClassObject.py index 73ebdaf6b179..49b24ef780c7 100644 --- a/BaseTools/Source/Python/Common/ToolDefClassObject.py +++ b/BaseTools/Source/Python/Common/ToolDefClassObject.py @@ -92,7 +92,9 @@ class ToolDefClassObject(object): =20 KeyList =3D [TAB_TOD_DEFINES_TARGET, TAB_TOD_DEFINES_TOOL_CHAIN_TA= G, TAB_TOD_DEFINES_TARGET_ARCH, TAB_TOD_DEFINES_COMMAND_TYPE] for Index in range(3, -1, -1): - for Key in dict(self.ToolsDefTxtDictionary): + # make a copy of the keys to enumerate over to prevent issues = when=20 + # adding/removing items from the original dict. + for Key in list(self.ToolsDefTxtDictionary.keys()): List =3D Key.split('_') if List[Index] =3D=3D '*': for String in self.ToolsDefTxtDatabase[KeyList[Index]]: @@ -100,7 +102,6 @@ class ToolDefClassObject(object): NewKey =3D '%s_%s_%s_%s_%s' % tuple(List) if NewKey not in self.ToolsDefTxtDictionary: self.ToolsDefTxtDictionary[NewKey] =3D self.To= olsDefTxtDictionary[Key] - continue del self.ToolsDefTxtDictionary[Key] elif List[Index] not in self.ToolsDefTxtDatabase[KeyList[I= ndex]]: del self.ToolsDefTxtDictionary[Key] diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Py= thon/GenFds/GenFds.py index 54c7d828305f..74017e72629b 100644 --- a/BaseTools/Source/Python/GenFds/GenFds.py +++ b/BaseTools/Source/Python/GenFds/GenFds.py @@ -428,7 +428,7 @@ def FindExtendTool(KeyStringList, CurrentArchList, Name= Guid): if BuildOption: ToolList =3D [TAB_TOD_DEFINES_TARGET, TAB_TOD_DEFINES_TOOL_CHA= IN_TAG, TAB_TOD_DEFINES_TARGET_ARCH] for Index in range(2, -1, -1): - for Key in dict(BuildOption): + for Key in list(BuildOption.keys()): List =3D Key.split('_') if List[Index] =3D=3D '*': for String in ToolDb[ToolList[Index]]: --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868431082445.6491631833376; Fri, 27 Apr 2018 15:33:51 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1EA51203B9261; Fri, 27 Apr 2018 15:33:07 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CA18B2034C8AD for ; Fri, 27 Apr 2018 15:33:01 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:00 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252813" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:29 -0700 Message-Id: <5f046290b899f0898657c0fe4d5ccd352576ceb7.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 15/42] BaseTools: eliminate {} from dictionary contructor call X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" no need to construct 2 dictionaries. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/Workspace/BuildClassObject.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTo= ols/Source/Python/Workspace/BuildClassObject.py index 226277a45130..8b3e2ec29973 100644 --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py @@ -123,16 +123,16 @@ class StructurePcd(PcdClassObject): self.StructuredPcdIncludeFile =3D [] if StructuredPcdIncludeFile i= s None else StructuredPcdIncludeFile self.PackageDecs =3D Packages self.DefaultStoreName =3D [default_store] - self.DefaultValues =3D collections.OrderedDict({}) + self.DefaultValues =3D collections.OrderedDict() self.PcdMode =3D None - self.SkuOverrideValues =3D collections.OrderedDict({}) + self.SkuOverrideValues =3D collections.OrderedDict() self.FlexibleFieldName =3D None self.StructName =3D None self.PcdDefineLineNo =3D 0 self.PkgPath =3D "" self.DefaultValueFromDec =3D "" self.ValueChain =3D dict() - self.PcdFieldValueFromComm =3D collections.OrderedDict({}) + self.PcdFieldValueFromComm =3D collections.OrderedDict() def __repr__(self): return self.TypeName =20 @@ -146,9 +146,9 @@ class StructurePcd(PcdClassObject): self.DefaultValueFromDec =3D DefaultValue def AddOverrideValue (self, FieldName, Value, SkuName, DefaultStoreNam= e, FileName=3D"", LineNo=3D0): if SkuName not in self.SkuOverrideValues: - self.SkuOverrideValues[SkuName] =3D collections.OrderedDict({}) + self.SkuOverrideValues[SkuName] =3D collections.OrderedDict() if DefaultStoreName not in self.SkuOverrideValues[SkuName]: - self.SkuOverrideValues[SkuName][DefaultStoreName] =3D collecti= ons.OrderedDict({}) + self.SkuOverrideValues[SkuName][DefaultStoreName] =3D collecti= ons.OrderedDict() if FieldName in self.SkuOverrideValues[SkuName][DefaultStoreName]: del self.SkuOverrideValues[SkuName][DefaultStoreName][FieldNam= e] self.SkuOverrideValues[SkuName][DefaultStoreName][FieldName] =3D [= Value.strip(), FileName, LineNo] --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 152486843938080.84933213046168; Fri, 27 Apr 2018 15:33:59 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7125D203B926B; Fri, 27 Apr 2018 15:33:07 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 07E142034C8D1 for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:01 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252816" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:30 -0700 Message-Id: <88c297e88633960b485fc01f711bd1b69ccfe9c3.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 16/42] BaseTools: remove Compound statements X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" split them into 2 seperate lines. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/Workspace/BuildClassObject.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTo= ols/Source/Python/Workspace/BuildClassObject.py index 8b3e2ec29973..6ca3cd9da22b 100644 --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py @@ -114,11 +114,16 @@ class PcdClassObject(object): =20 class StructurePcd(PcdClassObject): def __init__(self, StructuredPcdIncludeFile=3DNone, Packages=3DNone, N= ame=3DNone, Guid=3DNone, Type=3DNone, DatumType=3DNone, Value=3DNone, Token= =3DNone, MaxDatumSize=3DNone, SkuInfoList=3DNone, IsOverrided=3DFalse, Guid= Value=3DNone, validateranges=3DNone, validlists=3DNone, expressions=3DNone,= default_store =3D TAB_DEFAULT_STORES_DEFAULT): - if SkuInfoList is None: SkuInfoList=3D{} - if validateranges is None: validateranges=3D[] - if validlists is None: validlists=3D[] - if expressions is None : expressions=3D[] - if Packages is None : Packages =3D [] + if SkuInfoList is None: + SkuInfoList =3D {} + if validateranges is None: + validateranges =3D [] + if validlists is None: + validlists =3D [] + if expressions is None: + expressions =3D [] + if Packages is None: + Packages =3D [] super(StructurePcd, self).__init__(Name, Guid, Type, DatumType, Va= lue, Token, MaxDatumSize, SkuInfoList, IsOverrided, GuidValue, validaterang= es, validlists, expressions) self.StructuredPcdIncludeFile =3D [] if StructuredPcdIncludeFile i= s None else StructuredPcdIncludeFile self.PackageDecs =3D Packages --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868435298855.4012541212098; Fri, 27 Apr 2018 15:33:55 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 47ECA203B9266; Fri, 27 Apr 2018 15:33:07 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F2C972034C8CF for ; Fri, 27 Apr 2018 15:33:01 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:01 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252819" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:31 -0700 Message-Id: <73926a857dd8caa9a4129909cbf8516056d10abb.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 17/42] BaseTools: Workspace - refactor a dict X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" change a dict to a set since we never examine the contents, just the keys. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/Workspace/BuildClassObject.py | 2 +- BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTo= ols/Source/Python/Workspace/BuildClassObject.py index 6ca3cd9da22b..258905e80f25 100644 --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py @@ -136,7 +136,7 @@ class StructurePcd(PcdClassObject): self.PcdDefineLineNo =3D 0 self.PkgPath =3D "" self.DefaultValueFromDec =3D "" - self.ValueChain =3D dict() + self.ValueChain =3D set() self.PcdFieldValueFromComm =3D collections.OrderedDict() def __repr__(self): return self.TypeName diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 335267ebc576..8ebac8957a1b 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1347,7 +1347,7 @@ class DscBuildData(PlatformBuildClassObject): nextskuid =3D self.SkuIdMgr.GetNextSkuId(nextskuid) stru_pcd.SkuOverrideValues[skuid] =3D copy.deepcopy(st= ru_pcd.SkuOverrideValues[nextskuid]) if not NoDefault else copy.deepcopy({d= efaultstorename: stru_pcd.DefaultValues for defaultstorename in DefaultStor= es} if DefaultStores else {TAB_DEFAULT_STORES_DEFAULT:stru_pcd.DefaultValue= s}) if not NoDefault: - stru_pcd.ValueChain[(skuid,'')]=3D (nextskuid,'') + stru_pcd.ValueChain.add(skuid,'') if stru_pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_= HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]: for skuid in SkuIds: nextskuid =3D skuid @@ -1366,7 +1366,7 @@ class DscBuildData(PlatformBuildClassObject): for defaultstoreid in DefaultStores: if defaultstoreid not in stru_pcd.SkuOverrideValue= s[skuid]: stru_pcd.SkuOverrideValues[skuid][defaultstore= id] =3D copy.deepcopy(stru_pcd.SkuOverrideValues[nextskuid][mindefaultstore= name]) - stru_pcd.ValueChain[(skuid,defaultstoreid)]=3D= (nextskuid,mindefaultstorename) + stru_pcd.ValueChain.add(skuid,defaultstoreid) S_pcd_set =3D DscBuildData.OverrideByFdfComm(S_pcd_set) Str_Pcd_Values =3D self.GenerateByteArrayValue(S_pcd_set) if Str_Pcd_Values: --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868446942676.6499485596006; Fri, 27 Apr 2018 15:34:06 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BF337203B9274; Fri, 27 Apr 2018 15:33:07 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2E85C2034C8D4 for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:01 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252823" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:32 -0700 Message-Id: <83ae42f0dd824c7d13678fe465f628b03257b2bd.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 18/42] BaseTools: move PCD size calculation functions to PcdClassObject X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" move both GetPcdMaxSize and GetPcdSize to the PcdClassObject. fix MAX_SIZE_TYPE to have int values Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenC.py | 37 ++++------= ---------- BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py | 2 +- BaseTools/Source/Python/Common/DataType.py | 2 +- BaseTools/Source/Python/Common/VpdInfoFile.py | 2 +- BaseTools/Source/Python/Workspace/BuildClassObject.py | 30 ++++++++++= ++++++ BaseTools/Source/Python/Workspace/DscBuildData.py | 19 +--------- 6 files changed, 40 insertions(+), 52 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Pyt= hon/AutoGen/GenC.py index 73d7699ad01b..4e7e3d90be64 100644 --- a/BaseTools/Source/Python/AutoGen/GenC.py +++ b/BaseTools/Source/Python/AutoGen/GenC.py @@ -868,31 +868,6 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH): % (RealTokenCName, RealTokenCName, Rea= lTokenCName, RealTokenCName)) TokenCNameList.add(TokenCName) =20 -def GetPcdSize(Pcd): - if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES: - Value =3D Pcd.DefaultValue - if Value in [None, '']: - return 1 - elif Value[0] =3D=3D 'L': - return (len(Value) - 2) * 2 - elif Value[0] =3D=3D '{': - return len(Value.split(',')) - else: - return len(Value) - 1 - if Pcd.DatumType =3D=3D TAB_UINT64: - return 8 - if Pcd.DatumType =3D=3D TAB_UINT32: - return 4 - if Pcd.DatumType =3D=3D TAB_UINT16: - return 2 - if Pcd.DatumType =3D=3D TAB_UINT8: - return 1 - if Pcd.DatumType =3D=3D 'BOOLEAN': - return 1 - else: - return Pcd.MaxDatumSize - - ## Create code for module PCDs # # @param Info The ModuleAutoGen object @@ -1115,7 +1090,7 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd= ): "The maximum size of VOID* type PCD '%= s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuidCName, T= okenCName), ExtraData=3D"[%s]" % str(Info)) else: - ArraySize =3D GetPcdSize(Pcd) + ArraySize =3D Pcd.GetPcdSize() if Unicode: ArraySize =3D ArraySize / 2 Value =3D NewValue + '0 }' @@ -1155,7 +1130,7 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd= ): AutoGenH.Append('extern %s UINT8 %s%s;\n' %(Const, PcdVari= ableName, Array)) AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, PcdV= ariableName)) =20 - PcdDataSize =3D GetPcdSize(Pcd) + PcdDataSize =3D Pcd.GetPcdSize() if Pcd.Type =3D=3D TAB_PCDS_FIXED_AT_BUILD: AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenName, = PcdDataSize)) AutoGenH.Append('#define %s %s \n' % (GetModeSizeName,Fix= PcdSizeTokenName)) @@ -1172,14 +1147,14 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, P= cd): AutoGenH.Append('extern volatile %s %s %s%s;\n' % (Const, Pc= d.DatumType, PcdVariableName, Array)) AutoGenH.Append('#define %s %s%s\n' % (GetModeName, Type, Pcd= VariableName)) =20 - PcdDataSize =3D GetPcdSize(Pcd) + PcdDataSize =3D Pcd.GetPcdSize() AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, Pc= dDataSize)) =20 AutoGenH.Append('#define %s %s \n' % (GetModeSizeName,PatchPc= dSizeVariableName)) AutoGenH.Append('extern UINTN %s; \n' % PatchPcdSizeVariableNa= me) AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED UINTN %s =3D %s= ;\n' % (PatchPcdSizeVariableName,PcdDataSize)) else: - PcdDataSize =3D GetPcdSize(Pcd) + PcdDataSize =3D Pcd.GetPcdSize() AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenName, PcdD= ataSize)) AutoGenH.Append('#define %s %s \n' % (GetModeSizeName,FixPcdS= izeTokenName)) =20 @@ -1338,7 +1313,7 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pc= d): else: AutoGenH.Append('extern volatile %s %s%s;\n' % (DatumType, P= cdVariableName, Array)) AutoGenH.Append('#define %s %s_gPcd_BinaryPatch_%s\n' %(GetModeNa= me, Type, TokenCName)) - PcdDataSize =3D GetPcdSize(Pcd) + PcdDataSize =3D Pcd.GetPcdSize() if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES: AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatchPcd= SetPtrAndSize((VOID *)_gPcd_BinaryPatch_%s, &%s, %s, (SizeOfBuffer), (Buffe= r))\n' % (SetModeName, TokenCName, PatchPcdSizeVariableName, PatchPcdMaxSiz= eVariable)) AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatchPcd= SetPtrAndSizeS((VOID *)_gPcd_BinaryPatch_%s, &%s, %s, (SizeOfBuffer), (Buff= er))\n' % (SetModeStatusName, TokenCName, PatchPcdSizeVariableName, PatchPc= dMaxSizeVariable)) @@ -1372,7 +1347,7 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pc= d): AutoGenH.Append('#define _PCD_VALUE_%s %s%s\n' %(TokenCNam= e, Type, PcdVariableName)) else: AutoGenH.Append('#define _PCD_VALUE_%s %s\n' %(TokenCName,= Pcd.DefaultValue)) - PcdDataSize =3D GetPcdSize(Pcd) + PcdDataSize =3D Pcd.GetPcdSize() if PcdItemType =3D=3D TAB_PCDS_FIXED_AT_BUILD: if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES: if ConstFixedPcd: diff --git a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py b/B= aseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py index dd78dc520075..2f8f4fac23f8 100644 --- a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py +++ b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py @@ -253,7 +253,7 @@ class VAR_CHECK_PCD_VALID_OBJ(object): =20 def updateStorageWidth(self): try: - self.StorageWidth =3D int(MAX_SIZE_TYPE[self.PcdDataType]) + self.StorageWidth =3D MAX_SIZE_TYPE[self.PcdDataType] except: self.StorageWidth =3D 0 self.ValidData =3D False diff --git a/BaseTools/Source/Python/Common/DataType.py b/BaseTools/Source/= Python/Common/DataType.py index 20f31ce4b72f..8af94354620c 100644 --- a/BaseTools/Source/Python/Common/DataType.py +++ b/BaseTools/Source/Python/Common/DataType.py @@ -278,7 +278,7 @@ TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST =3D [TAB_PCDS_= PATCHABLE_LOAD_FIX_ADDRESS_ ## The mapping dictionary from datum type to its maximum number. MAX_VAL_TYPE =3D {"BOOLEAN":0x01, TAB_UINT8:0xFF, TAB_UINT16:0xFFFF, TAB_U= INT32:0xFFFFFFFF, TAB_UINT64:0xFFFFFFFFFFFFFFFF} ## The mapping dictionary from datum type to size string. -MAX_SIZE_TYPE =3D {"BOOLEAN":"1", TAB_UINT8:"1", TAB_UINT16:"2", TAB_UINT3= 2:"4", TAB_UINT64:"8"} +MAX_SIZE_TYPE =3D {"BOOLEAN":1, TAB_UINT8:1, TAB_UINT16:2, TAB_UINT32:4, T= AB_UINT64:8} =20 TAB_DEPEX =3D 'Depex' TAB_DEPEX_COMMON =3D TAB_DEPEX + TAB_SPLIT + TAB_ARCH_COMMON diff --git a/BaseTools/Source/Python/Common/VpdInfoFile.py b/BaseTools/Sour= ce/Python/Common/VpdInfoFile.py index 155693740f12..32895deb5d0c 100644 --- a/BaseTools/Source/Python/Common/VpdInfoFile.py +++ b/BaseTools/Source/Python/Common/VpdInfoFile.py @@ -99,7 +99,7 @@ class VpdInfoFile: EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_IN= VALID,=20 "Invalid max datum size for VPD PCD %s.%s"= % (Vpd.TokenSpaceGuidCName, Vpd.TokenCName)) elif Vpd.DatumType in TAB_PCD_NUMERIC_TYPES:=20 - if Vpd.MaxDatumSize is None or Vpd.MaxDatumSize =3D=3D "": + if not Vpd.MaxDatumSize: Vpd.MaxDatumSize =3D MAX_SIZE_TYPE[Vpd.DatumType] else: if Vpd.MaxDatumSize <=3D 0: diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTo= ols/Source/Python/Workspace/BuildClassObject.py index 258905e80f25..52725e968226 100644 --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py @@ -72,6 +72,36 @@ class PcdClassObject(object): self.PcdValueFromComm =3D "" self.DefinitionPosition =3D ("","") =20 + ## Get the maximum number of bytes + def GetPcdMaxSize(self): + if self.DatumType in TAB_PCD_NUMERIC_TYPES: + return MAX_SIZE_TYPE[self.DatumType] + + MaxSize =3D int(self.MaxDatumSize,10) if self.MaxDatumSize else 0 + if self.PcdValueFromComm: + if self.PcdValueFromComm.startswith("{") and self.PcdValueFrom= Comm.endswith("}"): + return max([len(self.PcdValueFromComm.split(",")),MaxSize]) + elif self.PcdValueFromComm.startswith("\"") or self.PcdValueFr= omComm.startswith("\'"): + return max([len(self.PcdValueFromComm)-2+1,MaxSize]) + elif self.PcdValueFromComm.startswith("L\""): + return max([2*(len(self.PcdValueFromComm)-3+1),MaxSize]) + else: + return max([len(self.PcdValueFromComm),MaxSize]) + return MaxSize + + ## Get the number of bytes + def GetPcdSize(self): + if self.DatumType in TAB_PCD_NUMERIC_TYPES: + return MAX_SIZE_TYPE[self.DatumType] + if not self.DefaultValue: + return 1 + elif self.DefaultValue[0] =3D=3D 'L': + return (len(self.DefaultValue) - 2) * 2 + elif self.DefaultValue[0] =3D=3D '{': + return len(self.DefaultValue.split(',')) + else: + return len(self.DefaultValue) - 1 + ## Convert the class to a string # # Convert each member of the class to string diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 8ebac8957a1b..13a1ed886cc4 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1535,23 +1535,6 @@ class DscBuildData(PlatformBuildClassObject): Result =3D Result + '"' return Result =20 - @staticmethod - def GetPcdMaxSize(Pcd): - if Pcd.DatumType in TAB_PCD_NUMERIC_TYPES: - return MAX_SIZE_TYPE[Pcd.DatumType] - - MaxSize =3D int(Pcd.MaxDatumSize,10) if Pcd.MaxDatumSize else 0 - if Pcd.PcdValueFromComm: - if Pcd.PcdValueFromComm.startswith("{") and Pcd.PcdValueFromCo= mm.endswith("}"): - return max([len(Pcd.PcdValueFromComm.split(",")),MaxSize]) - elif Pcd.PcdValueFromComm.startswith("\"") or Pcd.PcdValueFrom= Comm.startswith("\'"): - return max([len(Pcd.PcdValueFromComm)-2+1,MaxSize]) - elif Pcd.PcdValueFromComm.startswith("L\""): - return max([2*(len(Pcd.PcdValueFromComm)-3+1),MaxSize]) - else: - return max([len(Pcd.PcdValueFromComm),MaxSize]) - return MaxSize - def GenerateSizeFunction(self,Pcd): CApp =3D "// Default Value in Dec \n" CApp =3D CApp + "void Cal_%s_%s_Size(UINT32 *Size){\n" % (Pcd.Toke= nSpaceGuidCName, Pcd.TokenCName) @@ -1634,7 +1617,7 @@ class DscBuildData(PlatformBuildClassObject): while '[' in FieldName: FieldName =3D FieldName.rsplit('[', 1)[0] CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, %d);= // From %s Line %d Value %s \n' % (Pcd.DatumType, FieldName.strip("."), Ar= rayIndex + 1, Pcd.PcdFieldValueFromComm[FieldName_ori][1], Pcd.PcdFieldValu= eFromComm[FieldName_ori][2], Pcd.PcdFieldValueFromComm[FieldName_ori][0]) - CApp =3D CApp + " *Size =3D (%d > *Size ? %d : *Size); // The Pcd= maxsize is %d \n" % (DscBuildData.GetPcdMaxSize(Pcd),DscBuildData.GetPcdMa= xSize(Pcd),DscBuildData.GetPcdMaxSize(Pcd)) + CApp =3D CApp + " *Size =3D (%d > *Size ? %d : *Size); // The Pcd= maxsize is %d \n" % (Pcd.GetPcdMaxSize(),Pcd.GetPcdMaxSize(),Pcd.GetPcdMax= Size()) CApp =3D CApp + "}\n" return CApp =20 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868455210445.8721172561303; Fri, 27 Apr 2018 15:34:15 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1AF96203B927E; Fri, 27 Apr 2018 15:33:08 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 51A372034C8CF for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:01 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252825" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:33 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 19/42] BaseTools: AutoGen - refactor out functions only called in __init__ X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py | 16 +---------= ------ 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py b/B= aseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py index 2f8f4fac23f8..0b4677b62a73 100644 --- a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py +++ b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py @@ -244,16 +244,12 @@ class VAR_CHECK_PCD_VALID_OBJ(object): self.Type =3D 1 self.Length =3D 0 # Length include this header self.VarOffset =3D VarOffset - self.StorageWidth =3D 0 self.PcdDataType =3D PcdDataType.strip() self.rawdata =3D data self.data =3D set() - self.ValidData =3D True - self.updateStorageWidth() - - def updateStorageWidth(self): try: self.StorageWidth =3D MAX_SIZE_TYPE[self.PcdDataType] + self.ValidData =3D True except: self.StorageWidth =3D 0 self.ValidData =3D False @@ -265,9 +261,6 @@ class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OBJ): def __init__(self, VarOffset, validlist, PcdDataType): super(VAR_CHECK_PCD_VALID_LIST, self).__init__(VarOffset, validlis= t, PcdDataType) self.Type =3D 1 - self.update_data() - self.update_size() - def update_data(self): valid_num_list =3D [] data_list =3D [] for item in self.rawdata: @@ -283,8 +276,6 @@ class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OBJ): =20 =20 self.data =3D set(data_list) - =20 - def update_size(self): self.Length =3D 5 + len(self.data) * self.StorageWidth =20 =20 @@ -292,9 +283,6 @@ class VAR_CHECK_PCD_VALID_RANGE(VAR_CHECK_PCD_VALID_OBJ= ): def __init__(self, VarOffset, validrange, PcdDataType): super(VAR_CHECK_PCD_VALID_RANGE, self).__init__(VarOffset, validra= nge, PcdDataType) self.Type =3D 2 - self.update_data() - self.update_size() - def update_data(self): RangeExpr =3D "" data_list =3D [] i =3D 0 @@ -308,8 +296,6 @@ class VAR_CHECK_PCD_VALID_RANGE(VAR_CHECK_PCD_VALID_OBJ= ): for obj in rangelist.pop(): data_list.append((obj.start, obj.end)) self.data =3D set(data_list) - =20 - def update_size(self): self.Length =3D 5 + len(self.data) * 2 * self.StorageWidth =20 =20 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868462644691.0945589058283; Fri, 27 Apr 2018 15:34:22 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6C74D203B8C8D; Fri, 27 Apr 2018 15:33:08 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 612362034C8D9 for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:01 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252828" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:34 -0700 Message-Id: <14850ee3abacd3c46d4acf973820f33630ffb703.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 20/42] BaseTools: AutoGen - refactor out a list X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" the lists were used in __init__ then converted to sets instead just use the sets from the begining Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py b/B= aseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py index 0b4677b62a73..b491b68f6e87 100644 --- a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py +++ b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py @@ -262,7 +262,6 @@ class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OBJ): super(VAR_CHECK_PCD_VALID_LIST, self).__init__(VarOffset, validlis= t, PcdDataType) self.Type =3D 1 valid_num_list =3D [] - data_list =3D [] for item in self.rawdata: valid_num_list.extend(item.split(',')) =20 @@ -270,12 +269,11 @@ class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OB= J): valid_num =3D valid_num.strip() =20 if valid_num.startswith('0x') or valid_num.startswith('0X'): - data_list.append(int(valid_num, 16)) + self.data.add(int(valid_num, 16)) else: - data_list.append(int(valid_num)) + self.data.add(int(valid_num)) =20 =20 - self.data =3D set(data_list) self.Length =3D 5 + len(self.data) * self.StorageWidth =20 =20 @@ -284,7 +282,6 @@ class VAR_CHECK_PCD_VALID_RANGE(VAR_CHECK_PCD_VALID_OBJ= ): super(VAR_CHECK_PCD_VALID_RANGE, self).__init__(VarOffset, validra= nge, PcdDataType) self.Type =3D 2 RangeExpr =3D "" - data_list =3D [] i =3D 0 for item in self.rawdata: if i =3D=3D 0: @@ -294,8 +291,7 @@ class VAR_CHECK_PCD_VALID_RANGE(VAR_CHECK_PCD_VALID_OBJ= ): range_result =3D RangeExpression(RangeExpr, self.PcdDataType)(True) for rangelist in range_result: for obj in rangelist.pop(): - data_list.append((obj.start, obj.end)) - self.data =3D set(data_list) + self.data.add((obj.start, obj.end)) self.Length =3D 5 + len(self.data) * 2 * self.StorageWidth =20 =20 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868442852427.3704134383895; Fri, 27 Apr 2018 15:34:02 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 98909203B9270; Fri, 27 Apr 2018 15:33:07 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2C03E2034C8D3 for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:01 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252831" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:35 -0700 Message-Id: <3e8d3fab346a9491d3b1e07747c70a4a67fd760d.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 21/42] BaseTools: AutoGen - refactor out a useless class X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" this class was never instantiated. the static function was called. save the function, remove the rest. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenPcdDb.py | 4 ++-- BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py | 18 +++++++---= -------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source= /Python/AutoGen/GenPcdDb.py index 39e3c6896441..f816ccaae311 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -16,7 +16,7 @@ from Common.String import StringToArray from struct import pack from ValidCheckingInfoObject import VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER from ValidCheckingInfoObject import VAR_CHECK_PCD_VARIABLE_TAB -from ValidCheckingInfoObject import VAR_VALID_OBJECT_FACTORY +from ValidCheckingInfoObject import GetValidationObject from Common.VariableAttributes import VariableAttributes import copy from struct import unpack @@ -1247,7 +1247,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): if Platform.Platform.VarCheckFlag: var_check_obj =3D VAR_CHECK_PCD_VARIABLE_TAB(VariableG= uidStructure, StringToArray(Sku.VariableName)) try: - var_check_obj.push_back(VAR_VALID_OBJECT_FACTORY.G= et_valid_object(Pcd, Sku.VariableOffset)) + var_check_obj.push_back(GetValidationObject(Pcd, S= ku.VariableOffset)) VarAttr, _ =3D VariableAttributes.GetVarAttributes= (Sku.VariableAttribute) var_check_obj.SetAttributes(VarAttr) var_check_obj.UpdateSize() diff --git a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py b/B= aseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py index b491b68f6e87..92c8fe2df904 100644 --- a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py +++ b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py @@ -295,14 +295,10 @@ class VAR_CHECK_PCD_VALID_RANGE(VAR_CHECK_PCD_VALID_O= BJ): self.Length =3D 5 + len(self.data) * 2 * self.StorageWidth =20 =20 -class VAR_VALID_OBJECT_FACTORY(object): - def __init__(self): - pass - @staticmethod - def Get_valid_object(PcdClass, VarOffset): - if PcdClass.validateranges: - return VAR_CHECK_PCD_VALID_RANGE(VarOffset, PcdClass.validater= anges, PcdClass.DatumType) - if PcdClass.validlists: - return VAR_CHECK_PCD_VALID_LIST(VarOffset, PcdClass.validlists= , PcdClass.DatumType) - else: - return None +def GetValidationObject(PcdClass, VarOffset): + if PcdClass.validateranges: + return VAR_CHECK_PCD_VALID_RANGE(VarOffset, PcdClass.validaterange= s, PcdClass.DatumType) + if PcdClass.validlists: + return VAR_CHECK_PCD_VALID_LIST(VarOffset, PcdClass.validlists, Pc= dClass.DatumType) + else: + return None --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868459153834.0171705296713; Fri, 27 Apr 2018 15:34:19 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 454B42034C8C6; Fri, 27 Apr 2018 15:33:08 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 79E5A2034C8D3 for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252834" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:36 -0700 Message-Id: <07d1d4b37f911bce66a8e6d630f5cadccf03947d.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 22/42] BaseTools: AutoGen - no need to recompute X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" looping over a list and recomputing the same value has no impact on final v= alue Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenPcdDb.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source= /Python/AutoGen/GenPcdDb.py index f816ccaae311..70c7db7ca7c4 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -301,8 +301,7 @@ class DbItemList: for ItemIndex in xrange(Index): Offset +=3D len(self.RawDataList[ItemIndex]) else: - for Datas in self.RawDataList: - Offset =3D self.ItemSize * Index + Offset =3D self.ItemSize * Index =20 return Offset =20 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868471223284.80313140829503; Fri, 27 Apr 2018 15:34:31 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C0A952279CF12; Fri, 27 Apr 2018 15:33:08 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 886242034C8DD for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252837" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:37 -0700 Message-Id: <416b1af9225e09c98e01c3c727506c0d20f1a406.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 23/42] BaseTools: refactor __init__ functions to not compute temporary variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" just assign correct value to member variable in __init__ or call parent __init__ Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenPcdDb.py | 37 ++++---------------- 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source= /Python/AutoGen/GenPcdDb.py index 70c7db7ca7c4..4929bcf899ae 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -282,13 +282,9 @@ def toHex(s): # class DbItemList: def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone): - if DataList is None: - DataList =3D [] - if RawDataList is None: - RawDataList =3D [] self.ItemSize =3D ItemSize - self.DataList =3D DataList - self.RawDataList =3D RawDataList + self.DataList =3D DataList if DataList else [] + self.RawDataList =3D RawDataList if RawDataList else [] self.ListSize =3D 0 =20 def GetInterOffset(self, Index): @@ -357,11 +353,8 @@ class DbItemList: # class DbExMapTblItemList (DbItemList): def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone): - if DataList is None: - DataList =3D [] - if RawDataList is None: - RawDataList =3D [] DbItemList.__init__(self, ItemSize, DataList, RawDataList) + def PackData(self): Buffer =3D '' PackStr =3D "=3DLHH" @@ -379,11 +372,8 @@ class DbExMapTblItemList (DbItemList): # class DbComItemList (DbItemList): def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone): - if DataList is None: - DataList =3D [] - if RawDataList is None: - RawDataList =3D [] DbItemList.__init__(self, ItemSize, DataList, RawDataList) + def GetInterOffset(self, Index): Offset =3D 0 if self.ItemSize =3D=3D 0: @@ -443,11 +433,8 @@ class DbComItemList (DbItemList): # class DbVariableTableItemList (DbComItemList): def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone): - if DataList is None: - DataList =3D [] - if RawDataList is None: - RawDataList =3D [] DbComItemList.__init__(self, ItemSize, DataList, RawDataList) + def PackData(self): PackStr =3D "=3DLLHHLHH" Buffer =3D '' @@ -465,10 +452,6 @@ class DbVariableTableItemList (DbComItemList): =20 class DbStringHeadTableItemList(DbItemList): def __init__(self,ItemSize,DataList=3DNone,RawDataList=3DNone): - if DataList is None: - DataList =3D [] - if RawDataList is None: - RawDataList =3D [] =20 DbItemList.__init__(self, ItemSize, DataList, RawDataList) =20 def GetInterOffset(self, Index): @@ -511,11 +494,8 @@ class DbStringHeadTableItemList(DbItemList): # class DbSkuHeadTableItemList (DbItemList): def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone): - if DataList is None: - DataList =3D [] - if RawDataList is None: - RawDataList =3D [] =20 DbItemList.__init__(self, ItemSize, DataList, RawDataList) + def PackData(self): PackStr =3D "=3DLL" Buffer =3D '' @@ -531,11 +511,8 @@ class DbSkuHeadTableItemList (DbItemList): # class DbSizeTableItemList (DbItemList): def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone): - if DataList is None: - DataList =3D [] - if RawDataList is None: - RawDataList =3D [] =20 DbItemList.__init__(self, ItemSize, DataList, RawDataList) + def GetListSize(self): length =3D 0 for Data in self.RawDataList: --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 152486845115870.88894137708542; Fri, 27 Apr 2018 15:34:11 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E49A6203B927A; Fri, 27 Apr 2018 15:33:07 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5840F2034C8D1 for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252840" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:38 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 24/42] BaseTools: AutoGen - remove function no one calls X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenPcdDb.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source= /Python/AutoGen/GenPcdDb.py index 4929bcf899ae..6398a077e53a 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -261,17 +261,6 @@ def PackGuid(GuidStructureValue): ) return Buffer =20 -def toHex(s): - lst =3D [] - for ch in s: - hv =3D hex(ord(ch)).replace('0x', ' ') - if len(hv) =3D=3D 1: - hv =3D '0'+hv - lst.append(hv) - if lst: - return reduce(lambda x,y:x+y, lst) - else: - return 'empty' ## DbItemList # # The class holds the Pcd database items. ItemSize if not zero should mat= ch the item datum type in the C structure.=20 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 15248684759031023.7801691305899; Fri, 27 Apr 2018 15:34:35 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EB8EF2283930E; Fri, 27 Apr 2018 15:33:08 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 982B92035214D for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252841" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:39 -0700 Message-Id: <5022df4df8e7548ec310a2ef335b15a0a1916348.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 25/42] BaseTools: AutoGen - move function to clean file namespace X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" the function is only used in one other function. just move it there. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenPcdDb.py | 52 ++++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source= /Python/AutoGen/GenPcdDb.py index 6398a077e53a..a6d2381cfd3f 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -235,32 +235,6 @@ ${PHASE}_PCD_DATABASE_INIT g${PHASE}PcdDbInit =3D { #endif """) =20 -## PackGuid -# -# Pack the GUID value in C structure format into data array -# -# @param GuidStructureValue: The GUID value in C structure format -# -# @retval Buffer: a data array contains the Guid -# -def PackGuid(GuidStructureValue): - GuidString =3D GuidStructureStringToGuidString(GuidStructureValue) - Guid =3D GuidString.split('-') - Buffer =3D pack('=3DLHHBBBBBBBB',=20 - int(Guid[0], 16),=20 - int(Guid[1], 16),=20 - int(Guid[2], 16),=20 - int(Guid[3][-4:-2], 16),=20 - int(Guid[3][-2:], 16), - int(Guid[4][-12:-10], 16), - int(Guid[4][-10:-8], 16), - int(Guid[4][-8:-6], 16), - int(Guid[4][-6:-4], 16), - int(Guid[4][-4:-2], 16), - int(Guid[4][-2:], 16) - ) - return Buffer - ## DbItemList # # The class holds the Pcd database items. ItemSize if not zero should mat= ch the item datum type in the C structure.=20 @@ -303,6 +277,32 @@ class DbItemList: return self.ListSize =20 def PackData(self): + ## PackGuid + # + # Pack the GUID value in C structure format into data array + # + # @param GuidStructureValue: The GUID value in C structure format + # + # @retval Buffer: a data array contains the Guid + # + def PackGuid(GuidStructureValue): + GuidString =3D GuidStructureStringToGuidString(GuidStructureVa= lue) + Guid =3D GuidString.split('-') + Buffer =3D pack('=3DLHHBBBBBBBB',=20 + int(Guid[0], 16),=20 + int(Guid[1], 16),=20 + int(Guid[2], 16),=20 + int(Guid[3][-4:-2], 16),=20 + int(Guid[3][-2:], 16), + int(Guid[4][-12:-10], 16), + int(Guid[4][-10:-8], 16), + int(Guid[4][-8:-6], 16), + int(Guid[4][-6:-4], 16), + int(Guid[4][-4:-2], 16), + int(Guid[4][-2:], 16) + ) + return Buffer + if self.ItemSize =3D=3D 8: PackStr =3D "=3DQ" elif self.ItemSize =3D=3D 4: --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868480670794.2905851878805; Fri, 27 Apr 2018 15:34:40 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1ECE1207DF443; Fri, 27 Apr 2018 15:33:09 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A672E2034C8CF for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252844" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:40 -0700 Message-Id: <4b83217e27aa99e56302c6acf00cdc2deb665fd8.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 26/42] BaseTools: AutoGen - remove another function no one calls X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenVar.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/P= ython/AutoGen/GenVar.py index 9d226d0f4567..4f894f3f73f3 100644 --- a/BaseTools/Source/Python/AutoGen/GenVar.py +++ b/BaseTools/Source/Python/AutoGen/GenVar.py @@ -26,11 +26,6 @@ var_info =3D collections.namedtuple("uefi_var", "pcdinde= x,pcdname,defaultstoragena NvStorageHeaderSize =3D 28 VariableHeaderSize =3D 32 =20 -def StringArrayToList(StringArray): - StringArray =3D StringArray[1:-1] - StringArray =3D '[' + StringArray + ']' - return eval(StringArray) - def PackGUID(Guid): GuidBuffer =3D pack('=3DLHHBBBBBBBB', int(Guid[0], 16), --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868466682925.0508827701105; Fri, 27 Apr 2018 15:34:26 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 98BFA2279CF07; Fri, 27 Apr 2018 15:33:08 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7E85E2034C8D4 for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252847" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:41 -0700 Message-Id: <94a5d3213e66e4113c0085eacdb36f616f667639.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 27/42] BaseTools: Refactor to share GUID packing function X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenPcdDb.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source= /Python/AutoGen/GenPcdDb.py index a6d2381cfd3f..9280eeee641c 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -21,6 +21,7 @@ from Common.VariableAttributes import VariableAttributes import copy from struct import unpack from Common.DataType import * +from GenVar import PackGUID =20 DATABASE_VERSION =3D 7 =20 @@ -287,21 +288,7 @@ class DbItemList: # def PackGuid(GuidStructureValue): GuidString =3D GuidStructureStringToGuidString(GuidStructureVa= lue) - Guid =3D GuidString.split('-') - Buffer =3D pack('=3DLHHBBBBBBBB',=20 - int(Guid[0], 16),=20 - int(Guid[1], 16),=20 - int(Guid[2], 16),=20 - int(Guid[3][-4:-2], 16),=20 - int(Guid[3][-2:], 16), - int(Guid[4][-12:-10], 16), - int(Guid[4][-10:-8], 16), - int(Guid[4][-8:-6], 16), - int(Guid[4][-6:-4], 16), - int(Guid[4][-4:-2], 16), - int(Guid[4][-2:], 16) - ) - return Buffer + return PackGUID(GuidString.split('-')) =20 if self.ItemSize =3D=3D 8: PackStr =3D "=3DQ" --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 15248684906341017.9346979000479; Fri, 27 Apr 2018 15:34:50 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 73C0B207DF44C; Fri, 27 Apr 2018 15:33:09 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B2FC5203B8C8D for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252850" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:42 -0700 Message-Id: <450162a4490ab9262000c994d1167696826e5082.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 28/42] BaseTools: AutoGen - refactor function to remove extra variables X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" we dont need to keep data we already have in different formats... Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenVar.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/P= ython/AutoGen/GenVar.py index 4f894f3f73f3..e3595bb62315 100644 --- a/BaseTools/Source/Python/AutoGen/GenVar.py +++ b/BaseTools/Source/Python/AutoGen/GenVar.py @@ -110,17 +110,14 @@ class VariableMgr(object): =20 @staticmethod def assemble_variable(valuedict): - ordered_offset =3D sorted(valuedict.keys()) - ordered_value =3D [valuedict[k] for k in ordered_offset] + ordered_valuedict_keys =3D sorted(valuedict.keys()) var_value =3D [] - num =3D 0 - for offset in ordered_offset: - if offset < len(var_value): + for current_valuedict_key in ordered_valuedict_keys: + if current_valuedict_key < len(var_value): raise - for _ in xrange(offset - len(var_value)): + for _ in xrange(current_valuedict_key - len(var_value)): var_value.append('0x00') - var_value +=3D ordered_value[num] - num +=3D1 + var_value +=3D valuedict[current_valuedict_key] return var_value =20 def process_variable_data(self): --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868500372895.0594421435555; Fri, 27 Apr 2018 15:35:00 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C57DB207DF456; Fri, 27 Apr 2018 15:33:09 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C269F203B8C8F for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252853" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:43 -0700 Message-Id: <3ed1f73d339ca5239155a8aa51f7fdbb97731dbd.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 29/42] BaseTools: AutoGen - refactor more functions only called in __init__ X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/IdfClassObject.py | 89 +++++++++----------- 1 file changed, 40 insertions(+), 49 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/IdfClassObject.py b/BaseTools/= Source/Python/AutoGen/IdfClassObject.py index 82396d3744d5..7bc4e4ffb57b 100644 --- a/BaseTools/Source/Python/AutoGen/IdfClassObject.py +++ b/BaseTools/Source/Python/AutoGen/IdfClassObject.py @@ -66,61 +66,52 @@ EFI_HII_PACKAGE_TYPE_SYSTEM_END =3D 0xFF =20 class IdfFileClassObject(object): def __init__(self, FileList =3D []): - self.FileList =3D FileList self.ImageFilesDict =3D {} self.ImageIDList =3D [] - if len(self.FileList) > 0: - self.LoadIdfFiles(FileList) + for File in FileList: + if File is None: + EdkLogger.error("Image Definition File Parser", PARSER_ERR= OR, 'No Image definition file is given.') + self.File =3D File =20 - def LoadIdfFiles(self, FileList): - if len(FileList) > 0: - for File in FileList: - self.LoadIdfFile(File) + try: + IdfFile =3D open(LongFilePath(File.Path), mode=3D'r') + FileIn =3D IdfFile.read() + IdfFile.close() + except: + EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=3DFi= le) =20 - def LoadIdfFile(self, File =3D None): - if File is None: - EdkLogger.error("Image Definition File Parser", PARSER_ERROR, = 'No Image definition file is given.') - self.File =3D File + ImageFileList =3D [] + for Line in FileIn.splitlines(): + Line =3D Line.strip() + Line =3D StripComments(Line) + if len(Line) =3D=3D 0: + continue =20 - try: - IdfFile =3D open(LongFilePath(File.Path), mode=3D'r') - FileIn =3D IdfFile.read() - IdfFile.close() - except: - EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=3DFile) + LineNo =3D GetLineNo(FileIn, Line, False) + if not Line.startswith('#image '): + EdkLogger.error("Image Definition File Parser", PARSER= _ERROR, 'The %s in Line %s of File %s is invalid.' % (Line, LineNo, File.Pa= th)) =20 - ImageFileList =3D [] - for Line in FileIn.splitlines(): - Line =3D Line.strip() - Line =3D StripComments(Line) - if len(Line) =3D=3D 0: - continue - - LineNo =3D GetLineNo(FileIn, Line, False) - if not Line.startswith('#image '): - EdkLogger.error("Image Definition File Parser", PARSER_ERR= OR, 'The %s in Line %s of File %s is invalid.' % (Line, LineNo, File.Path)) - - if Line.find('#image ') >=3D 0: - LineDetails =3D Line.split() - Len =3D len(LineDetails) - if Len !=3D 3 and Len !=3D 4: - EdkLogger.error("Image Definition File Parser", PARSER= _ERROR, 'The format is not match #image IMAGE_ID [TRANSPARENT] ImageFileNam= e in Line %s of File %s.' % (LineNo, File.Path)) - if Len =3D=3D 4 and LineDetails[2] !=3D 'TRANSPARENT': - EdkLogger.error("Image Definition File Parser", PARSER= _ERROR, 'Please use the keyword "TRANSPARENT" to describe the transparency = setting in Line %s of File %s.' % (LineNo, File.Path)) - MatchString =3D gIdentifierPattern.match(LineDetails[1]) - if MatchString is None: - EdkLogger.error('Image Definition File Parser', FORMA= T_INVALID, 'The Image token name %s defined in Idf file %s contains the inv= alid character.' % (LineDetails[1], File.Path)) - if LineDetails[1] not in self.ImageIDList: - self.ImageIDList.append(LineDetails[1]) - else: - EdkLogger.error("Image Definition File Parser", PARSER= _ERROR, 'The %s in Line %s of File %s is already defined.' % (LineDetails[1= ], LineNo, File.Path)) - if Len =3D=3D 4: - ImageFile =3D ImageFileObject(LineDetails[Len-1], Line= Details[1], True) - else: - ImageFile =3D ImageFileObject(LineDetails[Len-1], Line= Details[1], False) - ImageFileList.append(ImageFile) - if ImageFileList: - self.ImageFilesDict[File] =3D ImageFileList + if Line.find('#image ') >=3D 0: + LineDetails =3D Line.split() + Len =3D len(LineDetails) + if Len !=3D 3 and Len !=3D 4: + EdkLogger.error("Image Definition File Parser", PA= RSER_ERROR, 'The format is not match #image IMAGE_ID [TRANSPARENT] ImageFil= eName in Line %s of File %s.' % (LineNo, File.Path)) + if Len =3D=3D 4 and LineDetails[2] !=3D 'TRANSPARENT': + EdkLogger.error("Image Definition File Parser", PA= RSER_ERROR, 'Please use the keyword "TRANSPARENT" to describe the transpare= ncy setting in Line %s of File %s.' % (LineNo, File.Path)) + MatchString =3D gIdentifierPattern.match(LineDetails[1= ]) + if MatchString is None: + EdkLogger.error('Image Definition File Parser', F= ORMAT_INVALID, 'The Image token name %s defined in Idf file %s contains the= invalid character.' % (LineDetails[1], File.Path)) + if LineDetails[1] not in self.ImageIDList: + self.ImageIDList.append(LineDetails[1]) + else: + EdkLogger.error("Image Definition File Parser", PA= RSER_ERROR, 'The %s in Line %s of File %s is already defined.' % (LineDetai= ls[1], LineNo, File.Path)) + if Len =3D=3D 4: + ImageFile =3D ImageFileObject(LineDetails[Len-1], = LineDetails[1], True) + else: + ImageFile =3D ImageFileObject(LineDetails[Len-1], = LineDetails[1], False) + ImageFileList.append(ImageFile) + if ImageFileList: + self.ImageFilesDict[File] =3D ImageFileList =20 def SearchImageID(ImageFileObject, FileList): if FileList =3D=3D []: --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868505898241.62855988405227; Fri, 27 Apr 2018 15:35:05 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EDC41207DF45A; Fri, 27 Apr 2018 15:33:09 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E5A36203B8C92 for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252856" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:44 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 30/42] BaseTools: remove unused member variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/IdfClassObject.py | 1 - 1 file changed, 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/IdfClassObject.py b/BaseTools/= Source/Python/AutoGen/IdfClassObject.py index 7bc4e4ffb57b..769790d965b5 100644 --- a/BaseTools/Source/Python/AutoGen/IdfClassObject.py +++ b/BaseTools/Source/Python/AutoGen/IdfClassObject.py @@ -71,7 +71,6 @@ class IdfFileClassObject(object): for File in FileList: if File is None: EdkLogger.error("Image Definition File Parser", PARSER_ERR= OR, 'No Image definition file is given.') - self.File =3D File =20 try: IdfFile =3D open(LongFilePath(File.Path), mode=3D'r') --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868485545648.5876193720256; Fri, 27 Apr 2018 15:34:45 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 488E7207DF448; Fri, 27 Apr 2018 15:33:09 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AB7662034C8D1 for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252859" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:45 -0700 Message-Id: <87d59c492c18e2b3526403d0bdcdaba6f5b531c4.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 31/42] BaseTools: remove redundant content in InfSectionParser X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/InfSectionParser.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/InfSectionParser.py b/BaseTool= s/Source/Python/AutoGen/InfSectionParser.py index cf4e76159e81..2cd5a6667a02 100644 --- a/BaseTools/Source/Python/AutoGen/InfSectionParser.py +++ b/BaseTools/Source/Python/AutoGen/InfSectionParser.py @@ -26,7 +26,6 @@ class InfSectionParser(): self._ParserInf() =20 def _ParserInf(self): - Filename =3D self._FilePath FileLinesList =3D [] UserExtFind =3D False FindEnd =3D True @@ -35,9 +34,9 @@ class InfSectionParser(): SectionData =3D [] =20 try: - FileLinesList =3D open(Filename, "r", 0).readlines() + FileLinesList =3D open(self._FilePath, "r", 0).readlines() except BaseException: - EdkLogger.error("build", AUTOGEN_ERROR, 'File %s is opened fai= led.' % Filename) + EdkLogger.error("build", AUTOGEN_ERROR, 'File %s is opened fai= led.' % self._FilePath) =20 for Index in range(0, len(FileLinesList)): line =3D str(FileLinesList[Index]).strip() @@ -49,7 +48,7 @@ class InfSectionParser(): if UserExtFind and FindEnd =3D=3D False: if line: SectionData.append(line) - if line.lower().startswith(TAB_SECTION_START) and line.lower()= .endswith(TAB_SECTION_END): + if line.startswith(TAB_SECTION_START) and line.endswith(TAB_SE= CTION_END): SectionLine =3D line UserExtFind =3D True FindEnd =3D False @@ -59,7 +58,7 @@ class InfSectionParser(): UserExtFind =3D False FindEnd =3D True self._FileSectionDataList.append({SectionLine: SectionData= [:]}) - SectionData =3D [] + del SectionData[:] SectionLine =3D '' =20 # Get user extension TianoCore data --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524924334427845.4676971454314; Sat, 28 Apr 2018 07:05:34 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 63899203B8C8F; Sat, 28 Apr 2018 07:05:32 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id BB3732034C8D4 for ; Fri, 27 Apr 2018 15:33:03 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252867" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:46 -0700 Message-Id: <07045766a942b1b70afa367803bb87afc3442b53.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: X-Mailman-Approved-At: Sat, 28 Apr 2018 07:05:31 -0700 Subject: [edk2] [PATCH v1 32/42] BaseTools: trim whitespace X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | = 190 +-- BaseTools/Source/Python/AutoGen/BuildEngine.py | = 2 +- BaseTools/Source/Python/AutoGen/GenC.py | = 74 +- BaseTools/Source/Python/AutoGen/GenPcdDb.py | = 208 +-- BaseTools/Source/Python/AutoGen/InfSectionParser.py | = 12 +- BaseTools/Source/Python/AutoGen/StrGather.py | = 26 +- BaseTools/Source/Python/AutoGen/UniClassObject.py | = 18 +- BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py | = 42 +- BaseTools/Source/Python/BPDG/BPDG.py | = 56 +- BaseTools/Source/Python/BPDG/GenVpd.py | = 132 +- BaseTools/Source/Python/BPDG/StringTable.py | = 10 +- BaseTools/Source/Python/Common/BuildVersion.py | = 6 +- BaseTools/Source/Python/Common/Database.py | = 17 +- BaseTools/Source/Python/Common/MigrationUtilities.py | = 64 +- BaseTools/Source/Python/Common/Misc.py | = 50 +- BaseTools/Source/Python/Common/MultipleWorkspace.py | = 17 +- BaseTools/Source/Python/Common/RangeExpression.py | = 126 +- BaseTools/Source/Python/Common/String.py | = 2 +- BaseTools/Source/Python/Common/ToolDefClassObject.py | = 2 +- BaseTools/Source/Python/Common/VariableAttributes.py | = 12 +- BaseTools/Source/Python/Common/VpdInfoFile.py | = 82 +- BaseTools/Source/Python/CommonDataClass/FdfClass.py | = 28 +- BaseTools/Source/Python/Ecc/CLexer.py | = 8 +- BaseTools/Source/Python/Ecc/CParser.py | 1= 468 ++++++++++---------- BaseTools/Source/Python/Ecc/Check.py | = 22 +- BaseTools/Source/Python/Ecc/CodeFragment.py | = 3 +- BaseTools/Source/Python/Ecc/CodeFragmentCollector.py | = 124 +- BaseTools/Source/Python/Ecc/Configuration.py | = 10 +- BaseTools/Source/Python/Ecc/Ecc.py | = 26 +- BaseTools/Source/Python/Ecc/Exception.py | = 14 +- BaseTools/Source/Python/Ecc/FileProfile.py | = 5 +- BaseTools/Source/Python/Ecc/MetaDataParser.py | = 46 +- BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py | = 100 +- BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py | = 88 +- BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py | = 4 +- BaseTools/Source/Python/Ecc/Xml/__init__.py | = 6 +- BaseTools/Source/Python/Ecc/c.py | = 12 +- BaseTools/Source/Python/Eot/CLexer.py | = 8 +- BaseTools/Source/Python/Eot/CParser.py | 1= 468 ++++++++++---------- BaseTools/Source/Python/Eot/Eot.py | = 16 +- BaseTools/Source/Python/Eot/Report.py | = 4 +- BaseTools/Source/Python/GenFds/Capsule.py | = 2 +- BaseTools/Source/Python/GenFds/CapsuleData.py | = 18 +- BaseTools/Source/Python/GenFds/EfiSection.py | = 8 +- BaseTools/Source/Python/GenFds/Fd.py | = 2 +- BaseTools/Source/Python/GenFds/FdfParser.py | = 144 +- BaseTools/Source/Python/GenFds/Ffs.py | = 10 +- BaseTools/Source/Python/GenFds/FfsFileStatement.py | = 4 +- BaseTools/Source/Python/GenFds/FfsInfStatement.py | = 62 +- BaseTools/Source/Python/GenFds/Fv.py | = 26 +- BaseTools/Source/Python/GenFds/GenFds.py | = 28 +- BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | = 36 +- BaseTools/Source/Python/GenFds/GuidSection.py | = 2 +- BaseTools/Source/Python/GenFds/OptRomFileStatement.py | = 6 +- BaseTools/Source/Python/GenFds/OptRomInfStatement.py | = 21 +- BaseTools/Source/Python/GenFds/OptionRom.py | = 49 +- BaseTools/Source/Python/GenFds/Region.py | = 4 +- BaseTools/Source/Python/GenFds/Section.py | = 2 +- BaseTools/Source/Python/GenFds/Vtf.py | = 18 +- BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py | = 26 +- BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py | = 6 +- BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256GenerateKeys.py | = 34 +- BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py | = 30 +- BaseTools/Source/Python/Table/Table.py | = 20 +- BaseTools/Source/Python/Table/TableDataModel.py | = 14 +- BaseTools/Source/Python/Table/TableDec.py | = 12 +- BaseTools/Source/Python/Table/TableDsc.py | = 12 +- BaseTools/Source/Python/Table/TableEotReport.py | = 6 +- BaseTools/Source/Python/Table/TableFdf.py | = 12 +- BaseTools/Source/Python/Table/TableFile.py | = 12 +- BaseTools/Source/Python/Table/TableFunction.py | = 8 +- BaseTools/Source/Python/Table/TableIdentifier.py | = 4 +- BaseTools/Source/Python/Table/TableInf.py | = 12 +- BaseTools/Source/Python/Table/TablePcd.py | = 4 +- BaseTools/Source/Python/Table/TableReport.py | = 6 +- BaseTools/Source/Python/TargetTool/TargetTool.py | = 24 +- BaseTools/Source/Python/Trim/Trim.py | = 20 +- BaseTools/Source/Python/Workspace/DscBuildData.py | = 2 +- BaseTools/Source/Python/Workspace/MetaFileParser.py | = 2 +- BaseTools/Source/Python/Workspace/MetaFileTable.py | = 88 +- BaseTools/Source/Python/Workspace/WorkspaceDatabase.py | = 24 +- BaseTools/Source/Python/build/BuildReport.py | = 34 +- BaseTools/Source/Python/build/build.py | = 14 +- BaseTools/Source/Python/sitecustomize.py | = 2 +- 84 files changed, 2736 insertions(+), 2742 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index dc82075c5876..39d5932a9a66 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -236,7 +236,7 @@ class WorkspaceAutoGen(AutoGen): super(WorkspaceAutoGen, self).__init__(Workspace, MetaFile, Ta= rget, Toolchain, Arch, *args, **kwargs) self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch,= *args, **kwargs) self._Init =3D True - =20 + ## Initialize WorkspaceAutoGen # # @param WorkspaceDir Root directory of workspace @@ -305,7 +305,7 @@ class WorkspaceAutoGen(AutoGen): ExtraData=3D"Build target [%s] is not supporte= d by the platform. [Valid target: %s]" % (self.BuildTarget, " ".join(self.P= latform.BuildTargets))) =20 - =20 + # parse FDF file to get PCDs in it, if any if not self.FdfFile: self.FdfFile =3D self.Platform.FlashDefinition @@ -743,7 +743,7 @@ class WorkspaceAutoGen(AutoGen): =20 ## _CheckDuplicateInFV() method # - # Check whether there is duplicate modules/files exist in FV section.=20 + # Check whether there is duplicate modules/files exist in FV section. # The check base on the file GUID; # def _CheckDuplicateInFV(self, Fdf): @@ -774,7 +774,7 @@ class WorkspaceAutoGen(AutoGen): = Module.Guid.upper(= )), ExtraData=3Dself.FdfFi= le) # - # Some INF files not have entity in DSC file.=20 + # Some INF files not have entity in DSC file. # if not InfFoundFlag: if FfsFile.InfFileName.find('$') =3D=3D -1: @@ -784,7 +784,7 @@ class WorkspaceAutoGen(AutoGen): =20 PathClassObj =3D PathClass(FfsFile.InfFileName= , self.WorkspaceDir) # - # Here we just need to get FILE_GUID from INF = file, use 'COMMON' as ARCH attribute. and use=20 + # Here we just need to get FILE_GUID from INF = file, use 'COMMON' as ARCH attribute. and use # BuildObject from one of AutoGenObjectList is= enough. # InfObj =3D self.AutoGenObjectList[0].BuildData= base.WorkspaceDb.BuildObject[PathClassObj, TAB_ARCH_COMMON, self.BuildTarge= t, self.ToolChain] @@ -803,7 +803,7 @@ class WorkspaceAutoGen(AutoGen): =20 if FfsFile.NameGuid is not None: # - # If the NameGuid reference a PCD name.=20 + # If the NameGuid reference a PCD name. # The style must match: PCD(xxxx.yyy) # if gPCDAsGuidPattern.match(FfsFile.NameGuid): @@ -880,7 +880,7 @@ class WorkspaceAutoGen(AutoGen): for Pcd in Pa.Platform.Pcds: PcdType =3D Pa.Platform.Pcds[Pcd].Type =20 - # If no PCD type, this PCD comes from FDF=20 + # If no PCD type, this PCD comes from FDF if not PcdType: continue =20 @@ -972,14 +972,14 @@ class WorkspaceAutoGen(AutoGen): ## Check the PCDs token value conflict in each DEC file. # # Will cause build break and raise error message while two PCDs confli= ct. - #=20 + # # @return None # def _CheckAllPcdsTokenValueConflict(self): for Pa in self.AutoGenObjectList: for Package in Pa.PackageList: PcdList =3D Package.Pcds.values() - PcdList.sort(lambda x, y: cmp(int(x.TokenValue, 0), int(y.= TokenValue, 0)))=20 + PcdList.sort(lambda x, y: cmp(int(x.TokenValue, 0), int(y.= TokenValue, 0))) Count =3D 0 while (Count < len(PcdList) - 1) : Item =3D PcdList[Count] @@ -1103,20 +1103,20 @@ class PlatformAutoGen(AutoGen): self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch) self._Init =3D True # - # Used to store all PCDs for both PEI and DXE phase, in order to gener= ate=20 + # Used to store all PCDs for both PEI and DXE phase, in order to gener= ate # correct PCD database - #=20 + # _DynaPcdList_ =3D [] _NonDynaPcdList_ =3D [] _PlatformPcds =3D {} - =20 + # - # The priority list while override build option=20 + # The priority list while override build option # PrioList =3D {"0x11111" : 16, # TARGET_TOOLCHAIN_ARCH_COMMANDTYP= E_ATTRIBUTE (Highest) "0x01111" : 15, # ******_TOOLCHAIN_ARCH_COMMANDTYPE_= ATTRIBUTE "0x10111" : 14, # TARGET_*********_ARCH_COMMANDTYPE_= ATTRIBUTE - "0x00111" : 13, # ******_*********_ARCH_COMMANDTYPE_= ATTRIBUTE=20 + "0x00111" : 13, # ******_*********_ARCH_COMMANDTYPE_= ATTRIBUTE "0x11011" : 12, # TARGET_TOOLCHAIN_****_COMMANDTYPE_= ATTRIBUTE "0x01011" : 11, # ******_TOOLCHAIN_****_COMMANDTYPE_= ATTRIBUTE "0x10011" : 10, # TARGET_*********_****_COMMANDTYPE_= ATTRIBUTE @@ -1268,17 +1268,17 @@ class PlatformAutoGen(AutoGen): # def CollectFixedAtBuildPcds(self): for LibAuto in self.LibraryAutoGenList: - FixedAtBuildPcds =3D {} =20 - ShareFixedAtBuildPcdsSameValue =3D {}=20 - for Module in LibAuto._ReferenceModules: =20 + FixedAtBuildPcds =3D {} + ShareFixedAtBuildPcdsSameValue =3D {} + for Module in LibAuto._ReferenceModules: for Pcd in Module.FixedAtBuildPcds + LibAuto.FixedAtBuildP= cds: - key =3D ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCNa= me)) =20 + key =3D ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCNa= me)) if key not in FixedAtBuildPcds: ShareFixedAtBuildPcdsSameValue[key] =3D True FixedAtBuildPcds[key] =3D Pcd.DefaultValue else: if FixedAtBuildPcds[key] !=3D Pcd.DefaultValue: - ShareFixedAtBuildPcdsSameValue[key] =3D False = =20 + ShareFixedAtBuildPcdsSameValue[key] =3D False for Pcd in LibAuto.FixedAtBuildPcds: key =3D ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName)) if (Pcd.TokenCName,Pcd.TokenSpaceGuidCName) not in self.No= nDynamicPcdDict: @@ -1287,7 +1287,7 @@ class PlatformAutoGen(AutoGen): DscPcd =3D self.NonDynamicPcdDict[(Pcd.TokenCName,Pcd.= TokenSpaceGuidCName)] if DscPcd.Type !=3D TAB_PCDS_FIXED_AT_BUILD: continue - if key in ShareFixedAtBuildPcdsSameValue and ShareFixedAtB= uildPcdsSameValue[key]: =20 + if key in ShareFixedAtBuildPcdsSameValue and ShareFixedAtB= uildPcdsSameValue[key]: LibAuto.ConstPcd[key] =3D FixedAtBuildPcds[key] =20 def CollectVariables(self, DynamicPcdSet): @@ -1388,7 +1388,7 @@ class PlatformAutoGen(AutoGen): for F in self.Platform.Modules.keys(): M =3D ModuleAutoGen(self.Workspace, F, self.BuildTarget, self.= ToolChain, self.Arch, self.MetaFile) #GuidValue.update(M.Guids) - =20 + self.Platform.Modules[F].M =3D M =20 for PcdFromModule in M.ModulePcdList + M.LibraryPcdList: @@ -1400,27 +1400,27 @@ class PlatformAutoGen(AutoGen): if M.IsBinaryModule =3D=3D True: PcdFromModule.IsFromBinaryInf =3D True =20 - # Check the PCD from DSC or not=20 + # Check the PCD from DSC or not PcdFromModule.IsFromDsc =3D (PcdFromModule.TokenCName, Pcd= FromModule.TokenSpaceGuidCName) in self.Platform.Pcds =20 if PcdFromModule.Type in GenC.gDynamicPcd or PcdFromModule= .Type in GenC.gDynamicExPcd: if F.Path not in FdfModuleList: - # If one of the Source built modules listed in the= DSC is not listed=20 - # in FDF modules, and the INF lists a PCD can only= use the PcdsDynamic=20 - # access method (it is only listed in the DEC file= that declares the=20 + # If one of the Source built modules listed in the= DSC is not listed + # in FDF modules, and the INF lists a PCD can only= use the PcdsDynamic + # access method (it is only listed in the DEC file= that declares the # PCD as PcdsDynamic), then build tool will report= warning message - # notify the PI that they are attempting to build = a module that must=20 - # be included in a flash image in order to be func= tional. These Dynamic=20 - # PCD will not be added into the Database unless i= t is used by other=20 + # notify the PI that they are attempting to build = a module that must + # be included in a flash image in order to be func= tional. These Dynamic + # PCD will not be added into the Database unless i= t is used by other # modules that are included in the FDF file. if PcdFromModule.Type in GenC.gDynamicPcd and \ PcdFromModule.IsFromBinaryInf =3D=3D False: # Print warning message to let the developer m= ake a determine. continue - # If one of the Source built modules listed in the= DSC is not listed in=20 - # FDF modules, and the INF lists a PCD can only us= e the PcdsDynamicEx=20 - # access method (it is only listed in the DEC file= that declares the=20 - # PCD as PcdsDynamicEx), then DO NOT break the bui= ld; DO NOT add the=20 + # If one of the Source built modules listed in the= DSC is not listed in + # FDF modules, and the INF lists a PCD can only us= e the PcdsDynamicEx + # access method (it is only listed in the DEC file= that declares the + # PCD as PcdsDynamicEx), then DO NOT break the bui= ld; DO NOT add the # PCD to the Platform's PCD Database. if PcdFromModule.Type in GenC.gDynamicExPcd: continue @@ -1448,14 +1448,14 @@ class PlatformAutoGen(AutoGen): PcdFromModule.Pending =3D False self._NonDynaPcdList_.append (PcdFromModule) DscModuleSet =3D {os.path.normpath(ModuleInf.Path) for ModuleInf i= n self.Platform.Modules} - # add the PCD from modules that listed in FDF but not in DSC to Da= tabase=20 + # add the PCD from modules that listed in FDF but not in DSC to Da= tabase for InfName in FdfModuleList: if InfName not in DscModuleSet: InfClass =3D PathClass(InfName) M =3D self.BuildDatabase[InfClass, self.Arch, self.BuildTa= rget, self.ToolChain] - # If a module INF in FDF but not in current arch's DSC mod= ule list, it must be module (either binary or source)=20 - # for different Arch. PCDs in source module for different = Arch is already added before, so skip the source module here.=20 - # For binary module, if in current arch, we need to list t= he PCDs into database. =20 + # If a module INF in FDF but not in current arch's DSC mod= ule list, it must be module (either binary or source) + # for different Arch. PCDs in source module for different = Arch is already added before, so skip the source module here. + # For binary module, if in current arch, we need to list t= he PCDs into database. if not M.IsSupportedArch: continue # Override the module PCD setting by platform setting @@ -1480,20 +1480,20 @@ class PlatformAutoGen(AutoGen): self._NonDynaPcdList_.append(PcdFromModule) if PcdFromModule in self._DynaPcdList_ and PcdFromModu= le.Phase =3D=3D 'PEI' and PcdFromModule.Type in GenC.gDynamicExPcd: # Overwrite the phase of any the same PCD existing= , if Phase is PEI. - # It is to solve the case that a dynamic PCD used = by a PEM module/PEI=20 + # It is to solve the case that a dynamic PCD used = by a PEM module/PEI # module & DXE module at a same time. # Overwrite the type of the PCDs in source INF by = the type of AsBuild - # INF file as DynamicEx.=20 + # INF file as DynamicEx. Index =3D self._DynaPcdList_.index(PcdFromModule) self._DynaPcdList_[Index].Phase =3D PcdFromModule.= Phase self._DynaPcdList_[Index].Type =3D PcdFromModule.T= ype for PcdFromModule in self._NonDynaPcdList_: - # If a PCD is not listed in the DSC file, but binary INF files= used by=20 - # this platform all (that use this PCD) list the PCD in a [Pat= chPcds]=20 - # section, AND all source INF files used by this platform the = build=20 - # that use the PCD list the PCD in either a [Pcds] or [PatchPc= ds]=20 + # If a PCD is not listed in the DSC file, but binary INF files= used by + # this platform all (that use this PCD) list the PCD in a [Pat= chPcds] + # section, AND all source INF files used by this platform the = build + # that use the PCD list the PCD in either a [Pcds] or [PatchPc= ds] # section, then the tools must NOT add the PCD to the Platform= 's PCD - # Database; the build must assign the access method for this P= CD as=20 + # Database; the build must assign the access method for this P= CD as # PcdsPatchableInModule. if PcdFromModule not in self._DynaPcdList_: continue @@ -1516,7 +1516,7 @@ class PlatformAutoGen(AutoGen): self._DynamicPcdList =3D self._DynaPcdList_ # # Sort dynamic PCD list to: - # 1) If PCD's datum type is VOID* and value is unicode string whic= h starts with L, the PCD item should=20 + # 1) If PCD's datum type is VOID* and value is unicode string whic= h starts with L, the PCD item should # try to be put header of dynamicd List # 2) If PCD is HII type, the PCD item should be put after unicode = type PCD # @@ -1537,7 +1537,7 @@ class PlatformAutoGen(AutoGen): if self._PlatformPcds[item].DatumType and self._PlatformPcds[i= tem].DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_V= OID, "BOOLEAN"]: self._PlatformPcds[item].DatumType =3D TAB_VOID =20 - if (self.Workspace.ArchList[-1] =3D=3D self.Arch):=20 + if (self.Workspace.ArchList[-1] =3D=3D self.Arch): for Pcd in self._DynamicPcdList: # just pick the a value to determine whether is unicode st= ring type Sku =3D Pcd.SkuInfoList.values()[0] @@ -1621,7 +1621,7 @@ class PlatformAutoGen(AutoGen): # # Fix the PCDs define in VPD PCD section that never referenced= by module. # An example is PCD for signature usage. - # =20 + # for DscPcd in PlatformPcds: DscPcdEntry =3D self._PlatformPcds[DscPcd] if DscPcdEntry.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYN= AMIC_EX_VPD]: @@ -1643,8 +1643,8 @@ class PlatformAutoGen(AutoGen): defaultindex =3D SkuObjList.index((TAB_DEF= AULT,DefaultSku)) SkuObjList[0],SkuObjList[defaultindex] =3D= SkuObjList[defaultindex],SkuObjList[0] for (SkuName,Sku) in SkuObjList: - Sku.VpdOffset =3D Sku.VpdOffset.strip()=20 - =20 + Sku.VpdOffset =3D Sku.VpdOffset.strip() + # Need to iterate DEC pcd information to g= et the value & datumtype for eachDec in self.PackageList: for DecPcd in eachDec.Pcds: @@ -1655,8 +1655,8 @@ class PlatformAutoGen(AutoGen): EdkLogger.warn("build", "Unref= erenced vpd pcd used!", File=3Dself.Me= taFile, \ ExtraData =3D = "PCD: %s.%s used in the DSC file %s is unreferenced." \ - %(DscPcdEntry.= TokenSpaceGuidCName, DscPcdEntry.TokenCName, self.Platform.MetaFile.Path)) =20 - = =20 + %(DscPcdEntry.= TokenSpaceGuidCName, DscPcdEntry.TokenCName, self.Platform.MetaFile.Path)) + DscPcdEntry.DatumType =3D D= ecPcdEntry.DatumType DscPcdEntry.DefaultValue =3D D= ecPcdEntry.DefaultValue DscPcdEntry.TokenValue =3D Dec= PcdEntry.TokenValue @@ -1664,7 +1664,7 @@ class PlatformAutoGen(AutoGen): # Only fix the value while no = value provided in DSC file. if not Sku.DefaultValue: DscPcdEntry.SkuInfoList[Ds= cPcdEntry.SkuInfoList.keys()[0]].DefaultValue =3D DecPcdEntry.DefaultValue - = =20 + if DscPcdEntry not in self._DynamicPcdList: self._DynamicPcdList.append(DscPcdEntr= y) Sku.VpdOffset =3D Sku.VpdOffset.strip() @@ -1695,7 +1695,7 @@ class PlatformAutoGen(AutoGen): VpdFile.Add(DscPcdEntry, SkuName,Sku.V= pdOffset) SkuValueMap[PcdValue].append(Sku) if not NeedProcessVpdMapFile and Sku.VpdOf= fset =3D=3D "*": - NeedProcessVpdMapFile =3D True=20 + NeedProcessVpdMapFile =3D True if DscPcdEntry.DatumType =3D=3D TAB_VOID and P= cdValue.startswith("L"): UnicodePcdArray.add(DscPcdEntry) elif len(Sku.VariableName) > 0: @@ -1707,7 +1707,7 @@ class PlatformAutoGen(AutoGen): VpdSkuMap[DscPcd] =3D SkuValueMap if (self.Platform.FlashDefinition is None or self.Platform.Fla= shDefinition =3D=3D '') and \ VpdFile.GetCount() !=3D 0: - EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE,=20 + EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "Fail to get FLASH_DEFINITION definition i= n DSC file %s which is required when DSC contains VPD PCD." % str(self.Plat= form.MetaFile)) =20 if VpdFile.GetCount() !=3D 0: @@ -2055,9 +2055,9 @@ class PlatformAutoGen(AutoGen): self._PcdTokenNumber =3D OrderedDict() TokenNumber =3D 1 # - # Make the Dynamic and DynamicEx PCD use within different Toke= nNumber area.=20 + # Make the Dynamic and DynamicEx PCD use within different Toke= nNumber area. # Such as: - #=20 + # # Dynamic PCD: # TokenNumber 0 ~ 10 # DynamicEx PCD: @@ -2522,7 +2522,7 @@ class PlatformAutoGen(AutoGen): # @param Options Options to be expanded # # @retval options Options expanded - # =20 + # def _ExpandBuildOption(self, Options, ModuleStyle=3DNone): BuildOptions =3D {} FamilyMatch =3D False @@ -2547,9 +2547,9 @@ class PlatformAutoGen(AutoGen): if OverrideList.get(Key[1]) is not None: OverrideList.pop(Key[1]) OverrideList[Key[1]] =3D Options[Key] - =20 + # - # Use the highest priority value.=20 + # Use the highest priority value. # if (len(OverrideList) >=3D 2): KeyList =3D OverrideList.keys() @@ -2560,7 +2560,7 @@ class PlatformAutoGen(AutoGen): NextKey =3D KeyList[Index1 + Index + 1] # # Compare two Key, if one is included by another, choo= se the higher priority one - # =20 + # Target2, ToolChain2, Arch2, CommandType2, Attr2 =3D Ne= xtKey.split("_") if Target1 =3D=3D Target2 or Target1 =3D=3D "*" or Tar= get2 =3D=3D "*": if ToolChain1 =3D=3D ToolChain2 or ToolChain1 =3D= =3D "*" or ToolChain2 =3D=3D "*": @@ -2573,7 +2573,7 @@ class PlatformAutoGen(AutoGen): else: if Options.get((self.BuildRule= Family, NowKey)) is not None: Options.pop((self.BuildRul= eFamily, NowKey)) - =20 + for Key in Options: if ModuleStyle is not None and len (Key) > 2: # Check Module style is EDK or EDKII. @@ -2762,7 +2762,7 @@ class ModuleAutoGen(AutoGen): % (MetaFile, Arch)) return None return obj - =20 + ## Initialize ModuleAutoGen # # @param Workspace EdkIIWorkspaceBuild object @@ -2861,13 +2861,13 @@ class ModuleAutoGen(AutoGen): =20 self.AutoGenDepSet =3D set() =20 - =20 + ## The Modules referenced to this Library # Only Library has this attribute - self._ReferenceModules =3D [] =20 - =20 + self._ReferenceModules =3D [] + ## Store the FixedAtBuild Pcds - # =20 + # self._FixedAtBuildPcds =3D [] self.ConstPcd =3D {} return True @@ -2884,8 +2884,8 @@ class ModuleAutoGen(AutoGen): continue if Pcd not in self._FixedAtBuildPcds: self._FixedAtBuildPcds.append(Pcd) - =20 - return self._FixedAtBuildPcds =20 + + return self._FixedAtBuildPcds =20 def _GetUniqueBaseName(self): BaseName =3D self.Name @@ -3087,7 +3087,7 @@ class ModuleAutoGen(AutoGen): continue PackageList.append(Package) return PackageList - =20 + ## Get the depex string # # @return : a string contain all depex expresion. @@ -3116,7 +3116,7 @@ class ModuleAutoGen(AutoGen): (Arch.upper() =3D=3D self.Arch.upper() and \ ModuleType.upper() in [TAB_ARCH_COMMON, self.Mod= uleType.upper()]): DepexList.append({(Arch, ModuleType): DepexExp= r}) - =20 + #the type of build module is USER_DEFINED. if self.ModuleType.upper() =3D=3D SUP_MODULE_USER_DEFINED: for Depex in DepexList: @@ -3127,7 +3127,7 @@ class ModuleAutoGen(AutoGen): if not DepexStr: return '[Depex.%s]\n' % self.Arch return DepexStr - =20 + #the type of build module not is USER_DEFINED. Count =3D 0 for Depex in DepexList: @@ -3147,7 +3147,7 @@ class ModuleAutoGen(AutoGen): if not DepexStr: return '[Depex.%s]\n' % self.Arch return '[Depex.%s]\n# ' % self.Arch + DepexStr - =20 + ## Merge dependency expression # # @retval list The token list of the dependency expression af= ter parsed @@ -3283,7 +3283,7 @@ class ModuleAutoGen(AutoGen): # self._BuildOptionIncPathList =3D [] return self._BuildOptionIncPathList - =20 + BuildOptionIncPathList =3D [] for Tool in ('CC', 'PP', 'VFRPP', 'ASLPP', 'ASLCC', 'APP', 'AS= M'): Attr =3D 'FLAGS' @@ -3291,7 +3291,7 @@ class ModuleAutoGen(AutoGen): FlagOption =3D self.BuildOption[Tool][Attr] except KeyError: FlagOption =3D '' - =20 + if self.PlatformInfo.ToolChainFamily !=3D 'RVCT': IncPathList =3D [NormPath(Path, self.Macros) for Path = in BuildOptIncludeRegEx.findall(FlagOption)] else: @@ -3304,7 +3304,7 @@ class ModuleAutoGen(AutoGen): IncPathList +=3D [NormPath(PathEntry, self.Macros)= for PathEntry in PathList] =20 # - # EDK II modules must not reference header files outside o= f the packages they depend on or=20 + # EDK II modules must not reference header files outside o= f the packages they depend on or # within the module's directory tree. Report error if viol= ation. # if self.AutoGenVersion >=3D 0x00010005 and len(IncPathList= ) > 0: @@ -3316,13 +3316,13 @@ class ModuleAutoGen(AutoGen): ExtraData=3DErrMsg, File=3Dstr(self.MetaFile)) =20 - =20 + BuildOptionIncPathList +=3D IncPathList - =20 + self._BuildOptionIncPathList =3D BuildOptionIncPathList - =20 + return self._BuildOptionIncPathList - =20 + ## Return a list of files which can be built from source # # What kind of files can be built is determined by build rules in @@ -3374,7 +3374,7 @@ class ModuleAutoGen(AutoGen): Order_Dict[F].sort(key=3Dlambda i: self.BuildRuleOrder.ind= ex(i)) for Ext in Order_Dict[F][1:]: RemoveList.append(F + Ext) - =20 + for item in RemoveList: FileList.remove(item) =20 @@ -3826,12 +3826,12 @@ class ModuleAutoGen(AutoGen): for SourceFile in self.Module.Sources: if SourceFile.Type.upper() =3D=3D ".VFR" : # - # search the .map file to find the offset of vfr binary in= the PE32+/TE file.=20 + # search the .map file to find the offset of vfr binary in= the PE32+/TE file. # VfrUniBaseName[SourceFile.BaseName] =3D (SourceFile.BaseNa= me + "Bin") if SourceFile.Type.upper() =3D=3D ".UNI" : # - # search the .map file to find the offset of Uni strings b= inary in the PE32+/TE file.=20 + # search the .map file to find the offset of Uni strings b= inary in the PE32+/TE file. # VfrUniBaseName["UniOffsetName"] =3D (self.Name + "Strings") =20 @@ -3852,7 +3852,7 @@ class ModuleAutoGen(AutoGen): EdkLogger.error("build", FILE_OPEN_FAILURE, "File open failed = for %s" % UniVfrOffsetFileName,None) =20 # Use a instance of StringIO to cache data - fStringIO =3D StringIO('') =20 + fStringIO =3D StringIO('') =20 for Item in VfrUniOffsetList: if (Item[0].find("Strings") !=3D -1): @@ -3863,7 +3863,7 @@ class ModuleAutoGen(AutoGen): # UniGuid =3D [0xe0, 0xc5, 0x13, 0x89, 0xf6, 0x33, 0x86, 0x4= d, 0x9b, 0xf1, 0x43, 0xef, 0x89, 0xfc, 0x6, 0x66] UniGuid =3D [chr(ItemGuid) for ItemGuid in UniGuid] - fStringIO.write(''.join(UniGuid)) =20 + fStringIO.write(''.join(UniGuid)) UniValue =3D pack ('Q', int (Item[1], 16)) fStringIO.write (UniValue) else: @@ -3874,13 +3874,13 @@ class ModuleAutoGen(AutoGen): # VfrGuid =3D [0xb4, 0x7c, 0xbc, 0xd0, 0x47, 0x6a, 0x5f, 0x4= 9, 0xaa, 0x11, 0x71, 0x7, 0x46, 0xda, 0x6, 0xa2] VfrGuid =3D [chr(ItemGuid) for ItemGuid in VfrGuid] - fStringIO.write(''.join(VfrGuid)) =20 + fStringIO.write(''.join(VfrGuid)) VfrValue =3D pack ('Q', int (Item[1], 16)) fStringIO.write (VfrValue) # # write data into file. # - try : =20 + try : fInputfile.write (fStringIO.getvalue()) except: EdkLogger.error("build", FILE_WRITE_FAILURE, "Write data to fi= le %s failed, please check whether the " @@ -3901,15 +3901,15 @@ class ModuleAutoGen(AutoGen): =20 if self.IsAsBuiltInfCreated: return - =20 + # Skip the following code for EDK I inf if self.AutoGenVersion < 0x00010005: return - =20 + # Skip the following code for libraries if self.IsLibrary: return - =20 + # Skip the following code for modules with no source files if not self.SourceFileList: return @@ -3917,7 +3917,7 @@ class ModuleAutoGen(AutoGen): # Skip the following code for modules without any binary files if self.BinaryFileList: return - =20 + ### TODO: How to handles mixed source and binary modules =20 # Find all DynamicEx and PatchableInModule PCDs used by this modul= e and dependent libraries @@ -4211,7 +4211,7 @@ class ModuleAutoGen(AutoGen): UsageIndex =3D Index break if UsageIndex !=3D -1: - PcdCommentList[UsageIndex] =3D '## %s %s %s' % (UsageS= tr, HiiInfo, PcdCommentList[UsageIndex].replace(UsageStr, ''))=20 + PcdCommentList[UsageIndex] =3D '## %s %s %s' % (UsageS= tr, HiiInfo, PcdCommentList[UsageIndex].replace(UsageStr, '')) else: PcdCommentList.append('## UNDEFINED ' + HiiInfo) PcdComments =3D '\n '.join(PcdCommentList) @@ -4226,7 +4226,7 @@ class ModuleAutoGen(AutoGen): # Generated LibraryClasses section in comments. for Library in self.LibraryAutoGenList: AsBuiltInfDict['libraryclasses_item'] +=3D [Library.MetaFile.F= ile.replace('\\', '/')] - =20 + # Generated UserExtensions TianoCore section. # All tianocore user extensions are copied. UserExtStr =3D '' @@ -4242,12 +4242,12 @@ class ModuleAutoGen(AutoGen): DepexExpresion =3D self._GetDepexExpresionString() if DepexExpresion: AsBuiltInfDict['depexsection_item'] =3D DepexExpresion - =20 + AsBuiltInf =3D TemplateString() AsBuiltInf.Append(gAsBuiltInfHeaderString.Replace(AsBuiltInfDict)) - =20 + SaveFileOnChange(os.path.join(self.OutputDir, self.Name + '.inf'),= str(AsBuiltInf), False) - =20 + self.IsAsBuiltInfCreated =3D True if GlobalData.gBinCacheDest: self.CopyModuleToCache() @@ -4570,7 +4570,7 @@ class ModuleAutoGen(AutoGen): BuildOption =3D property(_GetModuleBuildOption) BuildOptionIncPathList =3D property(_GetBuildOptionIncPathList) BuildCommand =3D property(_GetBuildCommand) - =20 + FixedAtBuildPcds =3D property(_GetFixedAtBuildPcds) =20 # This acts like the main() function for the script, unless it is 'import'= ed into another script. diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Sou= rce/Python/AutoGen/BuildEngine.py index 2c823797d7c5..dc803b094300 100644 --- a/BaseTools/Source/Python/AutoGen/BuildEngine.py +++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py @@ -359,7 +359,7 @@ class BuildRule: # Clean up the line and replace path separator with native one Line =3D self.RuleContent[Index].strip().replace(self._PATH_SE= P, os.path.sep) self.RuleContent[Index] =3D Line - =20 + # find the build_rule_version if Line and Line[0] =3D=3D "#" and Line.find(TAB_BUILD_RULE_VE= RSION) <> -1: if Line.find("=3D") <> -1 and Line.find("=3D") < (len(Line= ) - 1) and (Line[(Line.find("=3D") + 1):]).split(): diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Pyt= hon/AutoGen/GenC.py index 4e7e3d90be64..11c88803f201 100644 --- a/BaseTools/Source/Python/AutoGen/GenC.py +++ b/BaseTools/Source/Python/AutoGen/GenC.py @@ -789,7 +789,7 @@ gModuleTypeHeaderFile =3D { "USER_DEFINED" : [gBasicHeaderFile] } =20 -## Autogen internal worker macro to define DynamicEx PCD name includes bot= h the TokenSpaceGuidName=20 +## Autogen internal worker macro to define DynamicEx PCD name includes bot= h the TokenSpaceGuidName # the TokenName and Guid comparison to avoid define name collisions. # # @param Info The ModuleAutoGen object @@ -809,7 +809,7 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH): return AutoGenH.Append('\n#define COMPAREGUID(Guid1, Guid2) (BOOLEAN)(*(CONST= UINT64*)Guid1 =3D=3D *(CONST UINT64*)Guid2 && *((CONST UINT64*)Guid1 + 1) = =3D=3D *((CONST UINT64*)Guid2 + 1))\n') # AutoGen for each PCD listed in a [PcdEx] section of a Module/Lib INF= file. - # Auto generate a macro for each TokenName that takes a Guid pointer a= s a parameter. =20 + # Auto generate a macro for each TokenName that takes a Guid pointer a= s a parameter. # Use the Guid pointer to see if it matches any of the token space GUI= Ds. TokenCNameList =3D set() for TokenCName in ExTokenCNameList: @@ -827,15 +827,15 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH): Index =3D Index + 1 if Index =3D=3D 1: AutoGenH.Append('\n#define __PCD_%s_ADDR_CMP(GuidPtr) = (' % (RealTokenCName)) - AutoGenH.Append('\\\n (GuidPtr =3D=3D &%s) ? _PCD_TOK= EN_%s_%s:'=20 + AutoGenH.Append('\\\n (GuidPtr =3D=3D &%s) ? _PCD_TOK= EN_%s_%s:' % (Pcd.TokenSpaceGuidCName, Pcd.TokenS= paceGuidCName, RealTokenCName)) else: - AutoGenH.Append('\\\n (GuidPtr =3D=3D &%s) ? _PCD_TOK= EN_%s_%s:'=20 + AutoGenH.Append('\\\n (GuidPtr =3D=3D &%s) ? _PCD_TOK= EN_%s_%s:' % (Pcd.TokenSpaceGuidCName, Pcd.TokenS= paceGuidCName, RealTokenCName)) if Index =3D=3D Count: AutoGenH.Append('0 \\\n )\n') TokenCNameList.add(TokenCName) - =20 + TokenCNameList =3D set() for TokenCName in ExTokenCNameList: if TokenCName in TokenCNameList: @@ -853,14 +853,14 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH): if Index =3D=3D 1: AutoGenH.Append('\n#define __PCD_%s_VAL_CMP(GuidPtr) = (' % (RealTokenCName)) AutoGenH.Append('\\\n (GuidPtr =3D=3D NULL) ? 0:') - AutoGenH.Append('\\\n COMPAREGUID (GuidPtr, &%s) ? _P= CD_TOKEN_%s_%s:'=20 + AutoGenH.Append('\\\n COMPAREGUID (GuidPtr, &%s) ? _P= CD_TOKEN_%s_%s:' % (Pcd.TokenSpaceGuidCName, Pcd.TokenS= paceGuidCName, RealTokenCName)) else: - AutoGenH.Append('\\\n COMPAREGUID (GuidPtr, &%s) ? _P= CD_TOKEN_%s_%s:'=20 + AutoGenH.Append('\\\n COMPAREGUID (GuidPtr, &%s) ? _P= CD_TOKEN_%s_%s:' % (Pcd.TokenSpaceGuidCName, Pcd.TokenS= paceGuidCName, RealTokenCName)) if Index =3D=3D Count: AutoGenH.Append('0 \\\n )\n') - # Autogen internal worker macro to compare GUIDs. Gui= d1 is a pointer to a GUID. =20 + # Autogen internal worker macro to compare GUIDs. Gui= d1 is a pointer to a GUID. # Guid2 is a C name for a GUID. Compare pointers first= because optimizing compiler # can do this at build time on CONST GUID pointers and= optimize away call to COMPAREGUID(). # COMPAREGUID() will only be used if the Guid passed = in is local to the module. @@ -895,22 +895,22 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd= ): =20 if Pcd.PcdValueFromComm: Pcd.DefaultValue =3D Pcd.PcdValueFromComm - =20 + if Pcd.Type in gDynamicExPcd: TokenNumber =3D int(Pcd.TokenValue, 0) - # Add TokenSpaceGuidValue value to PcdTokenName to discriminate th= e DynamicEx PCDs with=20 + # Add TokenSpaceGuidValue value to PcdTokenName to discriminate th= e DynamicEx PCDs with # different Guids but same TokenCName PcdExTokenName =3D '_PCD_TOKEN_' + Pcd.TokenSpaceGuidCName + '_' += TokenCName AutoGenH.Append('\n#define %s %dU\n' % (PcdExTokenName, TokenNumb= er)) else: if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) not in PcdTokenNumber: - # If one of the Source built modules listed in the DSC is not = listed in FDF modules,=20 - # and the INF lists a PCD can only use the PcdsDynamic access = method (it is only=20 - # listed in the DEC file that declares the PCD as PcdsDynamic)= , then build tool will=20 - # report warning message notify the PI that they are attemptin= g to build a module=20 - # that must be included in a flash image in order to be functi= onal. These Dynamic PCD=20 - # will not be added into the Database unless it is used by oth= er modules that are=20 - # included in the FDF file.=20 + # If one of the Source built modules listed in the DSC is not = listed in FDF modules, + # and the INF lists a PCD can only use the PcdsDynamic access = method (it is only + # listed in the DEC file that declares the PCD as PcdsDynamic)= , then build tool will + # report warning message notify the PI that they are attemptin= g to build a module + # that must be included in a flash image in order to be functi= onal. These Dynamic PCD + # will not be added into the Database unless it is used by oth= er modules that are + # included in the FDF file. # In this case, just assign an invalid token number to make it= pass build. if Pcd.Type in PCD_DYNAMIC_TYPE_LIST: TokenNumber =3D 0 @@ -934,7 +934,7 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd): SetModeName =3D '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd.Datum= Type] + '_' + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else= '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[TAB_VOID] + '_' + TokenCName SetModeStatusName =3D '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd= .DatumType] + '_S_' + TokenCName if Pcd.DatumType in gDatumSizeStringDataba= seH else '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[TAB_VOID] + '_S_' + T= okenCName GetModeSizeName =3D '_PCD_GET_MODE_SIZE' + '_' + TokenCName - =20 + if Pcd.Type in gDynamicExPcd: if Info.IsLibrary: PcdList =3D Info.LibraryPcdList @@ -1049,7 +1049,7 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd= ): "Too large PCD value for datum type [%= s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, TokenCName), ExtraData=3D"[%s]" % str(Info)) if not Value.endswith('U'): - Value +=3D 'U' =20 + Value +=3D 'U' elif Pcd.DatumType =3D=3D TAB_UINT8: if ValueNumber < 0: EdkLogger.error("build", AUTOGEN_ERROR, @@ -1116,7 +1116,7 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd= ): PcdValueName =3D '_PCD_PATCHABLE_VALUE_' + TokenCName else: PcdValueName =3D '_PCD_VALUE_' + TokenCName - =20 + if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES: # # For unicode, UINT16 array will be generated, so the alignmen= t of unicode is guaranteed. @@ -1129,7 +1129,7 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd= ): AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT8 %s= %s =3D %s;\n' % (Const, PcdVariableName, Array, Value)) AutoGenH.Append('extern %s UINT8 %s%s;\n' %(Const, PcdVari= ableName, Array)) AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, PcdV= ariableName)) - =20 + PcdDataSize =3D Pcd.GetPcdSize() if Pcd.Type =3D=3D TAB_PCDS_FIXED_AT_BUILD: AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenName, = PcdDataSize)) @@ -1146,10 +1146,10 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, P= cd): AutoGenC.Append('volatile %s %s %s =3D %s;\n' %(Const, Pcd.Dat= umType, PcdVariableName, PcdValueName)) AutoGenH.Append('extern volatile %s %s %s%s;\n' % (Const, Pc= d.DatumType, PcdVariableName, Array)) AutoGenH.Append('#define %s %s%s\n' % (GetModeName, Type, Pcd= VariableName)) - =20 + PcdDataSize =3D Pcd.GetPcdSize() AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, Pc= dDataSize)) - =20 + AutoGenH.Append('#define %s %s \n' % (GetModeSizeName,PatchPc= dSizeVariableName)) AutoGenH.Append('extern UINTN %s; \n' % PatchPcdSizeVariableNa= me) AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED UINTN %s =3D %s= ;\n' % (PatchPcdSizeVariableName,PcdDataSize)) @@ -1157,7 +1157,7 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd= ): PcdDataSize =3D Pcd.GetPcdSize() AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenName, PcdD= ataSize)) AutoGenH.Append('#define %s %s \n' % (GetModeSizeName,FixPcdS= izeTokenName)) - =20 + AutoGenH.Append('#define %s %s\n' %(PcdValueName, Value)) AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s %s =3D %s= ;\n' %(Const, Pcd.DatumType, PcdVariableName, PcdValueName)) AutoGenH.Append('extern %s %s %s%s;\n' % (Const, Pcd.DatumTy= pe, PcdVariableName, Array)) @@ -1204,13 +1204,13 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, = Pcd): TokenNumber =3D int(Pcd.TokenValue, 0) else: if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) not in PcdTokenNumber: - # If one of the Source built modules listed in the DSC is not = listed in FDF modules,=20 - # and the INF lists a PCD can only use the PcdsDynamic access = method (it is only=20 - # listed in the DEC file that declares the PCD as PcdsDynamic)= , then build tool will=20 - # report warning message notify the PI that they are attemptin= g to build a module=20 - # that must be included in a flash image in order to be functi= onal. These Dynamic PCD=20 - # will not be added into the Database unless it is used by oth= er modules that are=20 - # included in the FDF file.=20 + # If one of the Source built modules listed in the DSC is not = listed in FDF modules, + # and the INF lists a PCD can only use the PcdsDynamic access = method (it is only + # listed in the DEC file that declares the PCD as PcdsDynamic)= , then build tool will + # report warning message notify the PI that they are attemptin= g to build a module + # that must be included in a flash image in order to be functi= onal. These Dynamic PCD + # will not be added into the Database unless it is used by oth= er modules that are + # included in the FDF file. # In this case, just assign an invalid token number to make it= pass build. if Pcd.Type in PCD_DYNAMIC_TYPE_LIST: TokenNumber =3D 0 @@ -1244,7 +1244,7 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pc= d): if PcdItemType in gDynamicExPcd: PcdExTokenName =3D '_PCD_TOKEN_' + TokenSpaceGuidCName + '_' + Tok= enCName AutoGenH.Append('\n#define %s %dU\n' % (PcdExTokenName, TokenNumb= er)) - =20 + if Info.IsLibrary: PcdList =3D Info.LibraryPcdList else: @@ -1326,7 +1326,7 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pc= d): =20 AutoGenH.Append('#define %s %s\n' % (GetModeSizeName,PatchPcdSizeV= ariableName)) AutoGenH.Append('extern UINTN %s; \n' % PatchPcdSizeVariableName) - =20 + if PcdItemType =3D=3D TAB_PCDS_FIXED_AT_BUILD or PcdItemType =3D=3D TA= B_PCDS_FEATURE_FLAG: key =3D ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName)) PcdVariableName =3D '_gPcd_' + gItemTypeStringDatabase[Pcd.Type] += '_' + TokenCName @@ -1337,7 +1337,7 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pc= d): AutoGenH.Append('extern const %s _gPcd_FixedAtBuild_%s%s;\n' %(Dat= umType, TokenCName, Array)) AutoGenH.Append('#define %s %s_gPcd_FixedAtBuild_%s\n' %(GetModeN= ame, Type, TokenCName)) AutoGenH.Append('//#define %s ASSERT(FALSE) // It is not allowed= to set value for a FIXED_AT_BUILD PCD\n' % SetModeName) - =20 + ConstFixedPcd =3D False if PcdItemType =3D=3D TAB_PCDS_FIXED_AT_BUILD and (key in Info.Con= stPcd or (Info.IsLibrary and not Info._ReferenceModules)): ConstFixedPcd =3D True @@ -1670,7 +1670,7 @@ def CreatePcdCode(Info, AutoGenC, AutoGenH): for Pcd in Info.ModulePcdList: if Pcd.Type in gDynamicExPcd and Pcd.TokenSpaceGuidCName not in To= kenSpaceList: TokenSpaceList +=3D [Pcd.TokenSpaceGuidCName] - =20 + SkuMgr =3D Info.Workspace.Platform.SkuIdMgr AutoGenH.Append("\n// Definition of SkuId Array\n") AutoGenH.Append("extern UINT64 _gPcd_SkuId_Array[];\n") @@ -1680,7 +1680,7 @@ def CreatePcdCode(Info, AutoGenC, AutoGenH): if Info.ModuleType in ["USER_DEFINED", "BASE"]: GuidType =3D "GUID" else: - GuidType =3D "EFI_GUID" =20 + GuidType =3D "EFI_GUID" for Item in TokenSpaceList: AutoGenH.Append('extern %s %s;\n' % (GuidType, Item)) =20 @@ -2032,7 +2032,7 @@ def CreateHeaderCode(Info, AutoGenC, AutoGenH): and gModuleTypeHeaderFile[Info.ModuleType][0] !=3D gBasicHeader= File: AutoGenH.Append("#include <%s>\n" % gModuleTypeHeaderFile[Info= .ModuleType][0]) # - # if either PcdLib in [LibraryClasses] sections or there exist Pcd= section, add PcdLib.h=20 + # if either PcdLib in [LibraryClasses] sections or there exist Pcd= section, add PcdLib.h # As if modules only uses FixedPcd, then PcdLib is not needed in [= LibraryClasses] section. # if 'PcdLib' in Info.Module.LibraryClasses or Info.Module.Pcds: diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source= /Python/AutoGen/GenPcdDb.py index 9280eeee641c..ef6647a15302 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -183,10 +183,10 @@ typedef struct { //UINT32 UninitDataBaseSize;// Total size for PCD those d= efault value with 0. //TABLE_OFFSET LocalTokenNumberTableOffset; //TABLE_OFFSET ExMapTableOffset; - //TABLE_OFFSET GuidTableOffset; =20 + //TABLE_OFFSET GuidTableOffset; //TABLE_OFFSET StringTableOffset; //TABLE_OFFSET SizeTableOffset; - //TABLE_OFFSET SkuIdTableOffset;=20 + //TABLE_OFFSET SkuIdTableOffset; //TABLE_OFFSET PcdNameTableOffset; //UINT16 LocalTokenCount; // LOCAL_TOKEN_NUMBER for all //UINT16 ExTokenCount; // EX_TOKEN_NUMBER for Dynamic= Ex @@ -238,11 +238,11 @@ ${PHASE}_PCD_DATABASE_INIT g${PHASE}PcdDbInit =3D { =20 ## DbItemList # -# The class holds the Pcd database items. ItemSize if not zero should mat= ch the item datum type in the C structure.=20 +# The class holds the Pcd database items. ItemSize if not zero should mat= ch the item datum type in the C structure. # When the structure is changed, remember to check the ItemSize and the r= elated PackStr in PackData() -# RawDataList is the RawData that may need some kind of calculation or tr= ansformation,=20 +# RawDataList is the RawData that may need some kind of calculation or tr= ansformation, # the DataList corresponds to the data that need to be written to databas= e. If DataList is not present, then RawDataList -# will be written to the database.=20 +# will be written to the database. # class DbItemList: def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone): @@ -325,7 +325,7 @@ class DbItemList: =20 ## DbExMapTblItemList # -# The class holds the ExMap table=20 +# The class holds the ExMap table # class DbExMapTblItemList (DbItemList): def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone): @@ -335,15 +335,15 @@ class DbExMapTblItemList (DbItemList): Buffer =3D '' PackStr =3D "=3DLHH" for Datas in self.RawDataList: - Buffer +=3D pack(PackStr,=20 + Buffer +=3D pack(PackStr, GetIntegerValue(Datas[0]), GetIntegerValue(Datas[1]), - GetIntegerValue(Datas[2])) =20 + GetIntegerValue(Datas[2])) return Buffer =20 ## DbComItemList # -# The DbComItemList is a special kind of DbItemList in case that the size = of the List can not be computed by the=20 +# The DbComItemList is a special kind of DbItemList in case that the size = of the List can not be computed by the # ItemSize multiply the ItemCount. # class DbComItemList (DbItemList): @@ -361,7 +361,7 @@ class DbComItemList (DbItemList): else: assert(Index < len(self.RawDataList)) for ItemIndex in xrange(Index): - Offset +=3D len(self.RawDataList[ItemIndex]) * self.ItemSi= ze =20 + Offset +=3D len(self.RawDataList[ItemIndex]) * self.ItemSi= ze =20 return Offset =20 @@ -400,12 +400,12 @@ class DbComItemList (DbItemList): Buffer +=3D pack(PackStr, GetIntegerValue(SingleDa= ta)) else: Buffer +=3D pack(PackStr, GetIntegerValue(Data)) - =20 + return Buffer =20 ## DbVariableTableItemList # -# The class holds the Variable header value table=20 +# The class holds the Variable header value table # class DbVariableTableItemList (DbComItemList): def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone): @@ -416,7 +416,7 @@ class DbVariableTableItemList (DbComItemList): Buffer =3D '' for DataList in self.RawDataList: for Data in DataList: - Buffer +=3D pack(PackStr,=20 + Buffer +=3D pack(PackStr, GetIntegerValue(Data[0]), GetIntegerValue(Data[1]), GetIntegerValue(Data[2]), @@ -429,7 +429,7 @@ class DbVariableTableItemList (DbComItemList): class DbStringHeadTableItemList(DbItemList): def __init__(self,ItemSize,DataList=3DNone,RawDataList=3DNone): DbItemList.__init__(self, ItemSize, DataList, RawDataList) - =20 + def GetInterOffset(self, Index): Offset =3D 0 if self.ItemSize =3D=3D 0: @@ -462,11 +462,11 @@ class DbStringHeadTableItemList(DbItemList): self.ListSize +=3D len(Datas) * self.ItemSize else: self.ListSize +=3D self.ItemSize - return self.ListSize=20 + return self.ListSize =20 ## DbSkuHeadTableItemList # -# The class holds the Sku header value table=20 +# The class holds the Sku header value table # class DbSkuHeadTableItemList (DbItemList): def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone): @@ -476,14 +476,14 @@ class DbSkuHeadTableItemList (DbItemList): PackStr =3D "=3DLL" Buffer =3D '' for Data in self.RawDataList: - Buffer +=3D pack(PackStr,=20 + Buffer +=3D pack(PackStr, GetIntegerValue(Data[0]), GetIntegerValue(Data[1])) return Buffer =20 ## DbSizeTableItemList # -# The class holds the size table=20 +# The class holds the size table # class DbSizeTableItemList (DbItemList): def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone): @@ -498,16 +498,16 @@ class DbSizeTableItemList (DbItemList): PackStr =3D "=3DH" Buffer =3D '' for Data in self.RawDataList: - Buffer +=3D pack(PackStr,=20 + Buffer +=3D pack(PackStr, GetIntegerValue(Data[0])) for subData in Data[1]: - Buffer +=3D pack(PackStr,=20 + Buffer +=3D pack(PackStr, GetIntegerValue(subData)) return Buffer =20 ## DbStringItemList # -# The class holds the string table=20 +# The class holds the string table # class DbStringItemList (DbComItemList): def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone, LenL= ist=3DNone): @@ -517,7 +517,7 @@ class DbStringItemList (DbComItemList): RawDataList =3D [] if LenList is None: LenList =3D [] - =20 + assert(len(RawDataList) =3D=3D len(LenList)) DataList =3D [] # adjust DataList according to the LenList @@ -576,7 +576,7 @@ def GetMatchedIndex(Key1, List1, Key2, List2): return Index else: StartPos =3D Index + 1 - =20 + return -1 =20 =20 @@ -584,7 +584,7 @@ def GetMatchedIndex(Key1, List1, Key2, List2): # to List like [0x36, 0x00, 0x34, 0x00, 0x21, 0x00, 0x36, 0x00, 0x34, 0x00= , 0x00, 0x00] # # @param StringArray A string array like {0x36, 0x00, 0x34, 0x00, 0= x21, 0x00, 0x36, 0x00, 0x34, 0x00, 0x00, 0x00} -# =20 +# # @retval A list object of integer items # def StringArrayToList(StringArray): @@ -596,7 +596,7 @@ def StringArrayToList(StringArray): ## Convert TokenType String like "PCD_DATUM_TYPE_UINT32 | PCD_TYPE_HII" t= o TokenType value # # @param TokenType A TokenType string like "PCD_DATUM_TYPE_UINT32 = | PCD_TYPE_HII" -# =20 +# # @retval A integer representation of the TokenType # def GetTokenTypeValue(TokenType): @@ -623,7 +623,7 @@ def GetTokenTypeValue(TokenType): ## construct the external Pcd database using data from Dict # # @param Dict A dictionary contains Pcd related tables -# =20 +# # @retval Buffer A byte stream of the Pcd database # def BuildExDataBase(Dict): @@ -652,26 +652,26 @@ def BuildExDataBase(Dict): NumberOfSkuEnabledPcd =3D GetIntegerValue(Dict['SKU_HEAD_SIZE']) =20 Dict['STRING_TABLE_DB_VALUE'] =3D [StringArrayToList(x) for x in Dict[= 'STRING_TABLE_VALUE']] - =20 + StringTableValue =3D Dict['STRING_TABLE_DB_VALUE'] # when calcute the offset, should use StringTableLen instead of String= TableValue, as string maxium len may be different with actual len StringTableLen =3D Dict['STRING_TABLE_LENGTH'] DbStringTableLen =3D DbStringItemList(0, RawDataList =3D StringTableVa= lue, LenList =3D StringTableLen) =20 - =20 + PcdTokenTable =3D Dict['PCD_TOKENSPACE'] PcdTokenLen =3D Dict['PCD_TOKENSPACE_LENGTH'] PcdTokenTableValue =3D [StringArrayToList(x) for x in Dict['PCD_TOKENS= PACE']] DbPcdTokenTable =3D DbStringItemList(0, RawDataList =3D PcdTokenTableV= alue, LenList =3D PcdTokenLen) - =20 + PcdCNameTable =3D Dict['PCD_CNAME'] PcdCNameLen =3D Dict['PCD_CNAME_LENGTH'] PcdCNameTableValue =3D [StringArrayToList(x) for x in Dict['PCD_CNAME'= ]] DbPcdCNameTable =3D DbStringItemList(0, RawDataList =3D PcdCNameTableV= alue, LenList =3D PcdCNameLen) - =20 + PcdNameOffsetTable =3D Dict['PCD_NAME_OFFSET'] DbPcdNameOffsetTable =3D DbItemList(4,RawDataList =3D PcdNameOffsetTab= le) - =20 + SizeTableValue =3D zip(Dict['SIZE_TABLE_MAXIMUM_LENGTH'], Dict['SIZE_T= ABLE_CURRENT_LENGTH']) DbSizeTableValue =3D DbSizeTableItemList(2, RawDataList =3D SizeTableV= alue) InitValueUint16 =3D Dict['INIT_DB_VALUE_UINT16'] @@ -690,7 +690,7 @@ def BuildExDataBase(Dict): DbSkuidValue =3D DbItemList(8, RawDataList =3D SkuidValue) =20 =20 - =20 + # Unit Db Items UnInitValueUint64 =3D Dict['UNINIT_GUID_DECL_UINT64'] DbUnInitValueUint64 =3D DbItemList(8, RawDataList =3D UnInitValueUint6= 4) @@ -703,12 +703,12 @@ def BuildExDataBase(Dict): UnInitValueBoolean =3D Dict['UNINIT_GUID_DECL_BOOLEAN'] DbUnInitValueBoolean =3D DbItemList(1, RawDataList =3D UnInitValueBool= ean) PcdTokenNumberMap =3D Dict['PCD_ORDER_TOKEN_NUMBER_MAP'] -=20 + DbNameTotle =3D ["SkuidValue", "InitValueUint64", "VardefValueUint64"= , "InitValueUint32", "VardefValueUint32", "VpdHeadValue", "ExMapTable", "LocalTokenNumberTable", "GuidTable", "StringHeadValue", "= PcdNameOffsetTable","VariableTable", "StringTableLen", "PcdTokenTable", "Pc= dCNameTable", "SizeTableValue", "InitValueUint16", "VardefValueUint16", "= InitValueUint8", "VardefValueUint8", "InitValueBoolean", "VardefValueBoolean", "UnInitValueUint64", "UnInitValueUint= 32", "UnInitValueUint16", "UnInitValueUint8", "UnInitValueBoolean"] -=20 + DbTotal =3D [SkuidValue, InitValueUint64, VardefValueUint64, InitValu= eUint32, VardefValueUint32, VpdHeadValue, ExMapTable, LocalTokenNumberTable, GuidTable, StringHeadValue, PcdName= OffsetTable,VariableTable, StringTableLen, PcdTokenTable,PcdCNameTable, SizeTableValue, InitValueUint16, VardefValueUint16, InitVal= ueUint8, VardefValueUint8, InitValueBoolean, @@ -717,21 +717,21 @@ def BuildExDataBase(Dict): DbLocalTokenNumberTable, DbGuidTable, DbStringHeadValue, D= bPcdNameOffsetTable,DbVariableTable, DbStringTableLen, DbPcdTokenTable, DbP= cdCNameTable, DbSizeTableValue, DbInitValueUint16, DbVardefValueUint16, D= bInitValueUint8, DbVardefValueUint8, DbInitValueBoolean, DbVardefValueBoolean, DbUnInitValueUint64, DbUnInitValueUin= t32, DbUnInitValueUint16, DbUnInitValueUint8, DbUnInitValueBoolean] - =20 + # VardefValueBoolean is the last table in the init table items InitTableNum =3D DbNameTotle.index("VardefValueBoolean") + 1 # The FixedHeader length of the PCD_DATABASE_INIT, from Signature to P= ad FixedHeaderLen =3D 80 =20 - # Get offset of SkuId table in the database=20 + # Get offset of SkuId table in the database SkuIdTableOffset =3D FixedHeaderLen for DbIndex in xrange(len(DbTotal)): if DbTotal[DbIndex] is SkuidValue: break SkuIdTableOffset +=3D DbItemTotal[DbIndex].GetListSize() - =20 - =20 - # Get offset of SkuValue table in the database =20 + + + # Get offset of SkuValue table in the database =20 # Fix up the LocalTokenNumberTable, SkuHeader table for (LocalTokenNumberTableIndex, (Offset, Table)) in enumerate(LocalTo= kenNumberTable): @@ -752,11 +752,11 @@ def BuildExDataBase(Dict): TokenTypeValue =3D GetTokenTypeValue(TokenTypeValue) LocalTokenNumberTable[LocalTokenNumberTableIndex] =3D DbOffset|int= (TokenTypeValue) # if PCD_TYPE_SKU_ENABLED, then we need to fix up the SkuTable - =20 - =20 - =20 =20 - # resolve variable table offset=20 + + + + # resolve variable table offset for VariableEntries in VariableTable: skuindex =3D 0 for VariableEntryPerSku in VariableEntries: @@ -774,7 +774,7 @@ def BuildExDataBase(Dict): else: assert(False) if isinstance(VariableRefTable[0],list): - DbOffset +=3D skuindex * 4 =20 + DbOffset +=3D skuindex * 4 skuindex +=3D 1 if DbIndex >=3D InitTableNum: assert(False) @@ -802,28 +802,28 @@ def BuildExDataBase(Dict): =20 DbTotalLength +=3D DbItemTotal[DbIndex].GetListSize() if not Dict['PCD_INFO_FLAG']: - DbPcdNameOffset =3D 0 =20 + DbPcdNameOffset =3D 0 LocalTokenCount =3D GetIntegerValue(Dict['LOCAL_TOKEN_NUMBER']) ExTokenCount =3D GetIntegerValue(Dict['EX_TOKEN_NUMBER']) GuidTableCount =3D GetIntegerValue(Dict['GUID_TABLE_SIZE']) SystemSkuId =3D GetIntegerValue(Dict['SYSTEM_SKU_ID_VALUE']) Pad =3D 0xDA - =20 + UninitDataBaseSize =3D 0 for Item in (DbUnInitValueUint64, DbUnInitValueUint32, DbUnInitValueUi= nt16, DbUnInitValueUint8, DbUnInitValueBoolean): UninitDataBaseSize +=3D Item.GetListSize() - =20 + if (DbTotalLength - UninitDataBaseSize) % 8: DbTotalLength +=3D (8 - (DbTotalLength - UninitDataBaseSize) % 8) # Construct the database buffer Guid =3D "{0x3c7d193c, 0x682c, 0x4c14, 0xa6, 0x8f, 0x55, 0x2d, 0xea, 0= x4f, 0x43, 0x7e}" Guid =3D StringArrayToList(Guid) - Buffer =3D pack('=3DLHHBBBBBBBB',=20 - Guid[0],=20 - Guid[1],=20 - Guid[2],=20 - Guid[3],=20 - Guid[4], =20 + Buffer =3D pack('=3DLHHBBBBBBBB', + Guid[0], + Guid[1], + Guid[2], + Guid[3], + Guid[4], Guid[5], Guid[6], Guid[7], @@ -851,7 +851,7 @@ def BuildExDataBase(Dict): =20 Buffer +=3D b b =3D pack('=3DL', ExMapTableOffset) -=20 + Buffer +=3D b b =3D pack('=3DL', GuidTableOffset) =20 @@ -875,7 +875,7 @@ def BuildExDataBase(Dict): =20 Buffer +=3D b b =3D pack('=3DH', GuidTableCount) -=20 + Buffer +=3D b b =3D pack('=3DB', Pad) Buffer +=3D b @@ -884,18 +884,18 @@ def BuildExDataBase(Dict): Buffer +=3D b Buffer +=3D b Buffer +=3D b - =20 + Index =3D 0 for Item in DbItemTotal: Index +=3D1 b =3D Item.PackData() - Buffer +=3D b =20 + Buffer +=3D b if Index =3D=3D InitTableNum: if len(Buffer) % 8: for num in range(8 - len(Buffer) % 8): b =3D pack('=3DB', Pad) Buffer +=3D b - break =20 + break return Buffer =20 ## Create code for PCD database @@ -1049,7 +1049,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): 'SYSTEM_SKU_ID' : ' SKU_ID SystemSkuI= d;', 'SYSTEM_SKU_ID_VALUE' : '0U' } - =20 + SkuObj =3D Platform.Platform.SkuIdMgr Dict['SYSTEM_SKU_ID_VALUE'] =3D 0 if SkuObj.SkuUsageType =3D=3D SkuObj= .SINGLE else Platform.Platform.SkuIds[SkuObj.SystemSkuId][0] =20 @@ -1067,7 +1067,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): Dict[Init+'_NUMSKUS_DECL_' + DatumType] =3D [] Dict[Init+'_VALUE_' + DatumType] =3D [] Dict[Init+'_DB_VALUE_'+DatumType] =3D [] - =20 + for Type in ['STRING_HEAD','VPD_HEAD','VARIABLE_HEAD']: Dict[Type + '_CNAME_DECL'] =3D [] Dict[Type + '_GUID_DECL'] =3D [] @@ -1077,7 +1077,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): Dict['STRING_DB_VALUE'] =3D [] Dict['VPD_DB_VALUE'] =3D [] Dict['VARIABLE_DB_VALUE'] =3D [] - =20 + Dict['STRING_TABLE_INDEX'] =3D [] Dict['STRING_TABLE_LENGTH'] =3D [] Dict['STRING_TABLE_CNAME'] =3D [] @@ -1100,19 +1100,19 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): =20 Dict['LOCAL_TOKEN_NUMBER_DB_VALUE'] =3D [] Dict['VARIABLE_DB_VALUE'] =3D [] - =20 + Dict['PCD_TOKENSPACE'] =3D [] - Dict['PCD_CNAME'] =3D []=20 + Dict['PCD_CNAME'] =3D [] Dict['PCD_TOKENSPACE_LENGTH'] =3D [] Dict['PCD_CNAME_LENGTH'] =3D [] Dict['PCD_TOKENSPACE_OFFSET'] =3D [] Dict['PCD_CNAME_OFFSET'] =3D [] Dict['PCD_TOKENSPACE_MAP'] =3D [] Dict['PCD_NAME_OFFSET'] =3D [] - =20 + Dict['PCD_ORDER_TOKEN_NUMBER_MAP'] =3D {} PCD_STRING_INDEX_MAP =3D {} - =20 + StringTableIndex =3D 0 StringTableSize =3D 0 NumberOfLocalTokens =3D 0 @@ -1181,8 +1181,8 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): if len(Pcd.SkuInfoList) > 1: # Pcd.TokenTypeList +=3D ['PCD_TYPE_SKU_ENABLED'] NumberOfSkuEnabledPcd +=3D 1 - =20 - SkuIdIndex =3D 1 =20 + + SkuIdIndex =3D 1 VariableHeadList =3D [] for SkuName in Pcd.SkuInfoList: Sku =3D Pcd.SkuInfoList[SkuName] @@ -1190,9 +1190,9 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): if SkuId is None or SkuId =3D=3D '': continue =20 - =20 + SkuIdIndex +=3D 1 - =20 + if len(Sku.VariableName) > 0: VariableGuidStructure =3D Sku.VariableGuidValue VariableGuid =3D GuidStructureStringToGuidValueName(Variab= leGuidStructure) @@ -1243,7 +1243,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): for Index in range(Dict['STRING_TABLE_VALUE'].index(Variab= leNameStructure)): VariableHeadStringIndex +=3D Dict['STRING_TABLE_LENGTH= '][Index] VariableHeadList.append(VariableHeadStringIndex) - =20 + VariableHeadStringIndex =3D VariableHeadList[SkuIdIndex - = 2] # store VariableGuid to GuidTable and get the VariableHead= GuidIndex =20 @@ -1254,11 +1254,11 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): =20 if "PCD_TYPE_STRING" in Pcd.TokenTypeList: VariableHeadValueList.append('%dU, offsetof(%s_PCD_DAT= ABASE, Init.%s_%s), %dU, %sU' % - (VariableHeadStringIndex,= Phase, CName, TokenSpaceGuid,=20 + (VariableHeadStringIndex,= Phase, CName, TokenSpaceGuid, VariableHeadGuidIndex, Sk= u.VariableOffset)) else: VariableHeadValueList.append('%dU, offsetof(%s_PCD_DAT= ABASE, Init.%s_%s_VariableDefault_%s), %dU, %sU' % - (VariableHeadStringIndex,= Phase, CName, TokenSpaceGuid, SkuIdIndex,=20 + (VariableHeadStringIndex,= Phase, CName, TokenSpaceGuid, SkuIdIndex, VariableHeadGuidIndex, Sk= u.VariableOffset)) Dict['VARDEF_CNAME_'+Pcd.DatumType].append(CName) Dict['VARDEF_GUID_'+Pcd.DatumType].append(TokenSpaceGuid) @@ -1271,7 +1271,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): # warning under linux building environment. # Dict['VARDEF_DB_VALUE_'+Pcd.DatumType].append(Sku.HiiD= efaultValue) - =20 + if Pcd.DatumType =3D=3D TAB_UINT64: Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.Hii= DefaultValue + "ULL") elif Pcd.DatumType in (TAB_UINT32, TAB_UINT16, TAB_UIN= T8): @@ -1304,13 +1304,13 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): Pcd.InitString =3D 'INIT' VpdHeadOffsetList.append(str(Sku.VpdOffset) + 'U') VpdDbOffsetList.append(Sku.VpdOffset) - # Also add the VOID* string of VPD PCD to SizeTable=20 + # Also add the VOID* string of VPD PCD to SizeTable if Pcd.DatumType =3D=3D TAB_VOID: NumberOfSizeItems +=3D 1 # For VPD type of PCD, its current size is equal to it= s MAX size. - VoidStarTypeCurrSize =3D [str(Pcd.MaxDatumSize) + 'U']= =20 + VoidStarTypeCurrSize =3D [str(Pcd.MaxDatumSize) + 'U'] continue - =20 + if Pcd.DatumType =3D=3D TAB_VOID: Pcd.TokenTypeList +=3D ['PCD_TYPE_STRING'] Pcd.InitString =3D 'INIT' @@ -1337,7 +1337,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): DefaultValueBinStructure =3D StringToArray(Sku.Def= aultValue) Size =3D len(Sku.DefaultValue.split(",")) Dict['STRING_TABLE_VALUE'].append(DefaultValueBinS= tructure) - =20 + StringHeadOffsetList.append(str(StringTableSize) + 'U') StringDbOffsetList.append(StringTableSize) if Pcd.MaxDatumSize !=3D '': @@ -1376,10 +1376,10 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): ValueList.append(Sku.DefaultValue + "U") elif Pcd.DatumType =3D=3D "BOOLEAN": if Sku.DefaultValue in ["1", "0"]: - ValueList.append(Sku.DefaultValue + "U") = =20 + ValueList.append(Sku.DefaultValue + "U") else: ValueList.append(Sku.DefaultValue) - =20 + DbValueList.append(Sku.DefaultValue) =20 Pcd.TokenTypeList =3D list(set(Pcd.TokenTypeList)) @@ -1388,8 +1388,8 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): Dict['SIZE_TABLE_GUID'].append(TokenSpaceGuid) Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(str(Pcd.MaxDatumSize)= + 'U') Dict['SIZE_TABLE_CURRENT_LENGTH'].append(VoidStarTypeCurrSize) - =20 - =20 + + =20 if 'PCD_TYPE_HII' in Pcd.TokenTypeList: Dict['VARIABLE_HEAD_CNAME_DECL'].append(CName) @@ -1422,7 +1422,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): else: Dict[Pcd.InitString+'_VALUE_'+Pcd.DatumType].append(', '.j= oin(ValueList)) Dict[Pcd.InitString+'_DB_VALUE_'+Pcd.DatumType].append(DbV= alueList) - =20 + if Phase =3D=3D 'PEI': NumberOfLocalTokens =3D NumberOfPeiLocalTokens if Phase =3D=3D 'DXE': @@ -1434,7 +1434,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): Dict['TOKEN_TYPE'] =3D ['' for x in range(NumberOfLocalTokens)] Dict['LOCAL_TOKEN_NUMBER_DB_VALUE'] =3D ['' for x in range(NumberOfLoc= alTokens)] Dict['PCD_CNAME'] =3D ['' for x in range(NumberOfLocalTokens)] - Dict['PCD_TOKENSPACE_MAP'] =3D ['' for x in range(NumberOfLocalTokens)= ] =20 + Dict['PCD_TOKENSPACE_MAP'] =3D ['' for x in range(NumberOfLocalTokens)] Dict['PCD_CNAME_LENGTH'] =3D [0 for x in range(NumberOfLocalTokens)] SkuEnablePcdIndex =3D 0 for Pcd in ReorderedDynPcdList: @@ -1459,7 +1459,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): EdkLogger.debug(EdkLogger.DEBUG_1, "PCD =3D %s.%s" % (CName, Token= SpaceGuidCName)) EdkLogger.debug(EdkLogger.DEBUG_1, "phase =3D %s" % Phase) EdkLogger.debug(EdkLogger.DEBUG_1, "GeneratedTokenNumber =3D %s" %= str(GeneratedTokenNumber)) - =20 + # # following four Dict items hold the information for LocalTokenNum= berTable # @@ -1470,7 +1470,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): Dict['TOKEN_CNAME'][GeneratedTokenNumber] =3D CName Dict['TOKEN_GUID'][GeneratedTokenNumber] =3D TokenSpaceGuid Dict['TOKEN_TYPE'][GeneratedTokenNumber] =3D ' | '.join(Pcd.TokenT= ypeList) - =20 + if Platform.Platform.PcdInfoFlag: TokenSpaceGuidCNameArray =3D StringToArray('"' + TokenSpaceGui= dCName + '"' ) if TokenSpaceGuidCNameArray not in Dict['PCD_TOKENSPACE']: @@ -1479,10 +1479,10 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): Dict['PCD_TOKENSPACE_MAP'][GeneratedTokenNumber] =3D Dict['PCD= _TOKENSPACE'].index(TokenSpaceGuidCNameArray) CNameBinArray =3D StringToArray('"' + CName + '"' ) Dict['PCD_CNAME'][GeneratedTokenNumber] =3D CNameBinArray - =20 + Dict['PCD_CNAME_LENGTH'][GeneratedTokenNumber] =3D len(CNameBi= nArray.split(",")) - =20 - =20 + + Pcd.TokenTypeList =3D list(set(Pcd.TokenTypeList)) =20 # search the Offset and Table, used by LocalTokenNumberTableOffset @@ -1508,7 +1508,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): if Pcd.InitString =3D=3D 'UNINIT': Table =3D Dict[Pcd.InitString+'_GUID_DECL_'+Pcd.DatumType] else: - Table =3D Dict[Pcd.InitString+'_DB_VALUE_'+Pcd.DatumType] = =20 + Table =3D Dict[Pcd.InitString+'_DB_VALUE_'+Pcd.DatumType] Dict['LOCAL_TOKEN_NUMBER_DB_VALUE'][GeneratedTokenNumber] =3D (Off= set, Table) =20 # @@ -1518,10 +1518,10 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): Dict['VARDEF_HEADER'][GeneratedTokenNumber] =3D '_Variable_Hea= der' else: Dict['VARDEF_HEADER'][GeneratedTokenNumber] =3D '' - =20 - =20 + + if Pcd.Type in gDynamicExPcd: - =20 + if Phase =3D=3D 'DXE': GeneratedTokenNumber +=3D NumberOfPeiLocalTokens # @@ -1533,7 +1533,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): # Therefore, 1 is added to GeneratedTokenNumber to generate a = PCD Token Number before being inserted # to the EXMAPPING_TABLE. # - =20 + =20 Dict['EXMAPPING_TABLE_EXTOKEN'].append(str(Pcd.TokenValue) + '= U') Dict['EXMAPPING_TABLE_LOCAL_TOKEN'].append(str(GeneratedTokenN= umber + 1) + 'U') @@ -1544,12 +1544,12 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): TokenSpaceIndex =3D StringTableSize for i in range(Dict['PCD_TOKENSPACE_MAP'][index]): TokenSpaceIndex +=3D Dict['PCD_TOKENSPACE_LENGTH'][i] - Dict['PCD_TOKENSPACE_OFFSET'].append(TokenSpaceIndex) =20 + Dict['PCD_TOKENSPACE_OFFSET'].append(TokenSpaceIndex) for index in range(len(Dict['PCD_TOKENSPACE'])): StringTableSize +=3D Dict['PCD_TOKENSPACE_LENGTH'][index] StringTableIndex +=3D 1 for index in range(len(Dict['PCD_CNAME'])): - Dict['PCD_CNAME_OFFSET'].append(StringTableSize) =20 + Dict['PCD_CNAME_OFFSET'].append(StringTableSize) Dict['PCD_NAME_OFFSET'].append(Dict['PCD_TOKENSPACE_OFFSET'][i= ndex]) Dict['PCD_NAME_OFFSET'].append(StringTableSize) StringTableSize +=3D Dict['PCD_CNAME_LENGTH'][index] @@ -1592,15 +1592,15 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): =20 if NumberOfSizeItems !=3D 0: Dict['SIZE_TABLE_SIZE'] =3D str(NumberOfSizeItems * 2) + 'U' - =20 - if NumberOfSkuEnabledPcd !=3D 0:=20 + + if NumberOfSkuEnabledPcd !=3D 0: Dict['SKU_HEAD_SIZE'] =3D str(NumberOfSkuEnabledPcd) + 'U' - =20 + for AvailableSkuNumber in SkuObj.SkuIdNumberSet: if AvailableSkuNumber not in Dict['SKUID_VALUE']: Dict['SKUID_VALUE'].append(AvailableSkuNumber) Dict['SKUID_VALUE'][0] =3D len(Dict['SKUID_VALUE']) - 1 - =20 + AutoGenH.Append(gPcdDatabaseAutoGenH.Replace(Dict)) if NumberOfLocalTokens =3D=3D 0: AutoGenC.Append(gEmptyPcdDatabaseAutoGenC.Replace(Dict)) @@ -1613,11 +1613,11 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): SizeCurLenTempList =3D [] SizeMaxLenTempList =3D [] ReOrderFlag =3D True - =20 + if len(Dict['SIZE_TABLE_CNAME']) =3D=3D 1: if not (Dict['SIZE_TABLE_CNAME'][0] and Dict['SIZE_TABLE_GUID'= ][0]): ReOrderFlag =3D False - =20 + if ReOrderFlag: for Count in range(len(Dict['TOKEN_CNAME'])): for Count1 in range(len(Dict['SIZE_TABLE_CNAME'])): @@ -1627,15 +1627,15 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): SizeGuidTempList.append(Dict['SIZE_TABLE_GUID'][Co= unt1]) SizeCurLenTempList.append(Dict['SIZE_TABLE_CURRENT= _LENGTH'][Count1]) SizeMaxLenTempList.append(Dict['SIZE_TABLE_MAXIMUM= _LENGTH'][Count1]) - =20 + for Count in range(len(Dict['SIZE_TABLE_CNAME'])): Dict['SIZE_TABLE_CNAME'][Count] =3D SizeCNameTempList[Coun= t] Dict['SIZE_TABLE_GUID'][Count] =3D SizeGuidTempList[Count] Dict['SIZE_TABLE_CURRENT_LENGTH'][Count] =3D SizeCurLenTem= pList[Count] Dict['SIZE_TABLE_MAXIMUM_LENGTH'][Count] =3D SizeMaxLenTem= pList[Count] - =20 + AutoGenC.Append(gPcdDatabaseAutoGenC.Replace(Dict)) - =20 + =20 # print Phase Buffer =3D BuildExDataBase(Dict) diff --git a/BaseTools/Source/Python/AutoGen/InfSectionParser.py b/BaseTool= s/Source/Python/AutoGen/InfSectionParser.py index 2cd5a6667a02..d98508973841 100644 --- a/BaseTools/Source/Python/AutoGen/InfSectionParser.py +++ b/BaseTools/Source/Python/AutoGen/InfSectionParser.py @@ -17,14 +17,14 @@ import Common.EdkLogger as EdkLogger from Common.BuildToolError import * from Common.DataType import * -=20 + =20 class InfSectionParser(): def __init__(self, FilePath): self._FilePath =3D FilePath self._FileSectionDataList =3D [] self._ParserInf() - =20 + def _ParserInf(self): FileLinesList =3D [] UserExtFind =3D False @@ -32,12 +32,12 @@ class InfSectionParser(): FileLastLine =3D False SectionLine =3D '' SectionData =3D [] - =20 + try: FileLinesList =3D open(self._FilePath, "r", 0).readlines() except BaseException: EdkLogger.error("build", AUTOGEN_ERROR, 'File %s is opened fai= led.' % self._FilePath) - =20 + for Index in range(0, len(FileLinesList)): line =3D str(FileLinesList[Index]).strip() if Index + 1 =3D=3D len(FileLinesList): @@ -52,7 +52,7 @@ class InfSectionParser(): SectionLine =3D line UserExtFind =3D True FindEnd =3D False - =20 + if (NextLine !=3D '' and NextLine[0] =3D=3D TAB_SECTION_START = and \ NextLine[-1] =3D=3D TAB_SECTION_END) or FileLastLine: UserExtFind =3D False @@ -60,7 +60,7 @@ class InfSectionParser(): self._FileSectionDataList.append({SectionLine: SectionData= [:]}) del SectionData[:] SectionLine =3D '' - =20 + # Get user extension TianoCore data # # @return: a list include some dictionary that key is section and valu= e is a list contain all data. diff --git a/BaseTools/Source/Python/AutoGen/StrGather.py b/BaseTools/Sourc= e/Python/AutoGen/StrGather.py index 73af1214eb0a..e97a3175e991 100644 --- a/BaseTools/Source/Python/AutoGen/StrGather.py +++ b/BaseTools/Source/Python/AutoGen/StrGather.py @@ -1,5 +1,5 @@ ## @file -# This file is used to parse a strings file and create or add to a string = database=20 +# This file is used to parse a strings file and create or add to a string = database # file. # # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
@@ -144,7 +144,7 @@ def CreateHFileContent(BaseName, UniObjectClass, IsComp= atibleMode, UniGenCFlag): Str =3D WriteLine(Str, Line) UnusedStr =3D '' =20 - #Group the referred/Unused STRING token together.=20 + #Group the referred/Unused STRING token together. for Index in range(2, len(UniObjectClass.OrderedStringList[UniObjectCl= ass.LanguageDef[0][0]])): StringItem =3D UniObjectClass.OrderedStringList[UniObjectClass.Lan= guageDef[0][0]][Index] Name =3D StringItem.StringName @@ -265,16 +265,16 @@ def GetFilteredLanguage(UniLanguageList, LanguageFilt= erList): PrimaryTag =3D Language[0:Language.find('-')].lower() else: PrimaryTag =3D Language - =20 + if len(PrimaryTag) =3D=3D 3: PrimaryTag =3D LangConvTable.get(PrimaryTag) - =20 + for UniLanguage in UniLanguageList: if UniLanguage.find('-') !=3D -1: UniLanguagePrimaryTag =3D UniLanguage[0:UniLanguage.fi= nd('-')].lower() else: UniLanguagePrimaryTag =3D UniLanguage - =20 + if len(UniLanguagePrimaryTag) =3D=3D 3: UniLanguagePrimaryTag =3D LangConvTable.get(UniLanguag= ePrimaryTag) =20 @@ -307,7 +307,7 @@ def GetFilteredLanguage(UniLanguageList, LanguageFilter= List): # @param UniObjectClass A UniObjectClass instance # @param IsCompatibleMode Compatible mode # @param UniBinBuffer UniBinBuffer to contain UniBinary data. -# @param FilterInfo Platform language filter information=20 +# @param FilterInfo Platform language filter information # # @retval Str: A string of .c file content # @@ -325,14 +325,14 @@ def CreateCFileContent(BaseName, UniObjectClass, IsCo= mpatibleMode, UniBinBuffer, else: # EDK module is using ISO639-2 format filter, convert to the RFC46= 46 format LanguageFilterList =3D [LangConvTable.get(F.lower()) for F in Filt= erInfo[1]] - =20 + UniLanguageList =3D [] for IndexI in range(len(UniObjectClass.LanguageDef)): UniLanguageList +=3D [UniObjectClass.LanguageDef[IndexI][0]] =20 UniLanguageListFiltered =3D GetFilteredLanguage(UniLanguageList, Langu= ageFilterList) -=20 - =20 + + # # Create lines for each language's strings # @@ -340,7 +340,7 @@ def CreateCFileContent(BaseName, UniObjectClass, IsComp= atibleMode, UniBinBuffer, Language =3D UniObjectClass.LanguageDef[IndexI][0] if Language not in UniLanguageListFiltered: continue - =20 + StringBuffer =3D StringIO() StrStringValue =3D '' ArrayLength =3D 0 @@ -403,7 +403,7 @@ def CreateCFileContent(BaseName, UniObjectClass, IsComp= atibleMode, UniBinBuffer, # Add an EFI_HII_SIBT_END at last # Str =3D WriteLine(Str, ' ' + EFI_HII_SIBT_END + ",") - =20 + # # Create binary UNI string # @@ -458,7 +458,7 @@ def CreateCFileEnd(): # @param BaseName: The basename of strings # @param UniObjectClass A UniObjectClass instance # @param IsCompatibleMode Compatible Mode -# @param FilterInfo Platform language filter information=20 +# @param FilterInfo Platform language filter information # # @retval CFile: A string of complete .c file # @@ -544,7 +544,7 @@ def SearchString(UniObjectClass, FileList, IsCompatible= Mode): # This function is used for UEFI2.1 spec # # -def GetStringFiles(UniFilList, SourceFileList, IncludeList, IncludePathLis= t, SkipList, BaseName, IsCompatibleMode =3D False, ShellMode =3D False, Uni= GenCFlag =3D True, UniGenBinBuffer =3D None, FilterInfo =3D [True, []]): =20 +def GetStringFiles(UniFilList, SourceFileList, IncludeList, IncludePathLis= t, SkipList, BaseName, IsCompatibleMode =3D False, ShellMode =3D False, Uni= GenCFlag =3D True, UniGenBinBuffer =3D None, FilterInfo =3D [True, []]): if len(UniFilList) > 0: if ShellMode: # diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/= Source/Python/AutoGen/UniClassObject.py index 54b6fb22a08a..ba451044f8e9 100644 --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py @@ -283,7 +283,7 @@ class UniFileClassObject(object): if not IsLangInDef: # # The found STRING tokens will be added into new language stri= ng list - # so that the unique STRING identifier is reserved for all lan= guages in the package list.=20 + # so that the unique STRING identifier is reserved for all lan= guages in the package list. # FirstLangName =3D self.LanguageDef[0][0] if LangName !=3D FirstLangName: @@ -410,10 +410,10 @@ class UniFileClassObject(object): # # Ignore empty line # - if len(Line) =3D=3D 0:=20 - continue=20 - =20 - =20 + if len(Line) =3D=3D 0: + continue + + Line =3D Line.replace(u'/langdef', u'#langdef') Line =3D Line.replace(u'/string', u'#string') Line =3D Line.replace(u'/language', u'#language') @@ -428,8 +428,8 @@ class UniFileClassObject(object): Line =3D Line.replace(u'\\r', CR) Line =3D Line.replace(u'\\t', u' ') Line =3D Line.replace(u'\t', u' ') - Line =3D Line.replace(u'\\"', u'"')=20 - Line =3D Line.replace(u"\\'", u"'")=20 + Line =3D Line.replace(u'\\"', u'"') + Line =3D Line.replace(u"\\'", u"'") Line =3D Line.replace(BACK_SLASH_PLACEHOLDER, u'\\') =20 StartPos =3D Line.find(u'\\x') @@ -569,7 +569,7 @@ class UniFileClassObject(object): else: EdkLogger.error('Unicode File Parser', FORMAT_NOT_SUPPORTED, "= The language '%s' for %s is not defined in Unicode file %s." \ % (Language, Name, self.File)) - =20 + if Language not in self.OrderedStringList: self.OrderedStringList[Language] =3D [] self.OrderedStringDict[Language] =3D {} @@ -591,7 +591,7 @@ class UniFileClassObject(object): for LangName in self.LanguageDef: # # New STRING token will be added into all language str= ing lists. - # so that the unique STRING identifier is reserved for= all languages in the package list.=20 + # so that the unique STRING identifier is reserved for= all languages in the package list. # if LangName[0] !=3D Language: if UseOtherLangDef !=3D '': diff --git a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py b/B= aseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py index 92c8fe2df904..f5b1574e4440 100644 --- a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py +++ b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py @@ -24,7 +24,7 @@ from Common.DataType import * class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object): def __init__(self): self.var_check_info =3D [] - =20 + def push_back(self, var_check_tab): for tab in self.var_check_info: if tab.equal(var_check_tab): @@ -32,15 +32,15 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object): break else: self.var_check_info.append(var_check_tab) - =20 + def dump(self, dest, Phase): - =20 + FormatMap =3D {} FormatMap[1] =3D "=3DB" FormatMap[2] =3D "=3DH" FormatMap[4] =3D "=3DL" FormatMap[8] =3D "=3DQ" - =20 + if not os.path.isabs(dest): return if not os.path.exists(dest): @@ -179,7 +179,7 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object): b =3D pack("=3DB", var_check_tab.pad) Buffer +=3D b realLength +=3D 1 - =20 + DbFile =3D StringIO() if Phase =3D=3D 'DXE' and os.path.exists(BinFilePath): BinFile =3D open(BinFilePath, "rb") @@ -193,7 +193,7 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object): Buffer =3D BinBuffer + Buffer DbFile.write(Buffer) SaveFileOnChange(BinFilePath, DbFile.getvalue(), True) - =20 + =20 class VAR_CHECK_PCD_VARIABLE_TAB(object): pad =3D 0xDA @@ -211,26 +211,26 @@ class VAR_CHECK_PCD_VARIABLE_TAB(object): def UpdateSize(self): self.HeaderLength =3D 32 + len(self.Name.split(",")) self.Length =3D 32 + len(self.Name.split(",")) + self.GetValidTabL= en() - =20 + def GetValidTabLen(self): validtablen =3D 0 for item in self.validtab: - validtablen +=3D item.Length =20 - return validtablen=20 - =20 + validtablen +=3D item.Length + return validtablen + def SetAttributes(self, attributes): self.Attributes =3D attributes - =20 + def push_back(self, valid_obj): if valid_obj is not None: self.validtab.append(valid_obj) - =20 + def equal(self, varchecktab): if self.Guid =3D=3D varchecktab.Guid and self.Name =3D=3D varcheck= tab.Name: return True else: return False - =20 + def merge(self, varchecktab): for validobj in varchecktab.validtab: if validobj in self.validtab: @@ -253,10 +253,10 @@ class VAR_CHECK_PCD_VALID_OBJ(object): except: self.StorageWidth =3D 0 self.ValidData =3D False - =20 - def __eq__(self, validObj): =20 + + def __eq__(self, validObj): return validObj and self.VarOffset =3D=3D validObj.VarOffset - =20 + class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OBJ): def __init__(self, VarOffset, validlist, PcdDataType): super(VAR_CHECK_PCD_VALID_LIST, self).__init__(VarOffset, validlis= t, PcdDataType) @@ -264,7 +264,7 @@ class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OBJ): valid_num_list =3D [] for item in self.rawdata: valid_num_list.extend(item.split(',')) - =20 + for valid_num in valid_num_list: valid_num =3D valid_num.strip() =20 @@ -273,10 +273,10 @@ class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OB= J): else: self.data.add(int(valid_num)) =20 - =20 + self.Length =3D 5 + len(self.data) * self.StorageWidth - =20 - =20 + + class VAR_CHECK_PCD_VALID_RANGE(VAR_CHECK_PCD_VALID_OBJ): def __init__(self, VarOffset, validrange, PcdDataType): super(VAR_CHECK_PCD_VALID_RANGE, self).__init__(VarOffset, validra= nge, PcdDataType) @@ -293,7 +293,7 @@ class VAR_CHECK_PCD_VALID_RANGE(VAR_CHECK_PCD_VALID_OBJ= ): for obj in rangelist.pop(): self.data.add((obj.start, obj.end)) self.Length =3D 5 + len(self.data) * 2 * self.StorageWidth - =20 + =20 def GetValidationObject(PcdClass, VarOffset): if PcdClass.validateranges: diff --git a/BaseTools/Source/Python/BPDG/BPDG.py b/BaseTools/Source/Python= /BPDG/BPDG.py index 6c8f89f5d12b..4f7a73b7e688 100644 --- a/BaseTools/Source/Python/BPDG/BPDG.py +++ b/BaseTools/Source/Python/BPDG/BPDG.py @@ -1,9 +1,9 @@ ## @file # Intel Binary Product Data Generation Tool (Intel BPDG). -# This tool provide a simple process for the creation of a binary file co= ntaining read-only=20 -# configuration data for EDK II platforms that contain Dynamic and Dynami= cEx PCDs described=20 -# in VPD sections. It also provide an option for specifying an alternate = name for a mapping=20 -# file of PCD layout for use during the build when the platform integrato= r selects to use=20 +# This tool provide a simple process for the creation of a binary file co= ntaining read-only +# configuration data for EDK II platforms that contain Dynamic and Dynami= cEx PCDs described +# in VPD sections. It also provide an option for specifying an alternate = name for a mapping +# file of PCD layout for use during the build when the platform integrato= r selects to use # automatic offset calculation. # # Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
@@ -46,26 +46,26 @@ VERSION =3D (st.LBL_BPDG_VERSION + " Build "= + gBUILD_VERSION) # def main(): global Options, Args - =20 + # Initialize log system - EdkLogger.Initialize() =20 + EdkLogger.Initialize() Options, Args =3D MyOptionParser() - =20 + ReturnCode =3D 0 - =20 + if Options.opt_verbose: EdkLogger.SetLevel(EdkLogger.VERBOSE) elif Options.opt_quiet: EdkLogger.SetLevel(EdkLogger.QUIET) elif Options.debug_level is not None: - EdkLogger.SetLevel(Options.debug_level + 1)=20 + EdkLogger.SetLevel(Options.debug_level + 1) else: EdkLogger.SetLevel(EdkLogger.INFO) - =20 + if Options.bin_filename is None: - EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -= o option to specify the file name for the VPD binary file") =20 + EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -= o option to specify the file name for the VPD binary file") if Options.filename is None: - EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -= m option to specify the file name for the mapping file") =20 + EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -= m option to specify the file name for the mapping file") =20 Force =3D False if Options.opt_force is not None: @@ -75,8 +75,8 @@ def main(): StartBpdg(Args[0], Options.filename, Options.bin_filename, Force) else : EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please specify t= he file which contain the VPD pcd info.", - None) =20 - =20 + None) + return ReturnCode =20 =20 @@ -86,8 +86,8 @@ def main(): # # @retval options A optparse.Values object containing the parsed optio= ns # @retval args Target of BPDG command -# =20 -def MyOptionParser(): =20 +# +def MyOptionParser(): # # Process command line firstly. # @@ -105,10 +105,10 @@ def MyOptionParser(): parser.add_option('-o', '--vpd-filename', action=3D'store', dest=3D'bi= n_filename', help=3Dst.MSG_OPTION_VPD_FILENAME) parser.add_option('-m', '--map-filename', action=3D'store', dest=3D'fi= lename', - help=3Dst.MSG_OPTION_MAP_FILENAME) =20 + help=3Dst.MSG_OPTION_MAP_FILENAME) parser.add_option('-f', '--force', action=3D'store_true', dest=3D'opt_= force', - help=3Dst.MSG_OPTION_FORCE) =20 - =20 + help=3Dst.MSG_OPTION_FORCE) + (options, args) =3D parser.parse_args() if len(args) =3D=3D 0: EdkLogger.info("Please specify the filename.txt file which contain= the VPD pcd info!") @@ -117,7 +117,7 @@ def MyOptionParser(): return options, args =20 =20 -## Start BPDG and call the main functions=20 +## Start BPDG and call the main functions # # This method mainly focus on call GenVPD class member functions to comple= te # BPDG's target. It will process VpdFile override, and provide the interfa= ce file @@ -136,19 +136,19 @@ def StartBpdg(InputFileName, MapFileName, VpdFileName= , Force): choice =3D sys.stdin.readline() if choice.strip().lower() not in ['y', 'yes', '']: return - =20 + GenVPD =3D GenVpd.GenVPD (InputFileName, MapFileName, VpdFileName) - =20 - EdkLogger.info('%-24s =3D %s' % ("VPD input data file: ", InputFileNam= e)) =20 + + EdkLogger.info('%-24s =3D %s' % ("VPD input data file: ", InputFileNam= e)) EdkLogger.info('%-24s =3D %s' % ("VPD output map file: ", MapFileName)) - EdkLogger.info('%-24s =3D %s' % ("VPD output binary file: ", VpdFileNa= me)) =20 - =20 + EdkLogger.info('%-24s =3D %s' % ("VPD output binary file: ", VpdFileNa= me)) + GenVPD.ParserInputFile() GenVPD.FormatFileLine() GenVPD.FixVpdOffset() GenVPD.GenerateVpdFile(MapFileName, VpdFileName) - =20 - EdkLogger.info("- Vpd pcd fixed done! -") =20 + + EdkLogger.info("- Vpd pcd fixed done! -") =20 if __name__ =3D=3D '__main__': r =3D main() @@ -156,4 +156,4 @@ if __name__ =3D=3D '__main__': if r < 0 or r > 127: r =3D 1 sys.exit(r) =20 - =20 + diff --git a/BaseTools/Source/Python/BPDG/GenVpd.py b/BaseTools/Source/Pyth= on/BPDG/GenVpd.py index 69a9665f5a76..f83d477c35f0 100644 --- a/BaseTools/Source/Python/BPDG/GenVpd.py +++ b/BaseTools/Source/Python/BPDG/GenVpd.py @@ -31,10 +31,10 @@ _FORMAT_CHAR =3D {1: 'B', =20 ## The VPD PCD data structure for store and process each VPD PCD entry. # -# This class contain method to format and pack pcd's value. =20 +# This class contain method to format and pack pcd's value. # class PcdEntry: - def __init__(self, PcdCName, SkuId,PcdOffset, PcdSize, PcdValue, Linen= o=3DNone, FileName=3DNone, PcdUnpackValue=3DNone,=20 + def __init__(self, PcdCName, SkuId,PcdOffset, PcdSize, PcdValue, Linen= o=3DNone, FileName=3DNone, PcdUnpackValue=3DNone, PcdBinOffset=3DNone, PcdBinSize=3DNone, Alignment=3DNone): self.PcdCName =3D PcdCName.strip() self.SkuId =3D SkuId.strip() @@ -47,7 +47,7 @@ class PcdEntry: self.PcdBinOffset =3D PcdBinOffset self.PcdBinSize =3D PcdBinSize self.Alignment =3D Alignment - =20 + if self.PcdValue =3D=3D '' : EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invalid PCD format(Name: %s File: %s line: %s= ) , no Value specified!" % (self.PcdCName, self.FileName, self.Lineno)) @@ -63,13 +63,13 @@ class PcdEntry: self._GenOffsetValue () =20 ## Analyze the string value to judge the PCD's datum type equal to Boo= lean or not. - #=20 + # # @param ValueString PCD's value # @param Size PCD's size - # =20 + # # @retval True PCD's datum type is Boolean - # @retval False PCD's datum type is not Boolean. =20 - # =20 + # @retval False PCD's datum type is not Boolean. + # def _IsBoolean(self, ValueString, Size): if (Size =3D=3D "1"): if ValueString.upper() in ["TRUE", "FALSE"]: @@ -80,10 +80,10 @@ class PcdEntry: return False =20 ## Convert the PCD's value from string to integer. - # =20 + # # This function will try to convert the Offset value form string to i= nteger # for both hexadecimal and decimal. - # =20 + # def _GenOffsetValue(self): if self.PcdOffset !=3D "*" : try: @@ -96,10 +96,10 @@ class PcdEntry: "Invalid offset value %s for PCD %s (F= ile: %s Line: %s)" % (self.PcdOffset, self.PcdCName, self.FileName, self.Li= neno)) =20 ## Pack Boolean type VPD PCD's value form string to binary type. - #=20 + # # @param ValueString The boolean type string for pack. - #=20 - #=20 + # + # def _PackBooleanValue(self, ValueString): if ValueString.upper() =3D=3D "TRUE" or ValueString in ["1", "0x1"= , "0x01"]: try: @@ -115,10 +115,10 @@ class PcdEntry: "Invalid size or value for PCD %s to pack(= File: %s Line: %s)." % (self.PcdCName, self.FileName, self.Lineno)) =20 ## Pack Integer type VPD PCD's value form string to binary type. - #=20 + # # @param ValueString The Integer type string for pack. - #=20 - # =20 + # + # def _PackIntValue(self, IntValue, Size): if Size not in _FORMAT_CHAR: EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, @@ -170,7 +170,7 @@ class PcdEntry: # 3: {bytearray}, only support byte-array. # # @param ValueString The Integer type string for pack. - # =20 + # def _PackPtrValue(self, ValueString, Size): if ValueString.startswith('L"') or ValueString.startswith("L'"): self._PackUnicode(ValueString, Size) @@ -183,9 +183,9 @@ class PcdEntry: "Invalid VOID* type PCD %s value %s (File: %s = Line: %s)" % (self.PcdCName, ValueString, self.FileName, self.Lineno)) =20 ## Pack an Ascii PCD value. - # =20 + # # An Ascii string for a PCD should be in format as ""/''. - # =20 + # def _PackString(self, ValueString, Size): if (Size < 0): EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, @@ -198,7 +198,7 @@ class PcdEntry: QuotedFlag =3D False =20 ValueString =3D ValueString[1:-1] - # No null-terminator in 'string'=20 + # No null-terminator in 'string' if (QuotedFlag and len(ValueString) + 1 > Size) or (not QuotedFlag= and len(ValueString) > Size): EdkLogger.error("BPDG", BuildToolError.RESOURCE_OVERFLOW, "PCD value string %s is exceed to size %d(File= : %s Line: %s)" % (ValueString, Size, self.FileName, self.Lineno)) @@ -209,9 +209,9 @@ class PcdEntry: "Invalid size or value for PCD %s to pack(File= : %s Line: %s)." % (self.PcdCName, self.FileName, self.Lineno)) =20 ## Pack a byte-array PCD value. - # =20 + # # A byte-array for a PCD should be in format as {0x01, 0x02, ...}. - # =20 + # def _PackByteArray(self, ValueString, Size): if (Size < 0): EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invali= d parameter Size %s of PCD %s!(File: %s Line: %s)" % (self.PcdBinSize, self= .PcdCName, self.FileName, self.Lineno)) @@ -261,7 +261,7 @@ class PcdEntry: self.PcdValue =3D ReturnArray.tolist() =20 ## Pack a unicode PCD value into byte array. - # =20 + # # A unicode string for a PCD should be in format as L""/L''. # def _PackUnicode(self, UnicodeString, Size): @@ -271,7 +271,7 @@ class PcdEntry: =20 QuotedFlag =3D True if UnicodeString.startswith("L'"): - QuotedFlag =3D False=20 + QuotedFlag =3D False UnicodeString =3D UnicodeString[2:-1] =20 # No null-terminator in L'string' @@ -304,7 +304,7 @@ class PcdEntry: # 2. Format the input file data to remove unused lines; # 3. Fixed offset if needed; # 4. Generate output file, including guided.map and guided.bin file; -# =20 +# class GenVPD : ## Constructor of DscBuildData # @@ -334,9 +334,9 @@ class GenVPD : EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE, "Fil= e open failed for %s" % InputFileName, None) =20 ## - # Parser the input file which is generated by the build tool. Convert = the value of each pcd's=20 + # Parser the input file which is generated by the build tool. Convert = the value of each pcd's # from string to it's real format. Also remove the useless line in the= input file. - #=20 + # def ParserInputFile (self): count =3D 0 for line in self.FileLinesList: @@ -390,7 +390,7 @@ class GenVPD : # # After remove the useless line, if there are no data remain in th= e file line list, # Report warning messages to user's. - #=20 + # if len(self.FileLinesList) =3D=3D 0 : EdkLogger.warn('BPDG', BuildToolError.RESOURCE_NOT_AVAILABLE, "There are no VPD type pcds defined in DSC file= , Please check it.") @@ -399,7 +399,7 @@ class GenVPD : count =3D 0 for line in self.FileLinesList: if line is not None : - PCD =3D PcdEntry(line[0], line[1], line[2], line[3], line[= 4],line[5], self.InputFileName) =20 + PCD =3D PcdEntry(line[0], line[1], line[2], line[3], line[= 4],line[5], self.InputFileName) # Strip the space char PCD.PcdCName =3D PCD.PcdCName.strip(' ') PCD.SkuId =3D PCD.SkuId.strip(' ') @@ -480,14 +480,14 @@ class GenVPD : continue =20 ## - # This function used to create a clean list only contain useful inform= ation and reorganized to make it=20 + # This function used to create a clean list only contain useful inform= ation and reorganized to make it # easy to be sorted # def FormatFileLine (self) : =20 for eachPcd in self.FileLinesList : if eachPcd.PcdOffset !=3D '*' : - # Use pcd's Offset value as key, and pcd's Value as value=20 + # Use pcd's Offset value as key, and pcd's Value as value self.PcdFixedOffsetSizeList.append(eachPcd) else : # Use pcd's CName as key, and pcd's Size as value @@ -497,11 +497,11 @@ class GenVPD : ## # This function is use to fix the offset value which the not specified= in the map file. # Usually it use the star (meaning any offset) character in the offset= field - # =20 + # def FixVpdOffset (self): # At first, the offset should start at 0 # Sort fixed offset list in order to find out where has free space= s for the pcd's offset - # value is "*" to insert into. =20 + # value is "*" to insert into. =20 self.PcdFixedOffsetSizeList.sort(lambda x, y: cmp(x.PcdBinOffset, = y.PcdBinOffset)) =20 @@ -530,57 +530,57 @@ class GenVPD : Pcd.PcdBinOffset =3D NowOffset Pcd.PcdOffset =3D str(hex(Pcd.PcdBinOffset)) NowOffset +=3D Pcd.PcdOccupySize - =20 + self.PcdFixedOffsetSizeList =3D self.PcdUnknownOffsetList return =20 - # Check the offset of VPD type pcd's offset start from 0. =20 + # Check the offset of VPD type pcd's offset start from 0. if self.PcdFixedOffsetSizeList[0].PcdBinOffset !=3D 0 : EdkLogger.warn("BPDG", "The offset of VPD type pcd should star= t with 0, please check it.", None) =20 # Judge whether the offset in fixed pcd offset list is overlapped = or not. lenOfList =3D len(self.PcdFixedOffsetSizeList) - count =3D 0 =20 + count =3D 0 while (count < lenOfList - 1) : PcdNow =3D self.PcdFixedOffsetSizeList[count] PcdNext =3D self.PcdFixedOffsetSizeList[count+1] - # Two pcd's offset is same =20 + # Two pcd's offset is same if PcdNow.PcdBinOffset =3D=3D PcdNext.PcdBinOffset : EdkLogger.error("BPDG", BuildToolError.ATTRIBUTE_GET_FAILU= RE, "The offset of %s at line: %s is same with= %s at line: %s in file %s" % \ (PcdNow.PcdCName, PcdNow.Lineno, PcdNext.P= cdCName, PcdNext.Lineno, PcdNext.FileName), None) =20 - # Overlapped =20 + # Overlapped if PcdNow.PcdBinOffset + PcdNow.PcdOccupySize > PcdNext.PcdBin= Offset : EdkLogger.error("BPDG", BuildToolError.ATTRIBUTE_GET_FAILU= RE, "The offset of %s at line: %s is overlappe= d with %s at line: %s in file %s" % \ (PcdNow.PcdCName, PcdNow.Lineno, PcdNext.P= cdCName, PcdNext.Lineno, PcdNext.FileName), None) =20 - # Has free space, raise a warning message =20 + # Has free space, raise a warning message if PcdNow.PcdBinOffset + PcdNow.PcdOccupySize < PcdNext.PcdBin= Offset : EdkLogger.warn("BPDG", BuildToolError.ATTRIBUTE_GET_FAILUR= E, "The offsets have free space of between %s = at line: %s and %s at line: %s in file %s" % \ (PcdNow.PcdCName, PcdNow.Lineno, PcdNext.Pc= dCName, PcdNext.Lineno, PcdNext.FileName), None) count +=3D 1 - =20 + LastOffset =3D self.PcdFixedOffsetSizeList[0].PcdBinO= ffset FixOffsetSizeListCount =3D 0 lenOfList =3D len(self.PcdFixedOffsetSizeList) lenOfUnfixedList =3D len(self.PcdUnknownOffsetList) - =20 + ## - # Insert the un-fixed offset pcd's list into fixed offset pcd's li= st if has free space between those pcds.=20 - #=20 + # Insert the un-fixed offset pcd's list into fixed offset pcd's li= st if has free space between those pcds. + # while (FixOffsetSizeListCount < lenOfList) : - =20 - eachFixedPcd =3D self.PcdFixedOffsetSizeList[FixOffsetSize= ListCount] =20 + + eachFixedPcd =3D self.PcdFixedOffsetSizeList[FixOffsetSize= ListCount] NowOffset =3D eachFixedPcd.PcdBinOffset - =20 - # Has free space =20 + + # Has free space if LastOffset < NowOffset : if lenOfUnfixedList !=3D 0 : countOfUnfixedList =3D 0 @@ -598,42 +598,42 @@ class GenVPD : eachUnfixedPcd.PcdBinOffset =3D LastOffset # Insert this pcd into fixed offset pcd li= st. self.PcdFixedOffsetSizeList.insert(FixOffs= etSizeListCount,eachUnfixedPcd) - =20 + # Delete the item's offset that has been f= ixed and added into fixed offset list self.PcdUnknownOffsetList.pop(countOfUnfix= edList) - =20 + # After item added, should enlarge the len= gth of fixed pcd offset list - lenOfList +=3D 1 = =20 + lenOfList +=3D 1 FixOffsetSizeListCount +=3D 1 - =20 + # Decrease the un-fixed pcd offset list's = length lenOfUnfixedList -=3D 1 - =20 - # Modify the last offset value=20 - LastOffset +=3D needFixPcdSiz= e =20 + + # Modify the last offset value + LastOffset +=3D needFixPcdSize else : # It can not insert into those two pcds, n= eed to check still has other space can store it. LastOffset =3D NowOffset + sel= f.PcdFixedOffsetSizeList[FixOffsetSizeListCount].PcdOccupySize FixOffsetSizeListCount +=3D 1 break - = =20 + # Set the FixOffsetSizeListCount =3D lenOfList for quit th= e loop else : - FixOffsetSizeListCount =3D lenOfList = =20 - =20 - # No free space, smoothly connect with previous pcd.=20 + FixOffsetSizeListCount =3D lenOfList + + # No free space, smoothly connect with previous pcd. elif LastOffset =3D=3D NowOffset : LastOffset =3D NowOffset + eachFixedPcd.PcdOccupySize FixOffsetSizeListCount +=3D 1 - # Usually it will not enter into this thunk, if so, means it o= verlapped.=20 + # Usually it will not enter into this thunk, if so, means it o= verlapped. else : EdkLogger.error("BPDG", BuildToolError.ATTRIBUTE_NOT_AVAIL= ABLE, "The offset value definition has overlappe= d at pcd: %s, it's offset is: %s, in file: %s line: %s" % \ (eachFixedPcd.PcdCName, eachFixedPcd.PcdOf= fset, eachFixedPcd.InputFileName, eachFixedPcd.Lineno), None) FixOffsetSizeListCount +=3D 1 - =20 - # Continue to process the un-fixed offset pcd's list, add this tim= e, just append them behind the fixed pcd's offset list. =20 + + # Continue to process the un-fixed offset pcd's list, add this tim= e, just append them behind the fixed pcd's offset list. lenOfUnfixedList =3D len(self.PcdUnknownOffsetList) lenOfList =3D len(self.PcdFixedOffsetSizeList) while (lenOfUnfixedList > 0) : @@ -641,23 +641,23 @@ class GenVPD : # The last pcd instance LastPcd =3D self.PcdFixedOffsetSizeList[lenOfList-1] NeedFixPcd =3D self.PcdUnknownOffsetList[0] - =20 + NeedFixPcd.PcdBinOffset =3D LastPcd.PcdBinOffset + LastPcd.Pcd= OccupySize if NeedFixPcd.PcdBinOffset % NeedFixPcd.Alignment !=3D 0: NeedFixPcd.PcdBinOffset =3D (NeedFixPcd.PcdBinOffset / Nee= dFixPcd.Alignment + 1) * NeedFixPcd.Alignment =20 NeedFixPcd.PcdOffset =3D str(hex(NeedFixPcd.PcdBinOffset)) - =20 + # Insert this pcd into fixed offset pcd list's tail. self.PcdFixedOffsetSizeList.insert(lenOfList, NeedFixPcd) # Delete the item's offset that has been fixed and added into = fixed offset list self.PcdUnknownOffsetList.pop(0) - =20 + lenOfList +=3D 1 - lenOfUnfixedList -=3D 1 = =20 + lenOfUnfixedList -=3D 1 ## # Write the final data into output files. - # =20 + # def GenerateVpdFile (self, MapFileName, BinFileName): #Open an VPD file to process =20 @@ -705,4 +705,4 @@ class GenVPD : fStringIO.close () fVpdFile.close () fMapFile.close () - =20 + diff --git a/BaseTools/Source/Python/BPDG/StringTable.py b/BaseTools/Source= /Python/BPDG/StringTable.py index bbcb45119868..79acefaf0a94 100644 --- a/BaseTools/Source/Python/BPDG/StringTable.py +++ b/BaseTools/Source/Python/BPDG/StringTable.py @@ -31,7 +31,7 @@ MAP_FILE_COMMENT_TEMPLATE =3D \ # THIS IS AUTO-GENERATED FILE BY BPDG TOOLS AND PLEASE DO NOT MAKE MODIFI= CATION. # # This file lists all VPD informations for a platform fixed/adjusted by B= PDG tool. -#=20 +# # Copyright (c) 2010 -2016, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BS= D License @@ -53,15 +53,15 @@ LBL_BPDG_USAGE =3D \ Copyright (c) 2010 - 2016, Intel Corporation All Rights Reserved. =20 Intel(r) Binary Product Data Generation Tool (Intel(r) BPDG) - =20 + Required Flags: -o BIN_FILENAME, --vpd-filename=3DBIN_FILENAME Specify the file name for the VPD binary file -m FILENAME, --map-filename=3DFILENAME - Generate file name for consumption during the build that conta= ins=20 - the mapping of Pcd name, offset, datum size and value derived=20 + Generate file name for consumption during the build that conta= ins + the mapping of Pcd name, offset, datum size and value derived from the input file and any automatic calculations. -"""=20 +""" ) =20 MSG_OPTION_HELP =3D ("Show this help message and exit.") diff --git a/BaseTools/Source/Python/Common/BuildVersion.py b/BaseTools/Sou= rce/Python/Common/BuildVersion.py index 7414d30f49ea..6dda750dc687 100644 --- a/BaseTools/Source/Python/Common/BuildVersion.py +++ b/BaseTools/Source/Python/Common/BuildVersion.py @@ -4,9 +4,9 @@ # # Copyright (c) 2011, Intel Corporation. All rights reserved.
# -# This program and the accompanying materials are licensed and made availa= ble=20 -# under the terms and conditions of the BSD License which accompanies this=20 -# distribution. The full text of the license may be found at=20 +# This program and the accompanying materials are licensed and made availa= ble +# 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, diff --git a/BaseTools/Source/Python/Common/Database.py b/BaseTools/Source/= Python/Common/Database.py index a81a44731f03..ca1859a4b912 100644 --- a/BaseTools/Source/Python/Common/Database.py +++ b/BaseTools/Source/Python/Common/Database.py @@ -33,7 +33,7 @@ from Table.TableDsc import TableDsc # This class defined the build databse # During the phase of initialization, the database will create all tables = and # insert all records of table DataModel -#=20 +# # @param object: Inherited from object class # @param DbPath: A string for the path of the ECC database # @@ -54,7 +54,7 @@ class Database(object): self.TblInf =3D TableInf(self.Cur) self.TblDec =3D TableDec(self.Cur) self.TblDsc =3D TableDsc(self.Cur) - =20 + ## Initialize build database # # 1. Delete all old existing tables @@ -69,7 +69,7 @@ class Database(object): # self.TblDataModel.Drop() # self.TblDsc.Drop() # self.TblFile.Drop() - =20 + # # Create new tables # @@ -78,7 +78,7 @@ class Database(object): self.TblInf.Create() self.TblDec.Create() self.TblDsc.Create() - =20 + # # Initialize table DataModel # @@ -91,10 +91,10 @@ class Database(object): # def QueryTable(self, Table): Table.Query() - =20 + ## Close entire database # - # Commit all first=20 + # Commit all first # Close the connection and cursor # def Close(self): @@ -110,11 +110,10 @@ class Database(object): if __name__ =3D=3D '__main__': EdkLogger.Initialize() EdkLogger.SetLevel(EdkLogger.DEBUG_0) - =20 + Db =3D Database(DATABASE_PATH) Db.InitDatabase() - Db.QueryTable(Db.TblDataModel) =20 + Db.QueryTable(Db.TblDataModel) Db.QueryTable(Db.TblFile) Db.QueryTable(Db.TblDsc) Db.Close() - =20 \ No newline at end of file diff --git a/BaseTools/Source/Python/Common/MigrationUtilities.py b/BaseToo= ls/Source/Python/Common/MigrationUtilities.py index e9f1cabcb794..27d30a11b529 100644 --- a/BaseTools/Source/Python/Common/MigrationUtilities.py +++ b/BaseTools/Source/Python/Common/MigrationUtilities.py @@ -36,10 +36,10 @@ def SetCommon(Common, XmlCommon): =20 XmlTag =3D "FeatureFlag" Common.FeatureFlag =3D XmlAttribute(XmlCommon, XmlTag) - =20 + XmlTag =3D "SupArchList" Common.SupArchList =3D XmlAttribute(XmlCommon, XmlTag).split() - =20 + XmlTag =3D XmlNodeName(XmlCommon) + "/" + "HelpText" Common.HelpText =3D XmlElement(XmlCommon, XmlTag) =20 @@ -56,7 +56,7 @@ def SetCommon(Common, XmlCommon): # def SetIdentification(CommonHeader, XmlCommonHeader, NameTag, FileName): XmlParentTag =3D XmlNodeName(XmlCommonHeader) - =20 + XmlTag =3D XmlParentTag + "/" + NameTag CommonHeader.Name =3D XmlElement(XmlCommonHeader, XmlTag) =20 @@ -102,7 +102,7 @@ def AddToSpecificationDict(SpecificationDict, Specifica= tionString): def SetCommonHeader(CommonHeader, XmlCommonHeader): """Set all attributes of CommonHeaderClass object from XmlCommonHeader= """ XmlParent =3D XmlNodeName(XmlCommonHeader) - =20 + XmlTag =3D XmlParent + "/" + "Abstract" CommonHeader.Abstract =3D XmlElement(XmlCommonHeader, XmlTag) =20 @@ -144,16 +144,16 @@ def LoadClonedRecord(XmlCloned): =20 XmlTag =3D "Cloned/PackageGuid" ClonedRecord.PackageGuid =3D XmlElement(XmlCloned, XmlTag) - =20 + XmlTag =3D "Cloned/PackageVersion" ClonedRecord.PackageVersion =3D XmlElement(XmlCloned, XmlTag) - =20 + XmlTag =3D "Cloned/ModuleGuid" ClonedRecord.ModuleGuid =3D XmlElement(XmlCloned, XmlTag) - =20 + XmlTag =3D "Cloned/ModuleVersion" ClonedRecord.ModuleVersion =3D XmlElement(XmlCloned, XmlTag) - =20 + return ClonedRecord =20 =20 @@ -169,7 +169,7 @@ def LoadClonedRecord(XmlCloned): # def LoadGuidProtocolPpiCommon(XmlGuidProtocolPpiCommon): GuidProtocolPpiCommon =3D GuidProtocolPpiCommonClass() - =20 + XmlTag =3D "Name" GuidProtocolPpiCommon.Name =3D XmlAttribute(XmlGuidProtocolPpiCommon, = XmlTag) =20 @@ -180,19 +180,19 @@ def LoadGuidProtocolPpiCommon(XmlGuidProtocolPpiCommo= n): XmlTag =3D "%s/GuidCName" % XmlParent else: XmlTag =3D "%s/%sCName" % (XmlParent, XmlParent) - =20 + GuidProtocolPpiCommon.CName =3D XmlElement(XmlGuidProtocolPpiCommon, X= mlTag) - =20 + XmlTag =3D XmlParent + "/" + "GuidValue" GuidProtocolPpiCommon.Guid =3D XmlElement(XmlGuidProtocolPpiCommon, Xm= lTag) - =20 + if XmlParent.endswith("Notify"): GuidProtocolPpiCommon.Notify =3D True =20 XmlTag =3D "GuidTypeList" GuidTypes =3D XmlAttribute(XmlGuidProtocolPpiCommon, XmlTag) GuidProtocolPpiCommon.GuidTypeList =3D GuidTypes.split() - =20 + XmlTag =3D "SupModuleList" SupModules =3D XmlAttribute(XmlGuidProtocolPpiCommon, XmlTag) GuidProtocolPpiCommon.SupModuleList =3D SupModules.split() @@ -264,24 +264,24 @@ def LoadLibraryClass(XmlLibraryClass): if LibraryClass.LibraryClass =3D=3D "": XmlTag =3D "Name" LibraryClass.LibraryClass =3D XmlAttribute(XmlLibraryClass, XmlTag) - =20 + XmlTag =3D "LibraryClass/IncludeHeader" LibraryClass.IncludeHeader =3D XmlElement(XmlLibraryClass, XmlTag) - =20 + XmlTag =3D "RecommendedInstanceVersion" RecommendedInstanceVersion =3D XmlAttribute(XmlLibraryClass, XmlTag) LibraryClass.RecommendedInstanceVersion =3D RecommendedInstanceVersion - =20 + XmlTag =3D "RecommendedInstanceGuid" RecommendedInstanceGuid =3D XmlAttribute(XmlLibraryClass, XmlTag) LibraryClass.RecommendedInstanceGuid =3D RecommendedInstanceGuid - =20 + XmlTag =3D "SupModuleList" SupModules =3D XmlAttribute(XmlLibraryClass, XmlTag) LibraryClass.SupModuleList =3D SupModules.split() - =20 + SetCommon(LibraryClass, XmlLibraryClass) - =20 + return LibraryClass =20 =20 @@ -297,24 +297,24 @@ def LoadLibraryClass(XmlLibraryClass): def LoadBuildOption(XmlBuildOption): """Return a new BuildOptionClass object equivalent to XmlBuildOption""" BuildOption =3D BuildOptionClass() - =20 + BuildOption.Option =3D XmlElementData(XmlBuildOption) =20 XmlTag =3D "BuildTargets" BuildOption.BuildTargetList =3D XmlAttribute(XmlBuildOption, XmlTag).s= plit() - =20 + XmlTag =3D "ToolChainFamily" BuildOption.ToolChainFamily =3D XmlAttribute(XmlBuildOption, XmlTag) - =20 + XmlTag =3D "TagName" BuildOption.TagName =3D XmlAttribute(XmlBuildOption, XmlTag) - =20 + XmlTag =3D "ToolCode" BuildOption.ToolCode =3D XmlAttribute(XmlBuildOption, XmlTag) - =20 + XmlTag =3D "SupArchList" BuildOption.SupArchList =3D XmlAttribute(XmlBuildOption, XmlTag).split= () - =20 + return BuildOption =20 =20 @@ -330,15 +330,15 @@ def LoadBuildOption(XmlBuildOption): # def LoadUserExtensions(XmlUserExtensions): UserExtensions =3D UserExtensionsClass() - =20 + XmlTag =3D "UserID" UserExtensions.UserID =3D XmlAttribute(XmlUserExtensions, XmlTag) - =20 + XmlTag =3D "Identifier" UserExtensions.Identifier =3D XmlAttribute(XmlUserExtensions, XmlTag) - =20 + UserExtensions.Content =3D XmlElementData(XmlUserExtensions) - =20 + return UserExtensions =20 =20 @@ -490,7 +490,7 @@ def GetTextFileInfo(FileName, TagTuple): ValueTuple[Index] =3D Value except: EdkLogger.info("IO Error in reading file %s" % FileName) - =20 + return ValueTuple =20 =20 @@ -524,7 +524,7 @@ def MigrationOptionParser(Source, Destinate, ToolName, = VersionNumber=3D1.0): UsageString =3D "%s [-a] [-v|-q] [-o ] " % To= olName Version =3D "%s Version %.2f" % (ToolName, VersionNumber) Copyright =3D "Copyright (c) 2007, Intel Corporation. All rights reser= ved." - =20 + Parser =3D OptionParser(description=3DCopyright, version=3DVersion, us= age=3DUsageString) Parser.add_option("-o", "--output", dest=3D"OutputFile", help=3D"The n= ame of the %s file to be created." % Destinate) Parser.add_option("-a", "--auto", dest=3D"AutoWrite", action=3D"store_= true", default=3DFalse, help=3D"Automatically create the %s file using the = name of the %s file and replacing file extension" % (Source, Destinate)) @@ -540,7 +540,7 @@ def MigrationOptionParser(Source, Destinate, ToolName, = VersionNumber=3D1.0): EdkLogger.setLevel(EdkLogger.QUIET) else: EdkLogger.setLevel(EdkLogger.INFO) - =20 + # error check if len(Args) =3D=3D 0: raise MigrationError(PARAMETER_MISSING, name=3D"Input file", usage= =3DParser.get_usage()) diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Pyth= on/Common/Misc.py index f05ae39ebb29..f6ebaa60e23f 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -56,11 +56,11 @@ gFileTimeStampCache =3D {} # {file path : file time = stamp} gDependencyDatabase =3D {} # arch : {file path : [dependent files list]} =20 def GetVariableOffset(mapfilepath, efifilepath, varnames): - """ Parse map file to get variable offset in current EFI file=20 + """ Parse map file to get variable offset in current EFI file @param mapfilepath Map file absolution path @param efifilepath: EFI binary file full path @param varnames iteratable container whose elements are variable= names to be searched - =20 + @return List whos elements are tuple with variable name and raw offset """ lines =3D [] @@ -70,7 +70,7 @@ def GetVariableOffset(mapfilepath, efifilepath, varnames): f.close() except: return None - =20 + if len(lines) =3D=3D 0: return None firstline =3D lines[0].strip() if (firstline.startswith("Archive member included ") and @@ -170,7 +170,7 @@ def _parseGeneral(lines, efifilepath, varnames): continue if line.startswith("entry point at"): status =3D 3 - continue =20 + continue if status =3D=3D 1 and len(line) !=3D 0: m =3D secReGeneral.match(line) assert m is not None, "Fail to parse the section in map file ,= line is %s" % line @@ -250,7 +250,7 @@ def ProcessDuplicatedInf(Path, BaseName, Workspace): # # A temporary INF is copied to database path which must have write per= mission # The temporary will be removed at the end of build - # In case of name conflict, the file name is=20 + # In case of name conflict, the file name is # FILE_GUIDBaseName (0D1B936F-68F3-4589-AFCC-FB8B7AEBC836module.inf) # TempFullPath =3D os.path.join(DbDir, @@ -261,7 +261,7 @@ def ProcessDuplicatedInf(Path, BaseName, Workspace): # # To build same module more than once, the module path with FILE_GUID = overridden has # the file name FILE_GUIDmodule.inf, but the relative path (self.MetaF= ile.File) is the real path - # in DSC which is used as relative path by C files and other files in = INF.=20 + # in DSC which is used as relative path by C files and other files in = INF. # A trick was used: all module paths are PathClass instances, after th= e initialization # of PathClass, the PathClass.Path is overridden by the temporary INF = path. # @@ -1538,29 +1538,29 @@ def AnalyzeDscPcd(Setting, PcdType, DataType=3D''): # Used to avoid split issue while the value string contain "|" character # # @param[in] Setting: A String contain value/datum type/token number inf= ormation; -# =20 -# @retval ValueList: A List contain value, datum type and toke number.=20 +# +# @retval ValueList: A List contain value, datum type and toke number. # def AnalyzePcdData(Setting): ValueList =3D ['', '', ''] =20 ValueRe =3D re.compile(r'^\s*L?\".*\|.*\"') PtrValue =3D ValueRe.findall(Setting) - =20 + ValueUpdateFlag =3D False - =20 + if len(PtrValue) >=3D 1: Setting =3D re.sub(ValueRe, '', Setting) ValueUpdateFlag =3D True =20 TokenList =3D Setting.split(TAB_VALUE_SPLIT) ValueList[0:len(TokenList)] =3D TokenList - =20 + if ValueUpdateFlag: ValueList[0] =3D PtrValue[0] - =20 - return ValueList =20 -=20 + + return ValueList + ## check format of PCD value against its the datum type # # For PCD value setting @@ -1764,7 +1764,7 @@ class PathClass(object): OtherKey =3D Other.Path else: OtherKey =3D str(Other) - =20 + SelfKey =3D self.Path if SelfKey =3D=3D OtherKey: return 0 @@ -1902,7 +1902,7 @@ class PeImageClass(): def _ByteListToStr(self, ByteList): String =3D '' for index in range(len(ByteList)): - if ByteList[index] =3D=3D 0:=20 + if ByteList[index] =3D=3D 0: break String +=3D chr(ByteList[index]) return String @@ -1939,11 +1939,11 @@ class DefaultStore(): if sid =3D=3D minid: return name class SkuClass(): - =20 + DEFAULT =3D 0 SINGLE =3D 1 MULTIPLE =3D2 - =20 + def __init__(self,SkuIdentifier=3D'', SkuIds=3DNone): if SkuIds is None: SkuIds =3D {} @@ -1955,7 +1955,7 @@ class SkuClass(): EdkLogger.error("build", PARAMETER_INVALID, ExtraData =3D "SKU-ID [%s] value %s exceeds th= e max value of UINT64" % (SkuName, SkuId)) - =20 + self.AvailableSkuIds =3D sdict() self.SkuIdSet =3D [] self.SkuIdNumberSet =3D [] @@ -1969,10 +1969,10 @@ class SkuClass(): self.SkuIdSet =3D SkuIds.keys() self.SkuIdNumberSet =3D [num[0].strip() + 'U' for num in SkuId= s.values()] else: - r =3D SkuIdentifier.split('|')=20 + r =3D SkuIdentifier.split('|') self.SkuIdSet=3D[(r[k].strip()).upper() for k in range(len(r))] k =3D None - try:=20 + try: self.SkuIdNumberSet =3D [SkuIds[k][0].strip() + 'U' for k = in self.SkuIdSet] except Exception: EdkLogger.error("build", PARAMETER_INVALID, @@ -2021,7 +2021,7 @@ class SkuClass(): skuorderset =3D [] for skuname in self.SkuIdSet: skuorderset.append(self.GetSkuChain(skuname)) - =20 + skuorder =3D [] for index in range(max([len(item) for item in skuorderset])): for subset in skuorderset: @@ -2033,8 +2033,8 @@ class SkuClass(): =20 return skuorder =20 - def __SkuUsageType(self):=20 - =20 + def __SkuUsageType(self): + if self.__SkuIdentifier.upper() =3D=3D "ALL": return SkuClass.MULTIPLE =20 @@ -2067,7 +2067,7 @@ class SkuClass(): return ArrayStr def __GetAvailableSkuIds(self): return self.AvailableSkuIds - =20 + def __GetSystemSkuID(self): if self.__SkuUsageType() =3D=3D SkuClass.SINGLE: if len(self.SkuIdSet) =3D=3D 1: diff --git a/BaseTools/Source/Python/Common/MultipleWorkspace.py b/BaseTool= s/Source/Python/Common/MultipleWorkspace.py index 2a76d49cc627..a80f22ade7da 100644 --- a/BaseTools/Source/Python/Common/MultipleWorkspace.py +++ b/BaseTools/Source/Python/Common/MultipleWorkspace.py @@ -20,16 +20,16 @@ from Common.DataType import TAB_WORKSPACE ## MultipleWorkspace # # This class manage multiple workspace behavior -#=20 +# # @param class: # # @var WORKSPACE: defined the current WORKSPACE # @var PACKAGES_PATH: defined the other WORKSAPCE, if current WORKSPACE i= s invalid, search valid WORKSPACE from PACKAGES_PATH -#=20 +# class MultipleWorkspace(object): WORKSPACE =3D '' PACKAGES_PATH =3D None - =20 + ## convertPackagePath() # # Convert path to match workspace. @@ -59,7 +59,7 @@ class MultipleWorkspace(object): cls.PACKAGES_PATH =3D [cls.convertPackagePath (Ws, os.path.nor= mpath(Path.strip())) for Path in PackagesPath.split(os.pathsep)] else: cls.PACKAGES_PATH =3D [] - =20 + ## join() # # rewrite os.path.join function @@ -79,7 +79,7 @@ class MultipleWorkspace(object): return Path Path =3D os.path.join(Ws, *p) return Path - =20 + ## relpath() # # rewrite os.path.relpath function @@ -98,7 +98,7 @@ class MultipleWorkspace(object): if Path.lower().startswith(Ws.lower()): Path =3D os.path.relpath(Path, Ws) return Path - =20 + ## getWs() # # get valid workspace for the path @@ -117,7 +117,7 @@ class MultipleWorkspace(object): if os.path.exists(absPath): return Pkg return Ws - =20 + ## handleWsMacro() # # handle the $(WORKSPACE) tag, if current workspace is invalid path = relative the tool, replace it. @@ -143,7 +143,7 @@ class MultipleWorkspace(object): PathList[i] =3D str[0:MacroStartPos] + Path PathStr =3D ' '.join(PathList) return PathStr - =20 + ## getPkgPath() # # get all package pathes. @@ -153,4 +153,3 @@ class MultipleWorkspace(object): @classmethod def getPkgPath(cls): return cls.PACKAGES_PATH - =20 \ No newline at end of file diff --git a/BaseTools/Source/Python/Common/RangeExpression.py b/BaseTools/= Source/Python/Common/RangeExpression.py index 4d07bd752330..35b35e4893bc 100644 --- a/BaseTools/Source/Python/Common/RangeExpression.py +++ b/BaseTools/Source/Python/Common/RangeExpression.py @@ -42,7 +42,7 @@ ERR_IN_OPERAND =3D 'Macro after IN operator can only be: = $(FAMILY), $(ARCH), $(TOO =20 class RangeObject(object): def __init__(self, start, end, empty =3D False): - =20 + if int(start) < int(end): self.start =3D int(start) self.end =3D int(end) @@ -54,24 +54,24 @@ class RangeObject(object): class RangeContainer(object): def __init__(self): self.rangelist =3D [] - =20 + def push(self, RangeObject): self.rangelist.append(RangeObject) self.rangelist =3D sorted(self.rangelist, key =3D lambda rangeobj = : rangeobj.start) self.merge() - =20 + def pop(self): for item in self.rangelist: yield item - =20 - def __clean__(self): =20 + + def __clean__(self): newrangelist =3D [] for rangeobj in self.rangelist: if rangeobj.empty =3D=3D True: continue else: newrangelist.append(rangeobj) - self.rangelist =3D newrangelist =20 + self.rangelist =3D newrangelist def merge(self): self.__clean__() for i in range(0, len(self.rangelist) - 1): @@ -79,23 +79,23 @@ class RangeContainer(object): continue else: self.rangelist[i + 1].start =3D self.rangelist[i].start - self.rangelist[i + 1].end =3D self.rangelist[i + 1].end > = self.rangelist[i].end and self.rangelist[i + 1].end or self.rangelist[i].en= d=20 + self.rangelist[i + 1].end =3D self.rangelist[i + 1].end > = self.rangelist[i].end and self.rangelist[i + 1].end or self.rangelist[i].end self.rangelist[i].empty =3D True =20 self.__clean__() - =20 + def dump(self): print "----------------------" rangelist =3D "" for object in self.rangelist: rangelist =3D rangelist + "[%d , %d]" % (object.start, object.= end) print rangelist - =20 - =20 -class XOROperatorObject(object): =20 - def __init__(self): =20 + + +class XOROperatorObject(object): + def __init__(self): pass - def Calculate(self, Operand, DataType, SymbolTable):=20 + def Calculate(self, Operand, DataType, SymbolTable): if type(Operand) =3D=3D type('') and not Operand.isalnum(): Expr =3D "XOR ..." raise BadExpression(ERR_SNYTAX % Expr) @@ -107,9 +107,9 @@ class XOROperatorObject(object): return rangeId =20 class LEOperatorObject(object): - def __init__(self): =20 + def __init__(self): pass - def Calculate(self, Operand, DataType, SymbolTable):=20 + def Calculate(self, Operand, DataType, SymbolTable): if type(Operand) =3D=3D type('') and not Operand.isalnum(): Expr =3D "LE ..." raise BadExpression(ERR_SNYTAX % Expr) @@ -119,22 +119,22 @@ class LEOperatorObject(object): SymbolTable[rangeId1] =3D rangeContainer return rangeId1 class LTOperatorObject(object): - def __init__(self): =20 + def __init__(self): pass def Calculate(self, Operand, DataType, SymbolTable): if type(Operand) =3D=3D type('') and not Operand.isalnum(): - Expr =3D "LT ..."=20 - raise BadExpression(ERR_SNYTAX % Expr)=20 + Expr =3D "LT ..." + raise BadExpression(ERR_SNYTAX % Expr) rangeId1 =3D str(uuid.uuid1()) rangeContainer =3D RangeContainer() rangeContainer.push(RangeObject(0, int(Operand) - 1)) SymbolTable[rangeId1] =3D rangeContainer - return rangeId1 =20 + return rangeId1 =20 class GEOperatorObject(object): - def __init__(self): =20 + def __init__(self): pass - def Calculate(self, Operand, DataType, SymbolTable):=20 + def Calculate(self, Operand, DataType, SymbolTable): if type(Operand) =3D=3D type('') and not Operand.isalnum(): Expr =3D "GE ..." raise BadExpression(ERR_SNYTAX % Expr) @@ -142,12 +142,12 @@ class GEOperatorObject(object): rangeContainer =3D RangeContainer() rangeContainer.push(RangeObject(int(Operand), MAX_VAL_TYPE[DataTyp= e])) SymbolTable[rangeId1] =3D rangeContainer - return rangeId1 =20 - =20 + return rangeId1 + class GTOperatorObject(object): - def __init__(self): =20 + def __init__(self): pass - def Calculate(self, Operand, DataType, SymbolTable):=20 + def Calculate(self, Operand, DataType, SymbolTable): if type(Operand) =3D=3D type('') and not Operand.isalnum(): Expr =3D "GT ..." raise BadExpression(ERR_SNYTAX % Expr) @@ -155,12 +155,12 @@ class GTOperatorObject(object): rangeContainer =3D RangeContainer() rangeContainer.push(RangeObject(int(Operand) + 1, MAX_VAL_TYPE[Dat= aType])) SymbolTable[rangeId1] =3D rangeContainer - return rangeId1 =20 - =20 + return rangeId1 + class EQOperatorObject(object): - def __init__(self): =20 + def __init__(self): pass - def Calculate(self, Operand, DataType, SymbolTable):=20 + def Calculate(self, Operand, DataType, SymbolTable): if type(Operand) =3D=3D type('') and not Operand.isalnum(): Expr =3D "EQ ..." raise BadExpression(ERR_SNYTAX % Expr) @@ -168,8 +168,8 @@ class EQOperatorObject(object): rangeContainer =3D RangeContainer() rangeContainer.push(RangeObject(int(Operand) , int(Operand))) SymbolTable[rangeId1] =3D rangeContainer - return rangeId1 =20 - =20 + return rangeId1 + def GetOperatorObject(Operator): if Operator =3D=3D '>': return GTOperatorObject() @@ -213,8 +213,8 @@ class RangeExpression(object): NumberDict[HexNumber] =3D Number for HexNum in NumberDict: expr =3D expr.replace(HexNum, NumberDict[HexNum]) - =20 - rangedict =3D {} =20 + + rangedict =3D {} for validrange in self.RangePattern.findall(expr): start, end =3D validrange.split(" - ") start =3D start.strip() @@ -224,19 +224,19 @@ class RangeExpression(object): rangeContainer.push(RangeObject(start, end)) self.operanddict[str(rangeid)] =3D rangeContainer rangedict[validrange] =3D str(rangeid) - =20 + for validrange in rangedict: expr =3D expr.replace(validrange, rangedict[validrange]) - =20 - self._Expr =3D expr =20 + + self._Expr =3D expr return expr - =20 - =20 + + def EvalRange(self, Operator, Oprand): =20 operatorobj =3D GetOperatorObject(Operator) return operatorobj.Calculate(Oprand, self.PcdDataType, self.operan= ddict) - =20 + def Rangeintersection(self, Oprand1, Oprand2): rangeContainer1 =3D self.operanddict[Oprand1] rangeContainer2 =3D self.operanddict[Oprand2] @@ -265,35 +265,35 @@ class RangeExpression(object): elif end1 >=3D end2: rangeid =3D str(uuid.uuid1()) rangeContainer.push(RangeObject(start2, end2)) - =20 + self.operanddict[rangeid] =3D rangeContainer # rangeContainer.dump() return rangeid - =20 + def Rangecollections(self, Oprand1, Oprand2): =20 rangeContainer1 =3D self.operanddict[Oprand1] rangeContainer2 =3D self.operanddict[Oprand2] rangeContainer =3D RangeContainer() - =20 + for rangeobj in rangeContainer2.pop(): rangeContainer.push(rangeobj) for rangeobj in rangeContainer1.pop(): rangeContainer.push(rangeobj) - =20 + rangeid =3D str(uuid.uuid1()) self.operanddict[rangeid] =3D rangeContainer - =20 + # rangeContainer.dump() return rangeid - =20 - =20 + + def NegtiveRange(self, Oprand1): rangeContainer1 =3D self.operanddict[Oprand1] - =20 - =20 + + rangeids =3D [] - =20 + for rangeobj in rangeContainer1.pop(): rangeContainer =3D RangeContainer() rangeid =3D str(uuid.uuid1()) @@ -320,13 +320,13 @@ class RangeExpression(object): re =3D self.Rangeintersection(rangeids[0], rangeids[1]) for i in range(2, len(rangeids)): re =3D self.Rangeintersection(re, rangeids[i]) - =20 + rangeid2 =3D str(uuid.uuid1()) self.operanddict[rangeid2] =3D self.operanddict[re] return rangeid2 - =20 + def Eval(self, Operator, Oprand1, Oprand2 =3D None): - =20 + if Operator in ["!", "NOT", "not"]: if not gGuidPattern.match(Oprand1.strip()): raise BadExpression(ERR_STRING_EXPR % Operator) @@ -337,7 +337,7 @@ class RangeExpression(object): elif Operator =3D=3D 'and' : if not gGuidPatternEnd.match(Oprand1.strip()) or not gGuid= PatternEnd.match(Oprand2.strip()): raise BadExpression(ERR_STRING_EXPR % Operator) - return self.Rangeintersection(Oprand1, Oprand2) =20 + return self.Rangeintersection(Oprand1, Oprand2) elif Operator =3D=3D 'or': if not gGuidPatternEnd.match(Oprand1.strip()) or not gGuid= PatternEnd.match(Oprand2.strip()): raise BadExpression(ERR_STRING_EXPR % Operator) @@ -367,11 +367,11 @@ class RangeExpression(object): self._Len =3D len(self._Expr) self._Token =3D '' self._WarnExcept =3D None - =20 + =20 # Literal token without any conversion self._LiteralToken =3D '' - =20 + # store the operand object self.operanddict =3D {} # The Pcd max value depends on PcdDataType @@ -391,9 +391,9 @@ class RangeExpression(object): self._Depth =3D Depth =20 self._Expr =3D self._Expr.strip() - =20 + self.preProcessRangeExpr(self._Expr) - =20 + # check if the expression does not need to evaluate if RealValue and Depth =3D=3D 0: self._Token =3D self._Expr @@ -405,12 +405,12 @@ class RangeExpression(object): =20 Val =3D self._OrExpr() RealVal =3D Val - =20 + RangeIdList =3D RealVal.split("or") RangeList =3D [] for rangeid in RangeIdList: RangeList.append(self.operanddict[rangeid.strip()]) - =20 + return RangeList =20 # Template function to parse binary operators which have same preceden= ce @@ -706,10 +706,10 @@ class RangeExpression(object): return False =20 =20 - =20 - =20 - =20 - =20 + + + + =20 =20 =20 diff --git a/BaseTools/Source/Python/Common/String.py b/BaseTools/Source/Py= thon/Common/String.py index ee26d7f7b1b0..389a3ca51d27 100644 --- a/BaseTools/Source/Python/Common/String.py +++ b/BaseTools/Source/Python/Common/String.py @@ -839,7 +839,7 @@ def StringToArray(String): return "{%s,0x00}" % ",".join([ C.strip() for C in String[1:-1= ].split(',')]) else: return "{%s}" % ",".join([ C.strip() for C in String[1:-1].spl= it(',')]) - =20 + else: if len(String.split()) % 2: return '{%s,0}' % ','.join(String.split()) diff --git a/BaseTools/Source/Python/Common/ToolDefClassObject.py b/BaseToo= ls/Source/Python/Common/ToolDefClassObject.py index 49b24ef780c7..83359586b994 100644 --- a/BaseTools/Source/Python/Common/ToolDefClassObject.py +++ b/BaseTools/Source/Python/Common/ToolDefClassObject.py @@ -92,7 +92,7 @@ class ToolDefClassObject(object): =20 KeyList =3D [TAB_TOD_DEFINES_TARGET, TAB_TOD_DEFINES_TOOL_CHAIN_TA= G, TAB_TOD_DEFINES_TARGET_ARCH, TAB_TOD_DEFINES_COMMAND_TYPE] for Index in range(3, -1, -1): - # make a copy of the keys to enumerate over to prevent issues = when=20 + # make a copy of the keys to enumerate over to prevent issues = when # adding/removing items from the original dict. for Key in list(self.ToolsDefTxtDictionary.keys()): List =3D Key.split('_') diff --git a/BaseTools/Source/Python/Common/VariableAttributes.py b/BaseToo= ls/Source/Python/Common/VariableAttributes.py index a2e22ca0409c..24d6f066fa3b 100644 --- a/BaseTools/Source/Python/Common/VariableAttributes.py +++ b/BaseTools/Source/Python/Common/VariableAttributes.py @@ -1,5 +1,5 @@ # # @file -#=20 +# # This file is used to handle the variable attributes and property informa= tion # # @@ -12,7 +12,7 @@ # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. # - =20 + class VariableAttributes(object): EFI_VARIABLE_NON_VOLATILE =3D 0x00000001 EFI_VARIABLE_BOOTSERVICE_ACCESS =3D 0x00000002 @@ -24,22 +24,22 @@ class VariableAttributes(object): "RT":EFI_VARIABLE_RUNTIME_ACCESS, "RO":VAR_CHECK_VARIABLE_PROPERTY_READ_ONLY } - =20 + def __init__(self): pass - =20 + @staticmethod def GetVarAttributes(var_attr_str): VarAttr =3D 0x00000000 VarProp =3D 0x00000000 - =20 + attr_list =3D var_attr_str.split(",") for attr in attr_list: attr =3D attr.strip() if attr =3D=3D 'RO': VarProp =3D VariableAttributes.VAR_CHECK_VARIABLE_PROPERTY= _READ_ONLY else: - VarAttr =3D VarAttr | VariableAttributes.VarAttributesMap.= get(attr, 0x00000000) =20 + VarAttr =3D VarAttr | VariableAttributes.VarAttributesMap.= get(attr, 0x00000000) return VarAttr, VarProp @staticmethod def ValidateVarAttributes(var_attr_str): diff --git a/BaseTools/Source/Python/Common/VpdInfoFile.py b/BaseTools/Sour= ce/Python/Common/VpdInfoFile.py index 32895deb5d0c..c9fdbff20e0b 100644 --- a/BaseTools/Source/Python/Common/VpdInfoFile.py +++ b/BaseTools/Source/Python/Common/VpdInfoFile.py @@ -1,9 +1,9 @@ ## @file -#=20 +# # This package manage the VPD PCD information file which will be generated # by build tool's autogen. # The VPD PCD information file will be input for third-party BPDG tool whi= ch -# is pointed by *_*_*_VPD_TOOL_GUID in conf/tools_def.txt=20 +# is pointed by *_*_*_VPD_TOOL_GUID in conf/tools_def.txt # # # Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
@@ -32,7 +32,7 @@ FILE_COMMENT_TEMPLATE =3D \ # THIS IS AUTO-GENERATED FILE BY BUILD TOOLS AND PLEASE DO NOT MAKE MODIF= ICATION. # # This file lists all VPD informations for a platform collected by build.= exe. -#=20 +# # Copyright (c) 2010, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BS= D License @@ -69,17 +69,17 @@ FILE_COMMENT_TEMPLATE =3D \ # class VpdInfoFile: =20 - _rVpdPcdLine =3D None=20 + _rVpdPcdLine =3D None ## Constructor def __init__(self): ## Dictionary for VPD in following format # - # Key : PcdClassObject instance.=20 + # Key : PcdClassObject instance. # @see BuildClassObject.PcdClassObject # Value : offset in different SKU such as [sku1_offset, sku2_off= set] self._VpdArray =3D {} self._VpdInfo =3D {} - =20 + ## Add a VPD PCD collected from platform's autogen when building. # # @param vpds The list of VPD PCD collected for a platform. @@ -90,40 +90,40 @@ class VpdInfoFile: def Add(self, Vpd, skuname,Offset): if (Vpd is None): EdkLogger.error("VpdInfoFile", BuildToolError.ATTRIBUTE_UNKNOW= N_ERROR, "Invalid VPD PCD entry.") - =20 + if not (Offset >=3D 0 or Offset =3D=3D "*"): EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALI= D, "Invalid offset parameter: %s." % Offset) - =20 + if Vpd.DatumType =3D=3D TAB_VOID: if Vpd.MaxDatumSize <=3D 0: - EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_IN= VALID,=20 + EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_IN= VALID, "Invalid max datum size for VPD PCD %s.%s"= % (Vpd.TokenSpaceGuidCName, Vpd.TokenCName)) - elif Vpd.DatumType in TAB_PCD_NUMERIC_TYPES:=20 + elif Vpd.DatumType in TAB_PCD_NUMERIC_TYPES: if not Vpd.MaxDatumSize: Vpd.MaxDatumSize =3D MAX_SIZE_TYPE[Vpd.DatumType] else: if Vpd.MaxDatumSize <=3D 0: EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_IN= VALID, "Invalid max datum size for VPD PCD %s.%s"= % (Vpd.TokenSpaceGuidCName, Vpd.TokenCName)) - =20 + if Vpd not in self._VpdArray: # - # If there is no Vpd instance in dict, that imply this offset = for a given SKU is a new one=20 + # If there is no Vpd instance in dict, that imply this offset = for a given SKU is a new one # self._VpdArray[Vpd] =3D {} =20 self._VpdArray[Vpd].update({skuname:Offset}) - =20 - =20 + + ## Generate VPD PCD information into a text file - # =20 + # # If parameter FilePath is invalid, then assert. - # If=20 + # If # @param FilePath The given file path which would hold VPD inf= ormation def Write(self, FilePath): if not (FilePath is not None or len(FilePath) !=3D 0): - EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALI= D, =20 - "Invalid parameter FilePath: %s." % FilePath) = =20 + EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALI= D, + "Invalid parameter FilePath: %s." % FilePath) =20 Content =3D FILE_COMMENT_TEMPLATE Pcds =3D self._VpdArray.keys() @@ -155,15 +155,15 @@ class VpdInfoFile: try: fd =3D open(FilePath, "r") except: - EdkLogger.error("VpdInfoFile",=20 - BuildToolError.FILE_OPEN_FAILURE,=20 + EdkLogger.error("VpdInfoFile", + BuildToolError.FILE_OPEN_FAILURE, "Fail to open file %s for written." % FilePath) Lines =3D fd.readlines() for Line in Lines: Line =3D Line.strip() if len(Line) =3D=3D 0 or Line.startswith("#"): continue - =20 + # # the line must follow output format defined in BPDG spec. # @@ -173,9 +173,9 @@ class VpdInfoFile: TokenSpaceName, PcdTokenName =3D PcdName.split(".") except: EdkLogger.error("BPDG", BuildToolError.PARSER_ERROR, "Fail= to parse VPD information file %s" % FilePath) - =20 + Found =3D False - =20 + if (TokenSpaceName, PcdTokenName) not in self._VpdInfo: self._VpdInfo[(TokenSpaceName, PcdTokenName)] =3D [] self._VpdInfo[(TokenSpaceName, PcdTokenName)].append((SkuId,Of= fset, Value)) @@ -188,61 +188,61 @@ class VpdInfoFile: if VpdObject.TokenSpaceGuidCName =3D=3D TokenSpaceName= and VpdObjectTokenCName =3D=3D PcdTokenName.strip() and sku =3D=3D SkuId: if self._VpdArray[VpdObject][sku] =3D=3D "*": if Offset =3D=3D "*": - EdkLogger.error("BPDG", BuildToolError.FOR= MAT_INVALID, "The offset of %s has not been fixed up by third-party BPDG to= ol." % PcdName) =20 + EdkLogger.error("BPDG", BuildToolError.FOR= MAT_INVALID, "The offset of %s has not been fixed up by third-party BPDG to= ol." % PcdName) self._VpdArray[VpdObject][sku] =3D Offset Found =3D True if not Found: EdkLogger.error("BPDG", BuildToolError.PARSER_ERROR, "Can = not find PCD defined in VPD guid file.") - =20 + ## Get count of VPD PCD collected from platform's autogen when buildin= g. # - # @return The integer count value=20 + # @return The integer count value def GetCount(self): Count =3D 0 for OffsetList in self._VpdArray.values(): Count +=3D len(OffsetList) - =20 + return Count - =20 + ## Get an offset value for a given VPD PCD # - # Because BPDG only support one Sku, so only return offset for SKU de= fault. =20 + # Because BPDG only support one Sku, so only return offset for SKU de= fault. # - # @param vpd A given VPD PCD=20 + # @param vpd A given VPD PCD def GetOffset(self, vpd): if not self._VpdArray.has_key(vpd): return None - =20 + if len(self._VpdArray[vpd]) =3D=3D 0: return None - =20 + return self._VpdArray[vpd] def GetVpdInfo(self,(PcdTokenName,TokenSpaceName)): return self._VpdInfo.get((TokenSpaceName, PcdTokenName)) - =20 + ## Call external BPDG tool to process VPD file -# =20 +# # @param ToolPath The string path name for BPDG tool # @param VpdFileName The string path name for VPD information guid.txt -#=20 +# def CallExtenalBPDGTool(ToolPath, VpdFileName): assert ToolPath is not None, "Invalid parameter ToolPath" assert VpdFileName is not None and os.path.exists(VpdFileName), "Inval= id parameter VpdFileName" - =20 + OutputDir =3D os.path.dirname(VpdFileName) FileName =3D os.path.basename(VpdFileName) BaseName, ext =3D os.path.splitext(FileName) OutputMapFileName =3D os.path.join(OutputDir, "%s.map" % BaseName) OutputBinFileName =3D os.path.join(OutputDir, "%s.bin" % BaseName) - =20 + try: PopenObject =3D subprocess.Popen(' '.join([ToolPath, - '-o', OutputBinFileName,=20 + '-o', OutputBinFileName, '-m', OutputMapFileName, '-q', '-f', VpdFileName]), - stdout=3Dsubprocess.PIPE,=20 + stdout=3Dsubprocess.PIPE, stderr=3D subprocess.PIPE, shell=3DTrue) except Exception, X: @@ -251,11 +251,11 @@ def CallExtenalBPDGTool(ToolPath, VpdFileName): print out while PopenObject.returncode is None : PopenObject.wait() - =20 + if PopenObject.returncode !=3D 0: if PopenObject.returncode !=3D 0: EdkLogger.debug(EdkLogger.DEBUG_1, "Fail to call BPDG tool", s= tr(error)) EdkLogger.error("BPDG", BuildToolError.COMMAND_FAILURE, "Fail = to execute BPDG tool with exit code: %d, the error message is: \n %s" % \ (PopenObject.returncode, str(error))) - =20 + return PopenObject.returncode diff --git a/BaseTools/Source/Python/CommonDataClass/FdfClass.py b/BaseTool= s/Source/Python/CommonDataClass/FdfClass.py index 96a630f4d2cc..563a7c9ddbd9 100644 --- a/BaseTools/Source/Python/CommonDataClass/FdfClass.py +++ b/BaseTools/Source/Python/CommonDataClass/FdfClass.py @@ -83,7 +83,7 @@ class RegionClassObject: =20 ## FFS data in FDF # -# =20 +# class FfsClassObject: ## The constructor # @@ -98,7 +98,7 @@ class FfsClassObject: =20 ## FILE statement data in FDF # -# =20 +# class FileStatementClassObject (FfsClassObject) : ## The constructor # @@ -149,7 +149,7 @@ class AprioriSectionClassObject: =20 ## section data in FDF # -# =20 +# class SectionClassObject: ## The constructor # @@ -157,10 +157,10 @@ class SectionClassObject: # def __init__(self): self.Alignment =3D None - =20 + ## Depex expression section in FDF # -# =20 +# class DepexSectionClassObject (SectionClassObject): ## The constructor # @@ -186,7 +186,7 @@ class CompressSectionClassObject (SectionClassObject) : =20 ## Data section data in FDF # -# =20 +# class DataSectionClassObject (SectionClassObject): ## The constructor # @@ -220,7 +220,7 @@ class EfiSectionClassObject (SectionClassObject): =20 ## FV image section data in FDF # -# =20 +# class FvImageSectionClassObject (SectionClassObject): ## The constructor # @@ -237,7 +237,7 @@ class FvImageSectionClassObject (SectionClassObject): =20 ## GUIDed section data in FDF # -# =20 +# class GuidSectionClassObject (SectionClassObject) : ## The constructor # @@ -270,7 +270,7 @@ class UiSectionClassObject (SectionClassObject): =20 ## Version section data in FDF # -# =20 +# class VerSectionClassObject (SectionClassObject): ## The constructor # @@ -305,7 +305,7 @@ class RuleClassObject : =20 ## Complex rule data in FDF # -# =20 +# class RuleComplexFileClassObject(RuleClassObject) : ## The constructor # @@ -343,7 +343,7 @@ class RuleFileExtensionClassObject(RuleClassObject): =20 ## Capsule data in FDF # -# =20 +# class CapsuleClassObject : ## The constructor # @@ -380,7 +380,7 @@ class VtfClassObject : =20 ## VTF component data in FDF # -# =20 +# class ComponentStatementClassObject : ## The constructor # @@ -396,7 +396,7 @@ class ComponentStatementClassObject : self.CompSym =3D None self.CompSize =3D None self.FilePos =3D None -=20 + ## OptionROM data in FDF # # @@ -408,4 +408,4 @@ class OptionRomClassObject: def __init__(self): self.DriverName =3D None self.FfsList =3D [] - =20 + diff --git a/BaseTools/Source/Python/Ecc/CLexer.py b/BaseTools/Source/Pytho= n/Ecc/CLexer.py index a496f4344030..c7956e8ddae6 100644 --- a/BaseTools/Source/Python/Ecc/CLexer.py +++ b/BaseTools/Source/Python/Ecc/CLexer.py @@ -2,7 +2,7 @@ =20 from antlr3 import * from antlr3.compat import set, frozenset - =20 + ## @file # The file defines the Lexer for C source files. # @@ -4341,7 +4341,7 @@ class CLexer(Lexer): u"\12\uffff" ) =20 - =20 + DFA25_transition =3D [ DFA.unpack(u"\1\2\1\uffff\12\1"), DFA.unpack(u"\1\3\1\uffff\12\1\12\uffff\1\5\1\4\1\5\35\uffff\1\5" @@ -4479,7 +4479,7 @@ class CLexer(Lexer): u"\u0192\uffff" ) =20 - =20 + DFA35_transition =3D [ DFA.unpack(u"\6\73\2\70\1\73\2\70\22\73\1\70\1\50\1\65\1\72\1\63" u"\1\45\1\46\1\64\1\34\1\35\1\40\1\42\1\3\1\43\1\41\1\44\1\66\11" @@ -4943,5 +4943,5 @@ class CLexer(Lexer): # class definition for DFA #35 =20 DFA35 =3D DFA -=20 + =20 diff --git a/BaseTools/Source/Python/Ecc/CParser.py b/BaseTools/Source/Pyth= on/Ecc/CParser.py index 94711a9a378a..e817af86f702 100644 --- a/BaseTools/Source/Python/Ecc/CParser.py +++ b/BaseTools/Source/Python/Ecc/CParser.py @@ -2,7 +2,7 @@ =20 from antlr3 import * from antlr3.compat import set, frozenset - =20 + ## @file # The file defines the parser for C source files. # @@ -56,23 +56,23 @@ OctalEscape=3D17 =20 # token names tokenNames =3D [ - "", "", "", "",=20 - "IDENTIFIER", "HEX_LITERAL", "OCTAL_LITERAL", "DECIMAL_LITERAL", "CHAR= ACTER_LITERAL",=20 - "STRING_LITERAL", "FLOATING_POINT_LITERAL", "LETTER", "EscapeSequence"= ,=20 - "HexDigit", "IntegerTypeSuffix", "Exponent", "FloatTypeSuffix", "Octal= Escape",=20 - "UnicodeEscape", "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COM= MENT",=20 - "LINE_COMMAND", "';'", "'typedef'", "','", "'=3D'", "'extern'", "'stat= ic'",=20 - "'auto'", "'register'", "'STATIC'", "'void'", "'char'", "'short'", "'i= nt'",=20 - "'long'", "'float'", "'double'", "'signed'", "'unsigned'", "'{'", "'}'= ",=20 - "'struct'", "'union'", "':'", "'enum'", "'const'", "'volatile'", "'IN'= ",=20 - "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED'", "'VOLATILE'", "'GLOBA= L_REMOVE_IF_UNREFERENCED'",=20 - "'EFIAPI'", "'EFI_BOOTSERVICE'", "'EFI_RUNTIMESERVICE'", "'PACKED'",=20 - "'('", "')'", "'['", "']'", "'*'", "'...'", "'+'", "'-'", "'/'", "'%'"= ,=20 - "'++'", "'--'", "'sizeof'", "'.'", "'->'", "'&'", "'~'", "'!'", "'*=3D= '",=20 - "'/=3D'", "'%=3D'", "'+=3D'", "'-=3D'", "'<<=3D'", "'>>=3D'", "'&=3D'"= , "'^=3D'", "'|=3D'",=20 - "'?'", "'||'", "'&&'", "'|'", "'^'", "'=3D=3D'", "'!=3D'", "'<'", "'>'= ", "'<=3D'",=20 - "'>=3D'", "'<<'", "'>>'", "'__asm__'", "'_asm'", "'__asm'", "'case'",=20 - "'default'", "'if'", "'else'", "'switch'", "'while'", "'do'", "'for'",=20 + "", "", "", "", + "IDENTIFIER", "HEX_LITERAL", "OCTAL_LITERAL", "DECIMAL_LITERAL", "CHAR= ACTER_LITERAL", + "STRING_LITERAL", "FLOATING_POINT_LITERAL", "LETTER", "EscapeSequence", + "HexDigit", "IntegerTypeSuffix", "Exponent", "FloatTypeSuffix", "Octal= Escape", + "UnicodeEscape", "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COM= MENT", + "LINE_COMMAND", "';'", "'typedef'", "','", "'=3D'", "'extern'", "'stat= ic'", + "'auto'", "'register'", "'STATIC'", "'void'", "'char'", "'short'", "'i= nt'", + "'long'", "'float'", "'double'", "'signed'", "'unsigned'", "'{'", "'}'= ", + "'struct'", "'union'", "':'", "'enum'", "'const'", "'volatile'", "'IN'= ", + "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED'", "'VOLATILE'", "'GLOBA= L_REMOVE_IF_UNREFERENCED'", + "'EFIAPI'", "'EFI_BOOTSERVICE'", "'EFI_RUNTIMESERVICE'", "'PACKED'", + "'('", "')'", "'['", "']'", "'*'", "'...'", "'+'", "'-'", "'/'", "'%'", + "'++'", "'--'", "'sizeof'", "'.'", "'->'", "'&'", "'~'", "'!'", "'*=3D= '", + "'/=3D'", "'%=3D'", "'+=3D'", "'-=3D'", "'<<=3D'", "'>>=3D'", "'&=3D'"= , "'^=3D'", "'|=3D'", + "'?'", "'||'", "'&&'", "'|'", "'^'", "'=3D=3D'", "'!=3D'", "'<'", "'>'= ", "'<=3D'", + "'>=3D'", "'<<'", "'>>'", "'__asm__'", "'_asm'", "'__asm'", "'case'", + "'default'", "'if'", "'else'", "'switch'", "'while'", "'do'", "'for'", "'goto'", "'continue'", "'break'", "'return'" ] =20 @@ -103,7 +103,7 @@ class CParser(Parser): =20 def printTokenInfo(self, line, offset, tokenText): print str(line)+ ',' + str(offset) + ':' + str(tokenText) - =20 + def StorePredicateExpression(self, StartLine, StartOffset, EndLine, En= dOffset, Text): PredExp =3D CodeFragment.PredicateExpression(Text, (StartLine, StartO= ffset), (EndLine, EndOffset)) FileProfile.PredicateExpressionList.append(PredExp) @@ -119,7 +119,7 @@ class CParser(Parser): def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndO= ffset, FromText, ToText): Tdef =3D CodeFragment.TypedefDefinition(FromText, ToText, (StartLine,= StartOffset), (EndLine, EndOffset)) FileProfile.TypedefDefinitionList.append(Tdef) - =20 + def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, End= Offset, ModifierText, DeclText, LeftBraceLine, LeftBraceOffset, DeclLine, D= eclOffset): FuncDef =3D CodeFragment.FunctionDefinition(ModifierText, DeclText, (= StartLine, StartOffset), (EndLine, EndOffset), (LeftBraceLine, LeftBraceOff= set), (DeclLine, DeclOffset)) FileProfile.FunctionDefinitionList.append(FuncDef) @@ -127,11 +127,11 @@ class CParser(Parser): def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, En= dOffset, ModifierText, DeclText): VarDecl =3D CodeFragment.VariableDeclaration(ModifierText, DeclText, = (StartLine, StartOffset), (EndLine, EndOffset)) FileProfile.VariableDeclarationList.append(VarDecl) - =20 + def StoreFunctionCalling(self, StartLine, StartOffset, EndLine, EndOff= set, FuncName, ParamList): FuncCall =3D CodeFragment.FunctionCalling(FuncName, ParamList, (Start= Line, StartOffset), (EndLine, EndOffset)) FileProfile.FunctionCallingList.append(FuncCall) - =20 + =20 =20 =20 @@ -143,7 +143,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 1): - return=20 + return =20 # C.g:103:2: ( ( external_declaration )* ) # C.g:103:4: ( external_declaration )* @@ -162,7 +162,7 @@ class CParser(Parser): self.external_declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -182,7 +182,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end translation_unit =20 @@ -195,7 +195,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 2): - return=20 + return =20 # C.g:119:2: ( ( ( declaration_specifiers )? declarator ( = declaration )* '{' )=3D> function_definition | declaration | macro_statemen= t ( ';' )? ) alt3 =3D 3 @@ -211,7 +211,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 1, self.input) =20 @@ -227,7 +227,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 2, self.input) =20 @@ -243,7 +243,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 3, self.input) =20 @@ -259,7 +259,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 4, self.input) =20 @@ -275,7 +275,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 5, self.input) =20 @@ -291,7 +291,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 6, self.input) =20 @@ -307,7 +307,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 7, self.input) =20 @@ -323,7 +323,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 8, self.input) =20 @@ -339,7 +339,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 9, self.input) =20 @@ -355,7 +355,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 10, self.input) =20 @@ -371,7 +371,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 11, self.input) =20 @@ -387,7 +387,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 12, self.input) =20 @@ -405,7 +405,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 13, self.input) =20 @@ -421,7 +421,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 14, self.input) =20 @@ -439,7 +439,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 16, self.input) =20 @@ -455,7 +455,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 17, self.input) =20 @@ -471,7 +471,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 18, self.input) =20 @@ -484,7 +484,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_declara= tion options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( decla= ration )* '{' )=3D> function_definition | declaration | macro_statement ( '= ;' )? );", 3, 0, self.input) =20 @@ -496,7 +496,7 @@ class CParser(Parser): self.function_definition() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt3 =3D=3D 2: @@ -505,7 +505,7 @@ class CParser(Parser): self.declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt3 =3D=3D 3: @@ -514,7 +514,7 @@ class CParser(Parser): self.macro_statement() self.following.pop() if self.failed: - return=20 + return # C.g:121:20: ( ';' )? alt2 =3D 2 LA2_0 =3D self.input.LA(1) @@ -525,7 +525,7 @@ class CParser(Parser): # C.g:121:21: ';' self.match(self.input, 25, self.FOLLOW_25_in_exter= nal_declaration126) if self.failed: - return=20 + return =20 =20 =20 @@ -541,7 +541,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end external_declaration =20 @@ -568,7 +568,7 @@ class CParser(Parser): declarator1 =3D None =20 =20 - =20 + self.function_definition_stack[-1].ModifierText =3D '' self.function_definition_stack[-1].DeclText =3D '' self.function_definition_stack[-1].LBLine =3D 0 @@ -782,7 +782,7 @@ class CParser(Parser): =20 =20 if self.backtracking =3D=3D 0: - =20 + if d is not None: self.function_definition_stack[-1].ModifierText =3D = self.input.toString(d.start,d.stop) else: @@ -796,7 +796,7 @@ class CParser(Parser): else: self.function_definition_stack[-1].LBLine =3D b.star= t.line self.function_definition_stack[-1].LBOffset =3D b.st= art.charPositionInLine - =20 + =09 =20 =20 =20 @@ -804,7 +804,7 @@ class CParser(Parser): retval.stop =3D self.input.LT(-1) =20 if self.backtracking =3D=3D 0: - =20 + self.StoreFunctionDefinition(retval.start.line, retval= .start.charPositionInLine, retval.stop.line, retval.stop.charPositionInLine= , self.function_definition_stack[-1].ModifierText, self.function_definition= _stack[-1].DeclText, self.function_definition_stack[-1].LBLine, self.functi= on_definition_stack[-1].LBOffset, self.function_definition_stack[-1].DeclLi= ne, self.function_definition_stack[-1].DeclOffset) =20 =20 @@ -844,7 +844,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 4): - return=20 + return =20 # C.g:167:2: (a=3D 'typedef' (b=3D declaration_specifiers = )? c=3D init_declarator_list d=3D ';' | s=3D declaration_specifiers (t=3D i= nit_declarator_list )? e=3D ';' ) alt9 =3D 2 @@ -857,7 +857,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("166:1: declaration : (a= =3D 'typedef' (b=3D declaration_specifiers )? c=3D init_declarator_list d= =3D ';' | s=3D declaration_specifiers (t=3D init_declarator_list )? e=3D ';= ' );", 9, 0, self.input) =20 @@ -868,7 +868,7 @@ class CParser(Parser): a =3D self.input.LT(1) self.match(self.input, 26, self.FOLLOW_26_in_declarati= on203) if self.failed: - return=20 + return # C.g:167:17: (b=3D declaration_specifiers )? alt7 =3D 2 LA7 =3D self.input.LA(1) @@ -905,7 +905,7 @@ class CParser(Parser): b =3D self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -913,18 +913,18 @@ class CParser(Parser): c =3D self.init_declarator_list() self.following.pop() if self.failed: - return=20 + return d =3D self.input.LT(1) self.match(self.input, 25, self.FOLLOW_25_in_declarati= on220) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: - =20 + if b is not None: self.StoreTypedefDefinition(a.line, a.charPositi= onInLine, d.line, d.charPositionInLine, self.input.toString(b.start,b.stop)= , self.input.toString(c.start,c.stop)) else: self.StoreTypedefDefinition(a.line, a.charPositi= onInLine, d.line, d.charPositionInLine, '', self.input.toString(c.start,c.s= top)) - =20 + =09 =20 =20 =20 @@ -934,7 +934,7 @@ class CParser(Parser): s =3D self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return # C.g:175:30: (t=3D init_declarator_list )? alt8 =3D 2 LA8_0 =3D self.input.LA(1) @@ -947,16 +947,16 @@ class CParser(Parser): t =3D self.init_declarator_list() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 e =3D self.input.LT(1) self.match(self.input, 25, self.FOLLOW_25_in_declarati= on243) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: - =20 + if t is not None: self.StoreVariableDeclaration(s.start.line, s.st= art.charPositionInLine, t.start.line, t.start.charPositionInLine, self.inpu= t.toString(s.start,s.stop), self.input.toString(t.start,t.stop)) =09 @@ -973,7 +973,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end declaration =20 @@ -1184,7 +1184,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 7): - return=20 + return =20 # C.g:194:2: ( declarator ( '=3D' initializer )? ) # C.g:194:4: declarator ( '=3D' initializer )? @@ -1192,7 +1192,7 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return # C.g:194:15: ( '=3D' initializer )? alt12 =3D 2 LA12_0 =3D self.input.LA(1) @@ -1203,12 +1203,12 @@ class CParser(Parser): # C.g:194:16: '=3D' initializer self.match(self.input, 28, self.FOLLOW_28_in_init_decl= arator329) if self.failed: - return=20 + return self.following.append(self.FOLLOW_initializer_in_init_= declarator331) self.initializer() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -1225,7 +1225,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end init_declarator =20 @@ -1238,7 +1238,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 8): - return=20 + return =20 # C.g:198:2: ( 'extern' | 'static' | 'auto' | 'register' |= 'STATIC' ) # C.g: @@ -1250,7 +1250,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.input) self.recoverFromMismatchedSet( @@ -1272,7 +1272,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end storage_class_specifier =20 @@ -1290,7 +1290,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 9): - return=20 + return =20 # C.g:206:2: ( 'void' | 'char' | 'short' | 'int' | 'long' = | 'float' | 'double' | 'signed' | 'unsigned' | s=3D struct_or_union_specifi= er | e=3D enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator )=3D= > type_id ) alt13 =3D 12 @@ -1323,7 +1323,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("205:1: type_specifier := ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signe= d' | 'unsigned' | s=3D struct_or_union_specifier | e=3D enum_specifier | ( = IDENTIFIER ( type_qualifier )* declarator )=3D> type_id );", 13, 0, self.in= put) =20 @@ -1333,63 +1333,63 @@ class CParser(Parser): # C.g:206:4: 'void' self.match(self.input, 34, self.FOLLOW_34_in_type_spec= ifier376) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 2: # C.g:207:4: 'char' self.match(self.input, 35, self.FOLLOW_35_in_type_spec= ifier381) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 3: # C.g:208:4: 'short' self.match(self.input, 36, self.FOLLOW_36_in_type_spec= ifier386) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 4: # C.g:209:4: 'int' self.match(self.input, 37, self.FOLLOW_37_in_type_spec= ifier391) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 5: # C.g:210:4: 'long' self.match(self.input, 38, self.FOLLOW_38_in_type_spec= ifier396) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 6: # C.g:211:4: 'float' self.match(self.input, 39, self.FOLLOW_39_in_type_spec= ifier401) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 7: # C.g:212:4: 'double' self.match(self.input, 40, self.FOLLOW_40_in_type_spec= ifier406) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 8: # C.g:213:4: 'signed' self.match(self.input, 41, self.FOLLOW_41_in_type_spec= ifier411) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 9: # C.g:214:4: 'unsigned' self.match(self.input, 42, self.FOLLOW_42_in_type_spec= ifier416) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 10: @@ -1398,9 +1398,9 @@ class CParser(Parser): s =3D self.struct_or_union_specifier() self.following.pop() if self.failed: - return=20 + return if self.backtracking =3D=3D 0: - =20 + if s.stop is not None: self.StoreStructUnionDefinition(s.start.line, s.= start.charPositionInLine, s.stop.line, s.stop.charPositionInLine, self.inpu= t.toString(s.start,s.stop)) =09 @@ -1413,9 +1413,9 @@ class CParser(Parser): e =3D self.enum_specifier() self.following.pop() if self.failed: - return=20 + return if self.backtracking =3D=3D 0: - =20 + if e.stop is not None: self.StoreEnumerationDefinition(e.start.line, e.= start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.inpu= t.toString(e.start,e.stop)) =09 @@ -1428,7 +1428,7 @@ class CParser(Parser): self.type_id() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -1441,7 +1441,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end type_specifier =20 @@ -1454,13 +1454,13 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 10): - return=20 + return =20 # C.g:229:5: ( IDENTIFIER ) # C.g:229:9: IDENTIFIER self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_type_id467) if self.failed: - return=20 + return =20 =20 =20 @@ -1474,7 +1474,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end type_id =20 @@ -1611,7 +1611,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 12): - return=20 + return =20 # C.g:240:2: ( 'struct' | 'union' ) # C.g: @@ -1623,7 +1623,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.input) self.recoverFromMismatchedSet( @@ -1645,7 +1645,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end struct_or_union =20 @@ -1658,7 +1658,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 13): - return=20 + return =20 # C.g:245:2: ( ( struct_declaration )+ ) # C.g:245:4: ( struct_declaration )+ @@ -1678,7 +1678,7 @@ class CParser(Parser): self.struct_declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -1687,7 +1687,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(16, self.input) raise eee @@ -1708,7 +1708,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end struct_declaration_list =20 @@ -1721,7 +1721,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 14): - return=20 + return =20 # C.g:249:2: ( specifier_qualifier_list struct_declarator_= list ';' ) # C.g:249:4: specifier_qualifier_list struct_declarator_li= st ';' @@ -1729,15 +1729,15 @@ class CParser(Parser): self.specifier_qualifier_list() self.following.pop() if self.failed: - return=20 + return self.following.append(self.FOLLOW_struct_declarator_list_i= n_struct_declaration551) self.struct_declarator_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_struct_declar= ation553) if self.failed: - return=20 + return =20 =20 =20 @@ -1751,7 +1751,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end struct_declaration =20 @@ -1764,7 +1764,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 15): - return=20 + return =20 # C.g:253:2: ( ( type_qualifier | type_specifier )+ ) # C.g:253:4: ( type_qualifier | type_specifier )+ @@ -1831,7 +1831,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt17 =3D=3D 2: @@ -1840,7 +1840,7 @@ class CParser(Parser): self.type_specifier() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -1849,7 +1849,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(17, self.input) raise eee @@ -1870,7 +1870,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end specifier_qualifier_list =20 @@ -1883,7 +1883,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 16): - return=20 + return =20 # C.g:257:2: ( struct_declarator ( ',' struct_declarator )= * ) # C.g:257:4: struct_declarator ( ',' struct_declarator )* @@ -1891,7 +1891,7 @@ class CParser(Parser): self.struct_declarator() self.following.pop() if self.failed: - return=20 + return # C.g:257:22: ( ',' struct_declarator )* while True: #loop18 alt18 =3D 2 @@ -1905,12 +1905,12 @@ class CParser(Parser): # C.g:257:23: ',' struct_declarator self.match(self.input, 27, self.FOLLOW_27_in_struc= t_declarator_list587) if self.failed: - return=20 + return self.following.append(self.FOLLOW_struct_declarato= r_in_struct_declarator_list589) self.struct_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -1930,7 +1930,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end struct_declarator_list =20 @@ -1943,7 +1943,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 17): - return=20 + return =20 # C.g:261:2: ( declarator ( ':' constant_expression )? | '= :' constant_expression ) alt20 =3D 2 @@ -1956,7 +1956,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("260:1: struct_declarato= r : ( declarator ( ':' constant_expression )? | ':' constant_expression );"= , 20, 0, self.input) =20 @@ -1968,7 +1968,7 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return # C.g:261:15: ( ':' constant_expression )? alt19 =3D 2 LA19_0 =3D self.input.LA(1) @@ -1979,12 +1979,12 @@ class CParser(Parser): # C.g:261:16: ':' constant_expression self.match(self.input, 47, self.FOLLOW_47_in_struc= t_declarator605) if self.failed: - return=20 + return self.following.append(self.FOLLOW_constant_express= ion_in_struct_declarator607) self.constant_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -1994,12 +1994,12 @@ class CParser(Parser): # C.g:262:4: ':' constant_expression self.match(self.input, 47, self.FOLLOW_47_in_struct_de= clarator614) if self.failed: - return=20 + return self.following.append(self.FOLLOW_constant_expression_= in_struct_declarator616) self.constant_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -2012,7 +2012,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end struct_declarator =20 @@ -2180,7 +2180,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 19): - return=20 + return =20 # C.g:273:2: ( enumerator ( ',' enumerator )* ) # C.g:273:4: enumerator ( ',' enumerator )* @@ -2188,7 +2188,7 @@ class CParser(Parser): self.enumerator() self.following.pop() if self.failed: - return=20 + return # C.g:273:15: ( ',' enumerator )* while True: #loop24 alt24 =3D 2 @@ -2207,12 +2207,12 @@ class CParser(Parser): # C.g:273:16: ',' enumerator self.match(self.input, 27, self.FOLLOW_27_in_enume= rator_list680) if self.failed: - return=20 + return self.following.append(self.FOLLOW_enumerator_in_en= umerator_list682) self.enumerator() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -2232,7 +2232,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end enumerator_list =20 @@ -2245,13 +2245,13 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 20): - return=20 + return =20 # C.g:277:2: ( IDENTIFIER ( '=3D' constant_expression )? ) # C.g:277:4: IDENTIFIER ( '=3D' constant_expression )? self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_enumerator695) if self.failed: - return=20 + return # C.g:277:15: ( '=3D' constant_expression )? alt25 =3D 2 LA25_0 =3D self.input.LA(1) @@ -2262,12 +2262,12 @@ class CParser(Parser): # C.g:277:16: '=3D' constant_expression self.match(self.input, 28, self.FOLLOW_28_in_enumerato= r698) if self.failed: - return=20 + return self.following.append(self.FOLLOW_constant_expression_= in_enumerator700) self.constant_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -2284,7 +2284,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end enumerator =20 @@ -2297,7 +2297,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 21): - return=20 + return =20 # C.g:281:2: ( 'const' | 'volatile' | 'IN' | 'OUT' | 'OPTI= ONAL' | 'CONST' | 'UNALIGNED' | 'VOLATILE' | 'GLOBAL_REMOVE_IF_UNREFERENCED= ' | 'EFIAPI' | 'EFI_BOOTSERVICE' | 'EFI_RUNTIMESERVICE' | 'PACKED' ) # C.g: @@ -2309,7 +2309,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.input) self.recoverFromMismatchedSet( @@ -2331,7 +2331,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end type_qualifier =20 @@ -2486,7 +2486,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 23): - return=20 + return =20 # C.g:303:2: ( IDENTIFIER ( declarator_suffix )* | '(' ( '= EFIAPI' )? declarator ')' ( declarator_suffix )+ ) alt34 =3D 2 @@ -2499,7 +2499,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("302:1: direct_declarato= r : ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' = ( declarator_suffix )+ );", 34, 0, self.input) =20 @@ -2509,7 +2509,7 @@ class CParser(Parser): # C.g:303:4: IDENTIFIER ( declarator_suffix )* self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_direct_declarator819) if self.failed: - return=20 + return # C.g:303:15: ( declarator_suffix )* while True: #loop31 alt31 =3D 2 @@ -2753,7 +2753,7 @@ class CParser(Parser): self.declarator_suffix() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -2766,7 +2766,7 @@ class CParser(Parser): # C.g:304:4: '(' ( 'EFIAPI' )? declarator ')' ( declar= ator_suffix )+ self.match(self.input, 62, self.FOLLOW_62_in_direct_de= clarator827) if self.failed: - return=20 + return # C.g:304:8: ( 'EFIAPI' )? alt32 =3D 2 LA32_0 =3D self.input.LA(1) @@ -2780,7 +2780,7 @@ class CParser(Parser): # C.g:304:9: 'EFIAPI' self.match(self.input, 58, self.FOLLOW_58_in_direc= t_declarator830) if self.failed: - return=20 + return =20 =20 =20 @@ -2788,10 +2788,10 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_direct_de= clarator836) if self.failed: - return=20 + return # C.g:304:35: ( declarator_suffix )+ cnt33 =3D 0 while True: #loop33 @@ -3036,7 +3036,7 @@ class CParser(Parser): self.declarator_suffix() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -3045,7 +3045,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(33, self.input) raise eee @@ -3065,7 +3065,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end direct_declarator =20 @@ -3078,7 +3078,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 24): - return=20 + return =20 # C.g:308:2: ( '[' constant_expression ']' | '[' ']' | '('= parameter_type_list ')' | '(' identifier_list ')' | '(' ')' ) alt35 =3D 5 @@ -3094,7 +3094,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("307:1: declarator_s= uffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list '= )' | '(' identifier_list ')' | '(' ')' );", 35, 1, self.input) =20 @@ -3116,7 +3116,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("307:1: declarat= or_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_li= st ')' | '(' identifier_list ')' | '(' ')' );", 35, 29, self.input) =20 @@ -3125,7 +3125,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("307:1: declarator_s= uffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list '= )' | '(' identifier_list ')' | '(' ')' );", 35, 2, self.input) =20 @@ -3134,7 +3134,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("307:1: declarator_suffi= x : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' |= '(' identifier_list ')' | '(' ')' );", 35, 0, self.input) =20 @@ -3144,65 +3144,65 @@ class CParser(Parser): # C.g:308:6: '[' constant_expression ']' self.match(self.input, 64, self.FOLLOW_64_in_declarato= r_suffix852) if self.failed: - return=20 + return self.following.append(self.FOLLOW_constant_expression_= in_declarator_suffix854) self.constant_expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 65, self.FOLLOW_65_in_declarato= r_suffix856) if self.failed: - return=20 + return =20 =20 elif alt35 =3D=3D 2: # C.g:309:9: '[' ']' self.match(self.input, 64, self.FOLLOW_64_in_declarato= r_suffix866) if self.failed: - return=20 + return self.match(self.input, 65, self.FOLLOW_65_in_declarato= r_suffix868) if self.failed: - return=20 + return =20 =20 elif alt35 =3D=3D 3: # C.g:310:9: '(' parameter_type_list ')' self.match(self.input, 62, self.FOLLOW_62_in_declarato= r_suffix878) if self.failed: - return=20 + return self.following.append(self.FOLLOW_parameter_type_list_= in_declarator_suffix880) self.parameter_type_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_declarato= r_suffix882) if self.failed: - return=20 + return =20 =20 elif alt35 =3D=3D 4: # C.g:311:9: '(' identifier_list ')' self.match(self.input, 62, self.FOLLOW_62_in_declarato= r_suffix892) if self.failed: - return=20 + return self.following.append(self.FOLLOW_identifier_list_in_d= eclarator_suffix894) self.identifier_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_declarato= r_suffix896) if self.failed: - return=20 + return =20 =20 elif alt35 =3D=3D 5: # C.g:312:9: '(' ')' self.match(self.input, 62, self.FOLLOW_62_in_declarato= r_suffix906) if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_declarato= r_suffix908) if self.failed: - return=20 + return =20 =20 =20 @@ -3215,7 +3215,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end declarator_suffix =20 @@ -3228,7 +3228,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 25): - return=20 + return =20 # C.g:316:2: ( '*' ( type_qualifier )+ ( pointer )? | '*' = pointer | '*' ) alt38 =3D 3 @@ -3246,7 +3246,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 2, se= lf.input) =20 @@ -3262,7 +3262,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 3, se= lf.input) =20 @@ -3278,7 +3278,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 4, se= lf.input) =20 @@ -3294,7 +3294,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 5, se= lf.input) =20 @@ -3312,7 +3312,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 21, s= elf.input) =20 @@ -3328,7 +3328,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 29, s= elf.input) =20 @@ -3337,7 +3337,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer : ( = '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 1, self.i= nput) =20 @@ -3346,7 +3346,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer : ( '*' = ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 0, self.input) =20 @@ -3356,7 +3356,7 @@ class CParser(Parser): # C.g:316:4: '*' ( type_qualifier )+ ( pointer )? self.match(self.input, 66, self.FOLLOW_66_in_pointer91= 9) if self.failed: - return=20 + return # C.g:316:8: ( type_qualifier )+ cnt36 =3D 0 while True: #loop36 @@ -3404,7 +3404,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -3413,7 +3413,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(36, self.input) raise eee @@ -3436,7 +3436,7 @@ class CParser(Parser): self.pointer() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -3446,19 +3446,19 @@ class CParser(Parser): # C.g:317:4: '*' pointer self.match(self.input, 66, self.FOLLOW_66_in_pointer93= 0) if self.failed: - return=20 + return self.following.append(self.FOLLOW_pointer_in_pointer93= 2) self.pointer() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt38 =3D=3D 3: # C.g:318:4: '*' self.match(self.input, 66, self.FOLLOW_66_in_pointer93= 7) if self.failed: - return=20 + return =20 =20 =20 @@ -3471,7 +3471,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end pointer =20 @@ -3484,7 +3484,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 26): - return=20 + return =20 # C.g:322:2: ( parameter_list ( ',' ( 'OPTIONAL' )? '...' = )? ) # C.g:322:4: parameter_list ( ',' ( 'OPTIONAL' )? '...' )? @@ -3492,7 +3492,7 @@ class CParser(Parser): self.parameter_list() self.following.pop() if self.failed: - return=20 + return # C.g:322:19: ( ',' ( 'OPTIONAL' )? '...' )? alt40 =3D 2 LA40_0 =3D self.input.LA(1) @@ -3503,7 +3503,7 @@ class CParser(Parser): # C.g:322:20: ',' ( 'OPTIONAL' )? '...' self.match(self.input, 27, self.FOLLOW_27_in_parameter= _type_list951) if self.failed: - return=20 + return # C.g:322:24: ( 'OPTIONAL' )? alt39 =3D 2 LA39_0 =3D self.input.LA(1) @@ -3514,13 +3514,13 @@ class CParser(Parser): # C.g:322:25: 'OPTIONAL' self.match(self.input, 53, self.FOLLOW_53_in_param= eter_type_list954) if self.failed: - return=20 + return =20 =20 =20 self.match(self.input, 67, self.FOLLOW_67_in_parameter= _type_list958) if self.failed: - return=20 + return =20 =20 =20 @@ -3537,7 +3537,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end parameter_type_list =20 @@ -3550,7 +3550,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 27): - return=20 + return =20 # C.g:326:2: ( parameter_declaration ( ',' ( 'OPTIONAL' )?= parameter_declaration )* ) # C.g:326:4: parameter_declaration ( ',' ( 'OPTIONAL' )? p= arameter_declaration )* @@ -3558,7 +3558,7 @@ class CParser(Parser): self.parameter_declaration() self.following.pop() if self.failed: - return=20 + return # C.g:326:26: ( ',' ( 'OPTIONAL' )? parameter_declaration = )* while True: #loop42 alt42 =3D 2 @@ -3584,7 +3584,7 @@ class CParser(Parser): # C.g:326:27: ',' ( 'OPTIONAL' )? parameter_declar= ation self.match(self.input, 27, self.FOLLOW_27_in_param= eter_list974) if self.failed: - return=20 + return # C.g:326:31: ( 'OPTIONAL' )? alt41 =3D 2 LA41_0 =3D self.input.LA(1) @@ -3598,7 +3598,7 @@ class CParser(Parser): # C.g:326:32: 'OPTIONAL' self.match(self.input, 53, self.FOLLOW_53_in_p= arameter_list977) if self.failed: - return=20 + return =20 =20 =20 @@ -3606,7 +3606,7 @@ class CParser(Parser): self.parameter_declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -3626,7 +3626,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end parameter_list =20 @@ -3639,7 +3639,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 28): - return=20 + return =20 # C.g:330:2: ( declaration_specifiers ( declarator | abstr= act_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER ) alt46 =3D 2 @@ -3656,7 +3656,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("329:1: parameter_de= claration : ( declaration_specifiers ( declarator | abstract_declarator )* = ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );", 46, 13, self.input) =20 @@ -3667,7 +3667,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("329:1: parameter_declar= ation : ( declaration_specifiers ( declarator | abstract_declarator )* ( 'O= PTIONAL' )? | ( pointer )* IDENTIFIER );", 46, 0, self.input) =20 @@ -3679,7 +3679,7 @@ class CParser(Parser): self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return # C.g:330:27: ( declarator | abstract_declarator )* while True: #loop43 alt43 =3D 3 @@ -3763,7 +3763,7 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt43 =3D=3D 2: @@ -3772,7 +3772,7 @@ class CParser(Parser): self.abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -3789,7 +3789,7 @@ class CParser(Parser): # C.g:330:62: 'OPTIONAL' self.match(self.input, 53, self.FOLLOW_53_in_param= eter_declaration1004) if self.failed: - return=20 + return =20 =20 =20 @@ -3812,7 +3812,7 @@ class CParser(Parser): self.pointer() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -3821,7 +3821,7 @@ class CParser(Parser): =20 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_parameter_declaration1016) if self.failed: - return=20 + return =20 =20 =20 @@ -3834,7 +3834,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end parameter_declaration =20 @@ -3847,13 +3847,13 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 29): - return=20 + return =20 # C.g:336:2: ( IDENTIFIER ( ',' IDENTIFIER )* ) # C.g:336:4: IDENTIFIER ( ',' IDENTIFIER )* self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_identifier_list1027) if self.failed: - return=20 + return # C.g:337:2: ( ',' IDENTIFIER )* while True: #loop47 alt47 =3D 2 @@ -3867,10 +3867,10 @@ class CParser(Parser): # C.g:337:3: ',' IDENTIFIER self.match(self.input, 27, self.FOLLOW_27_in_ident= ifier_list1031) if self.failed: - return=20 + return self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_identifier_list1033) if self.failed: - return=20 + return =20 =20 else: @@ -3890,7 +3890,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end identifier_list =20 @@ -3903,7 +3903,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 30): - return=20 + return =20 # C.g:341:2: ( specifier_qualifier_list ( abstract_declara= tor )? | type_id ) alt49 =3D 2 @@ -3921,7 +3921,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("340:1: type_name : = ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 49, 13, = self.input) =20 @@ -3930,7 +3930,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("340:1: type_name : ( sp= ecifier_qualifier_list ( abstract_declarator )? | type_id );", 49, 0, self.= input) =20 @@ -3942,7 +3942,7 @@ class CParser(Parser): self.specifier_qualifier_list() self.following.pop() if self.failed: - return=20 + return # C.g:341:29: ( abstract_declarator )? alt48 =3D 2 LA48_0 =3D self.input.LA(1) @@ -3955,7 +3955,7 @@ class CParser(Parser): self.abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -3967,7 +3967,7 @@ class CParser(Parser): self.type_id() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -3980,7 +3980,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end type_name =20 @@ -3993,7 +3993,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 31): - return=20 + return =20 # C.g:346:2: ( pointer ( direct_abstract_declarator )? | d= irect_abstract_declarator ) alt51 =3D 2 @@ -4006,7 +4006,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("345:1: abstract_declara= tor : ( pointer ( direct_abstract_declarator )? | direct_abstract_declarato= r );", 51, 0, self.input) =20 @@ -4018,7 +4018,7 @@ class CParser(Parser): self.pointer() self.following.pop() if self.failed: - return=20 + return # C.g:346:12: ( direct_abstract_declarator )? alt50 =3D 2 LA50_0 =3D self.input.LA(1) @@ -4203,7 +4203,7 @@ class CParser(Parser): self.direct_abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -4215,7 +4215,7 @@ class CParser(Parser): self.direct_abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -4228,7 +4228,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end abstract_declarator =20 @@ -4241,7 +4241,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 32): - return=20 + return =20 # C.g:351:2: ( ( '(' abstract_declarator ')' | abstract_de= clarator_suffix ) ( abstract_declarator_suffix )* ) # C.g:351:4: ( '(' abstract_declarator ')' | abstract_decl= arator_suffix ) ( abstract_declarator_suffix )* @@ -4263,7 +4263,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("351:4: ( '(' ab= stract_declarator ')' | abstract_declarator_suffix )", 52, 18, self.input) =20 @@ -4274,7 +4274,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("351:4: ( '(' abstra= ct_declarator ')' | abstract_declarator_suffix )", 52, 1, self.input) =20 @@ -4285,7 +4285,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("351:4: ( '(' abstract_d= eclarator ')' | abstract_declarator_suffix )", 52, 0, self.input) =20 @@ -4295,15 +4295,15 @@ class CParser(Parser): # C.g:351:6: '(' abstract_declarator ')' self.match(self.input, 62, self.FOLLOW_62_in_direct_ab= stract_declarator1086) if self.failed: - return=20 + return self.following.append(self.FOLLOW_abstract_declarator_= in_direct_abstract_declarator1088) self.abstract_declarator() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_direct_ab= stract_declarator1090) if self.failed: - return=20 + return =20 =20 elif alt52 =3D=3D 2: @@ -4312,7 +4312,7 @@ class CParser(Parser): self.abstract_declarator_suffix() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -4559,7 +4559,7 @@ class CParser(Parser): self.abstract_declarator_suffix() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -4579,7 +4579,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end direct_abstract_declarator =20 @@ -4592,7 +4592,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 33): - return=20 + return =20 # C.g:355:2: ( '[' ']' | '[' constant_expression ']' | '('= ')' | '(' parameter_type_list ')' ) alt54 =3D 4 @@ -4608,7 +4608,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("354:1: abstract_dec= larator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' pa= rameter_type_list ')' );", 54, 1, self.input) =20 @@ -4624,7 +4624,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("354:1: abstract_dec= larator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' pa= rameter_type_list ')' );", 54, 2, self.input) =20 @@ -4633,7 +4633,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("354:1: abstract_declara= tor_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parame= ter_type_list ')' );", 54, 0, self.input) =20 @@ -4643,50 +4643,50 @@ class CParser(Parser): # C.g:355:4: '[' ']' self.match(self.input, 64, self.FOLLOW_64_in_abstract_= declarator_suffix1110) if self.failed: - return=20 + return self.match(self.input, 65, self.FOLLOW_65_in_abstract_= declarator_suffix1112) if self.failed: - return=20 + return =20 =20 elif alt54 =3D=3D 2: # C.g:356:4: '[' constant_expression ']' self.match(self.input, 64, self.FOLLOW_64_in_abstract_= declarator_suffix1117) if self.failed: - return=20 + return self.following.append(self.FOLLOW_constant_expression_= in_abstract_declarator_suffix1119) self.constant_expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 65, self.FOLLOW_65_in_abstract_= declarator_suffix1121) if self.failed: - return=20 + return =20 =20 elif alt54 =3D=3D 3: # C.g:357:4: '(' ')' self.match(self.input, 62, self.FOLLOW_62_in_abstract_= declarator_suffix1126) if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_abstract_= declarator_suffix1128) if self.failed: - return=20 + return =20 =20 elif alt54 =3D=3D 4: # C.g:358:4: '(' parameter_type_list ')' self.match(self.input, 62, self.FOLLOW_62_in_abstract_= declarator_suffix1133) if self.failed: - return=20 + return self.following.append(self.FOLLOW_parameter_type_list_= in_abstract_declarator_suffix1135) self.parameter_type_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_abstract_= declarator_suffix1137) if self.failed: - return=20 + return =20 =20 =20 @@ -4699,7 +4699,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end abstract_declarator_suffix =20 @@ -4712,7 +4712,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 34): - return=20 + return =20 # C.g:363:2: ( assignment_expression | '{' initializer_lis= t ( ',' )? '}' ) alt56 =3D 2 @@ -4725,7 +4725,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("361:1: initializer : ( = assignment_expression | '{' initializer_list ( ',' )? '}' );", 56, 0, self.= input) =20 @@ -4737,19 +4737,19 @@ class CParser(Parser): self.assignment_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt56 =3D=3D 2: # C.g:364:4: '{' initializer_list ( ',' )? '}' self.match(self.input, 43, self.FOLLOW_43_in_initializ= er1155) if self.failed: - return=20 + return self.following.append(self.FOLLOW_initializer_list_in_= initializer1157) self.initializer_list() self.following.pop() if self.failed: - return=20 + return # C.g:364:25: ( ',' )? alt55 =3D 2 LA55_0 =3D self.input.LA(1) @@ -4760,13 +4760,13 @@ class CParser(Parser): # C.g:0:0: ',' self.match(self.input, 27, self.FOLLOW_27_in_initi= alizer1159) if self.failed: - return=20 + return =20 =20 =20 self.match(self.input, 44, self.FOLLOW_44_in_initializ= er1162) if self.failed: - return=20 + return =20 =20 =20 @@ -4779,7 +4779,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end initializer =20 @@ -4792,7 +4792,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 35): - return=20 + return =20 # C.g:368:2: ( initializer ( ',' initializer )* ) # C.g:368:4: initializer ( ',' initializer )* @@ -4800,7 +4800,7 @@ class CParser(Parser): self.initializer() self.following.pop() if self.failed: - return=20 + return # C.g:368:16: ( ',' initializer )* while True: #loop57 alt57 =3D 2 @@ -4819,12 +4819,12 @@ class CParser(Parser): # C.g:368:17: ',' initializer self.match(self.input, 27, self.FOLLOW_27_in_initi= alizer_list1176) if self.failed: - return=20 + return self.following.append(self.FOLLOW_initializer_in_i= nitializer_list1178) self.initializer() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -4844,7 +4844,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end initializer_list =20 @@ -4955,7 +4955,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 37): - return=20 + return =20 # C.g:378:2: ( ( multiplicative_expression ) ( '+' multipl= icative_expression | '-' multiplicative_expression )* ) # C.g:378:4: ( multiplicative_expression ) ( '+' multiplic= ative_expression | '-' multiplicative_expression )* @@ -4965,7 +4965,7 @@ class CParser(Parser): self.multiplicative_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -4984,24 +4984,24 @@ class CParser(Parser): # C.g:378:33: '+' multiplicative_expression self.match(self.input, 68, self.FOLLOW_68_in_addit= ive_expression1229) if self.failed: - return=20 + return self.following.append(self.FOLLOW_multiplicative_e= xpression_in_additive_expression1231) self.multiplicative_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt61 =3D=3D 2: # C.g:378:65: '-' multiplicative_expression self.match(self.input, 69, self.FOLLOW_69_in_addit= ive_expression1235) if self.failed: - return=20 + return self.following.append(self.FOLLOW_multiplicative_e= xpression_in_additive_expression1237) self.multiplicative_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -5021,7 +5021,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end additive_expression =20 @@ -5034,7 +5034,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 38): - return=20 + return =20 # C.g:382:2: ( ( cast_expression ) ( '*' cast_expression |= '/' cast_expression | '%' cast_expression )* ) # C.g:382:4: ( cast_expression ) ( '*' cast_expression | '= /' cast_expression | '%' cast_expression )* @@ -5044,7 +5044,7 @@ class CParser(Parser): self.cast_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -5063,36 +5063,36 @@ class CParser(Parser): # C.g:382:23: '*' cast_expression self.match(self.input, 66, self.FOLLOW_66_in_multi= plicative_expression1255) if self.failed: - return=20 + return self.following.append(self.FOLLOW_cast_expression_= in_multiplicative_expression1257) self.cast_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt62 =3D=3D 2: # C.g:382:45: '/' cast_expression self.match(self.input, 70, self.FOLLOW_70_in_multi= plicative_expression1261) if self.failed: - return=20 + return self.following.append(self.FOLLOW_cast_expression_= in_multiplicative_expression1263) self.cast_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt62 =3D=3D 3: # C.g:382:67: '%' cast_expression self.match(self.input, 71, self.FOLLOW_71_in_multi= plicative_expression1267) if self.failed: - return=20 + return self.following.append(self.FOLLOW_cast_expression_= in_multiplicative_expression1269) self.cast_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -5112,7 +5112,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end multiplicative_expression =20 @@ -5125,7 +5125,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 39): - return=20 + return =20 # C.g:386:2: ( '(' type_name ')' cast_expression | unary_e= xpression ) alt63 =3D 2 @@ -5145,7 +5145,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("385:1: cast_exp= ression : ( '(' type_name ')' cast_expression | unary_expression );", 63, 2= 5, self.input) =20 @@ -5156,7 +5156,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("385:1: cast_express= ion : ( '(' type_name ')' cast_expression | unary_expression );", 63, 1, se= lf.input) =20 @@ -5167,7 +5167,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("385:1: cast_expression = : ( '(' type_name ')' cast_expression | unary_expression );", 63, 0, self.i= nput) =20 @@ -5177,20 +5177,20 @@ class CParser(Parser): # C.g:386:4: '(' type_name ')' cast_expression self.match(self.input, 62, self.FOLLOW_62_in_cast_expr= ession1282) if self.failed: - return=20 + return self.following.append(self.FOLLOW_type_name_in_cast_ex= pression1284) self.type_name() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_cast_expr= ession1286) if self.failed: - return=20 + return self.following.append(self.FOLLOW_cast_expression_in_c= ast_expression1288) self.cast_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt63 =3D=3D 2: @@ -5199,7 +5199,7 @@ class CParser(Parser): self.unary_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -5212,7 +5212,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end cast_expression =20 @@ -5225,7 +5225,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 40): - return=20 + return =20 # C.g:391:2: ( postfix_expression | '++' unary_expression = | '--' unary_expression | unary_operator cast_expression | 'sizeof' unary_e= xpression | 'sizeof' '(' type_name ')' ) alt64 =3D 6 @@ -5251,7 +5251,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("390:1: unary_ex= pression : ( postfix_expression | '++' unary_expression | '--' unary_expres= sion | unary_operator cast_expression | 'sizeof' unary_expression | 'sizeof= ' '(' type_name ')' );", 64, 13, self.input) =20 @@ -5262,7 +5262,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("390:1: unary_expres= sion : ( postfix_expression | '++' unary_expression | '--' unary_expression= | unary_operator cast_expression | 'sizeof' unary_expression | 'sizeof' '(= ' type_name ')' );", 64, 12, self.input) =20 @@ -5271,7 +5271,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("390:1: unary_expression= : ( postfix_expression | '++' unary_expression | '--' unary_expression | u= nary_operator cast_expression | 'sizeof' unary_expression | 'sizeof' '(' ty= pe_name ')' );", 64, 0, self.input) =20 @@ -5283,31 +5283,31 @@ class CParser(Parser): self.postfix_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt64 =3D=3D 2: # C.g:392:4: '++' unary_expression self.match(self.input, 72, self.FOLLOW_72_in_unary_exp= ression1309) if self.failed: - return=20 + return self.following.append(self.FOLLOW_unary_expression_in_= unary_expression1311) self.unary_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt64 =3D=3D 3: # C.g:393:4: '--' unary_expression self.match(self.input, 73, self.FOLLOW_73_in_unary_exp= ression1316) if self.failed: - return=20 + return self.following.append(self.FOLLOW_unary_expression_in_= unary_expression1318) self.unary_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt64 =3D=3D 4: @@ -5316,42 +5316,42 @@ class CParser(Parser): self.unary_operator() self.following.pop() if self.failed: - return=20 + return self.following.append(self.FOLLOW_cast_expression_in_u= nary_expression1325) self.cast_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt64 =3D=3D 5: # C.g:395:4: 'sizeof' unary_expression self.match(self.input, 74, self.FOLLOW_74_in_unary_exp= ression1330) if self.failed: - return=20 + return self.following.append(self.FOLLOW_unary_expression_in_= unary_expression1332) self.unary_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt64 =3D=3D 6: # C.g:396:4: 'sizeof' '(' type_name ')' self.match(self.input, 74, self.FOLLOW_74_in_unary_exp= ression1337) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_unary_exp= ression1339) if self.failed: - return=20 + return self.following.append(self.FOLLOW_type_name_in_unary_e= xpression1341) self.type_name() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_unary_exp= ression1343) if self.failed: - return=20 + return =20 =20 =20 @@ -5364,7 +5364,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end unary_expression =20 @@ -5384,13 +5384,13 @@ class CParser(Parser): c =3D None =20 =20 - =20 + self.postfix_expression_stack[-1].FuncCallText =3D '' =20 try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 41): - return=20 + return =20 # C.g:406:2: (p=3D primary_expression ( '[' expression ']'= | '(' a=3D ')' | '(' c=3D argument_expression_list b=3D ')' | '(' macro_pa= rameter_list ')' | '.' x=3D IDENTIFIER | '*' y=3D IDENTIFIER | '->' z=3D ID= ENTIFIER | '++' | '--' )* ) # C.g:406:6: p=3D primary_expression ( '[' expression ']' = | '(' a=3D ')' | '(' c=3D argument_expression_list b=3D ')' | '(' macro_par= ameter_list ')' | '.' x=3D IDENTIFIER | '*' y=3D IDENTIFIER | '->' z=3D IDE= NTIFIER | '++' | '--' )* @@ -5398,7 +5398,7 @@ class CParser(Parser): p =3D self.primary_expression() self.following.pop() if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.postfix_expression_stack[-1].FuncCallText +=3D se= lf.input.toString(p.start,p.stop) =20 @@ -5460,26 +5460,26 @@ class CParser(Parser): # C.g:407:13: '[' expression ']' self.match(self.input, 64, self.FOLLOW_64_in_postf= ix_expression1383) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_in_po= stfix_expression1385) self.expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 65, self.FOLLOW_65_in_postf= ix_expression1387) if self.failed: - return=20 + return =20 =20 elif alt65 =3D=3D 2: # C.g:408:13: '(' a=3D ')' self.match(self.input, 62, self.FOLLOW_62_in_postf= ix_expression1401) if self.failed: - return=20 + return a =3D self.input.LT(1) self.match(self.input, 63, self.FOLLOW_63_in_postf= ix_expression1405) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.StoreFunctionCalling(p.start.line, p.star= t.charPositionInLine, a.line, a.charPositionInLine, self.postfix_expression= _stack[-1].FuncCallText, '') =20 @@ -5489,16 +5489,16 @@ class CParser(Parser): # C.g:409:13: '(' c=3D argument_expression_list b= =3D ')' self.match(self.input, 62, self.FOLLOW_62_in_postf= ix_expression1420) if self.failed: - return=20 + return self.following.append(self.FOLLOW_argument_express= ion_list_in_postfix_expression1424) c =3D self.argument_expression_list() self.following.pop() if self.failed: - return=20 + return b =3D self.input.LT(1) self.match(self.input, 63, self.FOLLOW_63_in_postf= ix_expression1428) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.StoreFunctionCalling(p.start.line, p.star= t.charPositionInLine, b.line, b.charPositionInLine, self.postfix_expression= _stack[-1].FuncCallText, self.input.toString(c.start,c.stop)) =20 @@ -5508,26 +5508,26 @@ class CParser(Parser): # C.g:410:13: '(' macro_parameter_list ')' self.match(self.input, 62, self.FOLLOW_62_in_postf= ix_expression1444) if self.failed: - return=20 + return self.following.append(self.FOLLOW_macro_parameter_= list_in_postfix_expression1446) self.macro_parameter_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_postf= ix_expression1448) if self.failed: - return=20 + return =20 =20 elif alt65 =3D=3D 5: # C.g:411:13: '.' x=3D IDENTIFIER self.match(self.input, 75, self.FOLLOW_75_in_postf= ix_expression1462) if self.failed: - return=20 + return x =3D self.input.LT(1) self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_postfix_expression1466) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.postfix_expression_stack[-1].FuncCallText= +=3D '.' + x.text =20 @@ -5537,11 +5537,11 @@ class CParser(Parser): # C.g:412:13: '*' y=3D IDENTIFIER self.match(self.input, 66, self.FOLLOW_66_in_postf= ix_expression1482) if self.failed: - return=20 + return y =3D self.input.LT(1) self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_postfix_expression1486) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.postfix_expression_stack[-1].FuncCallText= =3D y.text =20 @@ -5551,11 +5551,11 @@ class CParser(Parser): # C.g:413:13: '->' z=3D IDENTIFIER self.match(self.input, 76, self.FOLLOW_76_in_postf= ix_expression1502) if self.failed: - return=20 + return z =3D self.input.LT(1) self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_postfix_expression1506) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.postfix_expression_stack[-1].FuncCallText= +=3D '->' + z.text =20 @@ -5565,14 +5565,14 @@ class CParser(Parser): # C.g:414:13: '++' self.match(self.input, 72, self.FOLLOW_72_in_postf= ix_expression1522) if self.failed: - return=20 + return =20 =20 elif alt65 =3D=3D 9: # C.g:415:13: '--' self.match(self.input, 73, self.FOLLOW_73_in_postf= ix_expression1536) if self.failed: - return=20 + return =20 =20 else: @@ -5593,7 +5593,7 @@ class CParser(Parser): self.postfix_expression_stack.pop() pass =20 - return=20 + return =20 # $ANTLR end postfix_expression =20 @@ -5606,7 +5606,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 42): - return=20 + return =20 # C.g:420:2: ( parameter_declaration ( ',' parameter_decla= ration )* ) # C.g:420:4: parameter_declaration ( ',' parameter_declara= tion )* @@ -5614,7 +5614,7 @@ class CParser(Parser): self.parameter_declaration() self.following.pop() if self.failed: - return=20 + return # C.g:420:26: ( ',' parameter_declaration )* while True: #loop66 alt66 =3D 2 @@ -5628,12 +5628,12 @@ class CParser(Parser): # C.g:420:27: ',' parameter_declaration self.match(self.input, 27, self.FOLLOW_27_in_macro= _parameter_list1562) if self.failed: - return=20 + return self.following.append(self.FOLLOW_parameter_declar= ation_in_macro_parameter_list1564) self.parameter_declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -5653,7 +5653,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end macro_parameter_list =20 @@ -5666,7 +5666,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 43): - return=20 + return =20 # C.g:424:2: ( '&' | '*' | '+' | '-' | '~' | '!' ) # C.g: @@ -5678,7 +5678,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.input) self.recoverFromMismatchedSet( @@ -5700,7 +5700,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end unary_operator =20 @@ -5811,7 +5811,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 45): - return=20 + return =20 # C.g:439:5: ( HEX_LITERAL | OCTAL_LITERAL | DECIMAL_LITER= AL | CHARACTER_LITERAL | ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+ ( IDENTIF= IER )* | FLOATING_POINT_LITERAL ) alt72 =3D 6 @@ -5831,7 +5831,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("438:1: constant : ( HEX= _LITERAL | OCTAL_LITERAL | DECIMAL_LITERAL | CHARACTER_LITERAL | ( ( IDENTI= FIER )* ( STRING_LITERAL )+ )+ ( IDENTIFIER )* | FLOATING_POINT_LITERAL );"= , 72, 0, self.input) =20 @@ -5841,28 +5841,28 @@ class CParser(Parser): # C.g:439:9: HEX_LITERAL self.match(self.input, HEX_LITERAL, self.FOLLOW_HEX_LI= TERAL_in_constant1643) if self.failed: - return=20 + return =20 =20 elif alt72 =3D=3D 2: # C.g:440:9: OCTAL_LITERAL self.match(self.input, OCTAL_LITERAL, self.FOLLOW_OCTA= L_LITERAL_in_constant1653) if self.failed: - return=20 + return =20 =20 elif alt72 =3D=3D 3: # C.g:441:9: DECIMAL_LITERAL self.match(self.input, DECIMAL_LITERAL, self.FOLLOW_DE= CIMAL_LITERAL_in_constant1663) if self.failed: - return=20 + return =20 =20 elif alt72 =3D=3D 4: # C.g:442:7: CHARACTER_LITERAL self.match(self.input, CHARACTER_LITERAL, self.FOLLOW_= CHARACTER_LITERAL_in_constant1671) if self.failed: - return=20 + return =20 =20 elif alt72 =3D=3D 5: @@ -5906,7 +5906,7 @@ class CParser(Parser): # C.g:0:0: IDENTIFIER self.match(self.input, IDENTIFIER, sel= f.FOLLOW_IDENTIFIER_in_constant1680) if self.failed: - return=20 + return =20 =20 else: @@ -5932,7 +5932,7 @@ class CParser(Parser): # C.g:0:0: STRING_LITERAL self.match(self.input, STRING_LITERAL,= self.FOLLOW_STRING_LITERAL_in_constant1683) if self.failed: - return=20 + return =20 =20 else: @@ -5941,7 +5941,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(69, self.in= put) raise eee @@ -5957,7 +5957,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(70, self.input) raise eee @@ -5978,7 +5978,7 @@ class CParser(Parser): # C.g:0:0: IDENTIFIER self.match(self.input, IDENTIFIER, self.FOLLOW= _IDENTIFIER_in_constant1688) if self.failed: - return=20 + return =20 =20 else: @@ -5991,7 +5991,7 @@ class CParser(Parser): # C.g:444:9: FLOATING_POINT_LITERAL self.match(self.input, FLOATING_POINT_LITERAL, self.FO= LLOW_FLOATING_POINT_LITERAL_in_constant1699) if self.failed: - return=20 + return =20 =20 =20 @@ -6004,7 +6004,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end constant =20 @@ -6087,7 +6087,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 47): - return=20 + return =20 # C.g:454:2: ( conditional_expression ) # C.g:454:4: conditional_expression @@ -6095,7 +6095,7 @@ class CParser(Parser): self.conditional_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -6109,7 +6109,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end constant_expression =20 @@ -6122,7 +6122,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 48): - return=20 + return =20 # C.g:458:2: ( lvalue assignment_operator assignment_expre= ssion | conditional_expression ) alt74 =3D 2 @@ -6139,7 +6139,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 13, self.input) =20 @@ -6155,7 +6155,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 14, self.input) =20 @@ -6171,7 +6171,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 15, self.input) =20 @@ -6187,7 +6187,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 16, self.input) =20 @@ -6203,7 +6203,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 17, self.input) =20 @@ -6219,7 +6219,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 18, self.input) =20 @@ -6235,7 +6235,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 19, self.input) =20 @@ -6253,7 +6253,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 21, self.input) =20 @@ -6269,7 +6269,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 22, self.input) =20 @@ -6280,7 +6280,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 1, self.input) =20 @@ -6298,7 +6298,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 44, self.input) =20 @@ -6314,7 +6314,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 45, self.input) =20 @@ -6330,7 +6330,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 46, self.input) =20 @@ -6346,7 +6346,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 47, self.input) =20 @@ -6362,7 +6362,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 48, self.input) =20 @@ -6378,7 +6378,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 49, self.input) =20 @@ -6394,7 +6394,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 50, self.input) =20 @@ -6407,7 +6407,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 2, self.input) =20 @@ -6425,7 +6425,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 73, self.input) =20 @@ -6441,7 +6441,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 74, self.input) =20 @@ -6457,7 +6457,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 75, self.input) =20 @@ -6473,7 +6473,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 76, self.input) =20 @@ -6489,7 +6489,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 77, self.input) =20 @@ -6505,7 +6505,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 78, self.input) =20 @@ -6521,7 +6521,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 79, self.input) =20 @@ -6534,7 +6534,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 3, self.input) =20 @@ -6552,7 +6552,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 102, self.input) =20 @@ -6568,7 +6568,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 103, self.input) =20 @@ -6584,7 +6584,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 104, self.input) =20 @@ -6600,7 +6600,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 105, self.input) =20 @@ -6616,7 +6616,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 106, self.input) =20 @@ -6632,7 +6632,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 107, self.input) =20 @@ -6648,7 +6648,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 108, self.input) =20 @@ -6661,7 +6661,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 4, self.input) =20 @@ -6679,7 +6679,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 131, self.input) =20 @@ -6695,7 +6695,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 132, self.input) =20 @@ -6711,7 +6711,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 133, self.input) =20 @@ -6727,7 +6727,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 134, self.input) =20 @@ -6743,7 +6743,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 135, self.input) =20 @@ -6759,7 +6759,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 136, self.input) =20 @@ -6775,7 +6775,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 137, self.input) =20 @@ -6788,7 +6788,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 5, self.input) =20 @@ -6806,7 +6806,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 160, self.input) =20 @@ -6822,7 +6822,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 161, self.input) =20 @@ -6838,7 +6838,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 162, self.input) =20 @@ -6854,7 +6854,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 163, self.input) =20 @@ -6870,7 +6870,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 164, self.input) =20 @@ -6886,7 +6886,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 165, self.input) =20 @@ -6902,7 +6902,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 166, self.input) =20 @@ -6918,7 +6918,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 167, self.input) =20 @@ -6936,7 +6936,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 189, self.input) =20 @@ -6947,7 +6947,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 6, self.input) =20 @@ -6965,7 +6965,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 191, self.input) =20 @@ -6981,7 +6981,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 192, self.input) =20 @@ -6997,7 +6997,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 193, self.input) =20 @@ -7013,7 +7013,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 194, self.input) =20 @@ -7029,7 +7029,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 195, self.input) =20 @@ -7045,7 +7045,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 196, self.input) =20 @@ -7061,7 +7061,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 197, self.input) =20 @@ -7074,7 +7074,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 7, self.input) =20 @@ -7092,7 +7092,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 220, self.input) =20 @@ -7108,7 +7108,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 221, self.input) =20 @@ -7124,7 +7124,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 222, self.input) =20 @@ -7140,7 +7140,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 223, self.input) =20 @@ -7156,7 +7156,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 224, self.input) =20 @@ -7172,7 +7172,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 225, self.input) =20 @@ -7188,7 +7188,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 226, self.input) =20 @@ -7204,7 +7204,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 227, self.input) =20 @@ -7220,7 +7220,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 228, self.input) =20 @@ -7236,7 +7236,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 229, self.input) =20 @@ -7252,7 +7252,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 230, self.input) =20 @@ -7268,7 +7268,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 231, self.input) =20 @@ -7279,7 +7279,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 8, self.input) =20 @@ -7297,7 +7297,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 244, self.input) =20 @@ -7313,7 +7313,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 245, self.input) =20 @@ -7329,7 +7329,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 246, self.input) =20 @@ -7345,7 +7345,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 247, self.input) =20 @@ -7361,7 +7361,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 248, self.input) =20 @@ -7377,7 +7377,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 249, self.input) =20 @@ -7393,7 +7393,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 250, self.input) =20 @@ -7409,7 +7409,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 251, self.input) =20 @@ -7425,7 +7425,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 252, self.input) =20 @@ -7441,7 +7441,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 253, self.input) =20 @@ -7457,7 +7457,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 254, self.input) =20 @@ -7473,7 +7473,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 255, self.input) =20 @@ -7482,7 +7482,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 9, self.input) =20 @@ -7500,7 +7500,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 256, self.input) =20 @@ -7516,7 +7516,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 257, self.input) =20 @@ -7532,7 +7532,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 258, self.input) =20 @@ -7548,7 +7548,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 259, self.input) =20 @@ -7564,7 +7564,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 260, self.input) =20 @@ -7580,7 +7580,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 261, self.input) =20 @@ -7596,7 +7596,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 262, self.input) =20 @@ -7612,7 +7612,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 263, self.input) =20 @@ -7628,7 +7628,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 264, self.input) =20 @@ -7644,7 +7644,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 265, self.input) =20 @@ -7660,7 +7660,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 266, self.input) =20 @@ -7676,7 +7676,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 267, self.input) =20 @@ -7685,7 +7685,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 10, self.input) =20 @@ -7703,7 +7703,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 268, self.input) =20 @@ -7719,7 +7719,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 269, self.input) =20 @@ -7735,7 +7735,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 270, self.input) =20 @@ -7751,7 +7751,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 271, self.input) =20 @@ -7767,7 +7767,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 272, self.input) =20 @@ -7783,7 +7783,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 273, self.input) =20 @@ -7799,7 +7799,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 274, self.input) =20 @@ -7815,7 +7815,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 275, self.input) =20 @@ -7831,7 +7831,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 276, self.input) =20 @@ -7847,7 +7847,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 277, self.input) =20 @@ -7863,7 +7863,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 278, self.input) =20 @@ -7879,7 +7879,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 279, self.input) =20 @@ -7888,7 +7888,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 11, self.input) =20 @@ -7906,7 +7906,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 280, self.input) =20 @@ -7922,7 +7922,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 281, self.input) =20 @@ -7938,7 +7938,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 282, self.input) =20 @@ -7954,7 +7954,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 283, self.input) =20 @@ -7970,7 +7970,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 284, self.input) =20 @@ -7986,7 +7986,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 285, self.input) =20 @@ -8002,7 +8002,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 286, self.input) =20 @@ -8018,7 +8018,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 287, self.input) =20 @@ -8034,7 +8034,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 288, self.input) =20 @@ -8050,7 +8050,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 289, self.input) =20 @@ -8066,7 +8066,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 290, self.input) =20 @@ -8082,7 +8082,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 291, self.input) =20 @@ -8091,7 +8091,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 12, self.input) =20 @@ -8100,7 +8100,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_expre= ssion : ( lvalue assignment_operator assignment_expression | conditional_ex= pression );", 74, 0, self.input) =20 @@ -8112,17 +8112,17 @@ class CParser(Parser): self.lvalue() self.following.pop() if self.failed: - return=20 + return self.following.append(self.FOLLOW_assignment_operator_= in_assignment_expression1746) self.assignment_operator() self.following.pop() if self.failed: - return=20 + return self.following.append(self.FOLLOW_assignment_expressio= n_in_assignment_expression1748) self.assignment_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt74 =3D=3D 2: @@ -8131,7 +8131,7 @@ class CParser(Parser): self.conditional_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -8144,7 +8144,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end assignment_expression =20 @@ -8157,7 +8157,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 49): - return=20 + return =20 # C.g:463:2: ( unary_expression ) # C.g:463:4: unary_expression @@ -8165,7 +8165,7 @@ class CParser(Parser): self.unary_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -8179,7 +8179,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end lvalue =20 @@ -8192,7 +8192,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 50): - return=20 + return =20 # C.g:467:2: ( '=3D' | '*=3D' | '/=3D' | '%=3D' | '+=3D' |= '-=3D' | '<<=3D' | '>>=3D' | '&=3D' | '^=3D' | '|=3D' ) # C.g: @@ -8204,7 +8204,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.input) self.recoverFromMismatchedSet( @@ -8226,7 +8226,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end assignment_operator =20 @@ -8242,7 +8242,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 51): - return=20 + return =20 # C.g:481:2: (e=3D logical_or_expression ( '?' expression = ':' conditional_expression )? ) # C.g:481:4: e=3D logical_or_expression ( '?' expression '= :' conditional_expression )? @@ -8250,7 +8250,7 @@ class CParser(Parser): e =3D self.logical_or_expression() self.following.pop() if self.failed: - return=20 + return # C.g:481:28: ( '?' expression ':' conditional_expression = )? alt75 =3D 2 LA75_0 =3D self.input.LA(1) @@ -8261,20 +8261,20 @@ class CParser(Parser): # C.g:481:29: '?' expression ':' conditional_expression self.match(self.input, 90, self.FOLLOW_90_in_condition= al_expression1842) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_in_condit= ional_expression1844) self.expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 47, self.FOLLOW_47_in_condition= al_expression1846) if self.failed: - return=20 + return self.following.append(self.FOLLOW_conditional_expressi= on_in_conditional_expression1848) self.conditional_expression() self.following.pop() if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start,e.stop)) =20 @@ -8294,7 +8294,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end conditional_expression =20 @@ -8377,7 +8377,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 53): - return=20 + return =20 # C.g:489:2: ( inclusive_or_expression ( '&&' inclusive_or= _expression )* ) # C.g:489:4: inclusive_or_expression ( '&&' inclusive_or_e= xpression )* @@ -8385,7 +8385,7 @@ class CParser(Parser): self.inclusive_or_expression() self.following.pop() if self.failed: - return=20 + return # C.g:489:28: ( '&&' inclusive_or_expression )* while True: #loop77 alt77 =3D 2 @@ -8399,12 +8399,12 @@ class CParser(Parser): # C.g:489:29: '&&' inclusive_or_expression self.match(self.input, 92, self.FOLLOW_92_in_logic= al_and_expression1884) if self.failed: - return=20 + return self.following.append(self.FOLLOW_inclusive_or_exp= ression_in_logical_and_expression1886) self.inclusive_or_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -8424,7 +8424,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end logical_and_expression =20 @@ -8437,7 +8437,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 54): - return=20 + return =20 # C.g:493:2: ( exclusive_or_expression ( '|' exclusive_or_= expression )* ) # C.g:493:4: exclusive_or_expression ( '|' exclusive_or_ex= pression )* @@ -8445,7 +8445,7 @@ class CParser(Parser): self.exclusive_or_expression() self.following.pop() if self.failed: - return=20 + return # C.g:493:28: ( '|' exclusive_or_expression )* while True: #loop78 alt78 =3D 2 @@ -8459,12 +8459,12 @@ class CParser(Parser): # C.g:493:29: '|' exclusive_or_expression self.match(self.input, 93, self.FOLLOW_93_in_inclu= sive_or_expression1902) if self.failed: - return=20 + return self.following.append(self.FOLLOW_exclusive_or_exp= ression_in_inclusive_or_expression1904) self.exclusive_or_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -8484,7 +8484,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end inclusive_or_expression =20 @@ -8497,7 +8497,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 55): - return=20 + return =20 # C.g:497:2: ( and_expression ( '^' and_expression )* ) # C.g:497:4: and_expression ( '^' and_expression )* @@ -8505,7 +8505,7 @@ class CParser(Parser): self.and_expression() self.following.pop() if self.failed: - return=20 + return # C.g:497:19: ( '^' and_expression )* while True: #loop79 alt79 =3D 2 @@ -8519,12 +8519,12 @@ class CParser(Parser): # C.g:497:20: '^' and_expression self.match(self.input, 94, self.FOLLOW_94_in_exclu= sive_or_expression1920) if self.failed: - return=20 + return self.following.append(self.FOLLOW_and_expression_i= n_exclusive_or_expression1922) self.and_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -8544,7 +8544,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end exclusive_or_expression =20 @@ -8557,7 +8557,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 56): - return=20 + return =20 # C.g:501:2: ( equality_expression ( '&' equality_expressi= on )* ) # C.g:501:4: equality_expression ( '&' equality_expression= )* @@ -8565,7 +8565,7 @@ class CParser(Parser): self.equality_expression() self.following.pop() if self.failed: - return=20 + return # C.g:501:24: ( '&' equality_expression )* while True: #loop80 alt80 =3D 2 @@ -8579,12 +8579,12 @@ class CParser(Parser): # C.g:501:25: '&' equality_expression self.match(self.input, 77, self.FOLLOW_77_in_and_e= xpression1938) if self.failed: - return=20 + return self.following.append(self.FOLLOW_equality_express= ion_in_and_expression1940) self.equality_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -8604,7 +8604,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end and_expression =20 @@ -8617,7 +8617,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 57): - return=20 + return =20 # C.g:504:2: ( relational_expression ( ( '=3D=3D' | '!=3D'= ) relational_expression )* ) # C.g:504:4: relational_expression ( ( '=3D=3D' | '!=3D' )= relational_expression )* @@ -8625,7 +8625,7 @@ class CParser(Parser): self.relational_expression() self.following.pop() if self.failed: - return=20 + return # C.g:504:26: ( ( '=3D=3D' | '!=3D' ) relational_expressio= n )* while True: #loop81 alt81 =3D 2 @@ -8645,7 +8645,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.inpu= t) self.recoverFromMismatchedSet( @@ -8658,7 +8658,7 @@ class CParser(Parser): self.relational_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -8678,7 +8678,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end equality_expression =20 @@ -8691,7 +8691,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 58): - return=20 + return =20 # C.g:508:2: ( shift_expression ( ( '<' | '>' | '<=3D' | '= >=3D' ) shift_expression )* ) # C.g:508:4: shift_expression ( ( '<' | '>' | '<=3D' | '>= =3D' ) shift_expression )* @@ -8699,7 +8699,7 @@ class CParser(Parser): self.shift_expression() self.following.pop() if self.failed: - return=20 + return # C.g:508:21: ( ( '<' | '>' | '<=3D' | '>=3D' ) shift_expr= ession )* while True: #loop82 alt82 =3D 2 @@ -8719,7 +8719,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.inpu= t) self.recoverFromMismatchedSet( @@ -8732,7 +8732,7 @@ class CParser(Parser): self.shift_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -8752,7 +8752,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end relational_expression =20 @@ -8765,7 +8765,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 59): - return=20 + return =20 # C.g:512:2: ( additive_expression ( ( '<<' | '>>' ) addit= ive_expression )* ) # C.g:512:4: additive_expression ( ( '<<' | '>>' ) additiv= e_expression )* @@ -8773,7 +8773,7 @@ class CParser(Parser): self.additive_expression() self.following.pop() if self.failed: - return=20 + return # C.g:512:24: ( ( '<<' | '>>' ) additive_expression )* while True: #loop83 alt83 =3D 2 @@ -8793,7 +8793,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.inpu= t) self.recoverFromMismatchedSet( @@ -8806,7 +8806,7 @@ class CParser(Parser): self.additive_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -8826,7 +8826,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end shift_expression =20 @@ -8839,7 +8839,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 60): - return=20 + return =20 # C.g:518:2: ( labeled_statement | compound_statement | ex= pression_statement | selection_statement | iteration_statement | jump_state= ment | macro_statement | asm2_statement | asm1_statement | asm_statement | = declaration ) alt84 =3D 11 @@ -8860,7 +8860,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("517:1: statemen= t : ( labeled_statement | compound_statement | expression_statement | selec= tion_statement | iteration_statement | jump_statement | macro_statement | a= sm2_statement | asm1_statement | asm_statement | declaration );", 84, 43, s= elf.input) =20 @@ -8880,7 +8880,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("517:1: statemen= t : ( labeled_statement | compound_statement | expression_statement | selec= tion_statement | iteration_statement | jump_statement | macro_statement | a= sm2_statement | asm1_statement | asm_statement | declaration );", 84, 47, s= elf.input) =20 @@ -8896,7 +8896,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("517:1: statemen= t : ( labeled_statement | compound_statement | expression_statement | selec= tion_statement | iteration_statement | jump_statement | macro_statement | a= sm2_statement | asm1_statement | asm_statement | declaration );", 84, 53, s= elf.input) =20 @@ -8912,7 +8912,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("517:1: statemen= t : ( labeled_statement | compound_statement | expression_statement | selec= tion_statement | iteration_statement | jump_statement | macro_statement | a= sm2_statement | asm1_statement | asm_statement | declaration );", 84, 68, s= elf.input) =20 @@ -8923,7 +8923,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("517:1: statement : = ( labeled_statement | compound_statement | expression_statement | selection= _statement | iteration_statement | jump_statement | macro_statement | asm2_= statement | asm1_statement | asm_statement | declaration );", 84, 1, self.i= nput) =20 @@ -8952,7 +8952,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("517:1: statement : ( la= beled_statement | compound_statement | expression_statement | selection_sta= tement | iteration_statement | jump_statement | macro_statement | asm2_stat= ement | asm1_statement | asm_statement | declaration );", 84, 0, self.input) =20 @@ -8964,7 +8964,7 @@ class CParser(Parser): self.labeled_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 2: @@ -8973,7 +8973,7 @@ class CParser(Parser): self.compound_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 3: @@ -8982,7 +8982,7 @@ class CParser(Parser): self.expression_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 4: @@ -8991,7 +8991,7 @@ class CParser(Parser): self.selection_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 5: @@ -9000,7 +9000,7 @@ class CParser(Parser): self.iteration_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 6: @@ -9009,7 +9009,7 @@ class CParser(Parser): self.jump_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 7: @@ -9018,7 +9018,7 @@ class CParser(Parser): self.macro_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 8: @@ -9027,7 +9027,7 @@ class CParser(Parser): self.asm2_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 9: @@ -9036,7 +9036,7 @@ class CParser(Parser): self.asm1_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 10: @@ -9045,7 +9045,7 @@ class CParser(Parser): self.asm_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 11: @@ -9054,7 +9054,7 @@ class CParser(Parser): self.declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -9067,7 +9067,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end statement =20 @@ -9080,7 +9080,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 61): - return=20 + return =20 # C.g:532:2: ( ( '__asm__' )? IDENTIFIER '(' (~ ( ';' ) )*= ')' ';' ) # C.g:532:4: ( '__asm__' )? IDENTIFIER '(' (~ ( ';' ) )* '= )' ';' @@ -9094,16 +9094,16 @@ class CParser(Parser): # C.g:0:0: '__asm__' self.match(self.input, 103, self.FOLLOW_103_in_asm2_st= atement2086) if self.failed: - return=20 + return =20 =20 =20 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_asm2_statement2089) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_asm2_statemen= t2091) if self.failed: - return=20 + return # C.g:532:30: (~ ( ';' ) )* while True: #loop86 alt86 =3D 2 @@ -9130,7 +9130,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.inpu= t) self.recoverFromMismatchedSet( @@ -9147,10 +9147,10 @@ class CParser(Parser): =20 self.match(self.input, 63, self.FOLLOW_63_in_asm2_statemen= t2101) if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_asm2_statemen= t2103) if self.failed: - return=20 + return =20 =20 =20 @@ -9164,7 +9164,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end asm2_statement =20 @@ -9177,16 +9177,16 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 62): - return=20 + return =20 # C.g:536:2: ( '_asm' '{' (~ ( '}' ) )* '}' ) # C.g:536:4: '_asm' '{' (~ ( '}' ) )* '}' self.match(self.input, 104, self.FOLLOW_104_in_asm1_statem= ent2115) if self.failed: - return=20 + return self.match(self.input, 43, self.FOLLOW_43_in_asm1_statemen= t2117) if self.failed: - return=20 + return # C.g:536:15: (~ ( '}' ) )* while True: #loop87 alt87 =3D 2 @@ -9206,7 +9206,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.inpu= t) self.recoverFromMismatchedSet( @@ -9223,7 +9223,7 @@ class CParser(Parser): =20 self.match(self.input, 44, self.FOLLOW_44_in_asm1_statemen= t2127) if self.failed: - return=20 + return =20 =20 =20 @@ -9237,7 +9237,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end asm1_statement =20 @@ -9250,16 +9250,16 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 63): - return=20 + return =20 # C.g:540:2: ( '__asm' '{' (~ ( '}' ) )* '}' ) # C.g:540:4: '__asm' '{' (~ ( '}' ) )* '}' self.match(self.input, 105, self.FOLLOW_105_in_asm_stateme= nt2138) if self.failed: - return=20 + return self.match(self.input, 43, self.FOLLOW_43_in_asm_statement= 2140) if self.failed: - return=20 + return # C.g:540:16: (~ ( '}' ) )* while True: #loop88 alt88 =3D 2 @@ -9279,7 +9279,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.inpu= t) self.recoverFromMismatchedSet( @@ -9296,7 +9296,7 @@ class CParser(Parser): =20 self.match(self.input, 44, self.FOLLOW_44_in_asm_statement= 2150) if self.failed: - return=20 + return =20 =20 =20 @@ -9310,7 +9310,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end asm_statement =20 @@ -9323,16 +9323,16 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 64): - return=20 + return =20 # C.g:544:2: ( IDENTIFIER '(' ( declaration )* ( statement= _list )? ( expression )? ')' ) # C.g:544:4: IDENTIFIER '(' ( declaration )* ( statement_l= ist )? ( expression )? ')' self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_macro_statement2162) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_macro_stateme= nt2164) if self.failed: - return=20 + return # C.g:544:19: ( declaration )* while True: #loop89 alt89 =3D 2 @@ -11234,7 +11234,7 @@ class CParser(Parser): self.declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -12440,7 +12440,7 @@ class CParser(Parser): self.statement_list() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -12456,13 +12456,13 @@ class CParser(Parser): self.expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 self.match(self.input, 63, self.FOLLOW_63_in_macro_stateme= nt2176) if self.failed: - return=20 + return =20 =20 =20 @@ -12476,7 +12476,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end macro_statement =20 @@ -12489,7 +12489,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 65): - return=20 + return =20 # C.g:548:2: ( IDENTIFIER ':' statement | 'case' constant_= expression ':' statement | 'default' ':' statement ) alt92 =3D 3 @@ -12503,7 +12503,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("547:1: labeled_statemen= t : ( IDENTIFIER ':' statement | 'case' constant_expression ':' statement |= 'default' ':' statement );", 92, 0, self.input) =20 @@ -12513,50 +12513,50 @@ class CParser(Parser): # C.g:548:4: IDENTIFIER ':' statement self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_labeled_statement2188) if self.failed: - return=20 + return self.match(self.input, 47, self.FOLLOW_47_in_labeled_s= tatement2190) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_labeled= _statement2192) self.statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt92 =3D=3D 2: # C.g:549:4: 'case' constant_expression ':' statement self.match(self.input, 106, self.FOLLOW_106_in_labeled= _statement2197) if self.failed: - return=20 + return self.following.append(self.FOLLOW_constant_expression_= in_labeled_statement2199) self.constant_expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 47, self.FOLLOW_47_in_labeled_s= tatement2201) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_labeled= _statement2203) self.statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt92 =3D=3D 3: # C.g:550:4: 'default' ':' statement self.match(self.input, 107, self.FOLLOW_107_in_labeled= _statement2208) if self.failed: - return=20 + return self.match(self.input, 47, self.FOLLOW_47_in_labeled_s= tatement2210) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_labeled= _statement2212) self.statement() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -12569,7 +12569,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end labeled_statement =20 @@ -14552,7 +14552,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 67): - return=20 + return =20 # C.g:558:2: ( ( statement )+ ) # C.g:558:4: ( statement )+ @@ -16230,7 +16230,7 @@ class CParser(Parser): self.statement() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -16239,7 +16239,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(95, self.input) raise eee @@ -16260,7 +16260,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end statement_list =20 @@ -16347,7 +16347,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 69): - return=20 + return =20 # C.g:567:2: ( 'if' '(' e=3D expression ')' statement ( op= tions {k=3D1; backtrack=3Dfalse; } : 'else' statement )? | 'switch' '(' exp= ression ')' statement ) alt98 =3D 2 @@ -16360,7 +16360,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("566:1: selection_statem= ent : ( 'if' '(' e=3D expression ')' statement ( options {k=3D1; backtrack= =3Dfalse; } : 'else' statement )? | 'switch' '(' expression ')' statement )= ;", 98, 0, self.input) =20 @@ -16370,18 +16370,18 @@ class CParser(Parser): # C.g:567:4: 'if' '(' e=3D expression ')' statement ( = options {k=3D1; backtrack=3Dfalse; } : 'else' statement )? self.match(self.input, 108, self.FOLLOW_108_in_selecti= on_statement2272) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_selection= _statement2274) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_in_select= ion_statement2278) e =3D self.expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_selection= _statement2280) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start,e.stop)) =20 @@ -16389,7 +16389,7 @@ class CParser(Parser): self.statement() self.following.pop() if self.failed: - return=20 + return # C.g:567:167: ( options {k=3D1; backtrack=3Dfalse; } = : 'else' statement )? alt97 =3D 2 LA97_0 =3D self.input.LA(1) @@ -16400,12 +16400,12 @@ class CParser(Parser): # C.g:567:200: 'else' statement self.match(self.input, 109, self.FOLLOW_109_in_sel= ection_statement2299) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_sel= ection_statement2301) self.statement() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -16415,23 +16415,23 @@ class CParser(Parser): # C.g:568:4: 'switch' '(' expression ')' statement self.match(self.input, 110, self.FOLLOW_110_in_selecti= on_statement2308) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_selection= _statement2310) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_in_select= ion_statement2312) self.expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_selection= _statement2314) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_selecti= on_statement2316) self.statement() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -16444,7 +16444,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end selection_statement =20 @@ -16460,7 +16460,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 70): - return=20 + return =20 # C.g:572:2: ( 'while' '(' e=3D expression ')' statement |= 'do' statement 'while' '(' e=3D expression ')' ';' | 'for' '(' expression_= statement e=3D expression_statement ( expression )? ')' statement ) alt100 =3D 3 @@ -16474,7 +16474,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("571:1: iteration_statem= ent : ( 'while' '(' e=3D expression ')' statement | 'do' statement 'while' = '(' e=3D expression ')' ';' | 'for' '(' expression_statement e=3D expressio= n_statement ( expression )? ')' statement );", 100, 0, self.input) =20 @@ -16484,23 +16484,23 @@ class CParser(Parser): # C.g:572:4: 'while' '(' e=3D expression ')' statement self.match(self.input, 111, self.FOLLOW_111_in_iterati= on_statement2327) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_iteration= _statement2329) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_in_iterat= ion_statement2333) e =3D self.expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_iteration= _statement2335) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_iterati= on_statement2337) self.statement() self.following.pop() if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start,e.stop)) =20 @@ -16510,29 +16510,29 @@ class CParser(Parser): # C.g:573:4: 'do' statement 'while' '(' e=3D expressio= n ')' ';' self.match(self.input, 112, self.FOLLOW_112_in_iterati= on_statement2344) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_iterati= on_statement2346) self.statement() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 111, self.FOLLOW_111_in_iterati= on_statement2348) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_iteration= _statement2350) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_in_iterat= ion_statement2354) e =3D self.expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_iteration= _statement2356) if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_iteration= _statement2358) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start,e.stop)) =20 @@ -16542,20 +16542,20 @@ class CParser(Parser): # C.g:574:4: 'for' '(' expression_statement e=3D expre= ssion_statement ( expression )? ')' statement self.match(self.input, 113, self.FOLLOW_113_in_iterati= on_statement2365) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_iteration= _statement2367) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_statement= _in_iteration_statement2369) self.expression_statement() self.following.pop() if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_statement= _in_iteration_statement2373) e =3D self.expression_statement() self.following.pop() if self.failed: - return=20 + return # C.g:574:58: ( expression )? alt99 =3D 2 LA99_0 =3D self.input.LA(1) @@ -16568,18 +16568,18 @@ class CParser(Parser): self.expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 self.match(self.input, 63, self.FOLLOW_63_in_iteration= _statement2378) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_iterati= on_statement2380) self.statement() self.following.pop() if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start,e.stop)) =20 @@ -16595,7 +16595,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end iteration_statement =20 @@ -16608,7 +16608,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 71): - return=20 + return =20 # C.g:578:2: ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'b= reak' ';' | 'return' ';' | 'return' expression ';' ) alt101 =3D 5 @@ -16629,7 +16629,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("577:1: jump_stateme= nt : ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' = | 'return' expression ';' );", 101, 4, self.input) =20 @@ -16638,7 +16638,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("577:1: jump_statement := ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' | 'r= eturn' expression ';' );", 101, 0, self.input) =20 @@ -16648,58 +16648,58 @@ class CParser(Parser): # C.g:578:4: 'goto' IDENTIFIER ';' self.match(self.input, 114, self.FOLLOW_114_in_jump_st= atement2393) if self.failed: - return=20 + return self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_jump_statement2395) if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2397) if self.failed: - return=20 + return =20 =20 elif alt101 =3D=3D 2: # C.g:579:4: 'continue' ';' self.match(self.input, 115, self.FOLLOW_115_in_jump_st= atement2402) if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2404) if self.failed: - return=20 + return =20 =20 elif alt101 =3D=3D 3: # C.g:580:4: 'break' ';' self.match(self.input, 116, self.FOLLOW_116_in_jump_st= atement2409) if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2411) if self.failed: - return=20 + return =20 =20 elif alt101 =3D=3D 4: # C.g:581:4: 'return' ';' self.match(self.input, 117, self.FOLLOW_117_in_jump_st= atement2416) if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2418) if self.failed: - return=20 + return =20 =20 elif alt101 =3D=3D 5: # C.g:582:4: 'return' expression ';' self.match(self.input, 117, self.FOLLOW_117_in_jump_st= atement2423) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_in_jump_s= tatement2425) self.expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2427) if self.failed: - return=20 + return =20 =20 =20 @@ -16712,7 +16712,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end jump_statement =20 @@ -16724,7 +16724,7 @@ class CParser(Parser): self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred2 @@ -16855,7 +16855,7 @@ class CParser(Parser): self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -16863,7 +16863,7 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return # C.g:119:41: ( declaration )* while True: #loop103 alt103 =3D 2 @@ -16879,7 +16879,7 @@ class CParser(Parser): self.declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -16888,7 +16888,7 @@ class CParser(Parser): =20 self.match(self.input, 43, self.FOLLOW_43_in_synpred4108) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred4 @@ -16903,7 +16903,7 @@ class CParser(Parser): self.declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred5 @@ -16918,7 +16918,7 @@ class CParser(Parser): self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred7 @@ -16933,7 +16933,7 @@ class CParser(Parser): self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred10 @@ -16948,7 +16948,7 @@ class CParser(Parser): self.type_specifier() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred14 @@ -16963,7 +16963,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred15 @@ -16978,7 +16978,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred33 @@ -16991,7 +16991,7 @@ class CParser(Parser): # C.g:225:5: IDENTIFIER ( type_qualifier )* declarator self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_synpr= ed34442) if self.failed: - return=20 + return # C.g:225:16: ( type_qualifier )* while True: #loop106 alt106 =3D 2 @@ -17026,7 +17026,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -17037,7 +17037,7 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred34 @@ -17052,7 +17052,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred39 @@ -17067,7 +17067,7 @@ class CParser(Parser): self.type_specifier() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred40 @@ -17090,7 +17090,7 @@ class CParser(Parser): self.pointer() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -17104,7 +17104,7 @@ class CParser(Parser): # C.g:297:14: 'EFIAPI' self.match(self.input, 58, self.FOLLOW_58_in_synpred66788) if self.failed: - return=20 + return =20 =20 =20 @@ -17118,7 +17118,7 @@ class CParser(Parser): # C.g:297:26: 'EFI_BOOTSERVICE' self.match(self.input, 59, self.FOLLOW_59_in_synpred66793) if self.failed: - return=20 + return =20 =20 =20 @@ -17132,7 +17132,7 @@ class CParser(Parser): # C.g:297:47: 'EFI_RUNTIMESERVICE' self.match(self.input, 60, self.FOLLOW_60_in_synpred66798) if self.failed: - return=20 + return =20 =20 =20 @@ -17140,7 +17140,7 @@ class CParser(Parser): self.direct_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred66 @@ -17155,7 +17155,7 @@ class CParser(Parser): self.declarator_suffix() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred67 @@ -17168,7 +17168,7 @@ class CParser(Parser): # C.g:304:9: 'EFIAPI' self.match(self.input, 58, self.FOLLOW_58_in_synpred69830) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred69 @@ -17183,7 +17183,7 @@ class CParser(Parser): self.declarator_suffix() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred70 @@ -17196,15 +17196,15 @@ class CParser(Parser): # C.g:310:9: '(' parameter_type_list ')' self.match(self.input, 62, self.FOLLOW_62_in_synpred73878) if self.failed: - return=20 + return self.following.append(self.FOLLOW_parameter_type_list_in_synpred73= 880) self.parameter_type_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_synpred73882) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred73 @@ -17217,15 +17217,15 @@ class CParser(Parser): # C.g:311:9: '(' identifier_list ')' self.match(self.input, 62, self.FOLLOW_62_in_synpred74892) if self.failed: - return=20 + return self.following.append(self.FOLLOW_identifier_list_in_synpred74894) self.identifier_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_synpred74896) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred74 @@ -17240,7 +17240,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred75 @@ -17255,7 +17255,7 @@ class CParser(Parser): self.pointer() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred76 @@ -17268,7 +17268,7 @@ class CParser(Parser): # C.g:316:4: '*' ( type_qualifier )+ ( pointer )? self.match(self.input, 66, self.FOLLOW_66_in_synpred77919) if self.failed: - return=20 + return # C.g:316:8: ( type_qualifier )+ cnt116 =3D 0 while True: #loop116 @@ -17285,7 +17285,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -17294,7 +17294,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(116, self.input) raise eee @@ -17314,7 +17314,7 @@ class CParser(Parser): self.pointer() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -17330,12 +17330,12 @@ class CParser(Parser): # C.g:317:4: '*' pointer self.match(self.input, 66, self.FOLLOW_66_in_synpred78930) if self.failed: - return=20 + return self.following.append(self.FOLLOW_pointer_in_synpred78932) self.pointer() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred78 @@ -17348,7 +17348,7 @@ class CParser(Parser): # C.g:326:32: 'OPTIONAL' self.match(self.input, 53, self.FOLLOW_53_in_synpred81977) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred81 @@ -17361,7 +17361,7 @@ class CParser(Parser): # C.g:326:27: ',' ( 'OPTIONAL' )? parameter_declaration self.match(self.input, 27, self.FOLLOW_27_in_synpred82974) if self.failed: - return=20 + return # C.g:326:31: ( 'OPTIONAL' )? alt119 =3D 2 LA119_0 =3D self.input.LA(1) @@ -17375,7 +17375,7 @@ class CParser(Parser): # C.g:326:32: 'OPTIONAL' self.match(self.input, 53, self.FOLLOW_53_in_synpred82977) if self.failed: - return=20 + return =20 =20 =20 @@ -17383,7 +17383,7 @@ class CParser(Parser): self.parameter_declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred82 @@ -17398,7 +17398,7 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred83 @@ -17413,7 +17413,7 @@ class CParser(Parser): self.abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred84 @@ -17428,7 +17428,7 @@ class CParser(Parser): self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return # C.g:330:27: ( declarator | abstract_declarator )* while True: #loop120 alt120 =3D 3 @@ -17512,7 +17512,7 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt120 =3D=3D 2: @@ -17521,7 +17521,7 @@ class CParser(Parser): self.abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -17538,7 +17538,7 @@ class CParser(Parser): # C.g:330:62: 'OPTIONAL' self.match(self.input, 53, self.FOLLOW_53_in_synpred861004) if self.failed: - return=20 + return =20 =20 =20 @@ -17556,7 +17556,7 @@ class CParser(Parser): self.specifier_qualifier_list() self.following.pop() if self.failed: - return=20 + return # C.g:341:29: ( abstract_declarator )? alt122 =3D 2 LA122_0 =3D self.input.LA(1) @@ -17569,7 +17569,7 @@ class CParser(Parser): self.abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -17587,7 +17587,7 @@ class CParser(Parser): self.direct_abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred91 @@ -17600,15 +17600,15 @@ class CParser(Parser): # C.g:351:6: '(' abstract_declarator ')' self.match(self.input, 62, self.FOLLOW_62_in_synpred931086) if self.failed: - return=20 + return self.following.append(self.FOLLOW_abstract_declarator_in_synpred93= 1088) self.abstract_declarator() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_synpred931090) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred93 @@ -17623,7 +17623,7 @@ class CParser(Parser): self.abstract_declarator_suffix() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred94 @@ -17636,20 +17636,20 @@ class CParser(Parser): # C.g:386:4: '(' type_name ')' cast_expression self.match(self.input, 62, self.FOLLOW_62_in_synpred1091282) if self.failed: - return=20 + return self.following.append(self.FOLLOW_type_name_in_synpred1091284) self.type_name() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_synpred1091286) if self.failed: - return=20 + return self.following.append(self.FOLLOW_cast_expression_in_synpred109128= 8) self.cast_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred109 @@ -17662,12 +17662,12 @@ class CParser(Parser): # C.g:395:4: 'sizeof' unary_expression self.match(self.input, 74, self.FOLLOW_74_in_synpred1141330) if self.failed: - return=20 + return self.following.append(self.FOLLOW_unary_expression_in_synpred11413= 32) self.unary_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred114 @@ -17680,15 +17680,15 @@ class CParser(Parser): # C.g:409:13: '(' argument_expression_list ')' self.match(self.input, 62, self.FOLLOW_62_in_synpred1171420) if self.failed: - return=20 + return self.following.append(self.FOLLOW_argument_expression_list_in_synp= red1171424) self.argument_expression_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_synpred1171428) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred117 @@ -17701,15 +17701,15 @@ class CParser(Parser): # C.g:410:13: '(' macro_parameter_list ')' self.match(self.input, 62, self.FOLLOW_62_in_synpred1181444) if self.failed: - return=20 + return self.following.append(self.FOLLOW_macro_parameter_list_in_synpred1= 181446) self.macro_parameter_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_synpred1181448) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred118 @@ -17722,10 +17722,10 @@ class CParser(Parser): # C.g:412:13: '*' IDENTIFIER self.match(self.input, 66, self.FOLLOW_66_in_synpred1201482) if self.failed: - return=20 + return self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_synpr= ed1201486) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred120 @@ -17738,7 +17738,7 @@ class CParser(Parser): # C.g:443:20: STRING_LITERAL self.match(self.input, STRING_LITERAL, self.FOLLOW_STRING_LITERAL_= in_synpred1371683) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred137 @@ -17762,7 +17762,7 @@ class CParser(Parser): # C.g:0:0: IDENTIFIER self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_synpred1381680) if self.failed: - return=20 + return =20 =20 else: @@ -17783,7 +17783,7 @@ class CParser(Parser): # C.g:0:0: STRING_LITERAL self.match(self.input, STRING_LITERAL, self.FOLLOW_STRING_= LITERAL_in_synpred1381683) if self.failed: - return=20 + return =20 =20 else: @@ -17792,7 +17792,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(126, self.input) raise eee @@ -17814,17 +17814,17 @@ class CParser(Parser): self.lvalue() self.following.pop() if self.failed: - return=20 + return self.following.append(self.FOLLOW_assignment_operator_in_synpred14= 21746) self.assignment_operator() self.following.pop() if self.failed: - return=20 + return self.following.append(self.FOLLOW_assignment_expression_in_synpred= 1421748) self.assignment_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred142 @@ -17839,7 +17839,7 @@ class CParser(Parser): self.expression_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred169 @@ -17854,7 +17854,7 @@ class CParser(Parser): self.macro_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred173 @@ -17869,7 +17869,7 @@ class CParser(Parser): self.asm2_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred174 @@ -17884,7 +17884,7 @@ class CParser(Parser): self.declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred181 @@ -17899,7 +17899,7 @@ class CParser(Parser): self.statement_list() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred182 @@ -17914,7 +17914,7 @@ class CParser(Parser): self.declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred186 @@ -17929,7 +17929,7 @@ class CParser(Parser): self.statement() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred188 @@ -18388,7 +18388,7 @@ class CParser(Parser): =20 =20 =20 -=20 + =20 FOLLOW_external_declaration_in_translation_unit74 =3D frozenset([1, 4,= 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49= , 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66]) FOLLOW_function_definition_in_external_declaration113 =3D frozenset([1= ]) diff --git a/BaseTools/Source/Python/Ecc/Check.py b/BaseTools/Source/Python= /Ecc/Check.py index 27783e617b92..0a27081df37d 100644 --- a/BaseTools/Source/Python/Ecc/Check.py +++ b/BaseTools/Source/Python/Ecc/Check.py @@ -563,17 +563,17 @@ class Check(object): op =3D open(FullName).readlines() FileLinesList =3D op LineNo =3D 0 - CurrentSection =3D MODEL_UNKNOWN=20 + CurrentSection =3D MODEL_UNKNOWN HeaderSectionLines =3D [] - HeaderCommentStart =3D False=20 + HeaderCommentStart =3D False HeaderCommentEnd =3D False - =20 + for Line in FileLinesList: LineNo =3D LineNo + 1 Line =3D Line.strip() if (LineNo < len(FileLinesList) - 1): NextLine =3D FileLinesList[LineNo].strip() - =20 + # # blank line # @@ -600,8 +600,8 @@ class Check(object): # HeaderSectionLines.append((Line, LineN= o)) HeaderCommentStart =3D True - continue =20 - =20 + continue + # # Collect Header content. # @@ -635,7 +635,7 @@ class Check(object): if EccGlobalData.gConfig.HeaderCheckFileCo= mmentEnd =3D=3D '1' or EccGlobalData.gConfig.HeaderCheckAll =3D=3D '1' or E= ccGlobalData.gConfig.CheckAll =3D=3D '1': EccGlobalData.gDb.TblReport.Insert(ERR= OR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0]) =20 - =20 + =20 # Check whether the function headers are followed Doxygen special docu= mentation blocks in section 2.3.5 def DoxygenCheckFunctionHeader(self): @@ -827,7 +827,7 @@ class Check(object): for FilePath in FilePathList: if not EccGlobalData.gException.IsException(ERROR_= META_DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE, Record[1]): EccGlobalData.gDb.TblReport.Insert(ERROR_META_= DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE, OtherMsg=3D"The Library Class [%s] = is duplicated in '%s' line %s and line %s." % (Record[1], FilePath, Record[= 3], Record[4]), BelongsToTable=3D'Dsc', BelongsToItem=3DRecord[0]) - =20 + # Check the header file in Include\Library directory whether be define= d in the package DEC file. def MetaDataFileCheckLibraryDefinedInDec(self): if EccGlobalData.gConfig.MetaDataFileCheckLibraryDefinedInDec =3D= =3D '1' or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlob= alData.gConfig.CheckAll =3D=3D '1': @@ -842,9 +842,9 @@ class Check(object): if not LibraryDec: if not EccGlobalData.gException.IsException(ERROR_META= _DATA_FILE_CHECK_LIBRARY_NOT_DEFINED, LibraryInInf): EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA= _FILE_CHECK_LIBRARY_NOT_DEFINED, \ - OtherMsg=3D"The Library Class = [%s] in %s line is not defined in the associated package file." % (LibraryI= nInf, Line),=20 + OtherMsg=3D"The Library Class = [%s] in %s line is not defined in the associated package file." % (LibraryI= nInf, Line), BelongsToTable=3D'Inf', Belong= sToItem=3DID) - =20 + # Check whether an Inf file is specified in the FDF file, but not in t= he Dsc file, then the Inf file must be for a Binary module only def MetaDataFileCheckBinaryInfInFdf(self): if EccGlobalData.gConfig.MetaDataFileCheckBinaryInfInFdf =3D=3D '1= ' or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlobalData= .gConfig.CheckAll =3D=3D '1': @@ -1244,7 +1244,7 @@ class Check(object): group by A.ID """ % (Table.Table, Table.Table, Model, Model) RecordSet =3D Table.Exec(SqlCommand) - for Record in RecordSet: =20 + for Record in RecordSet: if not EccGlobalData.gException.IsException(ErrorID, Record[2]= ): EccGlobalData.gDb.TblReport.Insert(ErrorID, OtherMsg=3D"Th= e %s value [%s] is used more than one time" % (Name.upper(), Record[2]), Be= longsToTable=3DTable.Table, BelongsToItem=3DRecord[0]) =20 diff --git a/BaseTools/Source/Python/Ecc/CodeFragment.py b/BaseTools/Source= /Python/Ecc/CodeFragment.py index 3bf1c4515020..beb29a8203b4 100644 --- a/BaseTools/Source/Python/Ecc/CodeFragment.py +++ b/BaseTools/Source/Python/Ecc/CodeFragment.py @@ -161,5 +161,4 @@ class FunctionCalling: self.FuncName =3D Name self.ParamList =3D Param self.StartPos =3D Begin - self.EndPos =3D End =20 - =20 \ No newline at end of file + self.EndPos =3D End diff --git a/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py b/BaseToo= ls/Source/Python/Ecc/CodeFragmentCollector.py index ffa51de7c1bf..3377f4a94003 100644 --- a/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py +++ b/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py @@ -46,7 +46,7 @@ from ParserWarning import Warning T_CHAR_BACKSLASH, T_CHAR_DOUBLE_QUOTE, T_CHAR_SINGLE_QUOTE, T_CHAR_STAR, T= _CHAR_HASH) =3D \ (' ', '\0', '\r', '\t', '\n', '/', '\\', '\"', '\'', '*', '#') =20 -SEPERATOR_TUPLE =3D ('=3D', '|', ',', '{', '}')=20 +SEPERATOR_TUPLE =3D ('=3D', '|', ',', '{', '}') =20 (T_COMMENT_TWO_SLASH, T_COMMENT_SLASH_STAR) =3D (0, 1) =20 @@ -58,7 +58,7 @@ SEPERATOR_TUPLE =3D ('=3D', '|', ',', '{', '}') # # GetNext*** procedures mean these procedures will get next token first, t= hen make judgement. # Get*** procedures mean these procedures will make judgement on current t= oken only. -# =20 +# class CodeFragmentCollector: ## The constructor # @@ -88,7 +88,7 @@ class CodeFragmentCollector: SizeOfLastLine =3D NumberOfLines if NumberOfLines > 0: SizeOfLastLine =3D len(self.Profile.FileLinesList[-1]) - =20 + if self.CurrentLineNumber =3D=3D NumberOfLines and self.CurrentOff= setWithinLine >=3D SizeOfLastLine - 1: return True elif self.CurrentLineNumber > NumberOfLines: @@ -110,7 +110,7 @@ class CodeFragmentCollector: return True else: return False - =20 + ## Rewind() method # # Reset file data buffer to the initial state @@ -120,7 +120,7 @@ class CodeFragmentCollector: def Rewind(self): self.CurrentLineNumber =3D 1 self.CurrentOffsetWithinLine =3D 0 - =20 + ## __UndoOneChar() method # # Go back one char in the file buffer @@ -128,9 +128,9 @@ class CodeFragmentCollector: # @param self The object pointer # @retval True Successfully go back one char # @retval False Not able to go back one char as file beginning= reached - # =20 + # def __UndoOneChar(self): - =20 + if self.CurrentLineNumber =3D=3D 1 and self.CurrentOffsetWithinLin= e =3D=3D 0: return False elif self.CurrentOffsetWithinLine =3D=3D 0: @@ -139,13 +139,13 @@ class CodeFragmentCollector: else: self.CurrentOffsetWithinLine -=3D 1 return True - =20 + ## __GetOneChar() method # # Move forward one char in the file buffer # # @param self The object pointer - # =20 + # def __GetOneChar(self): if self.CurrentOffsetWithinLine =3D=3D len(self.Profile.FileLinesL= ist[self.CurrentLineNumber - 1]) - 1: self.CurrentLineNumber +=3D 1 @@ -159,13 +159,13 @@ class CodeFragmentCollector: # # @param self The object pointer # @retval Char Current char - # =20 + # def __CurrentChar(self): CurrentChar =3D self.Profile.FileLinesList[self.CurrentLineNumber = - 1][self.CurrentOffsetWithinLine] # if CurrentChar > 255: # raise Warning("Non-Ascii char found At Line %d, offset %d" % = (self.CurrentLineNumber, self.CurrentOffsetWithinLine), self.FileName, self= .CurrentLineNumber) return CurrentChar - =20 + ## __NextChar() method # # Get the one char pass the char pointed to by the file buffer point= er @@ -178,7 +178,7 @@ class CodeFragmentCollector: return self.Profile.FileLinesList[self.CurrentLineNumber][0] else: return self.Profile.FileLinesList[self.CurrentLineNumber - 1][= self.CurrentOffsetWithinLine + 1] - =20 + ## __SetCurrentCharValue() method # # Modify the value of current char @@ -188,7 +188,7 @@ class CodeFragmentCollector: # def __SetCurrentCharValue(self, Value): self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.Curren= tOffsetWithinLine] =3D Value - =20 + ## __SetCharValue() method # # Modify the value of current char @@ -198,7 +198,7 @@ class CodeFragmentCollector: # def __SetCharValue(self, Line, Offset, Value): self.Profile.FileLinesList[Line - 1][Offset] =3D Value - =20 + ## __CurrentLine() method # # Get the list that contains current line contents @@ -208,7 +208,7 @@ class CodeFragmentCollector: # def __CurrentLine(self): return self.Profile.FileLinesList[self.CurrentLineNumber - 1] - =20 + ## __InsertComma() method # # Insert ',' to replace PP @@ -217,24 +217,24 @@ class CodeFragmentCollector: # @retval List current line contents # def __InsertComma(self, Line): - =20 - =20 + + if self.Profile.FileLinesList[Line - 1][0] !=3D T_CHAR_HASH: BeforeHashPart =3D str(self.Profile.FileLinesList[Line - 1]).s= plit(T_CHAR_HASH)[0] if BeforeHashPart.rstrip().endswith(T_CHAR_COMMA) or BeforeHas= hPart.rstrip().endswith(';'): return - =20 + if Line - 2 >=3D 0 and str(self.Profile.FileLinesList[Line - 2]).r= strip().endswith(','): return - =20 + if Line - 2 >=3D 0 and str(self.Profile.FileLinesList[Line - 2]).r= strip().endswith(';'): return - =20 + if str(self.Profile.FileLinesList[Line]).lstrip().startswith(',') = or str(self.Profile.FileLinesList[Line]).lstrip().startswith(';'): return - =20 + self.Profile.FileLinesList[Line - 1].insert(self.CurrentOffsetWith= inLine, ',') - =20 + ## PreprocessFile() method # # Preprocess file contents, replace comments with spaces. @@ -243,7 +243,7 @@ class CodeFragmentCollector: # !include statement should be expanded at the same FileLinesList[Cu= rrentLineNumber - 1] # # @param self The object pointer - # =20 + # def PreprocessFile(self): =20 self.Rewind() @@ -255,14 +255,14 @@ class CodeFragmentCollector: PPDirectiveObj =3D None # HashComment in quoted string " " is ignored. InString =3D False - InCharLiteral =3D False=20 - =20 + InCharLiteral =3D False + self.Profile.FileLinesList =3D [list(s) for s in self.Profile.File= LinesListFromFile] while not self.__EndOfFile(): - =20 + if not InComment and self.__CurrentChar() =3D=3D T_CHAR_DOUBLE= _QUOTE: InString =3D not InString - =20 + if not InComment and self.__CurrentChar() =3D=3D T_CHAR_SINGLE= _QUOTE: InCharLiteral =3D not InCharLiteral # meet new line, then no longer in a comment for // and '#' @@ -273,9 +273,9 @@ class CodeFragmentCollector: PPExtend =3D True else: PPExtend =3D False - =20 + EndLinePos =3D (self.CurrentLineNumber, self.CurrentOffset= WithinLine) - =20 + if InComment and DoubleSlashComment: InComment =3D False DoubleSlashComment =3D False @@ -290,17 +290,17 @@ class CodeFragmentCollector: PPDirectiveObj.EndPos =3D EndLinePos FileProfile.PPDirectiveList.append(PPDirectiveObj) PPDirectiveObj =3D None - =20 + if InString or InCharLiteral: CurrentLine =3D "".join(self.__CurrentLine()) if CurrentLine.rstrip(T_CHAR_LF).rstrip(T_CHAR_CR).end= swith(T_CHAR_BACKSLASH): SlashIndex =3D CurrentLine.rindex(T_CHAR_BACKSLASH) self.__SetCharValue(self.CurrentLineNumber, SlashI= ndex, T_CHAR_SPACE) - =20 + if InComment and not DoubleSlashComment and not HashCommen= t: CommentObj.Content +=3D T_CHAR_LF self.CurrentLineNumber +=3D 1 - self.CurrentOffsetWithinLine =3D 0 =20 + self.CurrentOffsetWithinLine =3D 0 # check for */ comment end elif InComment and not DoubleSlashComment and not HashComment = and self.__CurrentChar() =3D=3D T_CHAR_STAR and self.__NextChar() =3D=3D T_= CHAR_SLASH: CommentObj.Content +=3D self.__CurrentChar() @@ -314,7 +314,7 @@ class CodeFragmentCollector: self.__GetOneChar() InComment =3D False # set comments to spaces - elif InComment: =20 + elif InComment: if HashComment: # // follows hash PP directive if self.__CurrentChar() =3D=3D T_CHAR_SLASH and self._= _NextChar() =3D=3D T_CHAR_SLASH: @@ -340,7 +340,7 @@ class CodeFragmentCollector: # check for '#' comment elif self.__CurrentChar() =3D=3D T_CHAR_HASH and not InString = and not InCharLiteral: InComment =3D True - HashComment =3D True=20 + HashComment =3D True PPDirectiveObj =3D PP_Directive('', (self.CurrentLineNumbe= r, self.CurrentOffsetWithinLine), None) # check for /* comment start elif self.__CurrentChar() =3D=3D T_CHAR_SLASH and self.__NextC= har() =3D=3D T_CHAR_STAR: @@ -354,9 +354,9 @@ class CodeFragmentCollector: InComment =3D True else: self.__GetOneChar() - =20 + EndLinePos =3D (self.CurrentLineNumber, self.CurrentOffsetWithinLi= ne) - =20 + if InComment and DoubleSlashComment: CommentObj.EndPos =3D EndLinePos FileProfile.CommentList.append(CommentObj) @@ -377,14 +377,14 @@ class CodeFragmentCollector: PPDirectiveObj =3D None # HashComment in quoted string " " is ignored. InString =3D False - InCharLiteral =3D False=20 + InCharLiteral =3D False =20 self.Profile.FileLinesList =3D [list(s) for s in self.Profile.File= LinesListFromFile] while not self.__EndOfFile(): - =20 + if not InComment and self.__CurrentChar() =3D=3D T_CHAR_DOUBLE= _QUOTE: InString =3D not InString - =20 + if not InComment and self.__CurrentChar() =3D=3D T_CHAR_SINGLE= _QUOTE: InCharLiteral =3D not InCharLiteral # meet new line, then no longer in a comment for // and '#' @@ -395,9 +395,9 @@ class CodeFragmentCollector: PPExtend =3D True else: PPExtend =3D False - =20 + EndLinePos =3D (self.CurrentLineNumber, self.CurrentOffset= WithinLine) - =20 + if InComment and DoubleSlashComment: InComment =3D False DoubleSlashComment =3D False @@ -412,17 +412,17 @@ class CodeFragmentCollector: PPDirectiveObj.EndPos =3D EndLinePos FileProfile.PPDirectiveList.append(PPDirectiveObj) PPDirectiveObj =3D None - =20 + if InString or InCharLiteral: CurrentLine =3D "".join(self.__CurrentLine()) if CurrentLine.rstrip(T_CHAR_LF).rstrip(T_CHAR_CR).end= swith(T_CHAR_BACKSLASH): SlashIndex =3D CurrentLine.rindex(T_CHAR_BACKSLASH) self.__SetCharValue(self.CurrentLineNumber, SlashI= ndex, T_CHAR_SPACE) - =20 + if InComment and not DoubleSlashComment and not HashCommen= t: CommentObj.Content +=3D T_CHAR_LF self.CurrentLineNumber +=3D 1 - self.CurrentOffsetWithinLine =3D 0 =20 + self.CurrentOffsetWithinLine =3D 0 # check for */ comment end elif InComment and not DoubleSlashComment and not HashComment = and self.__CurrentChar() =3D=3D T_CHAR_STAR and self.__NextChar() =3D=3D T_= CHAR_SLASH: CommentObj.Content +=3D self.__CurrentChar() @@ -436,7 +436,7 @@ class CodeFragmentCollector: self.__GetOneChar() InComment =3D False # set comments to spaces - elif InComment: =20 + elif InComment: if HashComment: # // follows hash PP directive if self.__CurrentChar() =3D=3D T_CHAR_SLASH and self._= _NextChar() =3D=3D T_CHAR_SLASH: @@ -462,7 +462,7 @@ class CodeFragmentCollector: # check for '#' comment elif self.__CurrentChar() =3D=3D T_CHAR_HASH and not InString = and not InCharLiteral: InComment =3D True - HashComment =3D True=20 + HashComment =3D True PPDirectiveObj =3D PP_Directive('', (self.CurrentLineNumbe= r, self.CurrentOffsetWithinLine), None) # check for /* comment start elif self.__CurrentChar() =3D=3D T_CHAR_SLASH and self.__NextC= har() =3D=3D T_CHAR_STAR: @@ -478,7 +478,7 @@ class CodeFragmentCollector: self.__GetOneChar() =20 EndLinePos =3D (self.CurrentLineNumber, self.CurrentOffsetWithinLi= ne) - =20 + if InComment and DoubleSlashComment: CommentObj.EndPos =3D EndLinePos FileProfile.CommentList.append(CommentObj) @@ -506,7 +506,7 @@ class CodeFragmentCollector: tStream =3D antlr3.CommonTokenStream(lexer) parser =3D CParser(tStream) parser.translation_unit() - =20 + def ParseFileWithClearedPPDirective(self): self.PreprocessFileWithClear() # restore from ListOfList to ListOfString @@ -519,7 +519,7 @@ class CodeFragmentCollector: tStream =3D antlr3.CommonTokenStream(lexer) parser =3D CParser(tStream) parser.translation_unit() - =20 + def CleanFileProfileBuffer(self): FileProfile.CommentList =3D [] FileProfile.PPDirectiveList =3D [] @@ -530,61 +530,61 @@ class CodeFragmentCollector: FileProfile.StructUnionDefinitionList =3D [] FileProfile.TypedefDefinitionList =3D [] FileProfile.FunctionCallingList =3D [] - =20 + def PrintFragments(self): - =20 + print '################# ' + self.FileName + '####################= #' - =20 + print '/****************************************/' print '/*************** COMMENTS ***************/' print '/****************************************/' for comment in FileProfile.CommentList: print str(comment.StartPos) + comment.Content - =20 + print '/****************************************/' print '/********* PREPROCESS DIRECTIVES ********/' print '/****************************************/' for pp in FileProfile.PPDirectiveList: print str(pp.StartPos) + pp.Content - =20 + print '/****************************************/' print '/********* VARIABLE DECLARATIONS ********/' print '/****************************************/' for var in FileProfile.VariableDeclarationList: print str(var.StartPos) + var.Modifier + ' '+ var.Declarator - =20 + print '/****************************************/' print '/********* FUNCTION DEFINITIONS *********/' print '/****************************************/' for func in FileProfile.FunctionDefinitionList: print str(func.StartPos) + func.Modifier + ' '+ func.Declarato= r + ' ' + str(func.NamePos) - =20 + print '/****************************************/' print '/************ ENUMERATIONS **************/' print '/****************************************/' for enum in FileProfile.EnumerationDefinitionList: print str(enum.StartPos) + enum.Content - =20 + print '/****************************************/' print '/*********** STRUCTS/UNIONS *************/' print '/****************************************/' for su in FileProfile.StructUnionDefinitionList: print str(su.StartPos) + su.Content - =20 + print '/****************************************/' print '/********* PREDICATE EXPRESSIONS ********/' print '/****************************************/' for predexp in FileProfile.PredicateExpressionList: print str(predexp.StartPos) + predexp.Content - =20 - print '/****************************************/' =20 + + print '/****************************************/' print '/************** TYPEDEFS ****************/' print '/****************************************/' for typedef in FileProfile.TypedefDefinitionList: print str(typedef.StartPos) + typedef.ToType - =20 + if __name__ =3D=3D "__main__": - =20 + collector =3D CodeFragmentCollector(sys.argv[1]) collector.PreprocessFile() print "For Test." diff --git a/BaseTools/Source/Python/Ecc/Configuration.py b/BaseTools/Sourc= e/Python/Ecc/Configuration.py index b523858e1b1f..818c4c641c74 100644 --- a/BaseTools/Source/Python/Ecc/Configuration.py +++ b/BaseTools/Source/Python/Ecc/Configuration.py @@ -111,7 +111,7 @@ class Configuration(object): self.HeaderCheckCFileCommentReferenceFormat =3D 1 # Check whether C File header Comment have the License immediately= after the ""Copyright"" line self.HeaderCheckCFileCommentLicenseFormat =3D 1 - =20 + ## C Function Layout Checking self.CFunctionLayoutCheckAll =3D 0 =20 @@ -248,7 +248,7 @@ class Configuration(object): self.MetaDataFileCheckModuleFilePpiFormat =3D 1 # Check Pcd Format in INF files self.MetaDataFileCheckModuleFilePcdFormat =3D 1 - =20 + # Check UNI file self.UniCheckAll =3D 0 # Check INF or DEC file whether defined the localized information = in the associated UNI file. @@ -270,16 +270,16 @@ class Configuration(object): =20 # The directory listed here will not be parsed, split with ',' self.SkipDirList =3D [] - =20 + # The file listed here will not be parsed, split with ',' self.SkipFileList =3D [] =20 # A list for binary file ext name self.BinaryExtList =3D [] - =20 + # A list for only scanned folders self.ScanOnlyDirList =3D [] - =20 + # A list for Copyright format self.Copyright =3D [] =20 diff --git a/BaseTools/Source/Python/Ecc/Ecc.py b/BaseTools/Source/Python/E= cc/Ecc.py index 60dfc00260f1..7760ae1359d5 100644 --- a/BaseTools/Source/Python/Ecc/Ecc.py +++ b/BaseTools/Source/Python/Ecc/Ecc.py @@ -66,17 +66,17 @@ class Ecc(object): # Parse the options and args self.ParseOption() EdkLogger.info(time.strftime("%H:%M:%S, %b.%d %Y ", time.localtime= ()) + "[00:00]" + "\n") - =20 + # # Check EFI_SOURCE (Edk build convention). EDK_SOURCE will always = point to ECP # WorkspaceDir =3D os.path.normcase(os.path.normpath(os.environ["WOR= KSPACE"])) os.environ["WORKSPACE"] =3D WorkspaceDir - =20 + # set multiple workspace PackagesPath =3D os.getenv("PACKAGES_PATH") mws.setWs(WorkspaceDir, PackagesPath) - =20 + if "ECP_SOURCE" not in os.environ: os.environ["ECP_SOURCE"] =3D mws.join(WorkspaceDir, GlobalData= .gEdkCompatibilityPkg) if "EFI_SOURCE" not in os.environ: @@ -90,11 +90,11 @@ class Ecc(object): EfiSourceDir =3D os.path.normcase(os.path.normpath(os.environ["EFI= _SOURCE"])) EdkSourceDir =3D os.path.normcase(os.path.normpath(os.environ["EDK= _SOURCE"])) EcpSourceDir =3D os.path.normcase(os.path.normpath(os.environ["ECP= _SOURCE"])) - =20 + os.environ["EFI_SOURCE"] =3D EfiSourceDir os.environ["EDK_SOURCE"] =3D EdkSourceDir os.environ["ECP_SOURCE"] =3D EcpSourceDir - =20 + GlobalData.gWorkspace =3D WorkspaceDir GlobalData.gEfiSource =3D EfiSourceDir GlobalData.gEdkSource =3D EdkSourceDir @@ -104,7 +104,7 @@ class Ecc(object): GlobalData.gGlobalDefines["EFI_SOURCE"] =3D EfiSourceDir GlobalData.gGlobalDefines["EDK_SOURCE"] =3D EdkSourceDir GlobalData.gGlobalDefines["ECP_SOURCE"] =3D EcpSourceDir - =20 + EdkLogger.info("Loading ECC configuration ... done") # Generate checkpoints list EccGlobalData.gConfig =3D Configuration(self.ConfigFile) @@ -120,11 +120,11 @@ class Ecc(object): # Get files real name in workspace dir # GlobalData.gAllFiles =3D DirCache(GlobalData.gWorkspace) - =20 + # Build ECC database # self.BuildDatabase() self.DetectOnlyScanDirs() - =20 + # Start to check self.Check() =20 @@ -160,8 +160,8 @@ class Ecc(object): EdkLogger.error("ECC", BuildToolError.OPTION_VALUE_INVALID= , ExtraData=3D"Use -f option need to fill specific folders in config.ini fi= le") else: self.BuildDatabase() - =20 - =20 + + ## BuildDatabase # # Build the database for target @@ -172,7 +172,7 @@ class Ecc(object): EccGlobalData.gDb.TblReport.Create() =20 # Build database - if self.IsInit: =20 + if self.IsInit: if self.ScanMetaData: EdkLogger.quiet("Building database for Meta Data File ...") self.BuildMetaDataFileDatabase(SpeciDirs) @@ -198,7 +198,7 @@ class Ecc(object): if SpecificDirs is None: ScanFolders.append(EccGlobalData.gTarget) else: - for specificDir in SpecificDirs: =20 + for specificDir in SpecificDirs: ScanFolders.append(os.path.join(EccGlobalData.gTarget, spe= cificDir)) EdkLogger.quiet("Building database for meta data files ...") Op =3D open(EccGlobalData.gConfig.MetaDataFileCheckPathOfGenerateF= ileList, 'w+') @@ -219,7 +219,7 @@ class Ecc(object): # symlinks to directories are treated as direc= tories Dirs.remove(Dir) Dirs.append(Dirname) - =20 + for File in Files: if len(File) > 4 and File[-4:].upper() =3D=3D ".DEC": Filename =3D os.path.normpath(os.path.join(Root, F= ile)) diff --git a/BaseTools/Source/Python/Ecc/Exception.py b/BaseTools/Source/Py= thon/Ecc/Exception.py index b0882afa6289..ef96264ab203 100644 --- a/BaseTools/Source/Python/Ecc/Exception.py +++ b/BaseTools/Source/Python/Ecc/Exception.py @@ -23,12 +23,12 @@ class ExceptionXml(object): self.KeyWord =3D '' self.ErrorID =3D '' self.FilePath =3D '' - =20 + def FromXml(self, Item, Key): self.KeyWord =3D XmlElement(Item, '%s/KeyWord' % Key) self.ErrorID =3D XmlElement(Item, '%s/ErrorID' % Key) self.FilePath =3D os.path.normpath(XmlElement(Item, '%s/FilePath' = % Key)) - =20 + def __str__(self): return 'ErrorID =3D %s KeyWord =3D %s FilePath =3D %s' %(self.Erro= rID, self.KeyWord, self.FilePath) =20 @@ -36,22 +36,22 @@ class ExceptionXml(object): class ExceptionListXml(object): def __init__(self): self.List =3D [] - =20 + def FromXmlFile(self, FilePath): XmlContent =3D XmlParseFile(FilePath) for Item in XmlList(XmlContent, '/ExceptionList/Exception'): Exp =3D ExceptionXml() Exp.FromXml(Item, 'Exception') self.List.append(Exp) - =20 + def ToList(self): RtnList =3D [] for Item in self.List: #RtnList.append((Item.ErrorID, Item.KeyWord, Item.FilePath)) RtnList.append((Item.ErrorID, Item.KeyWord)) - =20 + return RtnList - =20 + def __str__(self): RtnStr =3D '' if self.List: @@ -70,7 +70,7 @@ class ExceptionCheck(object): if FilePath and os.path.isfile(FilePath): self.ExceptionListXml.FromXmlFile(FilePath) self.ExceptionList =3D self.ExceptionListXml.ToList() - =20 + def IsException(self, ErrorID, KeyWord, FileID=3D-1): if (str(ErrorID), KeyWord.replace('\r\n', '\n')) in self.Exception= List: return True diff --git a/BaseTools/Source/Python/Ecc/FileProfile.py b/BaseTools/Source/= Python/Ecc/FileProfile.py index f31d37ff9683..4220a75a219e 100644 --- a/BaseTools/Source/Python/Ecc/FileProfile.py +++ b/BaseTools/Source/Python/Ecc/FileProfile.py @@ -36,7 +36,7 @@ FunctionCallingList =3D [] # May raise Exception when opening file. # class FileProfile : - =20 + ## The constructor # # @param self The object pointer @@ -54,5 +54,4 @@ class FileProfile : =20 except IOError: raise Warning("Error when opening file %s" % FileName) - =20 - =20 \ No newline at end of file + diff --git a/BaseTools/Source/Python/Ecc/MetaDataParser.py b/BaseTools/Sour= ce/Python/Ecc/MetaDataParser.py index 82ede3eb330c..b6d88c7b15a0 100644 --- a/BaseTools/Source/Python/Ecc/MetaDataParser.py +++ b/BaseTools/Source/Python/Ecc/MetaDataParser.py @@ -87,16 +87,16 @@ def GetTableList(FileModelList, Table, Db): # @param FileName: FileName of the comment # def ParseHeaderCommentSection(CommentList, FileName =3D None): - =20 + Abstract =3D '' Description =3D '' Copyright =3D '' License =3D '' EndOfLine =3D "\n" STR_HEADER_COMMENT_START =3D "@file" - =20 + # - # used to indicate the state of processing header comment section of d= ec,=20 + # used to indicate the state of processing header comment section of d= ec, # inf files # HEADER_COMMENT_NOT_STARTED =3D -1 @@ -117,11 +117,11 @@ def ParseHeaderCommentSection(CommentList, FileName = =3D None): if _IsCopyrightLine(Line): Last =3D Index break - =20 + for Item in CommentList: Line =3D Item[0] LineNo =3D Item[1] - =20 + if not Line.startswith('#') and Line: SqlStatement =3D """ select ID from File where FullPath like '= %s'""" % FileName ResultSet =3D EccGlobalData.gDb.TblFile.Exec(SqlStatement) @@ -131,14 +131,14 @@ def ParseHeaderCommentSection(CommentList, FileName = =3D None): Comment =3D CleanString2(Line)[1] Comment =3D Comment.strip() # - # if there are blank lines between License or Description, keep th= em as they would be=20 + # if there are blank lines between License or Description, keep th= em as they would be # indication of different block; or in the position that Abstract = should be, also keep it # as it indicates that no abstract # if not Comment and HeaderCommentStage not in [HEADER_COMMENT_LICEN= SE, \ HEADER_COMMENT_DESCR= IPTION, HEADER_COMMENT_ABSTRACT]: continue - =20 + if HeaderCommentStage =3D=3D HEADER_COMMENT_NOT_STARTED: if Comment.startswith(STR_HEADER_COMMENT_START): HeaderCommentStage =3D HEADER_COMMENT_ABSTRACT @@ -152,39 +152,39 @@ def ParseHeaderCommentSection(CommentList, FileName = =3D None): if not Comment: Abstract =3D '' HeaderCommentStage =3D HEADER_COMMENT_DESCRIPTION - elif _IsCopyrightLine(Comment): =20 + elif _IsCopyrightLine(Comment): Copyright +=3D Comment + EndOfLine HeaderCommentStage =3D HEADER_COMMENT_COPYRIGHT - else: =20 + else: Abstract +=3D Comment + EndOfLine HeaderCommentStage =3D HEADER_COMMENT_DESCRIPTION elif HeaderCommentStage =3D=3D HEADER_COMMENT_DESCRIPTION: # # in case there is no description - # =20 - if _IsCopyrightLine(Comment): =20 + # + if _IsCopyrightLine(Comment): Copyright +=3D Comment + EndOfLine HeaderCommentStage =3D HEADER_COMMENT_COPYRIGHT else: - Description +=3D Comment + EndOfLine =20 + Description +=3D Comment + EndOfLine elif HeaderCommentStage =3D=3D HEADER_COMMENT_COPYRIGHT: - if _IsCopyrightLine(Comment): =20 + if _IsCopyrightLine(Comment): Copyright +=3D Comment + EndOfLine else: # # Contents after copyright line are license, those non= -copyright lines in between - # copyright line will be discarded=20 + # copyright line will be discarded # if LineNo > Last: if License: License +=3D EndOfLine License +=3D Comment + EndOfLine - HeaderCommentStage =3D HEADER_COMMENT_LICENSE = =20 + HeaderCommentStage =3D HEADER_COMMENT_LICENSE else: if not Comment and not License: continue License +=3D Comment + EndOfLine - =20 + if not Copyright.strip(): SqlStatement =3D """ select ID from File where FullPath like '%s'"= "" % FileName ResultSet =3D EccGlobalData.gDb.TblFile.Exec(SqlStatement) @@ -198,19 +198,19 @@ def ParseHeaderCommentSection(CommentList, FileName = =3D None): for Result in ResultSet: Msg =3D 'Header comment section must have license information' EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HE= ADER, Msg, "File", Result[0]) - =20 + if not Abstract.strip() or Abstract.find('Component description file')= > -1: SqlStatement =3D """ select ID from File where FullPath like '%s'"= "" % FileName ResultSet =3D EccGlobalData.gDb.TblFile.Exec(SqlStatement) for Result in ResultSet: Msg =3D 'Header comment section must have Abstract information= .' EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HE= ADER, Msg, "File", Result[0]) - =20 + return Abstract.strip(), Description.strip(), Copyright.strip(), Licen= se.strip() =20 ## _IsCopyrightLine -# check whether current line is copyright line, the criteria is whether th= ere is case insensitive keyword "Copyright"=20 -# followed by zero or more white space characters followed by a "(" charac= ter=20 +# check whether current line is copyright line, the criteria is whether th= ere is case insensitive keyword "Copyright" +# followed by zero or more white space characters followed by a "(" charac= ter # # @param LineContent: the line need to be checked # @return: True if current line is copyright line, False else @@ -218,11 +218,11 @@ def ParseHeaderCommentSection(CommentList, FileName = =3D None): def _IsCopyrightLine (LineContent): LineContent =3D LineContent.upper() Result =3D False - =20 + ReIsCopyrightRe =3D re.compile(r"""(^|\s)COPYRIGHT *\(""", re.DOTALL) if ReIsCopyrightRe.search(LineContent): Result =3D True - =20 + return Result =20 =20 @@ -232,7 +232,7 @@ def _IsCopyrightLine (LineContent): # Remove spaces # # @param Line: The string to be cleaned -# @param CommentCharacter: Comment char, used to ignore comment content,=20 +# @param CommentCharacter: Comment char, used to ignore comment content, # default is DataType.TAB_COMMENT_SPLIT # def CleanString2(Line, CommentCharacter=3D'#', AllowCppStyleComment=3DFals= e): diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.p= y b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py index 4d61cd1cea91..659997045bc0 100644 --- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py @@ -92,7 +92,7 @@ def ParseMacro(Parser): elif (Name in self._FileLocalMacros) and (self._FileLocalMacros[Na= me] !=3D Value): EdkLogger.error('Parser', FORMAT_INVALID, "EDK_GLOBAL defined = a macro with the same name and different value as one defined by 'DEFINE'", ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile, Line=3Dself._LineIndex+1) - =20 + self._ValueList =3D [Type, Name, Value] =20 return MacroParser @@ -334,7 +334,7 @@ class MetaFileParser(object): =20 self._ValueList =3D [ReplaceMacro(Value, self._Macros) for Value i= n self._ValueList] Name, Value =3D self._ValueList[1], self._ValueList[2] - # Sometimes, we need to make differences between EDK and EDK2 modu= les=20 + # Sometimes, we need to make differences between EDK and EDK2 modu= les if Name =3D=3D 'INF_VERSION': try: self._Version =3D int(Value, 0) @@ -354,7 +354,7 @@ class MetaFileParser(object): UniFile =3D os.path.join(os.path.dirname(self.MetaFile), Value) if os.path.exists(UniFile): self._UniObj =3D UniParser(UniFile, IsExtraUni=3DFalse, Is= ModuleUni=3DFalse) - =20 + if type(self) =3D=3D InfParser and self._Version < 0x00010005: # EDK module allows using defines as macros self._FileLocalMacros[Name] =3D Value @@ -390,7 +390,7 @@ class MetaFileParser(object): return Macros =20 =20 - ## Get section Macros that are applicable to current line, which may c= ome from other sections=20 + ## Get section Macros that are applicable to current line, which may c= ome from other sections ## that share the same name while scope is wider def _GetApplicableSectionMacro(self): Macros =3D {} @@ -473,7 +473,7 @@ class InfParser(MetaFileParser): self.FileID =3D FileID else: self.FileID =3D self.TblFile.InsertFile(Filename, MODEL_FILE_I= NF) - =20 + # parse the file line by line IsFindBlockComment =3D False =20 @@ -591,7 +591,7 @@ class InfParser(MetaFileParser): ) Usage =3D '' if IsFindBlockComment: - EdkLogger.error("Parser", FORMAT_INVALID, "Open block comments= (starting with /*) are expected to end with */",=20 + EdkLogger.error("Parser", FORMAT_INVALID, "Open block comments= (starting with /*) are expected to end with */", File=3Dself.MetaFile) self._Done() =20 @@ -818,7 +818,7 @@ class DscParser(MetaFileParser): # the owner item # self._IdMapping =3D {-1:-1} - =20 + self.TblFile =3D EccGlobalData.gDb.TblFile self.FileID =3D -1 =20 @@ -838,8 +838,8 @@ class DscParser(MetaFileParser): self.FileID =3D FileID else: self.FileID =3D self.TblFile.InsertFile(Filename, MODEL_FILE_D= SC) - =20 - =20 + + for Index in range(0, len(Content)): Line =3D CleanString(Content[Index]) # skip empty line @@ -850,7 +850,7 @@ class DscParser(MetaFileParser): self._LineIndex =3D Index if self._InSubsection and self._Owner[-1] =3D=3D -1: self._Owner.append(self._LastItem) - =20 + # section header if Line[0] =3D=3D TAB_SECTION_START and Line[-1] =3D=3D TAB_SE= CTION_END: self._SectionType =3D MODEL_META_DATA_SECTION_HEADER @@ -960,7 +960,7 @@ class DscParser(MetaFileParser): elif self._From > 0: EdkLogger.error('Parser', FORMAT_INVALID, "No '!include' allowed in included file", - ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile,=20 + ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile, Line=3Dself._LineIndex+1) =20 # @@ -1154,7 +1154,7 @@ class DscParser(MetaFileParser): MODEL_META_DATA_USER_EXTENSION : self._Skip, MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR : self._Skip, } - =20 + self._RawTable =3D self._Table self._Table =3D MetaFileStorage(self._RawTable.Cur, self.MetaFile,= MODEL_FILE_DSC, True) self._DirectiveStack =3D [] @@ -1184,7 +1184,7 @@ class DscParser(MetaFileParser): try: Processer[self._ItemType]() except EvaluationException, Excpt: - #=20 + # # Only catch expression evaluation error here. We need to = report # the precise number of line on which the error occurred # @@ -1194,11 +1194,11 @@ class DscParser(MetaFileParser): # Line=3Dself._LineIndex+1) except MacroException, Excpt: EdkLogger.error('Parser', FORMAT_INVALID, str(Excpt), - File=3Dself._FileWithError, ExtraData=3D' = '.join(self._ValueList),=20 + File=3Dself._FileWithError, ExtraData=3D' = '.join(self._ValueList), Line=3Dself._LineIndex+1) =20 if self._ValueList is None: - continue=20 + continue =20 NewOwner =3D self._IdMapping.get(Owner, -1) self._Enabled =3D int((not self._DirectiveEvalStack) or (False= not in self._DirectiveEvalStack)) @@ -1221,7 +1221,7 @@ class DscParser(MetaFileParser): self._IdMapping[Id] =3D self._LastItem =20 RecordList =3D self._Table.GetAll() - =20 + self._RawTable.Drop() self._Table.Drop() for Record in RecordList: @@ -1255,7 +1255,7 @@ class DscParser(MetaFileParser): # Don't use PCD with different values. if Name in self._Symbols and self._Symbols[Name] !=3D Value: self._Symbols.pop(Name) - continue=20 + continue self._Symbols[Name] =3D Value =20 Records =3D self._RawTable.Query(MODEL_PCD_FIXED_AT_BUILD, Belongs= ToItem=3D-1.0) @@ -1263,12 +1263,12 @@ class DscParser(MetaFileParser): Value, DatumType, MaxDatumSize =3D AnalyzePcdData(Value) # Only use PCD whose value is straitforward (no macro and PCD) if self.SymbolPattern.findall(Value): - continue=20 + continue Name =3D TokenSpaceGuid+'.'+PcdName # Don't use PCD with different values. if Name in self._Symbols and self._Symbols[Name] !=3D Value: self._Symbols.pop(Name) - continue=20 + continue self._Symbols[Name] =3D Value =20 def __ProcessDefine(self): @@ -1288,13 +1288,13 @@ class DscParser(MetaFileParser): SectionLocalMacros[Name] =3D Value elif self._ItemType =3D=3D MODEL_META_DATA_GLOBAL_DEFINE: GlobalData.gEdkGlobal[Name] =3D Value - =20 + # # Keyword in [Defines] section can be used as Macros # if (self._ItemType =3D=3D MODEL_META_DATA_HEADER) and (self._Secti= onType =3D=3D MODEL_META_DATA_HEADER): self._FileLocalMacros[Name] =3D Value - =20 + self._ValueList =3D [Type, Name, Value] =20 def __ProcessDirective(self): @@ -1309,12 +1309,12 @@ class DscParser(MetaFileParser): EdkLogger.debug(EdkLogger.DEBUG_5, str(Exc), self._ValueLi= st[1]) Result =3D False except WrnExpression, Excpt: - #=20 + # # Catch expression evaluation warning here. We need to rep= ort # the precise number of line and return the evaluation res= ult # EdkLogger.warn('Parser', "Suspicious expression: %s" % str= (Excpt), - File=3Dself._FileWithError, ExtraData=3D' = '.join(self._ValueList),=20 + File=3Dself._FileWithError, ExtraData=3D' = '.join(self._ValueList), Line=3Dself._LineIndex+1) Result =3D Excpt.result except BadExpression, Exc: @@ -1365,14 +1365,14 @@ class DscParser(MetaFileParser): # elif "ECP_SOURCE" in GlobalData.gCommandLineDefines.keys(): __IncludeMacros['ECP_SOURCE'] =3D GlobalData.gCommandLineD= efines['ECP_SOURCE'] - =20 + __IncludeMacros['EFI_SOURCE'] =3D GlobalData.gGlobalDefines['E= FI_SOURCE'] __IncludeMacros['EDK_SOURCE'] =3D GlobalData.gGlobalDefines['E= DK_SOURCE'] # - # Allow using MACROs comes from [Defines] section to keep comp= atible.=20 + # Allow using MACROs comes from [Defines] section to keep comp= atible. # __IncludeMacros.update(self._Macros) - =20 + IncludedFile =3D NormPath(ReplaceMacro(self._ValueList[1], __I= ncludeMacros, RaiseError=3DTrue)) # # First search the include file under the same directory as DS= C file @@ -1386,14 +1386,14 @@ class DscParser(MetaFileParser): IncludedFile1 =3D PathClass(IncludedFile, GlobalData.gWork= space) ErrorCode, ErrorInfo2 =3D IncludedFile1.Validate() if ErrorCode !=3D 0: - EdkLogger.error('parser', ErrorCode, File=3Dself._File= WithError,=20 + EdkLogger.error('parser', ErrorCode, File=3Dself._File= WithError, Line=3Dself._LineIndex+1, ExtraData=3D= ErrorInfo1 + "\n"+ ErrorInfo2) =20 self._FileWithError =3D IncludedFile1 =20 IncludedFileTable =3D MetaFileStorage(self._Table.Cur, Include= dFile1, MODEL_FILE_DSC, True) Owner =3D self._Content[self._ContentIndex-1][0] - Parser =3D DscParser(IncludedFile1, self._FileType, IncludedFi= leTable,=20 + Parser =3D DscParser(IncludedFile1, self._FileType, IncludedFi= leTable, Owner=3DOwner, From=3DOwner) =20 # set the parser status with current status @@ -1417,7 +1417,7 @@ class DscParser(MetaFileParser): self._Content.pop(self._ContentIndex-1) self._ValueList =3D None self._ContentIndex -=3D 1 - =20 + def __ProcessSkuId(self): self._ValueList =3D [ReplaceMacro(Value, self._Macros, RaiseError= =3DTrue) for Value in self._ValueList] @@ -1434,22 +1434,22 @@ class DscParser(MetaFileParser): # PCD value can be an expression # if len(ValueList) > 1 and ValueList[1] =3D=3D TAB_VOID: - PcdValue =3D ValueList[0] =20 + PcdValue =3D ValueList[0] try: ValueList[0] =3D ValueExpression(PcdValue, self._Macros)(T= rue) except WrnExpression, Value: - ValueList[0] =3D Value.result =20 + ValueList[0] =3D Value.result else: PcdValue =3D ValueList[-1] try: ValueList[-1] =3D ValueExpression(PcdValue, self._Macros)(= True) except WrnExpression, Value: ValueList[-1] =3D Value.result - =20 + if ValueList[-1] =3D=3D 'True': ValueList[-1] =3D '1' if ValueList[-1] =3D=3D 'False': - ValueList[-1] =3D '0' =20 + ValueList[-1] =3D '0' =20 self._ValueList[2] =3D '|'.join(ValueList) =20 @@ -1548,7 +1548,7 @@ class DecParser(MetaFileParser): self.FileID =3D FileID else: self.FileID =3D self.TblFile.InsertFile(Filename, MODEL_FILE_D= EC) - =20 + for Index in range(0, len(Content)): Line, Comment =3D CleanString2(Content[Index]) self._CurrentLine =3D Line @@ -1750,19 +1750,19 @@ class DecParser(MetaFileParser): " (.|= ||)", File=3Dself.MetaFile, Line=3Dself._LineIndex+1) =20 - =20 + ValueRe =3D re.compile(r'^\s*L?\".*\|.*\"') PtrValue =3D ValueRe.findall(TokenList[1]) - =20 - # Has VOID* type string, may contain "|" character in the string.=20 + + # Has VOID* type string, may contain "|" character in the string. if len(PtrValue) !=3D 0: ptrValueList =3D re.sub(ValueRe, '', TokenList[1]) ValueList =3D GetSplitValueList(ptrValueList) ValueList[0] =3D PtrValue[0] else: ValueList =3D GetSplitValueList(TokenList[1]) - =20 - =20 + + # check if there's enough datum information given if len(ValueList) !=3D 3: EdkLogger.error('Parser', FORMAT_INVALID, "Invalid PCD Datum i= nformation given", @@ -1792,7 +1792,7 @@ class DecParser(MetaFileParser): if not IsValid: EdkLogger.error('Parser', FORMAT_INVALID, Cause, ExtraData=3Ds= elf._CurrentLine, File=3Dself.MetaFile, Line=3Dself._LineIndex+1) - =20 + if EccGlobalData.gConfig.UniCheckPCDInfo =3D=3D '1' or EccGlobalDa= ta.gConfig.UniCheckAll =3D=3D '1' or EccGlobalData.gConfig.CheckAll =3D=3D = '1': # check Description, Prompt information PatternDesc =3D re.compile('##\s*([\x21-\x7E\s]*)', re.S) @@ -1903,7 +1903,7 @@ class DecParser(MetaFileParser): ## Fdf # # This class defined the structure used in Fdf object -#=20 +# # @param Filename: Input value for Ffilename of Fdf file, default is = None # @param WorkspaceDir: Input value for current workspace directory, defau= lt is None # @@ -1911,7 +1911,7 @@ class Fdf(object): def __init__(self, Filename =3D None, IsToDatabase =3D False, Workspac= eDir =3D None, Database =3D None): self.WorkspaceDir =3D WorkspaceDir self.IsToDatabase =3D IsToDatabase - =20 + self.Cur =3D Database.Cur self.TblFile =3D Database.TblFile self.TblFdf =3D Database.TblFdf @@ -1938,15 +1938,15 @@ class Fdf(object): self.FileList[Filename] =3D FileID =20 return self.FileList[Filename] - =20 - =20 + + ## Load Fdf file # # Load the file if it exists # # @param Filename: Input value for filename of Fdf file # - def LoadFdfFile(self, Filename): =20 + def LoadFdfFile(self, Filename): FileList =3D [] # # Parse Fdf file @@ -1991,7 +1991,7 @@ class UniParser(object): self.FileIn =3D None self.Missing =3D [] self.__read() - =20 + def __read(self): try: self.FileIn =3D CodecOpenLongFilePath(self.FilePath, Mode=3D'r= b', Encoding=3D'utf_8').read() @@ -2001,7 +2001,7 @@ class UniParser(object): self.FileIn =3D CodecOpenLongFilePath(self.FilePath, Mode=3D'r= b', Encoding=3D'utf_16_le').read() except IOError: self.FileIn =3D "" - =20 + def Start(self): if self.IsModuleUni: if self.IsExtraUni: @@ -2021,7 +2021,7 @@ class UniParser(object): self.PrintLog('STR_PACKAGE_ABSTRACT', PackageAbstract) PackageDescription =3D self.CheckKeyValid('STR_PACKAGE_DES= CRIPTION') self.PrintLog('STR_PACKAGE_DESCRIPTION', PackageDescriptio= n) - =20 + def CheckKeyValid(self, Key, Contents=3DNone): if not Contents: Contents =3D self.FileIn @@ -2029,7 +2029,7 @@ class UniParser(object): if KeyPattern.search(Contents): return True return False - =20 + def CheckPcdInfo(self, PcdCName): PromptKey =3D 'STR_%s_PROMPT' % PcdCName.replace('.', '_') PcdPrompt =3D self.CheckKeyValid(PromptKey) @@ -2037,7 +2037,7 @@ class UniParser(object): HelpKey =3D 'STR_%s_HELP' % PcdCName.replace('.', '_') PcdHelp =3D self.CheckKeyValid(HelpKey) self.PrintLog(HelpKey, PcdHelp) - =20 + def PrintLog(self, Key, Value): if not Value and Key not in self.Missing: Msg =3D '%s is missing in the %s file.' % (Key, self.FileName) diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py= b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py index 9faa6b58b001..5376437e3d13 100644 --- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py +++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py @@ -25,7 +25,7 @@ from CommonDataClass.DataClass import MODEL_FILE_DSC, MOD= EL_FILE_DEC, MODEL_FILE MODEL_FILE_OTHERS =20 class MetaFileTable(Table): - ## Constructor=20 + ## Constructor def __init__(self, Cursor, MetaFile, FileType, TableName, Temporary = =3D False): self.MetaFile =3D MetaFile self.TblFile =3D EccGlobalData.gDb.TblFile @@ -88,30 +88,30 @@ class ModuleTable(MetaFileTable): BelongsToItem=3D-1, BelongsToFile =3D -1, StartLine=3D-1, S= tartColumn=3D-1, EndLine=3D-1, EndColumn=3D-1, Enabled=3D0, Usage=3D''): (Value1, Value2, Value3, Usage, Scope1, Scope2) =3D ConvertToSqlSt= ring((Value1, Value2, Value3, Usage, Scope1, Scope2)) return Table.Insert( - self,=20 - Model,=20 - Value1,=20 - Value2,=20 - Value3,=20 - Usage, =20 - Scope1,=20 + self, + Model, + Value1, + Value2, + Value3, + Usage, + Scope1, Scope2, BelongsToItem, - BelongsToFile,=20 - StartLine,=20 - StartColumn,=20 - EndLine,=20 - EndColumn,=20 + BelongsToFile, + StartLine, + StartColumn, + EndLine, + EndColumn, Enabled ) =20 ## Query table # - # @param Model: The Model of Record=20 - # @param Arch: The Arch attribute of Record=20 - # @param Platform The Platform attribute of Record=20 + # @param Model: The Model of Record + # @param Arch: The Arch attribute of Record + # @param Platform The Platform attribute of Record # - # @retval: A recordSet of all found records=20 + # @retval: A recordSet of all found records # def Query(self, Model, Arch=3DNone, Platform=3DNone): ConditionString =3D "Model=3D%s AND Enabled>=3D0" % Model @@ -171,28 +171,28 @@ class PackageTable(MetaFileTable): BelongsToItem=3D-1, BelongsToFile =3D -1, StartLine=3D-1, S= tartColumn=3D-1, EndLine=3D-1, EndColumn=3D-1, Enabled=3D0): (Value1, Value2, Value3, Scope1, Scope2) =3D ConvertToSqlString((V= alue1, Value2, Value3, Scope1, Scope2)) return Table.Insert( - self,=20 - Model,=20 - Value1,=20 - Value2,=20 - Value3,=20 - Scope1,=20 + self, + Model, + Value1, + Value2, + Value3, + Scope1, Scope2, BelongsToItem, - BelongsToFile,=20 - StartLine,=20 - StartColumn,=20 - EndLine,=20 - EndColumn,=20 + BelongsToFile, + StartLine, + StartColumn, + EndLine, + EndColumn, Enabled ) =20 ## Query table # - # @param Model: The Model of Record=20 - # @param Arch: The Arch attribute of Record=20 + # @param Model: The Model of Record + # @param Arch: The Arch attribute of Record # - # @retval: A recordSet of all found records=20 + # @retval: A recordSet of all found records # def Query(self, Model, Arch=3DNone): ConditionString =3D "Model=3D%s AND Enabled>=3D0" % Model @@ -252,32 +252,32 @@ class PlatformTable(MetaFileTable): FromItem=3D-1, StartLine=3D-1, StartColumn=3D-1, EndLine=3D= -1, EndColumn=3D-1, Enabled=3D1): (Value1, Value2, Value3, Scope1, Scope2) =3D ConvertToSqlString((V= alue1, Value2, Value3, Scope1, Scope2)) return Table.Insert( - self,=20 - Model,=20 - Value1,=20 - Value2,=20 - Value3,=20 - Scope1,=20 + self, + Model, + Value1, + Value2, + Value3, + Scope1, Scope2, - BelongsToItem,=20 + BelongsToItem, BelongsToFile, FromItem, - StartLine,=20 - StartColumn,=20 - EndLine,=20 - EndColumn,=20 + StartLine, + StartColumn, + EndLine, + EndColumn, Enabled ) =20 ## Query table # - # @param Model: The Model of Record=20 + # @param Model: The Model of Record # @param Scope1: Arch of a Dsc item # @param Scope2: Module type of a Dsc item # @param BelongsToItem: The item belongs to which another item # @param FromItem: The item belongs to which dsc file # - # @retval: A recordSet of all found records=20 + # @retval: A recordSet of all found records # def Query(self, Model, Scope1=3DNone, Scope2=3DNone, BelongsToItem=3DN= one, FromItem=3DNone): ConditionString =3D "Model=3D%s AND Enabled>0" % Model diff --git a/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py b/BaseTools/Sou= rce/Python/Ecc/Xml/XmlRoutines.py index a86f19624c44..51772e768a8c 100644 --- a/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py +++ b/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py @@ -32,7 +32,7 @@ def CreateXmlElement(Name, String, NodeList, AttributeLis= t): Element =3D Doc.createElement(Name) if String !=3D '' and String is not None: Element.appendChild(Doc.createTextNode(String)) - =20 + for Item in NodeList: if type(Item) =3D=3D type([]): Key =3D Item[0] @@ -48,7 +48,7 @@ def CreateXmlElement(Name, String, NodeList, AttributeLis= t): Value =3D Item[1] if Key !=3D '' and Key is not None and Value !=3D '' and Value is = not None: Element.setAttribute(Key, Value) - =20 + return Element =20 ## Get a list of XML nodes using XPath style syntax. diff --git a/BaseTools/Source/Python/Ecc/Xml/__init__.py b/BaseTools/Source= /Python/Ecc/Xml/__init__.py index f09eece5fb0e..4035345f225d 100644 --- a/BaseTools/Source/Python/Ecc/Xml/__init__.py +++ b/BaseTools/Source/Python/Ecc/Xml/__init__.py @@ -6,9 +6,9 @@ # # Copyright (c) 2011, Intel Corporation. All rights reserved.
# -# This program and the accompanying materials are licensed and made availa= ble=20 -# under the terms and conditions of the BSD License which accompanies this=20 -# distribution. The full text of the license may be found at=20 +# This program and the accompanying materials are licensed and made availa= ble +# 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, diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc= /c.py index 175e2d2e0439..d10d12a38724 100644 --- a/BaseTools/Source/Python/Ecc/c.py +++ b/BaseTools/Source/Python/Ecc/c.py @@ -2348,13 +2348,13 @@ def CheckFileHeaderDoxygenComments(FullFileName): if (len(CommentStrListTemp) <=3D 1): # For Mac CommentStrListTemp =3D CommentStr.split('\r') - # Skip the content before the file header =20 + # Skip the content before the file header for CommentLine in CommentStrListTemp: if CommentLine.strip().startswith('/** @file'): FileStartFlag =3D True if FileStartFlag =3D=3D True: CommentStrList.append(CommentLine) - =20 + ID =3D Result[1] Index =3D 0 if CommentStrList and CommentStrList[0].strip().startswith('/** @f= ile'): @@ -2377,7 +2377,7 @@ def CheckFileHeaderDoxygenComments(FullFileName): if EccGlobalData.gConfig.HeaderCheckCFileCommentStartSpacesNum= =3D=3D '1' or EccGlobalData.gConfig.HeaderCheckAll =3D=3D '1' or EccGlobal= Data.gConfig.CheckAll =3D=3D '1': if CommentLine.startswith('/** @file') =3D=3D False and Co= mmentLine.startswith('**/') =3D=3D False and CommentLine.strip() and Commen= tLine.startswith(' ') =3D=3D False: PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header co= mment content should start with two spaces at each line', FileTable, ID) - =20 + CommentLine =3D CommentLine.strip() if CommentLine.startswith('Copyright'): NoCopyrightFlag =3D False @@ -2402,9 +2402,9 @@ def CheckFileHeaderDoxygenComments(FullFileName): # Check whether C File header Comment's each reference= at list should begin with a bullet character. if EccGlobalData.gConfig.HeaderCheckCFileCommentRefere= nceFormat =3D=3D '1' or EccGlobalData.gConfig.HeaderCheckAll =3D=3D '1' or = EccGlobalData.gConfig.CheckAll =3D=3D '1': if RefListFlag =3D=3D True: - if RefLine.strip() and RefLine.strip().startsw= ith('**/') =3D=3D False and RefLine.startswith(' -') =3D=3D False: = =20 - PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'Ea= ch reference on a separate line should begin with a bullet character ""-"" = ', FileTable, ID) =20 - =20 + if RefLine.strip() and RefLine.strip().startsw= ith('**/') =3D=3D False and RefLine.startswith(' -') =3D=3D False: + PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'Ea= ch reference on a separate line should begin with a bullet character ""-"" = ', FileTable, ID) + if NoHeaderCommentStartFlag: PrintErrorMsg(ERROR_DOXYGEN_CHECK_FILE_HEADER, 'File header commen= t should begin with ""/** @file""', FileTable, ID) return diff --git a/BaseTools/Source/Python/Eot/CLexer.py b/BaseTools/Source/Pytho= n/Eot/CLexer.py index a496f4344030..c7956e8ddae6 100644 --- a/BaseTools/Source/Python/Eot/CLexer.py +++ b/BaseTools/Source/Python/Eot/CLexer.py @@ -2,7 +2,7 @@ =20 from antlr3 import * from antlr3.compat import set, frozenset - =20 + ## @file # The file defines the Lexer for C source files. # @@ -4341,7 +4341,7 @@ class CLexer(Lexer): u"\12\uffff" ) =20 - =20 + DFA25_transition =3D [ DFA.unpack(u"\1\2\1\uffff\12\1"), DFA.unpack(u"\1\3\1\uffff\12\1\12\uffff\1\5\1\4\1\5\35\uffff\1\5" @@ -4479,7 +4479,7 @@ class CLexer(Lexer): u"\u0192\uffff" ) =20 - =20 + DFA35_transition =3D [ DFA.unpack(u"\6\73\2\70\1\73\2\70\22\73\1\70\1\50\1\65\1\72\1\63" u"\1\45\1\46\1\64\1\34\1\35\1\40\1\42\1\3\1\43\1\41\1\44\1\66\11" @@ -4943,5 +4943,5 @@ class CLexer(Lexer): # class definition for DFA #35 =20 DFA35 =3D DFA -=20 + =20 diff --git a/BaseTools/Source/Python/Eot/CParser.py b/BaseTools/Source/Pyth= on/Eot/CParser.py index 94711a9a378a..e817af86f702 100644 --- a/BaseTools/Source/Python/Eot/CParser.py +++ b/BaseTools/Source/Python/Eot/CParser.py @@ -2,7 +2,7 @@ =20 from antlr3 import * from antlr3.compat import set, frozenset - =20 + ## @file # The file defines the parser for C source files. # @@ -56,23 +56,23 @@ OctalEscape=3D17 =20 # token names tokenNames =3D [ - "", "", "", "",=20 - "IDENTIFIER", "HEX_LITERAL", "OCTAL_LITERAL", "DECIMAL_LITERAL", "CHAR= ACTER_LITERAL",=20 - "STRING_LITERAL", "FLOATING_POINT_LITERAL", "LETTER", "EscapeSequence"= ,=20 - "HexDigit", "IntegerTypeSuffix", "Exponent", "FloatTypeSuffix", "Octal= Escape",=20 - "UnicodeEscape", "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COM= MENT",=20 - "LINE_COMMAND", "';'", "'typedef'", "','", "'=3D'", "'extern'", "'stat= ic'",=20 - "'auto'", "'register'", "'STATIC'", "'void'", "'char'", "'short'", "'i= nt'",=20 - "'long'", "'float'", "'double'", "'signed'", "'unsigned'", "'{'", "'}'= ",=20 - "'struct'", "'union'", "':'", "'enum'", "'const'", "'volatile'", "'IN'= ",=20 - "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED'", "'VOLATILE'", "'GLOBA= L_REMOVE_IF_UNREFERENCED'",=20 - "'EFIAPI'", "'EFI_BOOTSERVICE'", "'EFI_RUNTIMESERVICE'", "'PACKED'",=20 - "'('", "')'", "'['", "']'", "'*'", "'...'", "'+'", "'-'", "'/'", "'%'"= ,=20 - "'++'", "'--'", "'sizeof'", "'.'", "'->'", "'&'", "'~'", "'!'", "'*=3D= '",=20 - "'/=3D'", "'%=3D'", "'+=3D'", "'-=3D'", "'<<=3D'", "'>>=3D'", "'&=3D'"= , "'^=3D'", "'|=3D'",=20 - "'?'", "'||'", "'&&'", "'|'", "'^'", "'=3D=3D'", "'!=3D'", "'<'", "'>'= ", "'<=3D'",=20 - "'>=3D'", "'<<'", "'>>'", "'__asm__'", "'_asm'", "'__asm'", "'case'",=20 - "'default'", "'if'", "'else'", "'switch'", "'while'", "'do'", "'for'",=20 + "", "", "", "", + "IDENTIFIER", "HEX_LITERAL", "OCTAL_LITERAL", "DECIMAL_LITERAL", "CHAR= ACTER_LITERAL", + "STRING_LITERAL", "FLOATING_POINT_LITERAL", "LETTER", "EscapeSequence", + "HexDigit", "IntegerTypeSuffix", "Exponent", "FloatTypeSuffix", "Octal= Escape", + "UnicodeEscape", "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COM= MENT", + "LINE_COMMAND", "';'", "'typedef'", "','", "'=3D'", "'extern'", "'stat= ic'", + "'auto'", "'register'", "'STATIC'", "'void'", "'char'", "'short'", "'i= nt'", + "'long'", "'float'", "'double'", "'signed'", "'unsigned'", "'{'", "'}'= ", + "'struct'", "'union'", "':'", "'enum'", "'const'", "'volatile'", "'IN'= ", + "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED'", "'VOLATILE'", "'GLOBA= L_REMOVE_IF_UNREFERENCED'", + "'EFIAPI'", "'EFI_BOOTSERVICE'", "'EFI_RUNTIMESERVICE'", "'PACKED'", + "'('", "')'", "'['", "']'", "'*'", "'...'", "'+'", "'-'", "'/'", "'%'", + "'++'", "'--'", "'sizeof'", "'.'", "'->'", "'&'", "'~'", "'!'", "'*=3D= '", + "'/=3D'", "'%=3D'", "'+=3D'", "'-=3D'", "'<<=3D'", "'>>=3D'", "'&=3D'"= , "'^=3D'", "'|=3D'", + "'?'", "'||'", "'&&'", "'|'", "'^'", "'=3D=3D'", "'!=3D'", "'<'", "'>'= ", "'<=3D'", + "'>=3D'", "'<<'", "'>>'", "'__asm__'", "'_asm'", "'__asm'", "'case'", + "'default'", "'if'", "'else'", "'switch'", "'while'", "'do'", "'for'", "'goto'", "'continue'", "'break'", "'return'" ] =20 @@ -103,7 +103,7 @@ class CParser(Parser): =20 def printTokenInfo(self, line, offset, tokenText): print str(line)+ ',' + str(offset) + ':' + str(tokenText) - =20 + def StorePredicateExpression(self, StartLine, StartOffset, EndLine, En= dOffset, Text): PredExp =3D CodeFragment.PredicateExpression(Text, (StartLine, StartO= ffset), (EndLine, EndOffset)) FileProfile.PredicateExpressionList.append(PredExp) @@ -119,7 +119,7 @@ class CParser(Parser): def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndO= ffset, FromText, ToText): Tdef =3D CodeFragment.TypedefDefinition(FromText, ToText, (StartLine,= StartOffset), (EndLine, EndOffset)) FileProfile.TypedefDefinitionList.append(Tdef) - =20 + def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, End= Offset, ModifierText, DeclText, LeftBraceLine, LeftBraceOffset, DeclLine, D= eclOffset): FuncDef =3D CodeFragment.FunctionDefinition(ModifierText, DeclText, (= StartLine, StartOffset), (EndLine, EndOffset), (LeftBraceLine, LeftBraceOff= set), (DeclLine, DeclOffset)) FileProfile.FunctionDefinitionList.append(FuncDef) @@ -127,11 +127,11 @@ class CParser(Parser): def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, En= dOffset, ModifierText, DeclText): VarDecl =3D CodeFragment.VariableDeclaration(ModifierText, DeclText, = (StartLine, StartOffset), (EndLine, EndOffset)) FileProfile.VariableDeclarationList.append(VarDecl) - =20 + def StoreFunctionCalling(self, StartLine, StartOffset, EndLine, EndOff= set, FuncName, ParamList): FuncCall =3D CodeFragment.FunctionCalling(FuncName, ParamList, (Start= Line, StartOffset), (EndLine, EndOffset)) FileProfile.FunctionCallingList.append(FuncCall) - =20 + =20 =20 =20 @@ -143,7 +143,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 1): - return=20 + return =20 # C.g:103:2: ( ( external_declaration )* ) # C.g:103:4: ( external_declaration )* @@ -162,7 +162,7 @@ class CParser(Parser): self.external_declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -182,7 +182,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end translation_unit =20 @@ -195,7 +195,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 2): - return=20 + return =20 # C.g:119:2: ( ( ( declaration_specifiers )? declarator ( = declaration )* '{' )=3D> function_definition | declaration | macro_statemen= t ( ';' )? ) alt3 =3D 3 @@ -211,7 +211,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 1, self.input) =20 @@ -227,7 +227,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 2, self.input) =20 @@ -243,7 +243,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 3, self.input) =20 @@ -259,7 +259,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 4, self.input) =20 @@ -275,7 +275,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 5, self.input) =20 @@ -291,7 +291,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 6, self.input) =20 @@ -307,7 +307,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 7, self.input) =20 @@ -323,7 +323,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 8, self.input) =20 @@ -339,7 +339,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 9, self.input) =20 @@ -355,7 +355,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 10, self.input) =20 @@ -371,7 +371,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 11, self.input) =20 @@ -387,7 +387,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 12, self.input) =20 @@ -405,7 +405,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 13, self.input) =20 @@ -421,7 +421,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 14, self.input) =20 @@ -439,7 +439,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 16, self.input) =20 @@ -455,7 +455,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 17, self.input) =20 @@ -471,7 +471,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_dec= laration options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( d= eclaration )* '{' )=3D> function_definition | declaration | macro_statement= ( ';' )? );", 3, 18, self.input) =20 @@ -484,7 +484,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("114:1: external_declara= tion options {k=3D1; } : ( ( ( declaration_specifiers )? declarator ( decla= ration )* '{' )=3D> function_definition | declaration | macro_statement ( '= ;' )? );", 3, 0, self.input) =20 @@ -496,7 +496,7 @@ class CParser(Parser): self.function_definition() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt3 =3D=3D 2: @@ -505,7 +505,7 @@ class CParser(Parser): self.declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt3 =3D=3D 3: @@ -514,7 +514,7 @@ class CParser(Parser): self.macro_statement() self.following.pop() if self.failed: - return=20 + return # C.g:121:20: ( ';' )? alt2 =3D 2 LA2_0 =3D self.input.LA(1) @@ -525,7 +525,7 @@ class CParser(Parser): # C.g:121:21: ';' self.match(self.input, 25, self.FOLLOW_25_in_exter= nal_declaration126) if self.failed: - return=20 + return =20 =20 =20 @@ -541,7 +541,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end external_declaration =20 @@ -568,7 +568,7 @@ class CParser(Parser): declarator1 =3D None =20 =20 - =20 + self.function_definition_stack[-1].ModifierText =3D '' self.function_definition_stack[-1].DeclText =3D '' self.function_definition_stack[-1].LBLine =3D 0 @@ -782,7 +782,7 @@ class CParser(Parser): =20 =20 if self.backtracking =3D=3D 0: - =20 + if d is not None: self.function_definition_stack[-1].ModifierText =3D = self.input.toString(d.start,d.stop) else: @@ -796,7 +796,7 @@ class CParser(Parser): else: self.function_definition_stack[-1].LBLine =3D b.star= t.line self.function_definition_stack[-1].LBOffset =3D b.st= art.charPositionInLine - =20 + =09 =20 =20 =20 @@ -804,7 +804,7 @@ class CParser(Parser): retval.stop =3D self.input.LT(-1) =20 if self.backtracking =3D=3D 0: - =20 + self.StoreFunctionDefinition(retval.start.line, retval= .start.charPositionInLine, retval.stop.line, retval.stop.charPositionInLine= , self.function_definition_stack[-1].ModifierText, self.function_definition= _stack[-1].DeclText, self.function_definition_stack[-1].LBLine, self.functi= on_definition_stack[-1].LBOffset, self.function_definition_stack[-1].DeclLi= ne, self.function_definition_stack[-1].DeclOffset) =20 =20 @@ -844,7 +844,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 4): - return=20 + return =20 # C.g:167:2: (a=3D 'typedef' (b=3D declaration_specifiers = )? c=3D init_declarator_list d=3D ';' | s=3D declaration_specifiers (t=3D i= nit_declarator_list )? e=3D ';' ) alt9 =3D 2 @@ -857,7 +857,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("166:1: declaration : (a= =3D 'typedef' (b=3D declaration_specifiers )? c=3D init_declarator_list d= =3D ';' | s=3D declaration_specifiers (t=3D init_declarator_list )? e=3D ';= ' );", 9, 0, self.input) =20 @@ -868,7 +868,7 @@ class CParser(Parser): a =3D self.input.LT(1) self.match(self.input, 26, self.FOLLOW_26_in_declarati= on203) if self.failed: - return=20 + return # C.g:167:17: (b=3D declaration_specifiers )? alt7 =3D 2 LA7 =3D self.input.LA(1) @@ -905,7 +905,7 @@ class CParser(Parser): b =3D self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -913,18 +913,18 @@ class CParser(Parser): c =3D self.init_declarator_list() self.following.pop() if self.failed: - return=20 + return d =3D self.input.LT(1) self.match(self.input, 25, self.FOLLOW_25_in_declarati= on220) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: - =20 + if b is not None: self.StoreTypedefDefinition(a.line, a.charPositi= onInLine, d.line, d.charPositionInLine, self.input.toString(b.start,b.stop)= , self.input.toString(c.start,c.stop)) else: self.StoreTypedefDefinition(a.line, a.charPositi= onInLine, d.line, d.charPositionInLine, '', self.input.toString(c.start,c.s= top)) - =20 + =09 =20 =20 =20 @@ -934,7 +934,7 @@ class CParser(Parser): s =3D self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return # C.g:175:30: (t=3D init_declarator_list )? alt8 =3D 2 LA8_0 =3D self.input.LA(1) @@ -947,16 +947,16 @@ class CParser(Parser): t =3D self.init_declarator_list() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 e =3D self.input.LT(1) self.match(self.input, 25, self.FOLLOW_25_in_declarati= on243) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: - =20 + if t is not None: self.StoreVariableDeclaration(s.start.line, s.st= art.charPositionInLine, t.start.line, t.start.charPositionInLine, self.inpu= t.toString(s.start,s.stop), self.input.toString(t.start,t.stop)) =09 @@ -973,7 +973,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end declaration =20 @@ -1184,7 +1184,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 7): - return=20 + return =20 # C.g:194:2: ( declarator ( '=3D' initializer )? ) # C.g:194:4: declarator ( '=3D' initializer )? @@ -1192,7 +1192,7 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return # C.g:194:15: ( '=3D' initializer )? alt12 =3D 2 LA12_0 =3D self.input.LA(1) @@ -1203,12 +1203,12 @@ class CParser(Parser): # C.g:194:16: '=3D' initializer self.match(self.input, 28, self.FOLLOW_28_in_init_decl= arator329) if self.failed: - return=20 + return self.following.append(self.FOLLOW_initializer_in_init_= declarator331) self.initializer() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -1225,7 +1225,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end init_declarator =20 @@ -1238,7 +1238,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 8): - return=20 + return =20 # C.g:198:2: ( 'extern' | 'static' | 'auto' | 'register' |= 'STATIC' ) # C.g: @@ -1250,7 +1250,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.input) self.recoverFromMismatchedSet( @@ -1272,7 +1272,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end storage_class_specifier =20 @@ -1290,7 +1290,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 9): - return=20 + return =20 # C.g:206:2: ( 'void' | 'char' | 'short' | 'int' | 'long' = | 'float' | 'double' | 'signed' | 'unsigned' | s=3D struct_or_union_specifi= er | e=3D enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator )=3D= > type_id ) alt13 =3D 12 @@ -1323,7 +1323,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("205:1: type_specifier := ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signe= d' | 'unsigned' | s=3D struct_or_union_specifier | e=3D enum_specifier | ( = IDENTIFIER ( type_qualifier )* declarator )=3D> type_id );", 13, 0, self.in= put) =20 @@ -1333,63 +1333,63 @@ class CParser(Parser): # C.g:206:4: 'void' self.match(self.input, 34, self.FOLLOW_34_in_type_spec= ifier376) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 2: # C.g:207:4: 'char' self.match(self.input, 35, self.FOLLOW_35_in_type_spec= ifier381) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 3: # C.g:208:4: 'short' self.match(self.input, 36, self.FOLLOW_36_in_type_spec= ifier386) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 4: # C.g:209:4: 'int' self.match(self.input, 37, self.FOLLOW_37_in_type_spec= ifier391) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 5: # C.g:210:4: 'long' self.match(self.input, 38, self.FOLLOW_38_in_type_spec= ifier396) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 6: # C.g:211:4: 'float' self.match(self.input, 39, self.FOLLOW_39_in_type_spec= ifier401) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 7: # C.g:212:4: 'double' self.match(self.input, 40, self.FOLLOW_40_in_type_spec= ifier406) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 8: # C.g:213:4: 'signed' self.match(self.input, 41, self.FOLLOW_41_in_type_spec= ifier411) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 9: # C.g:214:4: 'unsigned' self.match(self.input, 42, self.FOLLOW_42_in_type_spec= ifier416) if self.failed: - return=20 + return =20 =20 elif alt13 =3D=3D 10: @@ -1398,9 +1398,9 @@ class CParser(Parser): s =3D self.struct_or_union_specifier() self.following.pop() if self.failed: - return=20 + return if self.backtracking =3D=3D 0: - =20 + if s.stop is not None: self.StoreStructUnionDefinition(s.start.line, s.= start.charPositionInLine, s.stop.line, s.stop.charPositionInLine, self.inpu= t.toString(s.start,s.stop)) =09 @@ -1413,9 +1413,9 @@ class CParser(Parser): e =3D self.enum_specifier() self.following.pop() if self.failed: - return=20 + return if self.backtracking =3D=3D 0: - =20 + if e.stop is not None: self.StoreEnumerationDefinition(e.start.line, e.= start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.inpu= t.toString(e.start,e.stop)) =09 @@ -1428,7 +1428,7 @@ class CParser(Parser): self.type_id() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -1441,7 +1441,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end type_specifier =20 @@ -1454,13 +1454,13 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 10): - return=20 + return =20 # C.g:229:5: ( IDENTIFIER ) # C.g:229:9: IDENTIFIER self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_type_id467) if self.failed: - return=20 + return =20 =20 =20 @@ -1474,7 +1474,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end type_id =20 @@ -1611,7 +1611,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 12): - return=20 + return =20 # C.g:240:2: ( 'struct' | 'union' ) # C.g: @@ -1623,7 +1623,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.input) self.recoverFromMismatchedSet( @@ -1645,7 +1645,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end struct_or_union =20 @@ -1658,7 +1658,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 13): - return=20 + return =20 # C.g:245:2: ( ( struct_declaration )+ ) # C.g:245:4: ( struct_declaration )+ @@ -1678,7 +1678,7 @@ class CParser(Parser): self.struct_declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -1687,7 +1687,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(16, self.input) raise eee @@ -1708,7 +1708,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end struct_declaration_list =20 @@ -1721,7 +1721,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 14): - return=20 + return =20 # C.g:249:2: ( specifier_qualifier_list struct_declarator_= list ';' ) # C.g:249:4: specifier_qualifier_list struct_declarator_li= st ';' @@ -1729,15 +1729,15 @@ class CParser(Parser): self.specifier_qualifier_list() self.following.pop() if self.failed: - return=20 + return self.following.append(self.FOLLOW_struct_declarator_list_i= n_struct_declaration551) self.struct_declarator_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_struct_declar= ation553) if self.failed: - return=20 + return =20 =20 =20 @@ -1751,7 +1751,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end struct_declaration =20 @@ -1764,7 +1764,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 15): - return=20 + return =20 # C.g:253:2: ( ( type_qualifier | type_specifier )+ ) # C.g:253:4: ( type_qualifier | type_specifier )+ @@ -1831,7 +1831,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt17 =3D=3D 2: @@ -1840,7 +1840,7 @@ class CParser(Parser): self.type_specifier() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -1849,7 +1849,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(17, self.input) raise eee @@ -1870,7 +1870,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end specifier_qualifier_list =20 @@ -1883,7 +1883,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 16): - return=20 + return =20 # C.g:257:2: ( struct_declarator ( ',' struct_declarator )= * ) # C.g:257:4: struct_declarator ( ',' struct_declarator )* @@ -1891,7 +1891,7 @@ class CParser(Parser): self.struct_declarator() self.following.pop() if self.failed: - return=20 + return # C.g:257:22: ( ',' struct_declarator )* while True: #loop18 alt18 =3D 2 @@ -1905,12 +1905,12 @@ class CParser(Parser): # C.g:257:23: ',' struct_declarator self.match(self.input, 27, self.FOLLOW_27_in_struc= t_declarator_list587) if self.failed: - return=20 + return self.following.append(self.FOLLOW_struct_declarato= r_in_struct_declarator_list589) self.struct_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -1930,7 +1930,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end struct_declarator_list =20 @@ -1943,7 +1943,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 17): - return=20 + return =20 # C.g:261:2: ( declarator ( ':' constant_expression )? | '= :' constant_expression ) alt20 =3D 2 @@ -1956,7 +1956,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("260:1: struct_declarato= r : ( declarator ( ':' constant_expression )? | ':' constant_expression );"= , 20, 0, self.input) =20 @@ -1968,7 +1968,7 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return # C.g:261:15: ( ':' constant_expression )? alt19 =3D 2 LA19_0 =3D self.input.LA(1) @@ -1979,12 +1979,12 @@ class CParser(Parser): # C.g:261:16: ':' constant_expression self.match(self.input, 47, self.FOLLOW_47_in_struc= t_declarator605) if self.failed: - return=20 + return self.following.append(self.FOLLOW_constant_express= ion_in_struct_declarator607) self.constant_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -1994,12 +1994,12 @@ class CParser(Parser): # C.g:262:4: ':' constant_expression self.match(self.input, 47, self.FOLLOW_47_in_struct_de= clarator614) if self.failed: - return=20 + return self.following.append(self.FOLLOW_constant_expression_= in_struct_declarator616) self.constant_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -2012,7 +2012,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end struct_declarator =20 @@ -2180,7 +2180,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 19): - return=20 + return =20 # C.g:273:2: ( enumerator ( ',' enumerator )* ) # C.g:273:4: enumerator ( ',' enumerator )* @@ -2188,7 +2188,7 @@ class CParser(Parser): self.enumerator() self.following.pop() if self.failed: - return=20 + return # C.g:273:15: ( ',' enumerator )* while True: #loop24 alt24 =3D 2 @@ -2207,12 +2207,12 @@ class CParser(Parser): # C.g:273:16: ',' enumerator self.match(self.input, 27, self.FOLLOW_27_in_enume= rator_list680) if self.failed: - return=20 + return self.following.append(self.FOLLOW_enumerator_in_en= umerator_list682) self.enumerator() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -2232,7 +2232,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end enumerator_list =20 @@ -2245,13 +2245,13 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 20): - return=20 + return =20 # C.g:277:2: ( IDENTIFIER ( '=3D' constant_expression )? ) # C.g:277:4: IDENTIFIER ( '=3D' constant_expression )? self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_enumerator695) if self.failed: - return=20 + return # C.g:277:15: ( '=3D' constant_expression )? alt25 =3D 2 LA25_0 =3D self.input.LA(1) @@ -2262,12 +2262,12 @@ class CParser(Parser): # C.g:277:16: '=3D' constant_expression self.match(self.input, 28, self.FOLLOW_28_in_enumerato= r698) if self.failed: - return=20 + return self.following.append(self.FOLLOW_constant_expression_= in_enumerator700) self.constant_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -2284,7 +2284,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end enumerator =20 @@ -2297,7 +2297,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 21): - return=20 + return =20 # C.g:281:2: ( 'const' | 'volatile' | 'IN' | 'OUT' | 'OPTI= ONAL' | 'CONST' | 'UNALIGNED' | 'VOLATILE' | 'GLOBAL_REMOVE_IF_UNREFERENCED= ' | 'EFIAPI' | 'EFI_BOOTSERVICE' | 'EFI_RUNTIMESERVICE' | 'PACKED' ) # C.g: @@ -2309,7 +2309,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.input) self.recoverFromMismatchedSet( @@ -2331,7 +2331,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end type_qualifier =20 @@ -2486,7 +2486,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 23): - return=20 + return =20 # C.g:303:2: ( IDENTIFIER ( declarator_suffix )* | '(' ( '= EFIAPI' )? declarator ')' ( declarator_suffix )+ ) alt34 =3D 2 @@ -2499,7 +2499,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("302:1: direct_declarato= r : ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' = ( declarator_suffix )+ );", 34, 0, self.input) =20 @@ -2509,7 +2509,7 @@ class CParser(Parser): # C.g:303:4: IDENTIFIER ( declarator_suffix )* self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_direct_declarator819) if self.failed: - return=20 + return # C.g:303:15: ( declarator_suffix )* while True: #loop31 alt31 =3D 2 @@ -2753,7 +2753,7 @@ class CParser(Parser): self.declarator_suffix() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -2766,7 +2766,7 @@ class CParser(Parser): # C.g:304:4: '(' ( 'EFIAPI' )? declarator ')' ( declar= ator_suffix )+ self.match(self.input, 62, self.FOLLOW_62_in_direct_de= clarator827) if self.failed: - return=20 + return # C.g:304:8: ( 'EFIAPI' )? alt32 =3D 2 LA32_0 =3D self.input.LA(1) @@ -2780,7 +2780,7 @@ class CParser(Parser): # C.g:304:9: 'EFIAPI' self.match(self.input, 58, self.FOLLOW_58_in_direc= t_declarator830) if self.failed: - return=20 + return =20 =20 =20 @@ -2788,10 +2788,10 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_direct_de= clarator836) if self.failed: - return=20 + return # C.g:304:35: ( declarator_suffix )+ cnt33 =3D 0 while True: #loop33 @@ -3036,7 +3036,7 @@ class CParser(Parser): self.declarator_suffix() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -3045,7 +3045,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(33, self.input) raise eee @@ -3065,7 +3065,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end direct_declarator =20 @@ -3078,7 +3078,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 24): - return=20 + return =20 # C.g:308:2: ( '[' constant_expression ']' | '[' ']' | '('= parameter_type_list ')' | '(' identifier_list ')' | '(' ')' ) alt35 =3D 5 @@ -3094,7 +3094,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("307:1: declarator_s= uffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list '= )' | '(' identifier_list ')' | '(' ')' );", 35, 1, self.input) =20 @@ -3116,7 +3116,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("307:1: declarat= or_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_li= st ')' | '(' identifier_list ')' | '(' ')' );", 35, 29, self.input) =20 @@ -3125,7 +3125,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("307:1: declarator_s= uffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list '= )' | '(' identifier_list ')' | '(' ')' );", 35, 2, self.input) =20 @@ -3134,7 +3134,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("307:1: declarator_suffi= x : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' |= '(' identifier_list ')' | '(' ')' );", 35, 0, self.input) =20 @@ -3144,65 +3144,65 @@ class CParser(Parser): # C.g:308:6: '[' constant_expression ']' self.match(self.input, 64, self.FOLLOW_64_in_declarato= r_suffix852) if self.failed: - return=20 + return self.following.append(self.FOLLOW_constant_expression_= in_declarator_suffix854) self.constant_expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 65, self.FOLLOW_65_in_declarato= r_suffix856) if self.failed: - return=20 + return =20 =20 elif alt35 =3D=3D 2: # C.g:309:9: '[' ']' self.match(self.input, 64, self.FOLLOW_64_in_declarato= r_suffix866) if self.failed: - return=20 + return self.match(self.input, 65, self.FOLLOW_65_in_declarato= r_suffix868) if self.failed: - return=20 + return =20 =20 elif alt35 =3D=3D 3: # C.g:310:9: '(' parameter_type_list ')' self.match(self.input, 62, self.FOLLOW_62_in_declarato= r_suffix878) if self.failed: - return=20 + return self.following.append(self.FOLLOW_parameter_type_list_= in_declarator_suffix880) self.parameter_type_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_declarato= r_suffix882) if self.failed: - return=20 + return =20 =20 elif alt35 =3D=3D 4: # C.g:311:9: '(' identifier_list ')' self.match(self.input, 62, self.FOLLOW_62_in_declarato= r_suffix892) if self.failed: - return=20 + return self.following.append(self.FOLLOW_identifier_list_in_d= eclarator_suffix894) self.identifier_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_declarato= r_suffix896) if self.failed: - return=20 + return =20 =20 elif alt35 =3D=3D 5: # C.g:312:9: '(' ')' self.match(self.input, 62, self.FOLLOW_62_in_declarato= r_suffix906) if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_declarato= r_suffix908) if self.failed: - return=20 + return =20 =20 =20 @@ -3215,7 +3215,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end declarator_suffix =20 @@ -3228,7 +3228,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 25): - return=20 + return =20 # C.g:316:2: ( '*' ( type_qualifier )+ ( pointer )? | '*' = pointer | '*' ) alt38 =3D 3 @@ -3246,7 +3246,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 2, se= lf.input) =20 @@ -3262,7 +3262,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 3, se= lf.input) =20 @@ -3278,7 +3278,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 4, se= lf.input) =20 @@ -3294,7 +3294,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 5, se= lf.input) =20 @@ -3312,7 +3312,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 21, s= elf.input) =20 @@ -3328,7 +3328,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 29, s= elf.input) =20 @@ -3337,7 +3337,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer : ( = '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 1, self.i= nput) =20 @@ -3346,7 +3346,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("315:1: pointer : ( '*' = ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 0, self.input) =20 @@ -3356,7 +3356,7 @@ class CParser(Parser): # C.g:316:4: '*' ( type_qualifier )+ ( pointer )? self.match(self.input, 66, self.FOLLOW_66_in_pointer91= 9) if self.failed: - return=20 + return # C.g:316:8: ( type_qualifier )+ cnt36 =3D 0 while True: #loop36 @@ -3404,7 +3404,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -3413,7 +3413,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(36, self.input) raise eee @@ -3436,7 +3436,7 @@ class CParser(Parser): self.pointer() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -3446,19 +3446,19 @@ class CParser(Parser): # C.g:317:4: '*' pointer self.match(self.input, 66, self.FOLLOW_66_in_pointer93= 0) if self.failed: - return=20 + return self.following.append(self.FOLLOW_pointer_in_pointer93= 2) self.pointer() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt38 =3D=3D 3: # C.g:318:4: '*' self.match(self.input, 66, self.FOLLOW_66_in_pointer93= 7) if self.failed: - return=20 + return =20 =20 =20 @@ -3471,7 +3471,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end pointer =20 @@ -3484,7 +3484,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 26): - return=20 + return =20 # C.g:322:2: ( parameter_list ( ',' ( 'OPTIONAL' )? '...' = )? ) # C.g:322:4: parameter_list ( ',' ( 'OPTIONAL' )? '...' )? @@ -3492,7 +3492,7 @@ class CParser(Parser): self.parameter_list() self.following.pop() if self.failed: - return=20 + return # C.g:322:19: ( ',' ( 'OPTIONAL' )? '...' )? alt40 =3D 2 LA40_0 =3D self.input.LA(1) @@ -3503,7 +3503,7 @@ class CParser(Parser): # C.g:322:20: ',' ( 'OPTIONAL' )? '...' self.match(self.input, 27, self.FOLLOW_27_in_parameter= _type_list951) if self.failed: - return=20 + return # C.g:322:24: ( 'OPTIONAL' )? alt39 =3D 2 LA39_0 =3D self.input.LA(1) @@ -3514,13 +3514,13 @@ class CParser(Parser): # C.g:322:25: 'OPTIONAL' self.match(self.input, 53, self.FOLLOW_53_in_param= eter_type_list954) if self.failed: - return=20 + return =20 =20 =20 self.match(self.input, 67, self.FOLLOW_67_in_parameter= _type_list958) if self.failed: - return=20 + return =20 =20 =20 @@ -3537,7 +3537,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end parameter_type_list =20 @@ -3550,7 +3550,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 27): - return=20 + return =20 # C.g:326:2: ( parameter_declaration ( ',' ( 'OPTIONAL' )?= parameter_declaration )* ) # C.g:326:4: parameter_declaration ( ',' ( 'OPTIONAL' )? p= arameter_declaration )* @@ -3558,7 +3558,7 @@ class CParser(Parser): self.parameter_declaration() self.following.pop() if self.failed: - return=20 + return # C.g:326:26: ( ',' ( 'OPTIONAL' )? parameter_declaration = )* while True: #loop42 alt42 =3D 2 @@ -3584,7 +3584,7 @@ class CParser(Parser): # C.g:326:27: ',' ( 'OPTIONAL' )? parameter_declar= ation self.match(self.input, 27, self.FOLLOW_27_in_param= eter_list974) if self.failed: - return=20 + return # C.g:326:31: ( 'OPTIONAL' )? alt41 =3D 2 LA41_0 =3D self.input.LA(1) @@ -3598,7 +3598,7 @@ class CParser(Parser): # C.g:326:32: 'OPTIONAL' self.match(self.input, 53, self.FOLLOW_53_in_p= arameter_list977) if self.failed: - return=20 + return =20 =20 =20 @@ -3606,7 +3606,7 @@ class CParser(Parser): self.parameter_declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -3626,7 +3626,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end parameter_list =20 @@ -3639,7 +3639,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 28): - return=20 + return =20 # C.g:330:2: ( declaration_specifiers ( declarator | abstr= act_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER ) alt46 =3D 2 @@ -3656,7 +3656,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("329:1: parameter_de= claration : ( declaration_specifiers ( declarator | abstract_declarator )* = ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );", 46, 13, self.input) =20 @@ -3667,7 +3667,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("329:1: parameter_declar= ation : ( declaration_specifiers ( declarator | abstract_declarator )* ( 'O= PTIONAL' )? | ( pointer )* IDENTIFIER );", 46, 0, self.input) =20 @@ -3679,7 +3679,7 @@ class CParser(Parser): self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return # C.g:330:27: ( declarator | abstract_declarator )* while True: #loop43 alt43 =3D 3 @@ -3763,7 +3763,7 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt43 =3D=3D 2: @@ -3772,7 +3772,7 @@ class CParser(Parser): self.abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -3789,7 +3789,7 @@ class CParser(Parser): # C.g:330:62: 'OPTIONAL' self.match(self.input, 53, self.FOLLOW_53_in_param= eter_declaration1004) if self.failed: - return=20 + return =20 =20 =20 @@ -3812,7 +3812,7 @@ class CParser(Parser): self.pointer() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -3821,7 +3821,7 @@ class CParser(Parser): =20 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_parameter_declaration1016) if self.failed: - return=20 + return =20 =20 =20 @@ -3834,7 +3834,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end parameter_declaration =20 @@ -3847,13 +3847,13 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 29): - return=20 + return =20 # C.g:336:2: ( IDENTIFIER ( ',' IDENTIFIER )* ) # C.g:336:4: IDENTIFIER ( ',' IDENTIFIER )* self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_identifier_list1027) if self.failed: - return=20 + return # C.g:337:2: ( ',' IDENTIFIER )* while True: #loop47 alt47 =3D 2 @@ -3867,10 +3867,10 @@ class CParser(Parser): # C.g:337:3: ',' IDENTIFIER self.match(self.input, 27, self.FOLLOW_27_in_ident= ifier_list1031) if self.failed: - return=20 + return self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_identifier_list1033) if self.failed: - return=20 + return =20 =20 else: @@ -3890,7 +3890,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end identifier_list =20 @@ -3903,7 +3903,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 30): - return=20 + return =20 # C.g:341:2: ( specifier_qualifier_list ( abstract_declara= tor )? | type_id ) alt49 =3D 2 @@ -3921,7 +3921,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("340:1: type_name : = ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 49, 13, = self.input) =20 @@ -3930,7 +3930,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("340:1: type_name : ( sp= ecifier_qualifier_list ( abstract_declarator )? | type_id );", 49, 0, self.= input) =20 @@ -3942,7 +3942,7 @@ class CParser(Parser): self.specifier_qualifier_list() self.following.pop() if self.failed: - return=20 + return # C.g:341:29: ( abstract_declarator )? alt48 =3D 2 LA48_0 =3D self.input.LA(1) @@ -3955,7 +3955,7 @@ class CParser(Parser): self.abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -3967,7 +3967,7 @@ class CParser(Parser): self.type_id() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -3980,7 +3980,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end type_name =20 @@ -3993,7 +3993,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 31): - return=20 + return =20 # C.g:346:2: ( pointer ( direct_abstract_declarator )? | d= irect_abstract_declarator ) alt51 =3D 2 @@ -4006,7 +4006,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("345:1: abstract_declara= tor : ( pointer ( direct_abstract_declarator )? | direct_abstract_declarato= r );", 51, 0, self.input) =20 @@ -4018,7 +4018,7 @@ class CParser(Parser): self.pointer() self.following.pop() if self.failed: - return=20 + return # C.g:346:12: ( direct_abstract_declarator )? alt50 =3D 2 LA50_0 =3D self.input.LA(1) @@ -4203,7 +4203,7 @@ class CParser(Parser): self.direct_abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -4215,7 +4215,7 @@ class CParser(Parser): self.direct_abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -4228,7 +4228,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end abstract_declarator =20 @@ -4241,7 +4241,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 32): - return=20 + return =20 # C.g:351:2: ( ( '(' abstract_declarator ')' | abstract_de= clarator_suffix ) ( abstract_declarator_suffix )* ) # C.g:351:4: ( '(' abstract_declarator ')' | abstract_decl= arator_suffix ) ( abstract_declarator_suffix )* @@ -4263,7 +4263,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("351:4: ( '(' ab= stract_declarator ')' | abstract_declarator_suffix )", 52, 18, self.input) =20 @@ -4274,7 +4274,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("351:4: ( '(' abstra= ct_declarator ')' | abstract_declarator_suffix )", 52, 1, self.input) =20 @@ -4285,7 +4285,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("351:4: ( '(' abstract_d= eclarator ')' | abstract_declarator_suffix )", 52, 0, self.input) =20 @@ -4295,15 +4295,15 @@ class CParser(Parser): # C.g:351:6: '(' abstract_declarator ')' self.match(self.input, 62, self.FOLLOW_62_in_direct_ab= stract_declarator1086) if self.failed: - return=20 + return self.following.append(self.FOLLOW_abstract_declarator_= in_direct_abstract_declarator1088) self.abstract_declarator() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_direct_ab= stract_declarator1090) if self.failed: - return=20 + return =20 =20 elif alt52 =3D=3D 2: @@ -4312,7 +4312,7 @@ class CParser(Parser): self.abstract_declarator_suffix() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -4559,7 +4559,7 @@ class CParser(Parser): self.abstract_declarator_suffix() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -4579,7 +4579,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end direct_abstract_declarator =20 @@ -4592,7 +4592,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 33): - return=20 + return =20 # C.g:355:2: ( '[' ']' | '[' constant_expression ']' | '('= ')' | '(' parameter_type_list ')' ) alt54 =3D 4 @@ -4608,7 +4608,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("354:1: abstract_dec= larator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' pa= rameter_type_list ')' );", 54, 1, self.input) =20 @@ -4624,7 +4624,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("354:1: abstract_dec= larator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' pa= rameter_type_list ')' );", 54, 2, self.input) =20 @@ -4633,7 +4633,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("354:1: abstract_declara= tor_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parame= ter_type_list ')' );", 54, 0, self.input) =20 @@ -4643,50 +4643,50 @@ class CParser(Parser): # C.g:355:4: '[' ']' self.match(self.input, 64, self.FOLLOW_64_in_abstract_= declarator_suffix1110) if self.failed: - return=20 + return self.match(self.input, 65, self.FOLLOW_65_in_abstract_= declarator_suffix1112) if self.failed: - return=20 + return =20 =20 elif alt54 =3D=3D 2: # C.g:356:4: '[' constant_expression ']' self.match(self.input, 64, self.FOLLOW_64_in_abstract_= declarator_suffix1117) if self.failed: - return=20 + return self.following.append(self.FOLLOW_constant_expression_= in_abstract_declarator_suffix1119) self.constant_expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 65, self.FOLLOW_65_in_abstract_= declarator_suffix1121) if self.failed: - return=20 + return =20 =20 elif alt54 =3D=3D 3: # C.g:357:4: '(' ')' self.match(self.input, 62, self.FOLLOW_62_in_abstract_= declarator_suffix1126) if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_abstract_= declarator_suffix1128) if self.failed: - return=20 + return =20 =20 elif alt54 =3D=3D 4: # C.g:358:4: '(' parameter_type_list ')' self.match(self.input, 62, self.FOLLOW_62_in_abstract_= declarator_suffix1133) if self.failed: - return=20 + return self.following.append(self.FOLLOW_parameter_type_list_= in_abstract_declarator_suffix1135) self.parameter_type_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_abstract_= declarator_suffix1137) if self.failed: - return=20 + return =20 =20 =20 @@ -4699,7 +4699,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end abstract_declarator_suffix =20 @@ -4712,7 +4712,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 34): - return=20 + return =20 # C.g:363:2: ( assignment_expression | '{' initializer_lis= t ( ',' )? '}' ) alt56 =3D 2 @@ -4725,7 +4725,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("361:1: initializer : ( = assignment_expression | '{' initializer_list ( ',' )? '}' );", 56, 0, self.= input) =20 @@ -4737,19 +4737,19 @@ class CParser(Parser): self.assignment_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt56 =3D=3D 2: # C.g:364:4: '{' initializer_list ( ',' )? '}' self.match(self.input, 43, self.FOLLOW_43_in_initializ= er1155) if self.failed: - return=20 + return self.following.append(self.FOLLOW_initializer_list_in_= initializer1157) self.initializer_list() self.following.pop() if self.failed: - return=20 + return # C.g:364:25: ( ',' )? alt55 =3D 2 LA55_0 =3D self.input.LA(1) @@ -4760,13 +4760,13 @@ class CParser(Parser): # C.g:0:0: ',' self.match(self.input, 27, self.FOLLOW_27_in_initi= alizer1159) if self.failed: - return=20 + return =20 =20 =20 self.match(self.input, 44, self.FOLLOW_44_in_initializ= er1162) if self.failed: - return=20 + return =20 =20 =20 @@ -4779,7 +4779,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end initializer =20 @@ -4792,7 +4792,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 35): - return=20 + return =20 # C.g:368:2: ( initializer ( ',' initializer )* ) # C.g:368:4: initializer ( ',' initializer )* @@ -4800,7 +4800,7 @@ class CParser(Parser): self.initializer() self.following.pop() if self.failed: - return=20 + return # C.g:368:16: ( ',' initializer )* while True: #loop57 alt57 =3D 2 @@ -4819,12 +4819,12 @@ class CParser(Parser): # C.g:368:17: ',' initializer self.match(self.input, 27, self.FOLLOW_27_in_initi= alizer_list1176) if self.failed: - return=20 + return self.following.append(self.FOLLOW_initializer_in_i= nitializer_list1178) self.initializer() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -4844,7 +4844,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end initializer_list =20 @@ -4955,7 +4955,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 37): - return=20 + return =20 # C.g:378:2: ( ( multiplicative_expression ) ( '+' multipl= icative_expression | '-' multiplicative_expression )* ) # C.g:378:4: ( multiplicative_expression ) ( '+' multiplic= ative_expression | '-' multiplicative_expression )* @@ -4965,7 +4965,7 @@ class CParser(Parser): self.multiplicative_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -4984,24 +4984,24 @@ class CParser(Parser): # C.g:378:33: '+' multiplicative_expression self.match(self.input, 68, self.FOLLOW_68_in_addit= ive_expression1229) if self.failed: - return=20 + return self.following.append(self.FOLLOW_multiplicative_e= xpression_in_additive_expression1231) self.multiplicative_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt61 =3D=3D 2: # C.g:378:65: '-' multiplicative_expression self.match(self.input, 69, self.FOLLOW_69_in_addit= ive_expression1235) if self.failed: - return=20 + return self.following.append(self.FOLLOW_multiplicative_e= xpression_in_additive_expression1237) self.multiplicative_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -5021,7 +5021,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end additive_expression =20 @@ -5034,7 +5034,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 38): - return=20 + return =20 # C.g:382:2: ( ( cast_expression ) ( '*' cast_expression |= '/' cast_expression | '%' cast_expression )* ) # C.g:382:4: ( cast_expression ) ( '*' cast_expression | '= /' cast_expression | '%' cast_expression )* @@ -5044,7 +5044,7 @@ class CParser(Parser): self.cast_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -5063,36 +5063,36 @@ class CParser(Parser): # C.g:382:23: '*' cast_expression self.match(self.input, 66, self.FOLLOW_66_in_multi= plicative_expression1255) if self.failed: - return=20 + return self.following.append(self.FOLLOW_cast_expression_= in_multiplicative_expression1257) self.cast_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt62 =3D=3D 2: # C.g:382:45: '/' cast_expression self.match(self.input, 70, self.FOLLOW_70_in_multi= plicative_expression1261) if self.failed: - return=20 + return self.following.append(self.FOLLOW_cast_expression_= in_multiplicative_expression1263) self.cast_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt62 =3D=3D 3: # C.g:382:67: '%' cast_expression self.match(self.input, 71, self.FOLLOW_71_in_multi= plicative_expression1267) if self.failed: - return=20 + return self.following.append(self.FOLLOW_cast_expression_= in_multiplicative_expression1269) self.cast_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -5112,7 +5112,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end multiplicative_expression =20 @@ -5125,7 +5125,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 39): - return=20 + return =20 # C.g:386:2: ( '(' type_name ')' cast_expression | unary_e= xpression ) alt63 =3D 2 @@ -5145,7 +5145,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("385:1: cast_exp= ression : ( '(' type_name ')' cast_expression | unary_expression );", 63, 2= 5, self.input) =20 @@ -5156,7 +5156,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("385:1: cast_express= ion : ( '(' type_name ')' cast_expression | unary_expression );", 63, 1, se= lf.input) =20 @@ -5167,7 +5167,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("385:1: cast_expression = : ( '(' type_name ')' cast_expression | unary_expression );", 63, 0, self.i= nput) =20 @@ -5177,20 +5177,20 @@ class CParser(Parser): # C.g:386:4: '(' type_name ')' cast_expression self.match(self.input, 62, self.FOLLOW_62_in_cast_expr= ession1282) if self.failed: - return=20 + return self.following.append(self.FOLLOW_type_name_in_cast_ex= pression1284) self.type_name() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_cast_expr= ession1286) if self.failed: - return=20 + return self.following.append(self.FOLLOW_cast_expression_in_c= ast_expression1288) self.cast_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt63 =3D=3D 2: @@ -5199,7 +5199,7 @@ class CParser(Parser): self.unary_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -5212,7 +5212,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end cast_expression =20 @@ -5225,7 +5225,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 40): - return=20 + return =20 # C.g:391:2: ( postfix_expression | '++' unary_expression = | '--' unary_expression | unary_operator cast_expression | 'sizeof' unary_e= xpression | 'sizeof' '(' type_name ')' ) alt64 =3D 6 @@ -5251,7 +5251,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("390:1: unary_ex= pression : ( postfix_expression | '++' unary_expression | '--' unary_expres= sion | unary_operator cast_expression | 'sizeof' unary_expression | 'sizeof= ' '(' type_name ')' );", 64, 13, self.input) =20 @@ -5262,7 +5262,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("390:1: unary_expres= sion : ( postfix_expression | '++' unary_expression | '--' unary_expression= | unary_operator cast_expression | 'sizeof' unary_expression | 'sizeof' '(= ' type_name ')' );", 64, 12, self.input) =20 @@ -5271,7 +5271,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("390:1: unary_expression= : ( postfix_expression | '++' unary_expression | '--' unary_expression | u= nary_operator cast_expression | 'sizeof' unary_expression | 'sizeof' '(' ty= pe_name ')' );", 64, 0, self.input) =20 @@ -5283,31 +5283,31 @@ class CParser(Parser): self.postfix_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt64 =3D=3D 2: # C.g:392:4: '++' unary_expression self.match(self.input, 72, self.FOLLOW_72_in_unary_exp= ression1309) if self.failed: - return=20 + return self.following.append(self.FOLLOW_unary_expression_in_= unary_expression1311) self.unary_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt64 =3D=3D 3: # C.g:393:4: '--' unary_expression self.match(self.input, 73, self.FOLLOW_73_in_unary_exp= ression1316) if self.failed: - return=20 + return self.following.append(self.FOLLOW_unary_expression_in_= unary_expression1318) self.unary_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt64 =3D=3D 4: @@ -5316,42 +5316,42 @@ class CParser(Parser): self.unary_operator() self.following.pop() if self.failed: - return=20 + return self.following.append(self.FOLLOW_cast_expression_in_u= nary_expression1325) self.cast_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt64 =3D=3D 5: # C.g:395:4: 'sizeof' unary_expression self.match(self.input, 74, self.FOLLOW_74_in_unary_exp= ression1330) if self.failed: - return=20 + return self.following.append(self.FOLLOW_unary_expression_in_= unary_expression1332) self.unary_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt64 =3D=3D 6: # C.g:396:4: 'sizeof' '(' type_name ')' self.match(self.input, 74, self.FOLLOW_74_in_unary_exp= ression1337) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_unary_exp= ression1339) if self.failed: - return=20 + return self.following.append(self.FOLLOW_type_name_in_unary_e= xpression1341) self.type_name() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_unary_exp= ression1343) if self.failed: - return=20 + return =20 =20 =20 @@ -5364,7 +5364,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end unary_expression =20 @@ -5384,13 +5384,13 @@ class CParser(Parser): c =3D None =20 =20 - =20 + self.postfix_expression_stack[-1].FuncCallText =3D '' =20 try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 41): - return=20 + return =20 # C.g:406:2: (p=3D primary_expression ( '[' expression ']'= | '(' a=3D ')' | '(' c=3D argument_expression_list b=3D ')' | '(' macro_pa= rameter_list ')' | '.' x=3D IDENTIFIER | '*' y=3D IDENTIFIER | '->' z=3D ID= ENTIFIER | '++' | '--' )* ) # C.g:406:6: p=3D primary_expression ( '[' expression ']' = | '(' a=3D ')' | '(' c=3D argument_expression_list b=3D ')' | '(' macro_par= ameter_list ')' | '.' x=3D IDENTIFIER | '*' y=3D IDENTIFIER | '->' z=3D IDE= NTIFIER | '++' | '--' )* @@ -5398,7 +5398,7 @@ class CParser(Parser): p =3D self.primary_expression() self.following.pop() if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.postfix_expression_stack[-1].FuncCallText +=3D se= lf.input.toString(p.start,p.stop) =20 @@ -5460,26 +5460,26 @@ class CParser(Parser): # C.g:407:13: '[' expression ']' self.match(self.input, 64, self.FOLLOW_64_in_postf= ix_expression1383) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_in_po= stfix_expression1385) self.expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 65, self.FOLLOW_65_in_postf= ix_expression1387) if self.failed: - return=20 + return =20 =20 elif alt65 =3D=3D 2: # C.g:408:13: '(' a=3D ')' self.match(self.input, 62, self.FOLLOW_62_in_postf= ix_expression1401) if self.failed: - return=20 + return a =3D self.input.LT(1) self.match(self.input, 63, self.FOLLOW_63_in_postf= ix_expression1405) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.StoreFunctionCalling(p.start.line, p.star= t.charPositionInLine, a.line, a.charPositionInLine, self.postfix_expression= _stack[-1].FuncCallText, '') =20 @@ -5489,16 +5489,16 @@ class CParser(Parser): # C.g:409:13: '(' c=3D argument_expression_list b= =3D ')' self.match(self.input, 62, self.FOLLOW_62_in_postf= ix_expression1420) if self.failed: - return=20 + return self.following.append(self.FOLLOW_argument_express= ion_list_in_postfix_expression1424) c =3D self.argument_expression_list() self.following.pop() if self.failed: - return=20 + return b =3D self.input.LT(1) self.match(self.input, 63, self.FOLLOW_63_in_postf= ix_expression1428) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.StoreFunctionCalling(p.start.line, p.star= t.charPositionInLine, b.line, b.charPositionInLine, self.postfix_expression= _stack[-1].FuncCallText, self.input.toString(c.start,c.stop)) =20 @@ -5508,26 +5508,26 @@ class CParser(Parser): # C.g:410:13: '(' macro_parameter_list ')' self.match(self.input, 62, self.FOLLOW_62_in_postf= ix_expression1444) if self.failed: - return=20 + return self.following.append(self.FOLLOW_macro_parameter_= list_in_postfix_expression1446) self.macro_parameter_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_postf= ix_expression1448) if self.failed: - return=20 + return =20 =20 elif alt65 =3D=3D 5: # C.g:411:13: '.' x=3D IDENTIFIER self.match(self.input, 75, self.FOLLOW_75_in_postf= ix_expression1462) if self.failed: - return=20 + return x =3D self.input.LT(1) self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_postfix_expression1466) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.postfix_expression_stack[-1].FuncCallText= +=3D '.' + x.text =20 @@ -5537,11 +5537,11 @@ class CParser(Parser): # C.g:412:13: '*' y=3D IDENTIFIER self.match(self.input, 66, self.FOLLOW_66_in_postf= ix_expression1482) if self.failed: - return=20 + return y =3D self.input.LT(1) self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_postfix_expression1486) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.postfix_expression_stack[-1].FuncCallText= =3D y.text =20 @@ -5551,11 +5551,11 @@ class CParser(Parser): # C.g:413:13: '->' z=3D IDENTIFIER self.match(self.input, 76, self.FOLLOW_76_in_postf= ix_expression1502) if self.failed: - return=20 + return z =3D self.input.LT(1) self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_postfix_expression1506) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.postfix_expression_stack[-1].FuncCallText= +=3D '->' + z.text =20 @@ -5565,14 +5565,14 @@ class CParser(Parser): # C.g:414:13: '++' self.match(self.input, 72, self.FOLLOW_72_in_postf= ix_expression1522) if self.failed: - return=20 + return =20 =20 elif alt65 =3D=3D 9: # C.g:415:13: '--' self.match(self.input, 73, self.FOLLOW_73_in_postf= ix_expression1536) if self.failed: - return=20 + return =20 =20 else: @@ -5593,7 +5593,7 @@ class CParser(Parser): self.postfix_expression_stack.pop() pass =20 - return=20 + return =20 # $ANTLR end postfix_expression =20 @@ -5606,7 +5606,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 42): - return=20 + return =20 # C.g:420:2: ( parameter_declaration ( ',' parameter_decla= ration )* ) # C.g:420:4: parameter_declaration ( ',' parameter_declara= tion )* @@ -5614,7 +5614,7 @@ class CParser(Parser): self.parameter_declaration() self.following.pop() if self.failed: - return=20 + return # C.g:420:26: ( ',' parameter_declaration )* while True: #loop66 alt66 =3D 2 @@ -5628,12 +5628,12 @@ class CParser(Parser): # C.g:420:27: ',' parameter_declaration self.match(self.input, 27, self.FOLLOW_27_in_macro= _parameter_list1562) if self.failed: - return=20 + return self.following.append(self.FOLLOW_parameter_declar= ation_in_macro_parameter_list1564) self.parameter_declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -5653,7 +5653,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end macro_parameter_list =20 @@ -5666,7 +5666,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 43): - return=20 + return =20 # C.g:424:2: ( '&' | '*' | '+' | '-' | '~' | '!' ) # C.g: @@ -5678,7 +5678,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.input) self.recoverFromMismatchedSet( @@ -5700,7 +5700,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end unary_operator =20 @@ -5811,7 +5811,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 45): - return=20 + return =20 # C.g:439:5: ( HEX_LITERAL | OCTAL_LITERAL | DECIMAL_LITER= AL | CHARACTER_LITERAL | ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+ ( IDENTIF= IER )* | FLOATING_POINT_LITERAL ) alt72 =3D 6 @@ -5831,7 +5831,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("438:1: constant : ( HEX= _LITERAL | OCTAL_LITERAL | DECIMAL_LITERAL | CHARACTER_LITERAL | ( ( IDENTI= FIER )* ( STRING_LITERAL )+ )+ ( IDENTIFIER )* | FLOATING_POINT_LITERAL );"= , 72, 0, self.input) =20 @@ -5841,28 +5841,28 @@ class CParser(Parser): # C.g:439:9: HEX_LITERAL self.match(self.input, HEX_LITERAL, self.FOLLOW_HEX_LI= TERAL_in_constant1643) if self.failed: - return=20 + return =20 =20 elif alt72 =3D=3D 2: # C.g:440:9: OCTAL_LITERAL self.match(self.input, OCTAL_LITERAL, self.FOLLOW_OCTA= L_LITERAL_in_constant1653) if self.failed: - return=20 + return =20 =20 elif alt72 =3D=3D 3: # C.g:441:9: DECIMAL_LITERAL self.match(self.input, DECIMAL_LITERAL, self.FOLLOW_DE= CIMAL_LITERAL_in_constant1663) if self.failed: - return=20 + return =20 =20 elif alt72 =3D=3D 4: # C.g:442:7: CHARACTER_LITERAL self.match(self.input, CHARACTER_LITERAL, self.FOLLOW_= CHARACTER_LITERAL_in_constant1671) if self.failed: - return=20 + return =20 =20 elif alt72 =3D=3D 5: @@ -5906,7 +5906,7 @@ class CParser(Parser): # C.g:0:0: IDENTIFIER self.match(self.input, IDENTIFIER, sel= f.FOLLOW_IDENTIFIER_in_constant1680) if self.failed: - return=20 + return =20 =20 else: @@ -5932,7 +5932,7 @@ class CParser(Parser): # C.g:0:0: STRING_LITERAL self.match(self.input, STRING_LITERAL,= self.FOLLOW_STRING_LITERAL_in_constant1683) if self.failed: - return=20 + return =20 =20 else: @@ -5941,7 +5941,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(69, self.in= put) raise eee @@ -5957,7 +5957,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(70, self.input) raise eee @@ -5978,7 +5978,7 @@ class CParser(Parser): # C.g:0:0: IDENTIFIER self.match(self.input, IDENTIFIER, self.FOLLOW= _IDENTIFIER_in_constant1688) if self.failed: - return=20 + return =20 =20 else: @@ -5991,7 +5991,7 @@ class CParser(Parser): # C.g:444:9: FLOATING_POINT_LITERAL self.match(self.input, FLOATING_POINT_LITERAL, self.FO= LLOW_FLOATING_POINT_LITERAL_in_constant1699) if self.failed: - return=20 + return =20 =20 =20 @@ -6004,7 +6004,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end constant =20 @@ -6087,7 +6087,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 47): - return=20 + return =20 # C.g:454:2: ( conditional_expression ) # C.g:454:4: conditional_expression @@ -6095,7 +6095,7 @@ class CParser(Parser): self.conditional_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -6109,7 +6109,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end constant_expression =20 @@ -6122,7 +6122,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 48): - return=20 + return =20 # C.g:458:2: ( lvalue assignment_operator assignment_expre= ssion | conditional_expression ) alt74 =3D 2 @@ -6139,7 +6139,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 13, self.input) =20 @@ -6155,7 +6155,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 14, self.input) =20 @@ -6171,7 +6171,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 15, self.input) =20 @@ -6187,7 +6187,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 16, self.input) =20 @@ -6203,7 +6203,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 17, self.input) =20 @@ -6219,7 +6219,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 18, self.input) =20 @@ -6235,7 +6235,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 19, self.input) =20 @@ -6253,7 +6253,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 21, self.input) =20 @@ -6269,7 +6269,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 22, self.input) =20 @@ -6280,7 +6280,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 1, self.input) =20 @@ -6298,7 +6298,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 44, self.input) =20 @@ -6314,7 +6314,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 45, self.input) =20 @@ -6330,7 +6330,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 46, self.input) =20 @@ -6346,7 +6346,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 47, self.input) =20 @@ -6362,7 +6362,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 48, self.input) =20 @@ -6378,7 +6378,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 49, self.input) =20 @@ -6394,7 +6394,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 50, self.input) =20 @@ -6407,7 +6407,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 2, self.input) =20 @@ -6425,7 +6425,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 73, self.input) =20 @@ -6441,7 +6441,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 74, self.input) =20 @@ -6457,7 +6457,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 75, self.input) =20 @@ -6473,7 +6473,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 76, self.input) =20 @@ -6489,7 +6489,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 77, self.input) =20 @@ -6505,7 +6505,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 78, self.input) =20 @@ -6521,7 +6521,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 79, self.input) =20 @@ -6534,7 +6534,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 3, self.input) =20 @@ -6552,7 +6552,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 102, self.input) =20 @@ -6568,7 +6568,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 103, self.input) =20 @@ -6584,7 +6584,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 104, self.input) =20 @@ -6600,7 +6600,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 105, self.input) =20 @@ -6616,7 +6616,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 106, self.input) =20 @@ -6632,7 +6632,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 107, self.input) =20 @@ -6648,7 +6648,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 108, self.input) =20 @@ -6661,7 +6661,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 4, self.input) =20 @@ -6679,7 +6679,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 131, self.input) =20 @@ -6695,7 +6695,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 132, self.input) =20 @@ -6711,7 +6711,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 133, self.input) =20 @@ -6727,7 +6727,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 134, self.input) =20 @@ -6743,7 +6743,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 135, self.input) =20 @@ -6759,7 +6759,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 136, self.input) =20 @@ -6775,7 +6775,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 137, self.input) =20 @@ -6788,7 +6788,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 5, self.input) =20 @@ -6806,7 +6806,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 160, self.input) =20 @@ -6822,7 +6822,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 161, self.input) =20 @@ -6838,7 +6838,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 162, self.input) =20 @@ -6854,7 +6854,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 163, self.input) =20 @@ -6870,7 +6870,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 164, self.input) =20 @@ -6886,7 +6886,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 165, self.input) =20 @@ -6902,7 +6902,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 166, self.input) =20 @@ -6918,7 +6918,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 167, self.input) =20 @@ -6936,7 +6936,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 189, self.input) =20 @@ -6947,7 +6947,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 6, self.input) =20 @@ -6965,7 +6965,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 191, self.input) =20 @@ -6981,7 +6981,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 192, self.input) =20 @@ -6997,7 +6997,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 193, self.input) =20 @@ -7013,7 +7013,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 194, self.input) =20 @@ -7029,7 +7029,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 195, self.input) =20 @@ -7045,7 +7045,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 196, self.input) =20 @@ -7061,7 +7061,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 197, self.input) =20 @@ -7074,7 +7074,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 7, self.input) =20 @@ -7092,7 +7092,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 220, self.input) =20 @@ -7108,7 +7108,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 221, self.input) =20 @@ -7124,7 +7124,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 222, self.input) =20 @@ -7140,7 +7140,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 223, self.input) =20 @@ -7156,7 +7156,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 224, self.input) =20 @@ -7172,7 +7172,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 225, self.input) =20 @@ -7188,7 +7188,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 226, self.input) =20 @@ -7204,7 +7204,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 227, self.input) =20 @@ -7220,7 +7220,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 228, self.input) =20 @@ -7236,7 +7236,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 229, self.input) =20 @@ -7252,7 +7252,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 230, self.input) =20 @@ -7268,7 +7268,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 231, self.input) =20 @@ -7279,7 +7279,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 8, self.input) =20 @@ -7297,7 +7297,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 244, self.input) =20 @@ -7313,7 +7313,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 245, self.input) =20 @@ -7329,7 +7329,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 246, self.input) =20 @@ -7345,7 +7345,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 247, self.input) =20 @@ -7361,7 +7361,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 248, self.input) =20 @@ -7377,7 +7377,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 249, self.input) =20 @@ -7393,7 +7393,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 250, self.input) =20 @@ -7409,7 +7409,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 251, self.input) =20 @@ -7425,7 +7425,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 252, self.input) =20 @@ -7441,7 +7441,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 253, self.input) =20 @@ -7457,7 +7457,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 254, self.input) =20 @@ -7473,7 +7473,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 255, self.input) =20 @@ -7482,7 +7482,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 9, self.input) =20 @@ -7500,7 +7500,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 256, self.input) =20 @@ -7516,7 +7516,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 257, self.input) =20 @@ -7532,7 +7532,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 258, self.input) =20 @@ -7548,7 +7548,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 259, self.input) =20 @@ -7564,7 +7564,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 260, self.input) =20 @@ -7580,7 +7580,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 261, self.input) =20 @@ -7596,7 +7596,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 262, self.input) =20 @@ -7612,7 +7612,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 263, self.input) =20 @@ -7628,7 +7628,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 264, self.input) =20 @@ -7644,7 +7644,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 265, self.input) =20 @@ -7660,7 +7660,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 266, self.input) =20 @@ -7676,7 +7676,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 267, self.input) =20 @@ -7685,7 +7685,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 10, self.input) =20 @@ -7703,7 +7703,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 268, self.input) =20 @@ -7719,7 +7719,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 269, self.input) =20 @@ -7735,7 +7735,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 270, self.input) =20 @@ -7751,7 +7751,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 271, self.input) =20 @@ -7767,7 +7767,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 272, self.input) =20 @@ -7783,7 +7783,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 273, self.input) =20 @@ -7799,7 +7799,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 274, self.input) =20 @@ -7815,7 +7815,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 275, self.input) =20 @@ -7831,7 +7831,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 276, self.input) =20 @@ -7847,7 +7847,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 277, self.input) =20 @@ -7863,7 +7863,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 278, self.input) =20 @@ -7879,7 +7879,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 279, self.input) =20 @@ -7888,7 +7888,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 11, self.input) =20 @@ -7906,7 +7906,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 280, self.input) =20 @@ -7922,7 +7922,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 281, self.input) =20 @@ -7938,7 +7938,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 282, self.input) =20 @@ -7954,7 +7954,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 283, self.input) =20 @@ -7970,7 +7970,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 284, self.input) =20 @@ -7986,7 +7986,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 285, self.input) =20 @@ -8002,7 +8002,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 286, self.input) =20 @@ -8018,7 +8018,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 287, self.input) =20 @@ -8034,7 +8034,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 288, self.input) =20 @@ -8050,7 +8050,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 289, self.input) =20 @@ -8066,7 +8066,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 290, self.input) =20 @@ -8082,7 +8082,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 291, self.input) =20 @@ -8091,7 +8091,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 12, self.input) =20 @@ -8100,7 +8100,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("457:1: assignment_expre= ssion : ( lvalue assignment_operator assignment_expression | conditional_ex= pression );", 74, 0, self.input) =20 @@ -8112,17 +8112,17 @@ class CParser(Parser): self.lvalue() self.following.pop() if self.failed: - return=20 + return self.following.append(self.FOLLOW_assignment_operator_= in_assignment_expression1746) self.assignment_operator() self.following.pop() if self.failed: - return=20 + return self.following.append(self.FOLLOW_assignment_expressio= n_in_assignment_expression1748) self.assignment_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt74 =3D=3D 2: @@ -8131,7 +8131,7 @@ class CParser(Parser): self.conditional_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -8144,7 +8144,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end assignment_expression =20 @@ -8157,7 +8157,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 49): - return=20 + return =20 # C.g:463:2: ( unary_expression ) # C.g:463:4: unary_expression @@ -8165,7 +8165,7 @@ class CParser(Parser): self.unary_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -8179,7 +8179,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end lvalue =20 @@ -8192,7 +8192,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 50): - return=20 + return =20 # C.g:467:2: ( '=3D' | '*=3D' | '/=3D' | '%=3D' | '+=3D' |= '-=3D' | '<<=3D' | '>>=3D' | '&=3D' | '^=3D' | '|=3D' ) # C.g: @@ -8204,7 +8204,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.input) self.recoverFromMismatchedSet( @@ -8226,7 +8226,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end assignment_operator =20 @@ -8242,7 +8242,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 51): - return=20 + return =20 # C.g:481:2: (e=3D logical_or_expression ( '?' expression = ':' conditional_expression )? ) # C.g:481:4: e=3D logical_or_expression ( '?' expression '= :' conditional_expression )? @@ -8250,7 +8250,7 @@ class CParser(Parser): e =3D self.logical_or_expression() self.following.pop() if self.failed: - return=20 + return # C.g:481:28: ( '?' expression ':' conditional_expression = )? alt75 =3D 2 LA75_0 =3D self.input.LA(1) @@ -8261,20 +8261,20 @@ class CParser(Parser): # C.g:481:29: '?' expression ':' conditional_expression self.match(self.input, 90, self.FOLLOW_90_in_condition= al_expression1842) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_in_condit= ional_expression1844) self.expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 47, self.FOLLOW_47_in_condition= al_expression1846) if self.failed: - return=20 + return self.following.append(self.FOLLOW_conditional_expressi= on_in_conditional_expression1848) self.conditional_expression() self.following.pop() if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start,e.stop)) =20 @@ -8294,7 +8294,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end conditional_expression =20 @@ -8377,7 +8377,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 53): - return=20 + return =20 # C.g:489:2: ( inclusive_or_expression ( '&&' inclusive_or= _expression )* ) # C.g:489:4: inclusive_or_expression ( '&&' inclusive_or_e= xpression )* @@ -8385,7 +8385,7 @@ class CParser(Parser): self.inclusive_or_expression() self.following.pop() if self.failed: - return=20 + return # C.g:489:28: ( '&&' inclusive_or_expression )* while True: #loop77 alt77 =3D 2 @@ -8399,12 +8399,12 @@ class CParser(Parser): # C.g:489:29: '&&' inclusive_or_expression self.match(self.input, 92, self.FOLLOW_92_in_logic= al_and_expression1884) if self.failed: - return=20 + return self.following.append(self.FOLLOW_inclusive_or_exp= ression_in_logical_and_expression1886) self.inclusive_or_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -8424,7 +8424,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end logical_and_expression =20 @@ -8437,7 +8437,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 54): - return=20 + return =20 # C.g:493:2: ( exclusive_or_expression ( '|' exclusive_or_= expression )* ) # C.g:493:4: exclusive_or_expression ( '|' exclusive_or_ex= pression )* @@ -8445,7 +8445,7 @@ class CParser(Parser): self.exclusive_or_expression() self.following.pop() if self.failed: - return=20 + return # C.g:493:28: ( '|' exclusive_or_expression )* while True: #loop78 alt78 =3D 2 @@ -8459,12 +8459,12 @@ class CParser(Parser): # C.g:493:29: '|' exclusive_or_expression self.match(self.input, 93, self.FOLLOW_93_in_inclu= sive_or_expression1902) if self.failed: - return=20 + return self.following.append(self.FOLLOW_exclusive_or_exp= ression_in_inclusive_or_expression1904) self.exclusive_or_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -8484,7 +8484,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end inclusive_or_expression =20 @@ -8497,7 +8497,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 55): - return=20 + return =20 # C.g:497:2: ( and_expression ( '^' and_expression )* ) # C.g:497:4: and_expression ( '^' and_expression )* @@ -8505,7 +8505,7 @@ class CParser(Parser): self.and_expression() self.following.pop() if self.failed: - return=20 + return # C.g:497:19: ( '^' and_expression )* while True: #loop79 alt79 =3D 2 @@ -8519,12 +8519,12 @@ class CParser(Parser): # C.g:497:20: '^' and_expression self.match(self.input, 94, self.FOLLOW_94_in_exclu= sive_or_expression1920) if self.failed: - return=20 + return self.following.append(self.FOLLOW_and_expression_i= n_exclusive_or_expression1922) self.and_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -8544,7 +8544,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end exclusive_or_expression =20 @@ -8557,7 +8557,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 56): - return=20 + return =20 # C.g:501:2: ( equality_expression ( '&' equality_expressi= on )* ) # C.g:501:4: equality_expression ( '&' equality_expression= )* @@ -8565,7 +8565,7 @@ class CParser(Parser): self.equality_expression() self.following.pop() if self.failed: - return=20 + return # C.g:501:24: ( '&' equality_expression )* while True: #loop80 alt80 =3D 2 @@ -8579,12 +8579,12 @@ class CParser(Parser): # C.g:501:25: '&' equality_expression self.match(self.input, 77, self.FOLLOW_77_in_and_e= xpression1938) if self.failed: - return=20 + return self.following.append(self.FOLLOW_equality_express= ion_in_and_expression1940) self.equality_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -8604,7 +8604,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end and_expression =20 @@ -8617,7 +8617,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 57): - return=20 + return =20 # C.g:504:2: ( relational_expression ( ( '=3D=3D' | '!=3D'= ) relational_expression )* ) # C.g:504:4: relational_expression ( ( '=3D=3D' | '!=3D' )= relational_expression )* @@ -8625,7 +8625,7 @@ class CParser(Parser): self.relational_expression() self.following.pop() if self.failed: - return=20 + return # C.g:504:26: ( ( '=3D=3D' | '!=3D' ) relational_expressio= n )* while True: #loop81 alt81 =3D 2 @@ -8645,7 +8645,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.inpu= t) self.recoverFromMismatchedSet( @@ -8658,7 +8658,7 @@ class CParser(Parser): self.relational_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -8678,7 +8678,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end equality_expression =20 @@ -8691,7 +8691,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 58): - return=20 + return =20 # C.g:508:2: ( shift_expression ( ( '<' | '>' | '<=3D' | '= >=3D' ) shift_expression )* ) # C.g:508:4: shift_expression ( ( '<' | '>' | '<=3D' | '>= =3D' ) shift_expression )* @@ -8699,7 +8699,7 @@ class CParser(Parser): self.shift_expression() self.following.pop() if self.failed: - return=20 + return # C.g:508:21: ( ( '<' | '>' | '<=3D' | '>=3D' ) shift_expr= ession )* while True: #loop82 alt82 =3D 2 @@ -8719,7 +8719,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.inpu= t) self.recoverFromMismatchedSet( @@ -8732,7 +8732,7 @@ class CParser(Parser): self.shift_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -8752,7 +8752,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end relational_expression =20 @@ -8765,7 +8765,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 59): - return=20 + return =20 # C.g:512:2: ( additive_expression ( ( '<<' | '>>' ) addit= ive_expression )* ) # C.g:512:4: additive_expression ( ( '<<' | '>>' ) additiv= e_expression )* @@ -8773,7 +8773,7 @@ class CParser(Parser): self.additive_expression() self.following.pop() if self.failed: - return=20 + return # C.g:512:24: ( ( '<<' | '>>' ) additive_expression )* while True: #loop83 alt83 =3D 2 @@ -8793,7 +8793,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.inpu= t) self.recoverFromMismatchedSet( @@ -8806,7 +8806,7 @@ class CParser(Parser): self.additive_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -8826,7 +8826,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end shift_expression =20 @@ -8839,7 +8839,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 60): - return=20 + return =20 # C.g:518:2: ( labeled_statement | compound_statement | ex= pression_statement | selection_statement | iteration_statement | jump_state= ment | macro_statement | asm2_statement | asm1_statement | asm_statement | = declaration ) alt84 =3D 11 @@ -8860,7 +8860,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("517:1: statemen= t : ( labeled_statement | compound_statement | expression_statement | selec= tion_statement | iteration_statement | jump_statement | macro_statement | a= sm2_statement | asm1_statement | asm_statement | declaration );", 84, 43, s= elf.input) =20 @@ -8880,7 +8880,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("517:1: statemen= t : ( labeled_statement | compound_statement | expression_statement | selec= tion_statement | iteration_statement | jump_statement | macro_statement | a= sm2_statement | asm1_statement | asm_statement | declaration );", 84, 47, s= elf.input) =20 @@ -8896,7 +8896,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("517:1: statemen= t : ( labeled_statement | compound_statement | expression_statement | selec= tion_statement | iteration_statement | jump_statement | macro_statement | a= sm2_statement | asm1_statement | asm_statement | declaration );", 84, 53, s= elf.input) =20 @@ -8912,7 +8912,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("517:1: statemen= t : ( labeled_statement | compound_statement | expression_statement | selec= tion_statement | iteration_statement | jump_statement | macro_statement | a= sm2_statement | asm1_statement | asm_statement | declaration );", 84, 68, s= elf.input) =20 @@ -8923,7 +8923,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("517:1: statement : = ( labeled_statement | compound_statement | expression_statement | selection= _statement | iteration_statement | jump_statement | macro_statement | asm2_= statement | asm1_statement | asm_statement | declaration );", 84, 1, self.i= nput) =20 @@ -8952,7 +8952,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("517:1: statement : ( la= beled_statement | compound_statement | expression_statement | selection_sta= tement | iteration_statement | jump_statement | macro_statement | asm2_stat= ement | asm1_statement | asm_statement | declaration );", 84, 0, self.input) =20 @@ -8964,7 +8964,7 @@ class CParser(Parser): self.labeled_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 2: @@ -8973,7 +8973,7 @@ class CParser(Parser): self.compound_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 3: @@ -8982,7 +8982,7 @@ class CParser(Parser): self.expression_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 4: @@ -8991,7 +8991,7 @@ class CParser(Parser): self.selection_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 5: @@ -9000,7 +9000,7 @@ class CParser(Parser): self.iteration_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 6: @@ -9009,7 +9009,7 @@ class CParser(Parser): self.jump_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 7: @@ -9018,7 +9018,7 @@ class CParser(Parser): self.macro_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 8: @@ -9027,7 +9027,7 @@ class CParser(Parser): self.asm2_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 9: @@ -9036,7 +9036,7 @@ class CParser(Parser): self.asm1_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 10: @@ -9045,7 +9045,7 @@ class CParser(Parser): self.asm_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt84 =3D=3D 11: @@ -9054,7 +9054,7 @@ class CParser(Parser): self.declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -9067,7 +9067,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end statement =20 @@ -9080,7 +9080,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 61): - return=20 + return =20 # C.g:532:2: ( ( '__asm__' )? IDENTIFIER '(' (~ ( ';' ) )*= ')' ';' ) # C.g:532:4: ( '__asm__' )? IDENTIFIER '(' (~ ( ';' ) )* '= )' ';' @@ -9094,16 +9094,16 @@ class CParser(Parser): # C.g:0:0: '__asm__' self.match(self.input, 103, self.FOLLOW_103_in_asm2_st= atement2086) if self.failed: - return=20 + return =20 =20 =20 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_asm2_statement2089) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_asm2_statemen= t2091) if self.failed: - return=20 + return # C.g:532:30: (~ ( ';' ) )* while True: #loop86 alt86 =3D 2 @@ -9130,7 +9130,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.inpu= t) self.recoverFromMismatchedSet( @@ -9147,10 +9147,10 @@ class CParser(Parser): =20 self.match(self.input, 63, self.FOLLOW_63_in_asm2_statemen= t2101) if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_asm2_statemen= t2103) if self.failed: - return=20 + return =20 =20 =20 @@ -9164,7 +9164,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end asm2_statement =20 @@ -9177,16 +9177,16 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 62): - return=20 + return =20 # C.g:536:2: ( '_asm' '{' (~ ( '}' ) )* '}' ) # C.g:536:4: '_asm' '{' (~ ( '}' ) )* '}' self.match(self.input, 104, self.FOLLOW_104_in_asm1_statem= ent2115) if self.failed: - return=20 + return self.match(self.input, 43, self.FOLLOW_43_in_asm1_statemen= t2117) if self.failed: - return=20 + return # C.g:536:15: (~ ( '}' ) )* while True: #loop87 alt87 =3D 2 @@ -9206,7 +9206,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.inpu= t) self.recoverFromMismatchedSet( @@ -9223,7 +9223,7 @@ class CParser(Parser): =20 self.match(self.input, 44, self.FOLLOW_44_in_asm1_statemen= t2127) if self.failed: - return=20 + return =20 =20 =20 @@ -9237,7 +9237,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end asm1_statement =20 @@ -9250,16 +9250,16 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 63): - return=20 + return =20 # C.g:540:2: ( '__asm' '{' (~ ( '}' ) )* '}' ) # C.g:540:4: '__asm' '{' (~ ( '}' ) )* '}' self.match(self.input, 105, self.FOLLOW_105_in_asm_stateme= nt2138) if self.failed: - return=20 + return self.match(self.input, 43, self.FOLLOW_43_in_asm_statement= 2140) if self.failed: - return=20 + return # C.g:540:16: (~ ( '}' ) )* while True: #loop88 alt88 =3D 2 @@ -9279,7 +9279,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 mse =3D MismatchedSetException(None, self.inpu= t) self.recoverFromMismatchedSet( @@ -9296,7 +9296,7 @@ class CParser(Parser): =20 self.match(self.input, 44, self.FOLLOW_44_in_asm_statement= 2150) if self.failed: - return=20 + return =20 =20 =20 @@ -9310,7 +9310,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end asm_statement =20 @@ -9323,16 +9323,16 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 64): - return=20 + return =20 # C.g:544:2: ( IDENTIFIER '(' ( declaration )* ( statement= _list )? ( expression )? ')' ) # C.g:544:4: IDENTIFIER '(' ( declaration )* ( statement_l= ist )? ( expression )? ')' self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_macro_statement2162) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_macro_stateme= nt2164) if self.failed: - return=20 + return # C.g:544:19: ( declaration )* while True: #loop89 alt89 =3D 2 @@ -11234,7 +11234,7 @@ class CParser(Parser): self.declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -12440,7 +12440,7 @@ class CParser(Parser): self.statement_list() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -12456,13 +12456,13 @@ class CParser(Parser): self.expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 self.match(self.input, 63, self.FOLLOW_63_in_macro_stateme= nt2176) if self.failed: - return=20 + return =20 =20 =20 @@ -12476,7 +12476,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end macro_statement =20 @@ -12489,7 +12489,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 65): - return=20 + return =20 # C.g:548:2: ( IDENTIFIER ':' statement | 'case' constant_= expression ':' statement | 'default' ':' statement ) alt92 =3D 3 @@ -12503,7 +12503,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("547:1: labeled_statemen= t : ( IDENTIFIER ':' statement | 'case' constant_expression ':' statement |= 'default' ':' statement );", 92, 0, self.input) =20 @@ -12513,50 +12513,50 @@ class CParser(Parser): # C.g:548:4: IDENTIFIER ':' statement self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_labeled_statement2188) if self.failed: - return=20 + return self.match(self.input, 47, self.FOLLOW_47_in_labeled_s= tatement2190) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_labeled= _statement2192) self.statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt92 =3D=3D 2: # C.g:549:4: 'case' constant_expression ':' statement self.match(self.input, 106, self.FOLLOW_106_in_labeled= _statement2197) if self.failed: - return=20 + return self.following.append(self.FOLLOW_constant_expression_= in_labeled_statement2199) self.constant_expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 47, self.FOLLOW_47_in_labeled_s= tatement2201) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_labeled= _statement2203) self.statement() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt92 =3D=3D 3: # C.g:550:4: 'default' ':' statement self.match(self.input, 107, self.FOLLOW_107_in_labeled= _statement2208) if self.failed: - return=20 + return self.match(self.input, 47, self.FOLLOW_47_in_labeled_s= tatement2210) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_labeled= _statement2212) self.statement() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -12569,7 +12569,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end labeled_statement =20 @@ -14552,7 +14552,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 67): - return=20 + return =20 # C.g:558:2: ( ( statement )+ ) # C.g:558:4: ( statement )+ @@ -16230,7 +16230,7 @@ class CParser(Parser): self.statement() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -16239,7 +16239,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(95, self.input) raise eee @@ -16260,7 +16260,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end statement_list =20 @@ -16347,7 +16347,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 69): - return=20 + return =20 # C.g:567:2: ( 'if' '(' e=3D expression ')' statement ( op= tions {k=3D1; backtrack=3Dfalse; } : 'else' statement )? | 'switch' '(' exp= ression ')' statement ) alt98 =3D 2 @@ -16360,7 +16360,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("566:1: selection_statem= ent : ( 'if' '(' e=3D expression ')' statement ( options {k=3D1; backtrack= =3Dfalse; } : 'else' statement )? | 'switch' '(' expression ')' statement )= ;", 98, 0, self.input) =20 @@ -16370,18 +16370,18 @@ class CParser(Parser): # C.g:567:4: 'if' '(' e=3D expression ')' statement ( = options {k=3D1; backtrack=3Dfalse; } : 'else' statement )? self.match(self.input, 108, self.FOLLOW_108_in_selecti= on_statement2272) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_selection= _statement2274) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_in_select= ion_statement2278) e =3D self.expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_selection= _statement2280) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start,e.stop)) =20 @@ -16389,7 +16389,7 @@ class CParser(Parser): self.statement() self.following.pop() if self.failed: - return=20 + return # C.g:567:167: ( options {k=3D1; backtrack=3Dfalse; } = : 'else' statement )? alt97 =3D 2 LA97_0 =3D self.input.LA(1) @@ -16400,12 +16400,12 @@ class CParser(Parser): # C.g:567:200: 'else' statement self.match(self.input, 109, self.FOLLOW_109_in_sel= ection_statement2299) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_sel= ection_statement2301) self.statement() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -16415,23 +16415,23 @@ class CParser(Parser): # C.g:568:4: 'switch' '(' expression ')' statement self.match(self.input, 110, self.FOLLOW_110_in_selecti= on_statement2308) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_selection= _statement2310) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_in_select= ion_statement2312) self.expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_selection= _statement2314) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_selecti= on_statement2316) self.statement() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -16444,7 +16444,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end selection_statement =20 @@ -16460,7 +16460,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 70): - return=20 + return =20 # C.g:572:2: ( 'while' '(' e=3D expression ')' statement |= 'do' statement 'while' '(' e=3D expression ')' ';' | 'for' '(' expression_= statement e=3D expression_statement ( expression )? ')' statement ) alt100 =3D 3 @@ -16474,7 +16474,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("571:1: iteration_statem= ent : ( 'while' '(' e=3D expression ')' statement | 'do' statement 'while' = '(' e=3D expression ')' ';' | 'for' '(' expression_statement e=3D expressio= n_statement ( expression )? ')' statement );", 100, 0, self.input) =20 @@ -16484,23 +16484,23 @@ class CParser(Parser): # C.g:572:4: 'while' '(' e=3D expression ')' statement self.match(self.input, 111, self.FOLLOW_111_in_iterati= on_statement2327) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_iteration= _statement2329) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_in_iterat= ion_statement2333) e =3D self.expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_iteration= _statement2335) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_iterati= on_statement2337) self.statement() self.following.pop() if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start,e.stop)) =20 @@ -16510,29 +16510,29 @@ class CParser(Parser): # C.g:573:4: 'do' statement 'while' '(' e=3D expressio= n ')' ';' self.match(self.input, 112, self.FOLLOW_112_in_iterati= on_statement2344) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_iterati= on_statement2346) self.statement() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 111, self.FOLLOW_111_in_iterati= on_statement2348) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_iteration= _statement2350) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_in_iterat= ion_statement2354) e =3D self.expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_iteration= _statement2356) if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_iteration= _statement2358) if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start,e.stop)) =20 @@ -16542,20 +16542,20 @@ class CParser(Parser): # C.g:574:4: 'for' '(' expression_statement e=3D expre= ssion_statement ( expression )? ')' statement self.match(self.input, 113, self.FOLLOW_113_in_iterati= on_statement2365) if self.failed: - return=20 + return self.match(self.input, 62, self.FOLLOW_62_in_iteration= _statement2367) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_statement= _in_iteration_statement2369) self.expression_statement() self.following.pop() if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_statement= _in_iteration_statement2373) e =3D self.expression_statement() self.following.pop() if self.failed: - return=20 + return # C.g:574:58: ( expression )? alt99 =3D 2 LA99_0 =3D self.input.LA(1) @@ -16568,18 +16568,18 @@ class CParser(Parser): self.expression() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 self.match(self.input, 63, self.FOLLOW_63_in_iteration= _statement2378) if self.failed: - return=20 + return self.following.append(self.FOLLOW_statement_in_iterati= on_statement2380) self.statement() self.following.pop() if self.failed: - return=20 + return if self.backtracking =3D=3D 0: self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start,e.stop)) =20 @@ -16595,7 +16595,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end iteration_statement =20 @@ -16608,7 +16608,7 @@ class CParser(Parser): try: try: if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 71): - return=20 + return =20 # C.g:578:2: ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'b= reak' ';' | 'return' ';' | 'return' expression ';' ) alt101 =3D 5 @@ -16629,7 +16629,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("577:1: jump_stateme= nt : ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' = | 'return' expression ';' );", 101, 4, self.input) =20 @@ -16638,7 +16638,7 @@ class CParser(Parser): else: if self.backtracking > 0: self.failed =3D True - return=20 + return =20 nvae =3D NoViableAltException("577:1: jump_statement := ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' | 'r= eturn' expression ';' );", 101, 0, self.input) =20 @@ -16648,58 +16648,58 @@ class CParser(Parser): # C.g:578:4: 'goto' IDENTIFIER ';' self.match(self.input, 114, self.FOLLOW_114_in_jump_st= atement2393) if self.failed: - return=20 + return self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_jump_statement2395) if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2397) if self.failed: - return=20 + return =20 =20 elif alt101 =3D=3D 2: # C.g:579:4: 'continue' ';' self.match(self.input, 115, self.FOLLOW_115_in_jump_st= atement2402) if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2404) if self.failed: - return=20 + return =20 =20 elif alt101 =3D=3D 3: # C.g:580:4: 'break' ';' self.match(self.input, 116, self.FOLLOW_116_in_jump_st= atement2409) if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2411) if self.failed: - return=20 + return =20 =20 elif alt101 =3D=3D 4: # C.g:581:4: 'return' ';' self.match(self.input, 117, self.FOLLOW_117_in_jump_st= atement2416) if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2418) if self.failed: - return=20 + return =20 =20 elif alt101 =3D=3D 5: # C.g:582:4: 'return' expression ';' self.match(self.input, 117, self.FOLLOW_117_in_jump_st= atement2423) if self.failed: - return=20 + return self.following.append(self.FOLLOW_expression_in_jump_s= tatement2425) self.expression() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2427) if self.failed: - return=20 + return =20 =20 =20 @@ -16712,7 +16712,7 @@ class CParser(Parser): =20 pass =20 - return=20 + return =20 # $ANTLR end jump_statement =20 @@ -16724,7 +16724,7 @@ class CParser(Parser): self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred2 @@ -16855,7 +16855,7 @@ class CParser(Parser): self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -16863,7 +16863,7 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return # C.g:119:41: ( declaration )* while True: #loop103 alt103 =3D 2 @@ -16879,7 +16879,7 @@ class CParser(Parser): self.declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -16888,7 +16888,7 @@ class CParser(Parser): =20 self.match(self.input, 43, self.FOLLOW_43_in_synpred4108) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred4 @@ -16903,7 +16903,7 @@ class CParser(Parser): self.declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred5 @@ -16918,7 +16918,7 @@ class CParser(Parser): self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred7 @@ -16933,7 +16933,7 @@ class CParser(Parser): self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred10 @@ -16948,7 +16948,7 @@ class CParser(Parser): self.type_specifier() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred14 @@ -16963,7 +16963,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred15 @@ -16978,7 +16978,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred33 @@ -16991,7 +16991,7 @@ class CParser(Parser): # C.g:225:5: IDENTIFIER ( type_qualifier )* declarator self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_synpr= ed34442) if self.failed: - return=20 + return # C.g:225:16: ( type_qualifier )* while True: #loop106 alt106 =3D 2 @@ -17026,7 +17026,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -17037,7 +17037,7 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred34 @@ -17052,7 +17052,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred39 @@ -17067,7 +17067,7 @@ class CParser(Parser): self.type_specifier() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred40 @@ -17090,7 +17090,7 @@ class CParser(Parser): self.pointer() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -17104,7 +17104,7 @@ class CParser(Parser): # C.g:297:14: 'EFIAPI' self.match(self.input, 58, self.FOLLOW_58_in_synpred66788) if self.failed: - return=20 + return =20 =20 =20 @@ -17118,7 +17118,7 @@ class CParser(Parser): # C.g:297:26: 'EFI_BOOTSERVICE' self.match(self.input, 59, self.FOLLOW_59_in_synpred66793) if self.failed: - return=20 + return =20 =20 =20 @@ -17132,7 +17132,7 @@ class CParser(Parser): # C.g:297:47: 'EFI_RUNTIMESERVICE' self.match(self.input, 60, self.FOLLOW_60_in_synpred66798) if self.failed: - return=20 + return =20 =20 =20 @@ -17140,7 +17140,7 @@ class CParser(Parser): self.direct_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred66 @@ -17155,7 +17155,7 @@ class CParser(Parser): self.declarator_suffix() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred67 @@ -17168,7 +17168,7 @@ class CParser(Parser): # C.g:304:9: 'EFIAPI' self.match(self.input, 58, self.FOLLOW_58_in_synpred69830) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred69 @@ -17183,7 +17183,7 @@ class CParser(Parser): self.declarator_suffix() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred70 @@ -17196,15 +17196,15 @@ class CParser(Parser): # C.g:310:9: '(' parameter_type_list ')' self.match(self.input, 62, self.FOLLOW_62_in_synpred73878) if self.failed: - return=20 + return self.following.append(self.FOLLOW_parameter_type_list_in_synpred73= 880) self.parameter_type_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_synpred73882) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred73 @@ -17217,15 +17217,15 @@ class CParser(Parser): # C.g:311:9: '(' identifier_list ')' self.match(self.input, 62, self.FOLLOW_62_in_synpred74892) if self.failed: - return=20 + return self.following.append(self.FOLLOW_identifier_list_in_synpred74894) self.identifier_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_synpred74896) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred74 @@ -17240,7 +17240,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred75 @@ -17255,7 +17255,7 @@ class CParser(Parser): self.pointer() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred76 @@ -17268,7 +17268,7 @@ class CParser(Parser): # C.g:316:4: '*' ( type_qualifier )+ ( pointer )? self.match(self.input, 66, self.FOLLOW_66_in_synpred77919) if self.failed: - return=20 + return # C.g:316:8: ( type_qualifier )+ cnt116 =3D 0 while True: #loop116 @@ -17285,7 +17285,7 @@ class CParser(Parser): self.type_qualifier() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -17294,7 +17294,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(116, self.input) raise eee @@ -17314,7 +17314,7 @@ class CParser(Parser): self.pointer() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -17330,12 +17330,12 @@ class CParser(Parser): # C.g:317:4: '*' pointer self.match(self.input, 66, self.FOLLOW_66_in_synpred78930) if self.failed: - return=20 + return self.following.append(self.FOLLOW_pointer_in_synpred78932) self.pointer() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred78 @@ -17348,7 +17348,7 @@ class CParser(Parser): # C.g:326:32: 'OPTIONAL' self.match(self.input, 53, self.FOLLOW_53_in_synpred81977) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred81 @@ -17361,7 +17361,7 @@ class CParser(Parser): # C.g:326:27: ',' ( 'OPTIONAL' )? parameter_declaration self.match(self.input, 27, self.FOLLOW_27_in_synpred82974) if self.failed: - return=20 + return # C.g:326:31: ( 'OPTIONAL' )? alt119 =3D 2 LA119_0 =3D self.input.LA(1) @@ -17375,7 +17375,7 @@ class CParser(Parser): # C.g:326:32: 'OPTIONAL' self.match(self.input, 53, self.FOLLOW_53_in_synpred82977) if self.failed: - return=20 + return =20 =20 =20 @@ -17383,7 +17383,7 @@ class CParser(Parser): self.parameter_declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred82 @@ -17398,7 +17398,7 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred83 @@ -17413,7 +17413,7 @@ class CParser(Parser): self.abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred84 @@ -17428,7 +17428,7 @@ class CParser(Parser): self.declaration_specifiers() self.following.pop() if self.failed: - return=20 + return # C.g:330:27: ( declarator | abstract_declarator )* while True: #loop120 alt120 =3D 3 @@ -17512,7 +17512,7 @@ class CParser(Parser): self.declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 elif alt120 =3D=3D 2: @@ -17521,7 +17521,7 @@ class CParser(Parser): self.abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 else: @@ -17538,7 +17538,7 @@ class CParser(Parser): # C.g:330:62: 'OPTIONAL' self.match(self.input, 53, self.FOLLOW_53_in_synpred861004) if self.failed: - return=20 + return =20 =20 =20 @@ -17556,7 +17556,7 @@ class CParser(Parser): self.specifier_qualifier_list() self.following.pop() if self.failed: - return=20 + return # C.g:341:29: ( abstract_declarator )? alt122 =3D 2 LA122_0 =3D self.input.LA(1) @@ -17569,7 +17569,7 @@ class CParser(Parser): self.abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 =20 @@ -17587,7 +17587,7 @@ class CParser(Parser): self.direct_abstract_declarator() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred91 @@ -17600,15 +17600,15 @@ class CParser(Parser): # C.g:351:6: '(' abstract_declarator ')' self.match(self.input, 62, self.FOLLOW_62_in_synpred931086) if self.failed: - return=20 + return self.following.append(self.FOLLOW_abstract_declarator_in_synpred93= 1088) self.abstract_declarator() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_synpred931090) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred93 @@ -17623,7 +17623,7 @@ class CParser(Parser): self.abstract_declarator_suffix() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred94 @@ -17636,20 +17636,20 @@ class CParser(Parser): # C.g:386:4: '(' type_name ')' cast_expression self.match(self.input, 62, self.FOLLOW_62_in_synpred1091282) if self.failed: - return=20 + return self.following.append(self.FOLLOW_type_name_in_synpred1091284) self.type_name() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_synpred1091286) if self.failed: - return=20 + return self.following.append(self.FOLLOW_cast_expression_in_synpred109128= 8) self.cast_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred109 @@ -17662,12 +17662,12 @@ class CParser(Parser): # C.g:395:4: 'sizeof' unary_expression self.match(self.input, 74, self.FOLLOW_74_in_synpred1141330) if self.failed: - return=20 + return self.following.append(self.FOLLOW_unary_expression_in_synpred11413= 32) self.unary_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred114 @@ -17680,15 +17680,15 @@ class CParser(Parser): # C.g:409:13: '(' argument_expression_list ')' self.match(self.input, 62, self.FOLLOW_62_in_synpred1171420) if self.failed: - return=20 + return self.following.append(self.FOLLOW_argument_expression_list_in_synp= red1171424) self.argument_expression_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_synpred1171428) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred117 @@ -17701,15 +17701,15 @@ class CParser(Parser): # C.g:410:13: '(' macro_parameter_list ')' self.match(self.input, 62, self.FOLLOW_62_in_synpred1181444) if self.failed: - return=20 + return self.following.append(self.FOLLOW_macro_parameter_list_in_synpred1= 181446) self.macro_parameter_list() self.following.pop() if self.failed: - return=20 + return self.match(self.input, 63, self.FOLLOW_63_in_synpred1181448) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred118 @@ -17722,10 +17722,10 @@ class CParser(Parser): # C.g:412:13: '*' IDENTIFIER self.match(self.input, 66, self.FOLLOW_66_in_synpred1201482) if self.failed: - return=20 + return self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_synpr= ed1201486) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred120 @@ -17738,7 +17738,7 @@ class CParser(Parser): # C.g:443:20: STRING_LITERAL self.match(self.input, STRING_LITERAL, self.FOLLOW_STRING_LITERAL_= in_synpred1371683) if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred137 @@ -17762,7 +17762,7 @@ class CParser(Parser): # C.g:0:0: IDENTIFIER self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_synpred1381680) if self.failed: - return=20 + return =20 =20 else: @@ -17783,7 +17783,7 @@ class CParser(Parser): # C.g:0:0: STRING_LITERAL self.match(self.input, STRING_LITERAL, self.FOLLOW_STRING_= LITERAL_in_synpred1381683) if self.failed: - return=20 + return =20 =20 else: @@ -17792,7 +17792,7 @@ class CParser(Parser): =20 if self.backtracking > 0: self.failed =3D True - return=20 + return =20 eee =3D EarlyExitException(126, self.input) raise eee @@ -17814,17 +17814,17 @@ class CParser(Parser): self.lvalue() self.following.pop() if self.failed: - return=20 + return self.following.append(self.FOLLOW_assignment_operator_in_synpred14= 21746) self.assignment_operator() self.following.pop() if self.failed: - return=20 + return self.following.append(self.FOLLOW_assignment_expression_in_synpred= 1421748) self.assignment_expression() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred142 @@ -17839,7 +17839,7 @@ class CParser(Parser): self.expression_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred169 @@ -17854,7 +17854,7 @@ class CParser(Parser): self.macro_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred173 @@ -17869,7 +17869,7 @@ class CParser(Parser): self.asm2_statement() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred174 @@ -17884,7 +17884,7 @@ class CParser(Parser): self.declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred181 @@ -17899,7 +17899,7 @@ class CParser(Parser): self.statement_list() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred182 @@ -17914,7 +17914,7 @@ class CParser(Parser): self.declaration() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred186 @@ -17929,7 +17929,7 @@ class CParser(Parser): self.statement() self.following.pop() if self.failed: - return=20 + return =20 =20 # $ANTLR end synpred188 @@ -18388,7 +18388,7 @@ class CParser(Parser): =20 =20 =20 -=20 + =20 FOLLOW_external_declaration_in_translation_unit74 =3D frozenset([1, 4,= 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49= , 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66]) FOLLOW_function_definition_in_external_declaration113 =3D frozenset([1= ]) diff --git a/BaseTools/Source/Python/Eot/Eot.py b/BaseTools/Source/Python/E= ot/Eot.py index fcde8fd3e22f..712fb3cd17c9 100644 --- a/BaseTools/Source/Python/Eot/Eot.py +++ b/BaseTools/Source/Python/Eot/Eot.py @@ -51,7 +51,7 @@ class MultipleFv(FirmwareVolume): Fv.frombuffer(Buf, 0, len(Buf)) =20 self.BasicInfo.append([Fv.Name, Fv.FileSystemGuid, Fv.Size]) - self.FfsDict.append(Fv.FfsDict) =20 + self.FfsDict.append(Fv.FfsDict) =20 ## Class Eot # @@ -82,7 +82,7 @@ class Eot(object): self.FvFileList =3D FvFileList self.MapFileList =3D MapFileList self.Dispatch =3D Dispatch - =20 + # Check workspace environment if "EFI_SOURCE" not in os.environ: if "EDK_SOURCE" not in os.environ: @@ -122,13 +122,13 @@ class Eot(object): if not os.path.isfile(MapFile): EdkLogger.error("Eot", EdkLogger.EOT_ERROR, "Can not f= ind file %s " % MapFile) EotGlobalData.gMAP_FILE.append(MapFile) - =20 + # Generate source file list self.GenerateSourceFileList(self.SourceFileList, self.IncludeDirLi= st) =20 # Generate guid list of dec file list self.ParseDecFile(self.DecFileList) - =20 + # Generate guid list from GUID list file self.ParseGuidList(self.GuidList) =20 @@ -188,7 +188,7 @@ class Eot(object): if len(list) =3D=3D 2: EotGlobalData.gGuidDict[list[0].strip()] =3D G= uidStructureStringToGuidString(list[1].strip()) =20 - =20 + ## ParseGuidList() method # # Parse Guid list and get all GUID names with GUID values as {GuidNam= e : GuidValue} @@ -203,7 +203,7 @@ class Eot(object): for Line in open(Path): (GuidName, GuidValue) =3D Line.split() EotGlobalData.gGuidDict[GuidName] =3D GuidValue - =20 + ## ConvertLogFile() method # # Parse a real running log file to get real dispatch order @@ -557,7 +557,7 @@ class Eot(object): =20 if Options.FvFileList: self.FvFileList =3D Options.FvFileList -=20 + if Options.MapFileList: self.MapFileList =3D Options.FvMapFileList =20 @@ -569,7 +569,7 @@ class Eot(object): =20 if Options.DecFileList: self.DecFileList =3D Options.DecFileList - =20 + if Options.GuidList: self.GuidList =3D Options.GuidList =20 diff --git a/BaseTools/Source/Python/Eot/Report.py b/BaseTools/Source/Pytho= n/Eot/Report.py index 7435b4d7c930..d631c036bad0 100644 --- a/BaseTools/Source/Python/Eot/Report.py +++ b/BaseTools/Source/Python/Eot/Report.py @@ -276,13 +276,13 @@ class Report(object): """ % (self= .FfsIndex, self.FfsIndex, self.FfsIndex, FfsPath, FfsName, FfsGuid, FfsOffs= et, FfsType, self.FfsIndex) - =20 + if self.DispatchList: if FfsObj.Type in [0x04, 0x06]: self.DispatchList.write("%s %s %s %s\n" % (FfsGuid, "P= ", FfsName, FfsPath)) if FfsObj.Type in [0x05, 0x07, 0x08, 0x0A]: self.DispatchList.write("%s %s %s %s\n" % (FfsGuid, "D= ", FfsName, FfsPath)) - =20 + self.WriteLn(Content) =20 EotGlobalData.gOP_DISPATCH_ORDER.write('%s\n' %FfsName) diff --git a/BaseTools/Source/Python/GenFds/Capsule.py b/BaseTools/Source/P= ython/GenFds/Capsule.py index fbd48f3c6d76..e2c8e388c50b 100644 --- a/BaseTools/Source/Python/GenFds/Capsule.py +++ b/BaseTools/Source/Python/GenFds/Capsule.py @@ -205,7 +205,7 @@ class Capsule (CapsuleClassObject) : return GenFds.ImageBinDict[self.UiCapsuleName.upper() + 'cap'] =20 GenFdsGlobalVariable.InfLogger( "\nGenerate %s Capsule" %self.UiCa= psuleName) - if ('CAPSULE_GUID' in self.TokensDict and=20 + if ('CAPSULE_GUID' in self.TokensDict and uuid.UUID(self.TokensDict['CAPSULE_GUID']) =3D=3D uuid.UUID('6= DCBD5ED-E82D-4C44-BDA1-7194199AD92A')): return self.GenFmpCapsule() =20 diff --git a/BaseTools/Source/Python/GenFds/CapsuleData.py b/BaseTools/Sour= ce/Python/GenFds/CapsuleData.py index b376d6b2e9be..9766a2c984a1 100644 --- a/BaseTools/Source/Python/GenFds/CapsuleData.py +++ b/BaseTools/Source/Python/GenFds/CapsuleData.py @@ -32,13 +32,13 @@ class CapsuleData: # @param self The object pointer def __init__(self): pass - =20 + ## generate capsule data # # @param self The object pointer def GenCapsuleSubItem(self): pass - =20 + ## FFS class for capsule data # # @@ -119,7 +119,7 @@ class CapsuleFd (CapsuleData): else: FdFile =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FdN= ame) return FdFile - =20 + ## AnyFile class for capsule data # # @@ -139,7 +139,7 @@ class CapsuleAnyFile (CapsuleData): # def GenCapsuleSubItem(self): return self.FileName - =20 + ## Afile class for capsule data # # @@ -208,11 +208,11 @@ class CapsulePayload(CapsuleData): Guid =3D self.ImageTypeId.split('-') Buffer =3D pack('=3DILHHBBBBBBBBBBBBIIQ', int(self.Version,16), - int(Guid[0], 16),=20 - int(Guid[1], 16),=20 - int(Guid[2], 16),=20 - int(Guid[3][-4:-2], 16),=20 - int(Guid[3][-2:], 16), =20 + int(Guid[0], 16), + int(Guid[1], 16), + int(Guid[2], 16), + int(Guid[3][-4:-2], 16), + int(Guid[3][-2:], 16), int(Guid[4][-12:-10], 16), int(Guid[4][-10:-8], 16), int(Guid[4][-8:-6], 16), diff --git a/BaseTools/Source/Python/GenFds/EfiSection.py b/BaseTools/Sourc= e/Python/GenFds/EfiSection.py index 5bb1ae6f664c..635070365b06 100644 --- a/BaseTools/Source/Python/GenFds/EfiSection.py +++ b/BaseTools/Source/Python/GenFds/EfiSection.py @@ -54,7 +54,7 @@ class EfiSection (EfiSectionClassObject): # @retval tuple (Generated file name list, section alignment) # def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, Ff= sInf =3D None, Dict =3D {}, IsMakefile =3D False) : - =20 + if self.FileName is not None and self.FileName.startswith('PCD('): self.FileName =3D GenFdsGlobalVariable.GetPcdValue(self.FileNa= me) """Prepare the parameter of GenSection""" @@ -154,7 +154,7 @@ class EfiSection (EfiSectionClassObject): BuildNumTuple =3D tuple() BuildNumString =3D ' ' + ' '.join(BuildNumTuple) =20 - #if VerString =3D=3D '' and=20 + #if VerString =3D=3D '' and if BuildNumString =3D=3D '': if self.Optional =3D=3D True : GenFdsGlobalVariable.VerboseLogger( "Optional Sect= ion don't exist!") @@ -239,7 +239,7 @@ class EfiSection (EfiSectionClassObject): Num =3D '%s.%d' %(SecNum , Index) OutputFile =3D os.path.join( OutputPath, ModuleName + = 'SEC' + Num + Ffs.SectionSuffix.get(SectionType)) File =3D GenFdsGlobalVariable.MacroExtend(File, Dict) - =20 + #Get PE Section alignment when align is set to AUTO if self.Alignment =3D=3D 'Auto' and (SectionType =3D= =3D 'PE32' or SectionType =3D=3D 'TE'): ImageObj =3D PeImageClass (File) @@ -283,7 +283,7 @@ class EfiSection (EfiSectionClassObject): IsMakefile =3D IsMakefile ) File =3D StrippedFile - =20 + """For TE Section call GenFw to generate TE image""" =20 if SectionType =3D=3D 'TE': diff --git a/BaseTools/Source/Python/GenFds/Fd.py b/BaseTools/Source/Python= /GenFds/Fd.py index cc4124ad902e..3a90a72157e5 100644 --- a/BaseTools/Source/Python/GenFds/Fd.py +++ b/BaseTools/Source/Python/GenFds/Fd.py @@ -102,7 +102,7 @@ class FD(FDClassObject): pass GenFdsGlobalVariable.VerboseLogger('Call each region\'s Ad= dToBuffer function') RegionObj.AddToBuffer (TempFdBuffer, self.BaseAddress, sel= f.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDict, = self.DefineVarDict) - =20 + FdBuffer =3D StringIO.StringIO('') PreviousRegionStart =3D -1 PreviousRegionSize =3D 1 diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source= /Python/GenFds/FdfParser.py index 80ff3ece43b4..29da68e14ff8 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -172,7 +172,7 @@ class IncludeFileProfile : self.InsertAdjust =3D 0 self.IncludeFileList =3D [] self.Level =3D 1 # first level include file - =20 + def GetTotalLines(self): TotalLines =3D self.InsertAdjust + len(self.FileLinesList) =20 @@ -190,7 +190,7 @@ class IncludeFileProfile : def GetLineInFile(self, Line): if not self.IsLineInFile (Line): return (self.FileName, -1) - =20 + InsertedLines =3D self.InsertStartLineNumber =20 for Profile in self.IncludeFileList: @@ -232,7 +232,7 @@ class FileProfile : # ECC will use this Dict and List information self.PcdFileLineDict =3D {} self.InfFileLineList =3D [] - =20 + self.FdDict =3D {} self.FdNameNotSet =3D False self.FvDict =3D {} @@ -338,11 +338,11 @@ class FdfParser: # # @param self The object pointer # @param DestLine Optional new destination line number. - # @param DestOffset Optional new destination offset. =20 + # @param DestOffset Optional new destination offset. # - def Rewind(self, DestLine =3D 1, DestOffset =3D 0): =20 - self.CurrentLineNumber =3D DestLine =20 - self.CurrentOffsetWithinLine =3D DestOffset =20 + def Rewind(self, DestLine =3D 1, DestOffset =3D 0): + self.CurrentLineNumber =3D DestLine + self.CurrentOffsetWithinLine =3D DestOffset =20 ## __UndoOneChar() method # @@ -458,7 +458,7 @@ class FdfParser: if MacroName.startswith('!'): NotFlag =3D True MacroName =3D MacroName[1:].strip() - =20 + if not MacroName.startswith('$(') or not MacroName.endswith(')'): raise Warning("Macro name expected(Please use '$(%(Token)s)' i= f '%(Token)s' is a macro.)" % {"Token" : MacroName}, self.FileName, self.CurrentLineNumber) @@ -663,7 +663,7 @@ class FdfParser: IncludedFile1 =3D PathClass(IncludedFile, GlobalDa= ta.gWorkspace) ErrorCode =3D IncludedFile1.Validate()[0] if ErrorCode !=3D 0: - raise Warning("The include file does not exist= under below directories: \n%s\n%s\n%s\n"%(os.path.dirname(self.FileName), = PlatformDir, GlobalData.gWorkspace),=20 + raise Warning("The include file does not exist= under below directories: \n%s\n%s\n%s\n"%(os.path.dirname(self.FileName), = PlatformDir, GlobalData.gWorkspace), self.FileName, self.CurrentLineN= umber) =20 if not IsValidInclude (IncludedFile1.Path, self.CurrentLin= eNumber): @@ -706,18 +706,18 @@ class FdfParser: Processed =3D False # Preprocess done. self.Rewind() - =20 + @staticmethod def __GetIfListCurrentItemStat(IfList): if len(IfList) =3D=3D 0: return True - =20 + for Item in IfList: if Item[1] =3D=3D False: return False - =20 + return True - =20 + ## PreprocessConditionalStatement() method # # Preprocess conditional statement. @@ -777,7 +777,7 @@ class FdfParser: Macro =3D self.__Token if not self.__IsToken( "=3D"): raise Warning("expected '=3D'", self.FileName, sel= f.CurrentLineNumber) - =20 + Value =3D self.__GetExpression() self.__SetMacroValue(Macro, Value) self.__WipeOffArea.append(((DefineLine, DefineOffset),= (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1))) @@ -807,7 +807,7 @@ class FdfParser: =20 CondLabel =3D self.__Token Expression =3D self.__GetExpression() - =20 + if CondLabel =3D=3D '!if': ConditionSatisfied =3D self.__EvaluateConditional(Expr= ession, IfList[-1][0][0] + 1, 'eval') else: @@ -818,7 +818,7 @@ class FdfParser: BranchDetermined =3D ConditionSatisfied IfList[-1] =3D [IfList[-1][0], ConditionSatisfied, BranchD= etermined] if ConditionSatisfied: - self.__WipeOffArea.append((IfList[-1][0], (self.Curren= tLineNumber - 1, self.CurrentOffsetWithinLine - 1))) =20 + self.__WipeOffArea.append((IfList[-1][0], (self.Curren= tLineNumber - 1, self.CurrentOffsetWithinLine - 1))) elif self.__Token in ('!elseif', '!else'): ElseStartPos =3D (self.CurrentLineNumber - 1, self.Current= OffsetWithinLine - len(self.__Token)) if len(IfList) <=3D 0: @@ -890,7 +890,7 @@ class FdfParser: ScopeMacro =3D self.__MacroDict[TAB_COMMON, TAB_COMMON, TAB_CO= MMON] if ScopeMacro: MacroDict.update(ScopeMacro) - =20 + # Section macro ScopeMacro =3D self.__MacroDict[ self.__CurSection[0], @@ -923,12 +923,12 @@ class FdfParser: else: return ValueExpression(Expression, MacroPcdDict)() except WrnExpression, Excpt: - #=20 + # # Catch expression evaluation warning here. We need to rep= ort # the precise number of line and return the evaluation res= ult # EdkLogger.warn('Parser', "Suspicious expression: %s" % str= (Excpt), - File=3Dself.FileName, ExtraData=3Dself.__C= urrentLine(),=20 + File=3Dself.FileName, ExtraData=3Dself.__C= urrentLine(), Line=3DLine) return Excpt.result except Exception, Excpt: @@ -947,7 +947,7 @@ class FdfParser: raise Warning(str(Excpt), *FileLineTuple) else: if Expression.startswith('$(') and Expression[-1] =3D=3D ')': - Expression =3D Expression[2:-1] =20 + Expression =3D Expression[2:-1] return Expression in MacroPcdDict =20 ## __IsToken() method @@ -1431,9 +1431,9 @@ class FdfParser: self.__UndoToken() self.__GetSetStatement(None) continue - =20 + Macro =3D self.__Token - =20 + if not self.__IsToken("=3D"): raise Warning("expected '=3D'", self.FileName, self.Curren= tLineNumber) if not self.__GetNextToken() or self.__Token.startswith('['): @@ -1480,7 +1480,7 @@ class FdfParser: else: raise Warning("expected FdName in [FD.] section", self.Fil= eName, self.CurrentLineNumber) self.CurrentFdName =3D FdName.upper() - =20 + if self.CurrentFdName in self.Profile.FdDict: raise Warning("Unexpected the same FD name", self.FileName, se= lf.CurrentLineNumber) =20 @@ -1566,12 +1566,12 @@ class FdfParser: if self.__IsKeyword( "BaseAddress"): if not self.__IsToken( "=3D"): raise Warning("expected '=3D'", self.FileName, self.Curren= tLineNumber) - =20 + if not self.__GetNextHexNumber(): raise Warning("expected Hex base address", self.FileName, = self.CurrentLineNumber) - =20 + Obj.BaseAddress =3D self.__Token - =20 + if self.__IsToken( "|"): pcdPair =3D self.__GetNextPcdName() Obj.BaseAddressPcd =3D pcdPair @@ -1583,7 +1583,7 @@ class FdfParser: if self.__IsKeyword( "Size"): if not self.__IsToken( "=3D"): raise Warning("expected '=3D'", self.FileName, self.Curren= tLineNumber) - =20 + if not self.__GetNextHexNumber(): raise Warning("expected Hex size", self.FileName, self.Cur= rentLineNumber) =20 @@ -1600,13 +1600,13 @@ class FdfParser: if self.__IsKeyword( "ErasePolarity"): if not self.__IsToken( "=3D"): raise Warning("expected '=3D'", self.FileName, self.Curren= tLineNumber) - =20 + if not self.__GetNextToken(): raise Warning("expected Erase Polarity", self.FileName, se= lf.CurrentLineNumber) - =20 + if self.__Token !=3D "1" and self.__Token !=3D "0": raise Warning("expected 1 or 0 Erase Polarity", self.FileN= ame, self.CurrentLineNumber) - =20 + Obj.ErasePolarity =3D self.__Token return True =20 @@ -1654,7 +1654,7 @@ class FdfParser: IsBlock =3D False while self.__GetBlockStatement(Obj): IsBlock =3D True - =20 + Item =3D Obj.BlockSizeList[-1] if Item[0] is None or Item[1] is None: raise Warning("expected block statement", self.FileName, s= elf.CurrentLineNumber) @@ -1823,7 +1823,7 @@ class FdfParser: # @retval False Not able to find # def __GetRegionLayout(self, Fd): - Offset =3D self.__CalcRegionExpr()=20 + Offset =3D self.__CalcRegionExpr() if Offset is None: return False =20 @@ -2139,9 +2139,9 @@ class FdfParser: while True: self.__GetSetStatements(FvObj) =20 - if not (self.__GetBlockStatement(FvObj) or self.__GetFvBaseAdd= ress(FvObj) or=20 - self.__GetFvForceRebase(FvObj) or self.__GetFvAlignment(Fv= Obj) or=20 - self.__GetFvAttributes(FvObj) or self.__GetFvNameGuid(FvOb= j) or=20 + if not (self.__GetBlockStatement(FvObj) or self.__GetFvBaseAdd= ress(FvObj) or + self.__GetFvForceRebase(FvObj) or self.__GetFvAlignment(Fv= Obj) or + self.__GetFvAttributes(FvObj) or self.__GetFvNameGuid(FvOb= j) or self.__GetFvExtEntryStatement(FvObj) or self.__GetFvNameSt= ring(FvObj)): break =20 @@ -2186,7 +2186,7 @@ class FdfParser: raise Warning("Unknown alignment value '%s'" % self.__Token, s= elf.FileName, self.CurrentLineNumber) Obj.FvAlignment =3D self.__Token return True - =20 + ## __GetFvBaseAddress() method # # Get BaseAddress for FV @@ -2210,8 +2210,8 @@ class FdfParser: if not BaseAddrValuePattern.match(self.__Token.upper()): raise Warning("Unknown FV base address value '%s'" % self.__To= ken, self.FileName, self.CurrentLineNumber) Obj.FvBaseAddress =3D self.__Token - return True =20 - =20 + return True + ## __GetFvForceRebase() method # # Get FvForceRebase for FV @@ -2234,14 +2234,14 @@ class FdfParser: =20 if self.__Token.upper() not in ["TRUE", "FALSE", "0", "0X0", "0X00= ", "1", "0X1", "0X01"]: raise Warning("Unknown FvForceRebase value '%s'" % self.__Toke= n, self.FileName, self.CurrentLineNumber) - =20 + if self.__Token.upper() in ["TRUE", "1", "0X1", "0X01"]: Obj.FvForceRebase =3D True elif self.__Token.upper() in ["FALSE", "0", "0X0", "0X00"]: Obj.FvForceRebase =3D False else: Obj.FvForceRebase =3D None - =20 + return True =20 =20 @@ -2276,7 +2276,7 @@ class FdfParser: FvObj.FvAttributeDict[name] =3D self.__Token =20 return IsWordToken - =20 + ## __GetFvNameGuid() method # # Get FV GUID for FV @@ -2322,7 +2322,7 @@ class FdfParser: =20 if not self.__IsKeyword ("TYPE"): raise Warning("expected 'TYPE'", self.FileName, self.CurrentLi= neNumber) - =20 + if not self.__IsToken( "=3D"): raise Warning("expected '=3D'", self.FileName, self.CurrentLin= eNumber) =20 @@ -2343,7 +2343,7 @@ class FdfParser: =20 if not self.__IsToken( "=3D"): raise Warning("expected '=3D'", self.FileName, self.Curren= tLineNumber) - =20 + if not self.__IsToken( "{"): raise Warning("expected '{'", self.FileName, self.CurrentL= ineNumber) =20 @@ -2374,13 +2374,13 @@ class FdfParser: FvObj.FvExtEntryData +=3D [DataString] =20 if self.__Token =3D=3D 'FILE': - =20 + if not self.__IsToken( "=3D"): raise Warning("expected '=3D'", self.FileName, self.Curren= tLineNumber) - =20 + if not self.__GetNextToken(): raise Warning("expected FV Extension Entry file path At Li= ne ", self.FileName, self.CurrentLineNumber) - =20 + FvObj.FvExtEntryData +=3D [self.__Token] =20 if not self.__IsToken( "}"): @@ -2543,7 +2543,7 @@ class FdfParser: raise Warning("expected ARCH name", self.FileName, self.Cu= rrentLineNumber) FfsInfObj.UseArch =3D self.__Token =20 - =20 + if self.__GetNextToken(): p =3D re.compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-= 9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\))') if p.match(self.__Token) and p.match(self.__Token).span()[1] = =3D=3D len(self.__Token): @@ -2584,7 +2584,7 @@ class FdfParser: self.__UndoToken() self.__UndoToken() return False - =20 + FfsFileObj =3D FfsFileStatement.FileStatement() FfsFileObj.FvFileType =3D self.__Token =20 @@ -2601,9 +2601,9 @@ class FdfParser: if not self.__IsToken( ")"): raise Warning("expected ')'", self.FileName, self.Curr= entLineNumber) self.__Token =3D 'PCD('+PcdPair[1]+'.'+PcdPair[0]+')' - =20 + FfsFileObj.NameGuid =3D self.__Token - =20 + self.__GetFilePart( FfsFileObj, MacroDict.copy()) =20 if ForCapsule: @@ -2879,7 +2879,7 @@ class FdfParser: else: VerSectionObj.FileName =3D self.__Token Obj.SectionList.append(VerSectionObj) - =20 + elif self.__IsKeyword( "UI"): if AlignValue =3D=3D 'Auto': raise Warning("Auto alignment can only be used in PE32 or = TE section ", self.FileName, self.CurrentLineNumber) @@ -3333,7 +3333,7 @@ class FdfParser: Value =3D self.__Token.strip() else: Value =3D self.__Token.strip() - Obj.TokensDict[Name] =3D Value =20 + Obj.TokensDict[Name] =3D Value if not self.__GetNextToken(): return False self.__UndoToken() @@ -3475,7 +3475,7 @@ class FdfParser: =20 if not self.__GetNextToken(): raise Warning("expected File name", self.FileName, self.Curren= tLineNumber) - =20 + AnyFileName =3D self.__Token self.__VerifyFile(AnyFileName) =20 @@ -3508,7 +3508,7 @@ class FdfParser: else: CapsuleObj.CapsuleDataList.append(CapsuleAnyFile) return True - =20 + ## __GetAfileStatement() method # # Get Afile for capsule @@ -3528,14 +3528,14 @@ class FdfParser: =20 if not self.__GetNextToken(): raise Warning("expected Afile name", self.FileName, self.Curre= ntLineNumber) - =20 + AfileName =3D self.__Token AfileBaseName =3D os.path.basename(AfileName) - =20 + if os.path.splitext(AfileBaseName)[1] not in [".bin",".BIN",".Bin= ",".dat",".DAT",".Dat",".data",".DATA",".Data"]: raise Warning('invalid binary file type, should be one of "bin= ","BIN","Bin","dat","DAT","Dat","data","DATA","Data"', \ self.FileName, self.CurrentLineNumber) - =20 + if not os.path.isabs(AfileName): AfileName =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(Afile= Name) self.__VerifyFile(AfileName) @@ -3689,7 +3689,7 @@ class FdfParser: if not self.__IsToken( ")"): raise Warning("expected ')'", self.FileName, self.Curr= entLineNumber) self.__Token =3D 'PCD('+PcdPair[1]+'.'+PcdPair[0]+')' - =20 + NameGuid =3D self.__Token =20 KeepReloc =3D None @@ -3951,11 +3951,11 @@ class FdfParser: elif self.__GetNextToken(): if self.__Token not in ("}", "COMPAT16", "PE32", "PIC", "TE", = "FV_IMAGE", "RAW", "DXE_DEPEX",\ "UI", "VERSION", "PEI_DEPEX", "GUID", "SMM_DEPEX"): - =20 + if self.__Token.startswith('PCD'): self.__UndoToken() self.__GetNextWord() - =20 + if self.__Token =3D=3D 'PCD': if not self.__IsToken( "("): raise Warning("expected '('", self.FileName, s= elf.CurrentLineNumber) @@ -3963,9 +3963,9 @@ class FdfParser: if not self.__IsToken( ")"): raise Warning("expected ')'", self.FileName, s= elf.CurrentLineNumber) self.__Token =3D 'PCD('+PcdPair[1]+'.'+PcdPair[0]+= ')' - =20 - EfiSectionObj.FileName =3D self.__Token =20 - =20 + + EfiSectionObj.FileName =3D self.__Token + else: self.__UndoToken() else: @@ -4352,7 +4352,7 @@ class FdfParser: self.SectionParser(S) self.__UndoToken() return False - =20 + self.__UndoToken() if not self.__IsToken("[OptionRom.", True): raise Warning("Unknown Keyword '%s'" % self.__Token, self.File= Name, self.CurrentLineNumber) @@ -4371,7 +4371,7 @@ class FdfParser: isFile =3D self.__GetOptRomFileStatement(OptRomObj) if not isInf and not isFile: break - =20 + return True =20 ## __GetOptRomInfStatement() method @@ -4412,9 +4412,9 @@ class FdfParser: else: self.Profile.InfDict['ArchTBD'].append(ffsInf.InfFileName) =20 - =20 + self.__GetOptRomOverrides (ffsInf) - =20 + Obj.FfsList.append(ffsInf) return True =20 @@ -4476,7 +4476,7 @@ class FdfParser: EdkLogger.error("FdfParser", FORMAT_INVALID, File=3Dse= lf.FileName, Line=3Dself.CurrentLineNumber) =20 Obj.OverrideAttribs =3D Overrides - =20 + ## __GetOptRomFileStatement() method # # Get FILE statements @@ -4508,7 +4508,7 @@ class FdfParser: =20 if FfsFileObj.FileType =3D=3D 'EFI': self.__GetOptRomOverrides(FfsFileObj) - =20 + Obj.FfsList.append(FfsFileObj) =20 return True @@ -4550,7 +4550,7 @@ class FdfParser: if hasattr(CapsuleDataObj, 'FvName') and CapsuleDataObj.FvName= is not None and CapsuleDataObj.FvName.upper() not in RefFvList: RefFvList.append (CapsuleDataObj.FvName.upper()) elif hasattr(CapsuleDataObj, 'FdName') and CapsuleDataObj.FdNa= me is not None and CapsuleDataObj.FdName.upper() not in RefFdList: - RefFdList.append (CapsuleDataObj.FdName.upper()) = =20 + RefFdList.append (CapsuleDataObj.FdName.upper()) elif CapsuleDataObj.Ffs is not None: if isinstance(CapsuleDataObj.Ffs, FfsFileStatement.FileSta= tement): if CapsuleDataObj.Ffs.FvName is not None and CapsuleDa= taObj.Ffs.FvName.upper() not in RefFvList: @@ -4645,7 +4645,7 @@ class FdfParser: RefFvStack =3D [] RefFvStack.append(FvName) FdAnalyzedList =3D [] - =20 + Index =3D 0 while RefFvStack !=3D [] and Index < MaxLength: Index =3D Index + 1 @@ -4698,7 +4698,7 @@ class FdfParser: RefCapStack.append(CapName) FdAnalyzedList =3D [] FvAnalyzedList =3D [] - =20 + Index =3D 0 while RefCapStack !=3D [] and Index < MaxLength: Index =3D Index + 1 diff --git a/BaseTools/Source/Python/GenFds/Ffs.py b/BaseTools/Source/Pytho= n/GenFds/Ffs.py index a4178121118b..f3a252ee1b9d 100644 --- a/BaseTools/Source/Python/GenFds/Ffs.py +++ b/BaseTools/Source/Python/GenFds/Ffs.py @@ -21,7 +21,7 @@ from CommonDataClass.FdfClass import FDClassObject # # class Ffs(FDClassObject): - =20 + # mapping between MODULE type in FDF (from INF) and file type for GenF= fs ModuleTypeToFileType =3D { 'SEC' : 'EFI_FV_FILETYPE_SECURITY_CORE', @@ -38,7 +38,7 @@ class Ffs(FDClassObject): 'MM_STANDALONE' : 'EFI_FV_FILETYPE_MM_STANDALONE', 'MM_CORE_STANDALONE' : 'EFI_FV_FILETYPE_MM_CORE_STANDALONE' } - =20 + # mapping between FILE type in FDF and file type for GenFfs FdfFvFileTypeToFileType =3D { 'SEC' : 'EFI_FV_FILETYPE_SECURITY_CORE', @@ -56,7 +56,7 @@ class Ffs(FDClassObject): 'MM_STANDALONE' : 'EFI_FV_FILETYPE_MM_STANDALONE', 'MM_CORE_STANDALONE' : 'EFI_FV_FILETYPE_MM_CORE_STANDALONE' } - =20 + # mapping between section type in FDF and file suffix SectionSuffix =3D { 'PE32' : '.pe32', @@ -68,14 +68,14 @@ class Ffs(FDClassObject): 'COMPAT16' : '.com16', 'RAW' : '.raw', 'FREEFORM_SUBTYPE_GUID': '.guid', - 'SUBTYPE_GUID' : '.guid', =20 + 'SUBTYPE_GUID' : '.guid', 'FV_IMAGE' : 'fv.sec', 'COMPRESS' : '.com', 'GUIDED' : '.guided', 'PEI_DEPEX' : '.dpx', 'SMM_DEPEX' : '.dpx' } - =20 + ## The constructor # # @param self The object pointer diff --git a/BaseTools/Source/Python/GenFds/FfsFileStatement.py b/BaseTools= /Source/Python/GenFds/FfsFileStatement.py index ba8e0465ef34..cb83f6428c23 100644 --- a/BaseTools/Source/Python/GenFds/FfsFileStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsFileStatement.py @@ -58,7 +58,7 @@ class FileStatement (FileStatementClassObject) : # @retval string Generated FFS file name # def GenFfs(self, Dict =3D {}, FvChildAddr=3D[], FvParentAddr=3DNone, I= sMakefile=3DFalse, FvName=3DNone): - =20 + if self.NameGuid is not None and self.NameGuid.startswith('PCD('): PcdValue =3D GenFdsGlobalVariable.GetPcdValue(self.NameGuid) if len(PcdValue) =3D=3D 0: @@ -71,7 +71,7 @@ class FileStatement (FileStatementClassObject) : EdkLogger.error("GenFds", GENFDS_ERROR, 'GUID value for %s= in wrong format.' \ % (self.NameGuid)) self.NameGuid =3D RegistryGuidStr - =20 + Str =3D self.NameGuid if FvName: Str +=3D FvName diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/= Source/Python/GenFds/FfsInfStatement.py index 3c5eef40222b..4cbc6bb9ba7f 100644 --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py @@ -225,7 +225,7 @@ class FfsInfStatement(FfsInfStatementClassObject): EdkLogger.warn("GenFds", GENFDS_ERROR, "Module %s NOT found in= DSC file; Is it really a binary module?" % (self.InfFileName)) =20 if self.ModuleType =3D=3D 'SMM_CORE' and int(self.PiSpecVersion, 1= 6) < 0x0001000A: - EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "SMM_CORE modu= le type can't be used in the module with PI_SPECIFICATION_VERSION less than= 0x0001000A", File=3Dself.InfFileName) =20 + EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "SMM_CORE modu= le type can't be used in the module with PI_SPECIFICATION_VERSION less than= 0x0001000A", File=3Dself.InfFileName) =20 if self.ModuleType =3D=3D 'MM_CORE_STANDALONE' and int(self.PiSpec= Version, 16) < 0x00010032: EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "MM_CORE_STAND= ALONE module type can't be used in the module with PI_SPECIFICATION_VERSION= less than 0x00010032", File=3Dself.InfFileName) @@ -374,13 +374,13 @@ class FfsInfStatement(FfsInfStatementClassObject): def PatchEfiFile(self, EfiFile, FileType): # # If the module does not have any patches, then return path to inp= ut file - # =20 + # if not self.PatchPcds: return EfiFile =20 # # Only patch file if FileType is PE32 or ModuleType is USER_DEFINED - # =20 + # if FileType !=3D 'PE32' and self.ModuleType !=3D "USER_DEFINED": return EfiFile =20 @@ -398,7 +398,7 @@ class FfsInfStatement(FfsInfStatementClassObject): =20 # # If a different file from the same module has already been patche= d, then generate an error - # =20 + # if self.PatchedBinFile: EdkLogger.error("GenFds", GENFDS_ERROR, 'Only one binary file can be patched:\n' @@ -408,12 +408,12 @@ class FfsInfStatement(FfsInfStatementClassObject): =20 # # Copy unpatched file contents to output file location to perform = patching - # =20 + # CopyLongFilePath(EfiFile, Output) =20 # # Apply patches to patched output file - # =20 + # for Pcd, Value in self.PatchPcds: RetVal, RetStr =3D PatchBinaryFile(Output, int(Pcd.Offset, 0),= Pcd.DatumType, Value, Pcd.MaxDatumSize) if RetVal: @@ -421,12 +421,12 @@ class FfsInfStatement(FfsInfStatementClassObject): =20 # # Save the path of the patched output file - # =20 + # self.PatchedBinFile =3D Output =20 # # Return path to patched output file - # =20 + # return Output =20 ## GenFfs() method @@ -448,14 +448,14 @@ class FfsInfStatement(FfsInfStatementClassObject): Arch =3D self.GetCurrentArch() SrcFile =3D mws.join( GenFdsGlobalVariable.WorkSpaceDir , self.Inf= FileName); DestFile =3D os.path.join( self.OutputPath, self.ModuleGuid + '.ff= s') - =20 + SrcFileDir =3D "." SrcPath =3D os.path.dirname(SrcFile) SrcFileName =3D os.path.basename(SrcFile) - SrcFileBase, SrcFileExt =3D os.path.splitext(SrcFileName) =20 + SrcFileBase, SrcFileExt =3D os.path.splitext(SrcFileName) DestPath =3D os.path.dirname(DestFile) DestFileName =3D os.path.basename(DestFile) - DestFileBase, DestFileExt =3D os.path.splitext(DestFileName) =20 + DestFileBase, DestFileExt =3D os.path.splitext(DestFileName) self.MacroDict =3D { # source file "${src}" : SrcFile, @@ -473,7 +473,7 @@ class FfsInfStatement(FfsInfStatementClassObject): } # # Allow binary type module not specify override rule in FDF file. - #=20 + # if len(self.BinFileList) > 0: if self.Rule is None or self.Rule =3D=3D "": self.Rule =3D "BINARY" @@ -534,7 +534,7 @@ class FfsInfStatement(FfsInfStatementClassObject): '$(NAMED_GUID)' : self.ModuleGuid } String =3D GenFdsGlobalVariable.MacroExtend(String, MacroDict) - String =3D GenFdsGlobalVariable.MacroExtend(String, self.MacroDict= ) =20 + String =3D GenFdsGlobalVariable.MacroExtend(String, self.MacroDict) return String =20 ## __GetRule__() method @@ -960,14 +960,14 @@ class FfsInfStatement(FfsInfStatementClassObject): Sect.FvAddr =3D FvChildAddr if FvParentAddr is not None and isinstance(Sect, GuidSection): Sect.FvParentAddr =3D FvParentAddr - =20 + if Rule.KeyStringList !=3D []: SectList, Align =3D Sect.GenSection(self.OutputPath , self= .ModuleGuid, SecIndex, Rule.KeyStringList, self, IsMakefile =3D IsMakefile) else : SectList, Align =3D Sect.GenSection(self.OutputPath , self= .ModuleGuid, SecIndex, self.KeyStringList, self, IsMakefile =3D IsMakefile) - =20 + if not HasGeneratedFlag: - UniVfrOffsetFileSection =3D "" =20 + UniVfrOffsetFileSection =3D "" ModuleFileName =3D mws.join(GenFdsGlobalVariable.WorkSpace= Dir, self.InfFileName) InfData =3D GenFdsGlobalVariable.WorkSpace.BuildObject[Pat= hClass(ModuleFileName), self.CurrentArch] # @@ -978,16 +978,16 @@ class FfsInfStatement(FfsInfStatementClassObject): for SourceFile in InfData.Sources: if SourceFile.Type.upper() =3D=3D ".VFR" : # - # search the .map file to find the offset of vfr b= inary in the PE32+/TE file.=20 + # search the .map file to find the offset of vfr b= inary in the PE32+/TE file. # VfrUniBaseName[SourceFile.BaseName] =3D (SourceFil= e.BaseName + "Bin") if SourceFile.Type.upper() =3D=3D ".UNI" : # - # search the .map file to find the offset of Uni s= trings binary in the PE32+/TE file.=20 + # search the .map file to find the offset of Uni s= trings binary in the PE32+/TE file. # VfrUniBaseName["UniOffsetName"] =3D (self.BaseName= + "Strings") - =20 - =20 + + if len(VfrUniBaseName) > 0: if IsMakefile: if InfData.BuildType !=3D 'UEFI_HII': @@ -1023,7 +1023,7 @@ class FfsInfStatement(FfsInfStatementClassObject): if UniVfrOffsetFileSection: SectList.append(UniVfrOffsetFileSection) HasGeneratedFlag =3D True - =20 + for SecName in SectList : SectFiles.append(SecName) SectAlignments.append(Align) @@ -1071,12 +1071,12 @@ class FfsInfStatement(FfsInfStatementClassObject): # @param self The object pointer # @param VfrUniBaseName A name list contain the UNI/INF obje= ct name. # @retval RetValue A list contain offset of UNI/INF obj= ect. - # =20 + # def __GetBuildOutputMapFileVfrUniInfo(self, VfrUniBaseName): MapFileName =3D os.path.join(self.EfiOutputPath, self.BaseName + "= .map") EfiFileName =3D os.path.join(self.EfiOutputPath, self.BaseName + "= .efi") return GetVariableOffset(MapFileName, EfiFileName, VfrUniBaseName.= values()) - =20 + ## __GenUniVfrOffsetFile() method # # Generate the offset file for the module which contain VFR or UNI f= ile. @@ -1088,8 +1088,8 @@ class FfsInfStatement(FfsInfStatementClassObject): def __GenUniVfrOffsetFile(VfrUniOffsetList, UniVfrOffsetFileName): =20 # Use a instance of StringIO to cache data - fStringIO =3D StringIO.StringIO('') =20 - =20 + fStringIO =3D StringIO.StringIO('') + for Item in VfrUniOffsetList: if (Item[0].find("Strings") !=3D -1): # @@ -1099,7 +1099,7 @@ class FfsInfStatement(FfsInfStatementClassObject): # UniGuid =3D [0xe0, 0xc5, 0x13, 0x89, 0xf6, 0x33, 0x86, 0x4= d, 0x9b, 0xf1, 0x43, 0xef, 0x89, 0xfc, 0x6, 0x66] UniGuid =3D [chr(ItemGuid) for ItemGuid in UniGuid] - fStringIO.write(''.join(UniGuid)) =20 + fStringIO.write(''.join(UniGuid)) UniValue =3D pack ('Q', int (Item[1], 16)) fStringIO.write (UniValue) else: @@ -1110,11 +1110,11 @@ class FfsInfStatement(FfsInfStatementClassObject): # VfrGuid =3D [0xb4, 0x7c, 0xbc, 0xd0, 0x47, 0x6a, 0x5f, 0x4= 9, 0xaa, 0x11, 0x71, 0x7, 0x46, 0xda, 0x6, 0xa2] VfrGuid =3D [chr(ItemGuid) for ItemGuid in VfrGuid] - fStringIO.write(''.join(VfrGuid)) =20 - type (Item[1])=20 + fStringIO.write(''.join(VfrGuid)) + type (Item[1]) VfrValue =3D pack ('Q', int (Item[1], 16)) fStringIO.write (VfrValue) - =20 + # # write data into file. # @@ -1122,7 +1122,7 @@ class FfsInfStatement(FfsInfStatementClassObject): SaveFileOnChange(UniVfrOffsetFileName, fStringIO.getvalue()) except: EdkLogger.error("GenFds", FILE_WRITE_FAILURE, "Write data to f= ile %s failed, please check whether the file been locked or using by other = applications." %UniVfrOffsetFileName,None) - =20 + fStringIO.close () =20 - =20 + diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python= /GenFds/Fv.py index 0fb2bd456a6d..2e57c5e92365 100644 --- a/BaseTools/Source/Python/GenFds/Fv.py +++ b/BaseTools/Source/Python/GenFds/Fv.py @@ -53,7 +53,7 @@ class FV (FvClassObject): self.FvForceRebase =3D None self.FvRegionInFD =3D None self.UsedSizeEnable =3D False - =20 + ## AddToBuffer() # # Generate Fv and add it to the Buffer @@ -72,7 +72,7 @@ class FV (FvClassObject): =20 if BaseAddress is None and self.UiFvName.upper() + 'fv' in GenFds.= ImageBinDict: return GenFds.ImageBinDict[self.UiFvName.upper() + 'fv'] - =20 + # # Check whether FV in Capsule is in FD flash region. # If yes, return error. Doesn't support FV in Capsule image is als= o in FD flash region. @@ -92,7 +92,7 @@ class FV (FvClassObject): GenFdsGlobalVariable.InfLogger( "\nGenerating %s FV" %self.UiF= vName) GenFdsGlobalVariable.LargeFileInFvFlags.append(False) FFSGuid =3D None - =20 + if self.FvBaseAddress is not None: BaseAddress =3D self.FvBaseAddress if not Flag: @@ -289,7 +289,7 @@ class FV (FvClassObject): if not self._GetBlockSize(): #set default block size is 1 self.FvInfFile.writelines("EFI_BLOCK_SIZE =3D 0x1" + = T_CHAR_LF) - =20 + for BlockSize in self.BlockSizeList : if BlockSize[0] is not None: self.FvInfFile.writelines("EFI_BLOCK_SIZE =3D " + \ @@ -331,7 +331,7 @@ class FV (FvClassObject): self.FvAlignment.strip() + \ " =3D TRUE" + \ T_CHAR_LF) - =20 + # # Generate FV extension header file # @@ -390,7 +390,7 @@ class FV (FvClassObject): TotalSize +=3D (Size + 4) FvExtFile.seek(0) Buffer +=3D pack('HH', (Size + 4), int(self.FvExtEntry= TypeValue[Index], 16)) - Buffer +=3D FvExtFile.read()=20 + Buffer +=3D FvExtFile.read() FvExtFile.close() if self.FvExtEntryType[Index] =3D=3D 'DATA': ByteList =3D self.FvExtEntryData[Index].split(',') @@ -403,12 +403,12 @@ class FV (FvClassObject): Buffer +=3D pack('B', int(ByteList[Index1], 16)) =20 Guid =3D self.FvNameGuid.split('-') - Buffer =3D pack('=3DLHHBBBBBBBBL',=20 - int(Guid[0], 16),=20 - int(Guid[1], 16),=20 - int(Guid[2], 16),=20 - int(Guid[3][-4:-2], 16),=20 - int(Guid[3][-2:], 16), =20 + Buffer =3D pack('=3DLHHBBBBBBBBL', + int(Guid[0], 16), + int(Guid[1], 16), + int(Guid[2], 16), + int(Guid[3][-4:-2], 16), + int(Guid[3][-2:], 16), int(Guid[4][-12:-10], 16), int(Guid[4][-10:-8], 16), int(Guid[4][-8:-6], 16), @@ -434,7 +434,7 @@ class FV (FvClassObject): FvExtHeaderFileName = + \ T_CHAR_LF) =20 - =20 + # # Add [Files] # diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Py= thon/GenFds/GenFds.py index 74017e72629b..4b8c7913d2db 100644 --- a/BaseTools/Source/Python/GenFds/GenFds.py +++ b/BaseTools/Source/Python/GenFds/GenFds.py @@ -71,10 +71,10 @@ def main(): if Options.verbose is not None: EdkLogger.SetLevel(EdkLogger.VERBOSE) GenFdsGlobalVariable.VerboseMode =3D True - =20 + if Options.FixedAddress is not None: GenFdsGlobalVariable.FixedLoadAddress =3D True - =20 + if Options.quiet is not None: EdkLogger.SetLevel(EdkLogger.QUIET) if Options.debug is not None: @@ -99,7 +99,7 @@ def main(): if Options.GenfdsMultiThread: GenFdsGlobalVariable.EnableGenfdsMultiThread =3D True os.chdir(GenFdsGlobalVariable.WorkSpaceDir) - =20 + # set multiple workspace PackagesPath =3D os.getenv("PACKAGES_PATH") mws.setWs(GenFdsGlobalVariable.WorkSpaceDir, PackagesPath) @@ -227,7 +227,7 @@ def main(): GlobalData.gDatabasePath =3D os.path.normpath(os.path.join(ConfDir= ectoryPath, GlobalData.gDatabasePath)) BuildWorkSpace =3D WorkspaceDatabase(GlobalData.gDatabasePath) BuildWorkSpace.InitDatabase() - =20 + # # Get files real name in workspace dir # @@ -243,7 +243,7 @@ def main(): TargetArchList =3D set(BuildWorkSpace.BuildObject[GenFdsGlobalVari= able.ActivePlatform, TAB_COMMON, Options.BuildTarget, Options.ToolChain].Su= pArchList) & set(ArchList) if len(TargetArchList) =3D=3D 0: EdkLogger.error("GenFds", GENFDS_ERROR, "Target ARCH %s not in= platform supported ARCH %s" % (str(ArchList), str(BuildWorkSpace.BuildObje= ct[GenFdsGlobalVariable.ActivePlatform, TAB_COMMON].SupArchList))) - =20 + for Arch in ArchList: GenFdsGlobalVariable.OutputDirFromDscDict[Arch] =3D NormPath(B= uildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, Option= s.BuildTarget, Options.ToolChain].OutputDirectory) GenFdsGlobalVariable.PlatformName =3D BuildWorkSpace.BuildObje= ct[GenFdsGlobalVariable.ActivePlatform, Arch, Options.BuildTarget, Options.= ToolChain].PlatformName @@ -550,7 +550,7 @@ class GenFds : Buffer =3D StringIO.StringIO('') FvObj.AddToBuffer(Buffer) Buffer.close() - =20 + if GenFds.OnlyGenerateThisFv is None and GenFds.OnlyGenerateThisFd= is None and GenFds.OnlyGenerateThisCap is None: if GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict !=3D {}: GenFdsGlobalVariable.VerboseLogger("\n Generate other Caps= ule images!") @@ -616,7 +616,7 @@ class GenFds : # @retval None # def DisplayFvSpaceInfo(FdfParser): - =20 + FvSpaceInfoList =3D [] MaxFvNameLength =3D 0 for FvName in FdfParser.Profile.FvDict: @@ -643,10 +643,10 @@ class GenFds : if NameValue[0].strip() =3D=3D 'EFI_FV_SPACE_SIZE': FreeFound =3D True Free =3D NameValue[1].strip() - =20 + if TotalFound and UsedFound and FreeFound: FvSpaceInfoList.append((FvName, Total, Used, Free)) - =20 + GenFdsGlobalVariable.InfLogger('\nFV Space Information') for FvSpaceInfo in FvSpaceInfoList: Name =3D FvSpaceInfo[0] @@ -674,18 +674,18 @@ class GenFds : if PcdObj.TokenCName =3D=3D 'PcdBsBaseAddress': PcdValue =3D PcdObj.DefaultValue break - =20 + if PcdValue =3D=3D '': return - =20 + Int64PcdValue =3D long(PcdValue, 0) - if Int64PcdValue =3D=3D 0 or Int64PcdValue < -1: =20 + if Int64PcdValue =3D=3D 0 or Int64PcdValue < -1: return - =20 + TopAddress =3D 0 if Int64PcdValue > 0: TopAddress =3D Int64PcdValue - =20 + ModuleDict =3D BuildDb.BuildObject[DscFile, TAB_COMMON, GenFdsGlob= alVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].Modules for Key in ModuleDict: ModuleObj =3D BuildDb.BuildObject[Key, TAB_COMMON, GenFdsGloba= lVariable.TargetName, GenFdsGlobalVariable.ToolChainTag] diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseT= ools/Source/Python/GenFds/GenFdsGlobalVariable.py index 6745a89514b7..fac9fee0bea6 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -64,7 +64,7 @@ class GenFdsGlobalVariable: FdfFileTimeStamp =3D 0 FixedLoadAddress =3D False PlatformName =3D '' - =20 + BuildRuleFamily =3D "MSFT" ToolChainFamily =3D "MSFT" __BuildRuleDatabase =3D None @@ -74,7 +74,7 @@ class GenFdsGlobalVariable: CopyList =3D [] ModuleFile =3D '' EnableGenfdsMultiThread =3D False - =20 + # # The list whose element are flags to indicate if large FFS or SECTION= files exist in FV. # At the beginning of each generation of FV, false flag is appended to= the list, @@ -89,7 +89,7 @@ class GenFdsGlobalVariable: LARGE_FILE_SIZE =3D 0x1000000 =20 SectionHeader =3D struct.Struct("3B 1B") - =20 + ## LoadBuildRule # @staticmethod @@ -116,7 +116,7 @@ class GenFdsGlobalVariable: and GenFdsGlobalVariable.ToolChainTag in ToolDefinition= [DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY] \ and ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFA= MILY][GenFdsGlobalVariable.ToolChainTag]: GenFdsGlobalVariable.BuildRuleFamily =3D ToolDefinitio= n[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY][GenFdsGlobalVariable.ToolChainT= ag] - =20 + if DataType.TAB_TOD_DEFINES_FAMILY in ToolDefinition \ and GenFdsGlobalVariable.ToolChainTag in ToolDefinition= [DataType.TAB_TOD_DEFINES_FAMILY] \ and ToolDefinition[DataType.TAB_TOD_DEFINES_FAMILY][Gen= FdsGlobalVariable.ToolChainTag]: @@ -228,11 +228,11 @@ class GenFdsGlobalVariable: while Index < len(SourceList): Source =3D SourceList[Index] Index =3D Index + 1 - =20 + if File.IsBinary and File =3D=3D Source and Inf.Binaries i= s not None and File in Inf.Binaries: # Skip all files that are not binary libraries if not Inf.LibraryClass: - continue =20 + continue RuleObject =3D BuildRules[DataType.TAB_DEFAULT_BINARY_= FILE] elif FileType in BuildRules: RuleObject =3D BuildRules[FileType] @@ -243,15 +243,15 @@ class GenFdsGlobalVariable: if LastTarget: TargetList.add(str(LastTarget)) break - =20 + FileType =3D RuleObject.SourceFileType - =20 + # stop at STATIC_LIBRARY for library if Inf.LibraryClass and FileType =3D=3D DataType.TAB_STATI= C_LIBRARY: if LastTarget: TargetList.add(str(LastTarget)) break - =20 + Target =3D RuleObject.Apply(Source) if not Target: if LastTarget: @@ -260,11 +260,11 @@ class GenFdsGlobalVariable: elif not Target.Outputs: # Only do build for target with outputs TargetList.add(str(Target)) - =20 + # to avoid cyclic rule if FileType in RuleChain: break - =20 + RuleChain.append(FileType) SourceList.extend(Target.Outputs) LastTarget =3D Target @@ -647,19 +647,19 @@ class GenFdsGlobalVariable: @staticmethod def GenerateOptionRom(Output, EfiInput, BinaryInput, Compress=3DFalse,= ClassCode=3DNone, Revision=3DNone, DeviceId=3DNone, VendorId=3DNone,= IsMakefile=3DFalse): - InputList =3D [] =20 + InputList =3D [] Cmd =3D ["EfiRom"] if len(EfiInput) > 0: - =20 + if Compress: Cmd +=3D ["-ec"] else: Cmd +=3D ["-e"] - =20 + for EfiFile in EfiInput: Cmd +=3D [EfiFile] InputList.append (EfiFile) - =20 + if len(BinaryInput) > 0: Cmd +=3D ["-b"] for BinFile in BinaryInput: @@ -670,7 +670,7 @@ class GenFdsGlobalVariable: if not GenFdsGlobalVariable.NeedsUpdate(Output, InputList) and not= IsMakefile: return GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs upda= te because of newer %s" % (Output, InputList)) - =20 + if ClassCode is not None: Cmd +=3D ["-l", ClassCode] if Revision is not None: @@ -813,7 +813,7 @@ class GenFdsGlobalVariable: EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not= FixedAtBuild type." % PcdPattern) if PcdObj.DatumType !=3D DataType.TAB_VOID: EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not= VOID* datum type." % PcdPattern) - =20 + PcdValue =3D PcdObj.DefaultValue return PcdValue =20 @@ -829,7 +829,7 @@ class GenFdsGlobalVariable: EdkLogger.error("GenFds", GENFDS_ERROR, "%s is= not FixedAtBuild type." % PcdPattern) if PcdObj.DatumType !=3D DataType.TAB_VOID: EdkLogger.error("GenFds", GENFDS_ERROR, "%s is= not VOID* datum type." % PcdPattern) - =20 + PcdValue =3D PcdObj.DefaultValue return PcdValue =20 diff --git a/BaseTools/Source/Python/GenFds/GuidSection.py b/BaseTools/Sour= ce/Python/GenFds/GuidSection.py index 08665a3d4d49..eebdafd823bb 100644 --- a/BaseTools/Source/Python/GenFds/GuidSection.py +++ b/BaseTools/Source/Python/GenFds/GuidSection.py @@ -74,7 +74,7 @@ class GuidSection(GuidSectionClassObject) : FvAddrIsSet =3D True else: FvAddrIsSet =3D False - =20 + if self.ProcessRequired in ("TRUE", "1"): if self.FvAddr !=3D []: #no use FvAddr when the image is processed. diff --git a/BaseTools/Source/Python/GenFds/OptRomFileStatement.py b/BaseTo= ols/Source/Python/GenFds/OptRomFileStatement.py index 4ef9b4d0e9a8..744c2b0422d9 100644 --- a/BaseTools/Source/Python/GenFds/OptRomFileStatement.py +++ b/BaseTools/Source/Python/GenFds/OptRomFileStatement.py @@ -18,7 +18,7 @@ import Common.LongFilePathOs as os =20 from GenFdsGlobalVariable import GenFdsGlobalVariable -##=20 +## # # class OptRomFileStatement: @@ -40,10 +40,10 @@ class OptRomFileStatement: # @retval string Generated FFS file name # def GenFfs(self, Dict =3D {}, IsMakefile=3DFalse): - =20 + if self.FileName is not None: self.FileName =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(s= elf.FileName) - =20 + return self.FileName =20 =20 diff --git a/BaseTools/Source/Python/GenFds/OptRomInfStatement.py b/BaseToo= ls/Source/Python/GenFds/OptRomInfStatement.py index 62d731fb9cca..1ef82f7106a1 100644 --- a/BaseTools/Source/Python/GenFds/OptRomInfStatement.py +++ b/BaseTools/Source/Python/GenFds/OptRomInfStatement.py @@ -26,7 +26,7 @@ from Common.String import * from FfsInfStatement import FfsInfStatement from GenFdsGlobalVariable import GenFdsGlobalVariable =20 -##=20 +## # # class OptRomInfStatement (FfsInfStatement): @@ -45,7 +45,7 @@ class OptRomInfStatement (FfsInfStatement): # @param self The object pointer # def __GetOptRomParams(self): - =20 + if self.OverrideAttribs is None: self.OverrideAttribs =3D OptionRom.OverrideAttribs() =20 @@ -59,21 +59,21 @@ class OptRomInfStatement (FfsInfStatement): =20 if self.OverrideAttribs.PciVendorId is None: self.OverrideAttribs.PciVendorId =3D self.OptRomDefs.get ('PCI= _VENDOR_ID') - =20 + if self.OverrideAttribs.PciClassCode is None: self.OverrideAttribs.PciClassCode =3D self.OptRomDefs.get ('PC= I_CLASS_CODE') - =20 + if self.OverrideAttribs.PciDeviceId is None: self.OverrideAttribs.PciDeviceId =3D self.OptRomDefs.get ('PCI= _DEVICE_ID') - =20 + if self.OverrideAttribs.PciRevision is None: self.OverrideAttribs.PciRevision =3D self.OptRomDefs.get ('PCI= _REVISION') - =20 -# InfObj =3D GenFdsGlobalVariable.WorkSpace.BuildObject[self.PathCl= assObj, self.CurrentArch] =20 + +# InfObj =3D GenFdsGlobalVariable.WorkSpace.BuildObject[self.PathCl= assObj, self.CurrentArch] # RecordList =3D InfObj._RawData[MODEL_META_DATA_HEADER, InfObj._Ar= ch, InfObj._Platform] # for Record in RecordList: # Record =3D ReplaceMacros(Record, GlobalData.gEdkGlobal, False) -# Name =3D Record[0] =20 +# Name =3D Record[0] ## GenFfs() method # # Generate FFS @@ -148,8 +148,7 @@ class OptRomInfStatement (FfsInfStatement): OutputFileList.append(GenSecInputFile) else: FileList, IsSect =3D Section.Section.GetFileList(self,= '', Sect.FileExtension) - OutputFileList.extend(FileList) =20 - =20 + OutputFileList.extend(FileList) + return OutputFileList =20 - =20 \ No newline at end of file diff --git a/BaseTools/Source/Python/GenFds/OptionRom.py b/BaseTools/Source= /Python/GenFds/OptionRom.py index b05841529940..7373a6a2f0bf 100644 --- a/BaseTools/Source/Python/GenFds/OptionRom.py +++ b/BaseTools/Source/Python/GenFds/OptionRom.py @@ -29,7 +29,7 @@ from Common.BuildToolError import * =20 T_CHAR_LF =3D '\n' =20 -##=20 +## # # class OPTIONROM (OptionRomClassObject): @@ -58,7 +58,7 @@ class OPTIONROM (OptionRomClassObject): =20 # Process Modules in FfsList for FfsFile in self.FfsList : - =20 + if isinstance(FfsFile, OptRomInfStatement.OptRomInfStatement): FilePathNameList =3D FfsFile.GenFfs(IsMakefile=3DFlag) if len(FilePathNameList) =3D=3D 0: @@ -71,14 +71,14 @@ class OPTIONROM (OptionRomClassObject): if not os.path.exists(TmpOutputDir) : os.makedirs(TmpOutputDir) TmpOutputFile =3D os.path.join(TmpOutputDir, FileName+= '.tmp') - =20 - GenFdsGlobalVariable.GenerateOptionRom(TmpOutputFile,=20 - FilePathNameLis= t,=20 - [],=20 - FfsFile.Overrid= eAttribs.NeedCompress,=20 - FfsFile.Overrid= eAttribs.PciClassCode,=20 - FfsFile.Overrid= eAttribs.PciRevision,=20 - FfsFile.Overrid= eAttribs.PciDeviceId,=20 + + GenFdsGlobalVariable.GenerateOptionRom(TmpOutputFile, + FilePathNameLis= t, + [], + FfsFile.Overrid= eAttribs.NeedCompress, + FfsFile.Overrid= eAttribs.PciClassCode, + FfsFile.Overrid= eAttribs.PciRevision, + FfsFile.Overrid= eAttribs.PciDeviceId, FfsFile.Overrid= eAttribs.PciVendorId, IsMakefile =3D = Flag) BinFileList.append(TmpOutputFile) @@ -90,14 +90,14 @@ class OPTIONROM (OptionRomClassObject): if not os.path.exists(TmpOutputDir) : os.makedirs(TmpOutputDir) TmpOutputFile =3D os.path.join(TmpOutputDir, FileName+= '.tmp') - =20 - GenFdsGlobalVariable.GenerateOptionRom(TmpOutputFile,=20 - [FilePathName],=20 - [],=20 - FfsFile.Overrid= eAttribs.NeedCompress,=20 - FfsFile.Overrid= eAttribs.PciClassCode,=20 - FfsFile.Overrid= eAttribs.PciRevision,=20 - FfsFile.Overrid= eAttribs.PciDeviceId,=20 + + GenFdsGlobalVariable.GenerateOptionRom(TmpOutputFile, + [FilePathName], + [], + FfsFile.Overrid= eAttribs.NeedCompress, + FfsFile.Overrid= eAttribs.PciClassCode, + FfsFile.Overrid= eAttribs.PciRevision, + FfsFile.Overrid= eAttribs.PciDeviceId, FfsFile.Overrid= eAttribs.PciVendorId, IsMakefile=3DFl= ag) BinFileList.append(TmpOutputFile) @@ -106,13 +106,13 @@ class OPTIONROM (OptionRomClassObject): EfiFileList.append(FilePathName) else: BinFileList.append(FilePathName) - =20 + # # Call EfiRom tool # OutputFile =3D os.path.join(GenFdsGlobalVariable.FvDir, self.Drive= rName) OutputFile =3D OutputFile + '.rom' - =20 + GenFdsGlobalVariable.GenerateOptionRom( OutputFile, EfiFileList, @@ -122,21 +122,20 @@ class OPTIONROM (OptionRomClassObject): if not Flag: GenFdsGlobalVariable.InfLogger( "\nGenerate %s Option ROM Succ= essfully" %self.DriverName) GenFdsGlobalVariable.SharpCounter =3D 0 - =20 + return OutputFile =20 class OverrideAttribs: - =20 + ## The constructor # # @param self The object pointer # def __init__(self): - =20 + self.PciVendorId =3D None self.PciClassCode =3D None self.PciDeviceId =3D None self.PciRevision =3D None self.NeedCompress =3D None - =20 - =20 \ No newline at end of file + diff --git a/BaseTools/Source/Python/GenFds/Region.py b/BaseTools/Source/Py= thon/GenFds/Region.py index 44f122a71216..1042281fe314 100644 --- a/BaseTools/Source/Python/GenFds/Region.py +++ b/BaseTools/Source/Python/GenFds/Region.py @@ -309,7 +309,7 @@ class Region(RegionClassObject): if self.Offset >=3D End: Start =3D End continue - # region located in current blocks=20 + # region located in current blocks else: # region ended within current blocks if self.Offset + self.Size <=3D End: @@ -361,5 +361,5 @@ class Region(RegionClassObject): else: Index +=3D 1 =20 - =20 + =20 diff --git a/BaseTools/Source/Python/GenFds/Section.py b/BaseTools/Source/P= ython/GenFds/Section.py index 4b368b3ada9d..ce10c35dc880 100644 --- a/BaseTools/Source/Python/GenFds/Section.py +++ b/BaseTools/Source/Python/GenFds/Section.py @@ -160,7 +160,7 @@ class Section (SectionClassObject): SuffixMap =3D FfsInf.GetFinalTargetSuffixMap() if Suffix in SuffixMap: FileList.extend(SuffixMap[Suffix]) - =20 + #Process the file lists is alphabetical for a same section type if len (FileList) > 1: FileList.sort() diff --git a/BaseTools/Source/Python/GenFds/Vtf.py b/BaseTools/Source/Pytho= n/GenFds/Vtf.py index 18ea37b9afdd..beb3200f23e6 100644 --- a/BaseTools/Source/Python/GenFds/Vtf.py +++ b/BaseTools/Source/Python/GenFds/Vtf.py @@ -25,7 +25,7 @@ T_CHAR_LF =3D '\n' # # class Vtf (VtfClassObject): - =20 + ## The constructor # # @param self The object pointer @@ -46,7 +46,7 @@ class Vtf (VtfClassObject): OutputFile =3D os.path.join(GenFdsGlobalVariable.FvDir, self.UiNam= e + '.Vtf') BaseAddArg =3D self.GetBaseAddressArg(FdAddressDict) OutputArg, VtfRawDict =3D self.GenOutputArg() - =20 + Cmd =3D ( 'GenVtf', ) + OutputArg + ( @@ -55,9 +55,9 @@ class Vtf (VtfClassObject): =20 GenFdsGlobalVariable.CallExternalTool(Cmd, "GenFv -Vtf Failed!") GenFdsGlobalVariable.SharpCounter =3D 0 - =20 + return VtfRawDict - =20 + ## GenBsfInf() method # # Generate inf used to generate VTF @@ -154,7 +154,7 @@ class Vtf (VtfClassObject): for component in self.ComponentStatementList : if component.CompLoc.upper() !=3D 'NONE' and not (component.Co= mpLoc.upper() in FvList): FvList.append(component.CompLoc.upper()) - =20 + return FvList =20 ## GetBaseAddressArg() method @@ -173,13 +173,13 @@ class Vtf (VtfClassObject): '-s', '0x%x' % Size, ) return CmdStr - =20 + ## GenOutputArg() method # # Get output arguments for GenVtf # # @param self The object pointer - # =20 + # def GenOutputArg(self): FvVtfDict =3D {} OutputFileName =3D '' @@ -192,6 +192,6 @@ class Vtf (VtfClassObject): OutputFileName =3D os.path.join(GenFdsGlobalVariable.FvDir, Ou= tputFileName) Arg +=3D ('-o', OutputFileName) FvVtfDict[FvObj.upper()] =3D OutputFileName - =20 + return Arg, FvVtfDict - =20 + diff --git a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py b= /BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py index ebd6a306390b..bf01de35a6e6 100644 --- a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py +++ b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py @@ -1,7 +1,7 @@ ## @file # Generate PCD table for 'Patchable In Module' type PCD with given .map fi= le. # The Patch PCD table like: -# =20 +# # PCD Name Offset in binary # =3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D # @@ -39,9 +39,9 @@ __copyright__ =3D "Copyright (c) 2008 - 2010, Intel Corpo= ration. All rights reserv symRe =3D re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\.\-:\\\\\w\?@\$<>]+= ) +([\da-fA-F]+)', re.UNICODE) =20 def parsePcdInfoFromMapFile(mapfilepath, efifilepath): - """ Parse map file to get binary patch pcd information=20 + """ Parse map file to get binary patch pcd information @param path Map file absolution path - =20 + @return a list which element hold (PcdName, Offset, SectionName) """ lines =3D [] @@ -51,7 +51,7 @@ def parsePcdInfoFromMapFile(mapfilepath, efifilepath): f.close() except: return None - =20 + if len(lines) =3D=3D 0: return None firstline =3D lines[0].strip() if (firstline.startswith("Archive member included ") and @@ -110,7 +110,7 @@ def _parseForGCC(lines, efifilepath): m =3D pcdPatternGcc.match(lines[index + 1].strip()) if m is not None: bpcds.append((PcdName, int(m.groups(0)[0], 16) , i= nt(sections[-1][1], 16), sections[-1][0])) - =20 + # get section information from efi file efisecs =3D PeImageClass(efifilepath).SectionHeaderList if efisecs is None or len(efisecs) =3D=3D 0: @@ -128,11 +128,11 @@ def _parseForGCC(lines, efifilepath): #assert efisec[0].strip() =3D=3D pcd[3].strip() and efisec= [1] + redirection =3D=3D pcd[2], "There are some differences between map fi= le and efi file" pcds.append([pcd[0], efisec[2] + pcd[1] - efisec[1] - redi= rection, efisec[0]]) return pcds - =20 + def _parseGeneral(lines, efifilepath): - """ For MSFT, ICC, EBC=20 + """ For MSFT, ICC, EBC @param lines line array for map file - =20 + @return a list which element hold (PcdName, Offset, SectionName) """ status =3D 0 #0 - beginning of file; 1 - PE section definition; 2 -= symbol table @@ -176,7 +176,7 @@ def _parseGeneral(lines, efifilepath): efisecs =3D PeImageClass(efifilepath).SectionHeaderList if efisecs is None or len(efisecs) =3D=3D 0: return None - =20 + pcds =3D [] for pcd in bPcds: index =3D 0 @@ -187,7 +187,7 @@ def _parseGeneral(lines, efifilepath): elif pcd[4] =3D=3D index: pcds.append([pcd[0], efisec[2] + pcd[2], efisec[0]]) return pcds - =20 + def generatePcdTable(list, pcdpath): try: f =3D open(pcdpath, 'w') @@ -195,12 +195,12 @@ def generatePcdTable(list, pcdpath): pass =20 f.write('PCD Name Offset Section Name\r\n') - =20 + for pcditem in list: f.write('%-30s 0x%-08X %-6s\r\n' % (pcditem[0], pcditem[1], pcdite= m[2])) f.close() =20 - #print 'Success to generate Binary Patch PCD table at %s!' % pcdpath=20 + #print 'Success to generate Binary Patch PCD table at %s!' % pcdpath =20 if __name__ =3D=3D '__main__': UsageString =3D "%prog -m -e -o " @@ -212,7 +212,7 @@ if __name__ =3D=3D '__main__': help=3D'Absolute path of EFI binary file.') parser.add_option('-o', '--outputfile', action=3D'store', dest=3D'outf= ile', help=3D'Absolute path of output file to store the go= t patchable PCD table.') - =20 + (options, args) =3D parser.parse_args() =20 if options.mapfile is None or options.efifile is None: diff --git a/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py b/BaseT= ools/Source/Python/PatchPcdValue/PatchPcdValue.py index cf2fc7c4f70a..1feec1313f95 100644 --- a/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py +++ b/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py @@ -35,9 +35,9 @@ __copyright__ =3D "Copyright (c) 2010, Intel Corporation.= All rights reserved." ## PatchBinaryFile method # # This method mainly patches the data into binary file. -#=20 +# # @param FileName File path of the binary file -# @param ValueOffset Offset value=20 +# @param ValueOffset Offset value # @param TypeName DataType Name # @param Value Value String # @param MaxSize MaxSize value @@ -173,7 +173,7 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, Va= lueString, MaxSize=3D0): return PARAMETER_INVALID, "PCD Value %s is not valid dec o= r hex string array." % (ValueString) else: # - # Patch ascii string=20 + # Patch ascii string # Index =3D 0 for ByteString in ValueString[1:-1]: diff --git a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Generat= eKeys.py b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256GenerateK= eys.py index 9711de8f5c2e..6e28b351488d 100644 --- a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256GenerateKeys.py +++ b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256GenerateKeys.py @@ -1,11 +1,11 @@ ## @file -# This tool can be used to generate new RSA 2048 bit private/public key pa= irs=20 -# in a PEM file format using OpenSSL command line utilities that are insta= lled=20 +# This tool can be used to generate new RSA 2048 bit private/public key pa= irs +# in a PEM file format using OpenSSL command line utilities that are insta= lled # on the path specified by the system environment variable OPENSSL_PATH. -# This tool can also optionally write one or more SHA 256 hashes of 2048 b= it=20 -# public keys to a binary file, write one or more SHA 256 hashes of 2048 b= it=20 -# public keys to a file in a C structure format, and in verbose mode displ= ay=20 -# one or more SHA 256 hashes of 2048 bit public keys in a C structure form= at=20 +# This tool can also optionally write one or more SHA 256 hashes of 2048 b= it +# public keys to a binary file, write one or more SHA 256 hashes of 2048 b= it +# public keys to a file in a C structure format, and in verbose mode displ= ay +# one or more SHA 256 hashes of 2048 bit public keys in a C structure form= at # on STDOUT. # This tool has been tested with OpenSSL 1.0.1e 11 Feb 2013 # @@ -25,7 +25,7 @@ Rsa2048Sha256GenerateKeys =20 import os import sys -import argparse=20 +import argparse import subprocess from Common.BuildVersion import gBUILD_VERSION =20 @@ -41,7 +41,7 @@ __usage__ =3D '%s [options]' % (__prog__) if __name__ =3D=3D '__main__': # # Create command line argument parser object - # =20 + # parser =3D argparse.ArgumentParser(prog=3D__prog__, version=3D__version_= _, usage=3D__usage__, description=3D__copyright__, conflict_handler=3D'reso= lve') group =3D parser.add_mutually_exclusive_group(required=3DTrue) group.add_argument("-o", "--output", dest=3D'OutputFile', type=3Dargpars= e.FileType('wb'), metavar=3D'filename', nargs=3D'*', help=3D"specify the ou= tput private key filename in PEM format") @@ -54,7 +54,7 @@ if __name__ =3D=3D '__main__': =20 # # Parse command line arguments - # =20 + # args =3D parser.parse_args() =20 # @@ -74,18 +74,18 @@ if __name__ =3D=3D '__main__': # try: Process =3D subprocess.Popen('%s version' % (OpenSslCommand), stdout= =3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE, shell=3DTrue) - except: =20 + except: print 'ERROR: Open SSL command not available. Please verify PATH or s= et OPENSSL_PATH' sys.exit(1) - =20 + Version =3D Process.communicate() if Process.returncode <> 0: print 'ERROR: Open SSL command not available. Please verify PATH or s= et OPENSSL_PATH' sys.exit(Process.returncode) print Version[0] - =20 + args.PemFileName =3D [] - =20 + # # Check for output file argument # @@ -105,7 +105,7 @@ if __name__ =3D=3D '__main__': if Process.returncode <> 0: print 'ERROR: RSA 2048 key generation failed' sys.exit(Process.returncode) - =20 + # # Check for input file argument # @@ -157,7 +157,7 @@ if __name__ =3D=3D '__main__': for Item in PublicKeyHash: PublicKeyHashC =3D PublicKeyHashC + '0x%02x, ' % (ord(Item)) PublicKeyHashC =3D PublicKeyHashC[:-2] + '}' - =20 + # # Write SHA 256 of 2048 bit binary public key to public key hash C struc= ture file # @@ -166,9 +166,9 @@ if __name__ =3D=3D '__main__': args.PublicKeyHashCFile.close () except: pass - =20 + # # If verbose is enabled display the public key in C structure format # if args.Verbose: - print 'PublicKeySha256 =3D ' + PublicKeyHashC =20 + print 'PublicKeySha256 =3D ' + PublicKeyHashC diff --git a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py= b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py index d36a14ffb775..1db9bb9f9705 100644 --- a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py +++ b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py @@ -20,7 +20,7 @@ Rsa2048Sha256Sign =20 import os import sys -import argparse=20 +import argparse import subprocess import uuid import struct @@ -60,7 +60,7 @@ TEST_SIGNING_PRIVATE_KEY_FILENAME =3D 'TestSigningPrivate= Key.pem' if __name__ =3D=3D '__main__': # # Create command line argument parser object - # =20 + # parser =3D argparse.ArgumentParser(prog=3D__prog__, version=3D__version_= _, usage=3D__usage__, description=3D__copyright__, conflict_handler=3D'reso= lve') group =3D parser.add_mutually_exclusive_group(required=3DTrue) group.add_argument("-e", action=3D"store_true", dest=3D'Encode', help=3D= 'encode file') @@ -75,7 +75,7 @@ if __name__ =3D=3D '__main__': =20 # # Parse command line arguments - # =20 + # args =3D parser.parse_args() =20 # @@ -95,19 +95,19 @@ if __name__ =3D=3D '__main__': # try: Process =3D subprocess.Popen('%s version' % (OpenSslCommand), stdout= =3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE, shell=3DTrue) - except: =20 + except: print 'ERROR: Open SSL command not available. Please verify PATH or s= et OPENSSL_PATH' sys.exit(1) - =20 + Version =3D Process.communicate() if Process.returncode <> 0: print 'ERROR: Open SSL command not available. Please verify PATH or s= et OPENSSL_PATH' sys.exit(Process.returncode) print Version[0] - =20 + # # Read input file into a buffer and save input filename - # =20 + # args.InputFileName =3D args.InputFile.name args.InputFileBuffer =3D args.InputFile.read() args.InputFile.close() @@ -173,17 +173,17 @@ if __name__ =3D=3D '__main__': if args.MonotonicCountStr: format =3D "%dsQ" % len(args.InputFileBuffer) FullInputFileBuffer =3D struct.pack(format, args.InputFileBuffer, ar= gs.MonotonicCountValue) - #=20 + # # Sign the input file using the specified private key and capture sign= ature from STDOUT # Process =3D subprocess.Popen('%s dgst -sha256 -sign "%s"' % (OpenSslCo= mmand, args.PrivateKeyFileName), stdin=3Dsubprocess.PIPE, stdout=3Dsubproce= ss.PIPE, stderr=3Dsubprocess.PIPE, shell=3DTrue) Signature =3D Process.communicate(input=3DFullInputFileBuffer)[0] if Process.returncode <> 0: sys.exit(Process.returncode) - =20 + # # Write output file that contains hash GUID, Public Key, Signature, an= d Input data - # =20 + # args.OutputFile =3D open(args.OutputFileName, 'wb') args.OutputFile.write(EFI_HASH_ALGORITHM_SHA256_GUID.get_bytes_le()) args.OutputFile.write(PublicKey) @@ -197,7 +197,7 @@ if __name__ =3D=3D '__main__': # Header =3D EFI_CERT_BLOCK_RSA_2048_SHA256._make(EFI_CERT_BLOCK_RSA_204= 8_SHA256_STRUCT.unpack_from(args.InputFileBuffer)) args.InputFileBuffer =3D args.InputFileBuffer[EFI_CERT_BLOCK_RSA_2048_= SHA256_STRUCT.size:] - =20 + # # Verify that the Hash Type matches the expected SHA256 type # @@ -221,10 +221,10 @@ if __name__ =3D=3D '__main__': # Write Signature to output file # open(args.OutputFileName, 'wb').write(Header.Signature) - =20 + # # Verify signature - # =20 + # Process =3D subprocess.Popen('%s dgst -sha256 -prverify "%s" -signatur= e %s' % (OpenSslCommand, args.PrivateKeyFileName, args.OutputFileName), std= in=3Dsubprocess.PIPE, stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE, s= hell=3DTrue) Process.communicate(input=3DFullInputFileBuffer) if Process.returncode <> 0: @@ -233,6 +233,6 @@ if __name__ =3D=3D '__main__': sys.exit(Process.returncode) =20 # - # Save output file contents from input file=20 - # =20 + # Save output file contents from input file + # open(args.OutputFileName, 'wb').write(args.InputFileBuffer) diff --git a/BaseTools/Source/Python/Table/Table.py b/BaseTools/Source/Pyth= on/Table/Table.py index c311df91c2ec..846f76718220 100644 --- a/BaseTools/Source/Python/Table/Table.py +++ b/BaseTools/Source/Python/Table/Table.py @@ -19,7 +19,7 @@ import Common.EdkLogger as EdkLogger ## TableFile # # This class defined a common table -#=20 +# # @param object: Inherited from object class # # @param Cursor: Cursor of the database @@ -30,7 +30,7 @@ class Table(object): self.Cur =3D Cursor self.Table =3D '' self.ID =3D 0 - =20 + ## Create table # # Create a table @@ -46,18 +46,18 @@ class Table(object): # def Insert(self, SqlCommand): self.Exec(SqlCommand) - =20 + ## Query table # # Query all records of the table - # =20 + # def Query(self): EdkLogger.verbose("\nQuery tabel %s started ..." % self.Table) SqlCommand =3D """select * from %s""" % self.Table self.Cur.execute(SqlCommand) for Rs in self.Cur: EdkLogger.verbose(str(Rs)) - =20 + TotalCount =3D self.GetCount() EdkLogger.verbose("*** Total %s records in table %s ***" % (TotalC= ount, self.Table) ) EdkLogger.verbose("Query tabel %s DONE!" % self.Table) @@ -70,7 +70,7 @@ class Table(object): SqlCommand =3D """drop table IF EXISTS %s""" % self.Table self.Cur.execute(SqlCommand) EdkLogger.verbose("Drop tabel %s ... DONE!" % self.Table) - =20 + ## Get count # # Get a count of all records of the table @@ -82,12 +82,12 @@ class Table(object): self.Cur.execute(SqlCommand) for Item in self.Cur: return Item[0] - =20 + ## Generate ID # # Generate an ID if input ID is -1 # - # @param ID: Input ID=20 + # @param ID: Input ID # # @retval ID: New generated ID # @@ -96,14 +96,14 @@ class Table(object): self.ID =3D self.ID + 1 =20 return self.ID - =20 + ## Init the ID of the table # # Init the ID of the table # def InitID(self): self.ID =3D self.GetCount() - =20 + ## Exec # # Exec Sql Command, return result diff --git a/BaseTools/Source/Python/Table/TableDataModel.py b/BaseTools/So= urce/Python/Table/TableDataModel.py index 9c3d7bd9345f..b939bc217518 100644 --- a/BaseTools/Source/Python/Table/TableDataModel.py +++ b/BaseTools/Source/Python/Table/TableDataModel.py @@ -22,7 +22,7 @@ from Common.String import ConvertToSqlString ## TableDataModel # # This class defined a table used for data model -#=20 +# # @param object: Inherited from object class # # @@ -30,7 +30,7 @@ class TableDataModel(Table): def __init__(self, Cursor): Table.__init__(self, Cursor) self.Table =3D 'DataModel' - =20 + ## Create table # # Create table DataModel @@ -62,13 +62,13 @@ class TableDataModel(Table): (Name, Description) =3D ConvertToSqlString((Name, Description)) SqlCommand =3D """insert into %s values(%s, %s, '%s', '%s')""" % (= self.Table, self.ID, CrossIndex, Name, Description) Table.Insert(self, SqlCommand) - =20 + return self.ID - =20 + ## Init table # # Create all default records of table DataModel - # =20 + # def InitTable(self): EdkLogger.verbose("\nInitialize table DataModel started ...") for Item in DataClass.MODEL_LIST: @@ -77,7 +77,7 @@ class TableDataModel(Table): Description =3D Item[0] self.Insert(CrossIndex, Name, Description) EdkLogger.verbose("Initialize table DataModel ... DONE!") - =20 + ## Get CrossIndex # # Get a model's cross index from its name @@ -91,5 +91,5 @@ class TableDataModel(Table): self.Cur.execute(SqlCommand) for Item in self.Cur: CrossIndex =3D Item[0] - =20 + return CrossIndex diff --git a/BaseTools/Source/Python/Table/TableDec.py b/BaseTools/Source/P= ython/Table/TableDec.py index 6b7d22c9384c..9daa5a008e6c 100644 --- a/BaseTools/Source/Python/Table/TableDec.py +++ b/BaseTools/Source/Python/Table/TableDec.py @@ -22,7 +22,7 @@ from Common.String import ConvertToSqlString ## TableDec # # This class defined a table used for data model -#=20 +# # @param object: Inherited from object class # # @@ -30,7 +30,7 @@ class TableDec(Table): def __init__(self, Cursor): Table.__init__(self, Cursor) self.Table =3D 'Dec' - =20 + ## Create table # # Create table Dec @@ -90,14 +90,14 @@ class TableDec(Table): SqlCommand =3D """insert into %s values(%s, %s, '%s', '%s', '%s', = '%s', %s, %s, %s, %s, %s, %s, %s)""" \ % (self.Table, self.ID, Model, Value1, Value2, Value3= , Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndC= olumn, Enabled) Table.Insert(self, SqlCommand) - =20 + return self.ID - =20 + ## Query table # - # @param Model: The Model of Record=20 + # @param Model: The Model of Record # - # @retval: A recordSet of all found records=20 + # @retval: A recordSet of all found records # def Query(self, Model): SqlCommand =3D """select ID, Value1, Value2, Value3, Arch, Belongs= ToItem, BelongsToFile, StartLine from %s diff --git a/BaseTools/Source/Python/Table/TableDsc.py b/BaseTools/Source/P= ython/Table/TableDsc.py index 69477d544d8e..10d384dc39fa 100644 --- a/BaseTools/Source/Python/Table/TableDsc.py +++ b/BaseTools/Source/Python/Table/TableDsc.py @@ -22,7 +22,7 @@ from Common.String import ConvertToSqlString ## TableDsc # # This class defined a table used for data model -#=20 +# # @param object: Inherited from object class # # @@ -30,7 +30,7 @@ class TableDsc(Table): def __init__(self, Cursor): Table.__init__(self, Cursor) self.Table =3D 'Dsc' - =20 + ## Create table # # Create table Dsc @@ -90,14 +90,14 @@ class TableDsc(Table): SqlCommand =3D """insert into %s values(%s, %s, '%s', '%s', '%s', = '%s', %s, %s, %s, %s, %s, %s, %s)""" \ % (self.Table, self.ID, Model, Value1, Value2, Value3= , Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndC= olumn, Enabled) Table.Insert(self, SqlCommand) - =20 + return self.ID - =20 + ## Query table # - # @param Model: The Model of Record=20 + # @param Model: The Model of Record # - # @retval: A recordSet of all found records=20 + # @retval: A recordSet of all found records # def Query(self, Model): SqlCommand =3D """select ID, Value1, Value2, Value3, Arch, Belongs= ToItem, BelongsToFile, StartLine from %s diff --git a/BaseTools/Source/Python/Table/TableEotReport.py b/BaseTools/So= urce/Python/Table/TableEotReport.py index 740105c8f99d..35ac291eb443 100644 --- a/BaseTools/Source/Python/Table/TableEotReport.py +++ b/BaseTools/Source/Python/Table/TableEotReport.py @@ -24,7 +24,7 @@ import Eot.EotGlobalData as EotGlobalData ## TableReport # # This class defined a table used for data model -#=20 +# # @param object: Inherited from object class # # @@ -32,7 +32,7 @@ class TableEotReport(Table): def __init__(self, Cursor): Table.__init__(self, Cursor) self.Table =3D 'Report' - =20 + ## Create table # # Create table report @@ -68,7 +68,7 @@ class TableEotReport(Table): % (self.Table, self.ID, ModuleID, ModuleName, ModuleG= uid, SourceFileID, SourceFileFullPath, \ ItemName, ItemType, ItemMode, GuidName, GuidMacro,= GuidValue, BelongsToFunction, Enabled) Table.Insert(self, SqlCommand) - =20 + def GetMaxID(self): SqlCommand =3D """select max(ID) from %s""" % self.Table self.Cur.execute(SqlCommand) diff --git a/BaseTools/Source/Python/Table/TableFdf.py b/BaseTools/Source/P= ython/Table/TableFdf.py index 927b5d1a3be6..2ee836e93b0a 100644 --- a/BaseTools/Source/Python/Table/TableFdf.py +++ b/BaseTools/Source/Python/Table/TableFdf.py @@ -22,7 +22,7 @@ from Common.String import ConvertToSqlString ## TableFdf # # This class defined a table used for data model -#=20 +# # @param object: Inherited from object class # # @@ -30,7 +30,7 @@ class TableFdf(Table): def __init__(self, Cursor): Table.__init__(self, Cursor) self.Table =3D 'Fdf' - =20 + ## Create table # # Create table Fdf @@ -91,14 +91,14 @@ class TableFdf(Table): SqlCommand =3D """insert into %s values(%s, %s, '%s', '%s', '%s', = '%s', '%s', %s, %s, %s, %s, %s, %s, %s)""" \ % (self.Table, self.ID, Model, Value1, Value2, Value3= , Scope1, Scope2, BelongsToItem, BelongsToFile, StartLine, StartColumn, End= Line, EndColumn, Enabled) Table.Insert(self, SqlCommand) - =20 + return self.ID - =20 + ## Query table # - # @param Model: The Model of Record=20 + # @param Model: The Model of Record # - # @retval: A recordSet of all found records=20 + # @retval: A recordSet of all found records # def Query(self, Model): SqlCommand =3D """select ID, Value1, Value2, Value3, Scope1, Scope= 2, BelongsToItem, BelongsToFile, StartLine from %s diff --git a/BaseTools/Source/Python/Table/TableFile.py b/BaseTools/Source/= Python/Table/TableFile.py index caf749e9d3c5..723b19b69d81 100644 --- a/BaseTools/Source/Python/Table/TableFile.py +++ b/BaseTools/Source/Python/Table/TableFile.py @@ -23,14 +23,14 @@ from CommonDataClass.DataClass import FileClass ## TableFile # # This class defined a table used for file -#=20 +# # @param object: Inherited from object class # class TableFile(Table): def __init__(self, Cursor): Table.__init__(self, Cursor) self.Table =3D 'File' - =20 + ## Create table # # Create table File @@ -72,15 +72,15 @@ class TableFile(Table): SqlCommand =3D """insert into %s values(%s, '%s', '%s', '%s', '%s'= , %s, '%s')""" \ % (self.Table, self.ID, Name, E= xtName, Path, FullPath, Model, TimeStamp) Table.Insert(self, SqlCommand) - =20 + return self.ID ## InsertFile # # Insert one file to table # # @param FileFullPath: The full path of the file - # @param Model: The model of the file=20 - #=20 + # @param Model: The model of the file + # # @retval FileID: The ID after record is inserted # def InsertFile(self, FileFullPath, Model): @@ -89,7 +89,7 @@ class TableFile(Table): TimeStamp =3D os.stat(FileFullPath)[8] File =3D FileClass(-1, Name, Ext, Filepath, FileFullPath, Model, '= ', [], [], []) return self.Insert(File.Name, File.ExtName, File.Path, File.FullPa= th, File.Model, TimeStamp) - =20 + ## Get ID of a given file # # @param FilePath Path of file diff --git a/BaseTools/Source/Python/Table/TableFunction.py b/BaseTools/Sou= rce/Python/Table/TableFunction.py index 3d7c2d0ea5a0..af483ebd8c12 100644 --- a/BaseTools/Source/Python/Table/TableFunction.py +++ b/BaseTools/Source/Python/Table/TableFunction.py @@ -21,21 +21,21 @@ from Common.String import ConvertToSqlString ## TableFunction # # This class defined a table used for function -#=20 +# # @param Table: Inherited from Table class # class TableFunction(Table): def __init__(self, Cursor): Table.__init__(self, Cursor) self.Table =3D 'Function' - =20 + ## Create table # # Create table Function # # @param ID: ID of a Function # @param Header: Header of a Function - # @param Modifier: Modifier of a Function=20 + # @param Modifier: Modifier of a Function # @param Name: Name of a Function # @param ReturnStatement: ReturnStatement of a Funciont # @param StartLine: StartLine of a Function @@ -72,7 +72,7 @@ class TableFunction(Table): # # @param ID: ID of a Function # @param Header: Header of a Function - # @param Modifier: Modifier of a Function=20 + # @param Modifier: Modifier of a Function # @param Name: Name of a Function # @param ReturnStatement: ReturnStatement of a Funciont # @param StartLine: StartLine of a Function diff --git a/BaseTools/Source/Python/Table/TableIdentifier.py b/BaseTools/S= ource/Python/Table/TableIdentifier.py index bcd6d6e1c152..d90035c6df82 100644 --- a/BaseTools/Source/Python/Table/TableIdentifier.py +++ b/BaseTools/Source/Python/Table/TableIdentifier.py @@ -21,7 +21,7 @@ from Table import Table ## TableIdentifier # # This class defined a table used for Identifier -#=20 +# # @param object: Inherited from object class # # @@ -29,7 +29,7 @@ class TableIdentifier(Table): def __init__(self, Cursor): Table.__init__(self, Cursor) self.Table =3D 'Identifier' - =20 + ## Create table # # Create table Identifier diff --git a/BaseTools/Source/Python/Table/TableInf.py b/BaseTools/Source/P= ython/Table/TableInf.py index b6e300b150c1..1480af39d718 100644 --- a/BaseTools/Source/Python/Table/TableInf.py +++ b/BaseTools/Source/Python/Table/TableInf.py @@ -22,7 +22,7 @@ from Common.String import ConvertToSqlString ## TableInf # # This class defined a table used for data model -#=20 +# # @param object: Inherited from object class # # @@ -30,7 +30,7 @@ class TableInf(Table): def __init__(self, Cursor): Table.__init__(self, Cursor) self.Table =3D 'Inf' - =20 + ## Create table # # Create table Inf @@ -96,14 +96,14 @@ class TableInf(Table): SqlCommand =3D """insert into %s values(%s, %s, '%s', '%s', '%s', = '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s)""" \ % (self.Table, self.ID, Model, Value1, Value2, Value3= , Value4, Value5, Arch, BelongsToItem, BelongsToFile, StartLine, StartColum= n, EndLine, EndColumn, Enabled) Table.Insert(self, SqlCommand) - =20 + return self.ID - =20 + ## Query table # - # @param Model: The Model of Record=20 + # @param Model: The Model of Record # - # @retval: A recordSet of all found records=20 + # @retval: A recordSet of all found records # def Query(self, Model): SqlCommand =3D """select ID, Value1, Value2, Value3, Arch, Belongs= ToItem, BelongsToFile, StartLine from %s diff --git a/BaseTools/Source/Python/Table/TablePcd.py b/BaseTools/Source/P= ython/Table/TablePcd.py index 19623f98f42c..7ea521517199 100644 --- a/BaseTools/Source/Python/Table/TablePcd.py +++ b/BaseTools/Source/Python/Table/TablePcd.py @@ -21,7 +21,7 @@ from Common.String import ConvertToSqlString ## TablePcd # # This class defined a table used for pcds -#=20 +# # @param object: Inherited from object class # # @@ -29,7 +29,7 @@ class TablePcd(Table): def __init__(self, Cursor): Table.__init__(self, Cursor) self.Table =3D 'Pcd' - =20 + ## Create table # # Create table Pcd diff --git a/BaseTools/Source/Python/Table/TableReport.py b/BaseTools/Sourc= e/Python/Table/TableReport.py index 4af0e98d86b4..aec7c7203c44 100644 --- a/BaseTools/Source/Python/Table/TableReport.py +++ b/BaseTools/Source/Python/Table/TableReport.py @@ -25,7 +25,7 @@ from Common.LongFilePathSupport import OpenLongFilePath a= s open ## TableReport # # This class defined a table used for data model -#=20 +# # @param object: Inherited from object class # # @@ -33,7 +33,7 @@ class TableReport(Table): def __init__(self, Cursor): Table.__init__(self, Cursor) self.Table =3D 'Report' - =20 + ## Create table # # Create table report @@ -78,7 +78,7 @@ class TableReport(Table): =20 ## Query table # - # @retval: A recordSet of all found records=20 + # @retval: A recordSet of all found records # def Query(self): SqlCommand =3D """select ID, ErrorID, OtherMsg, BelongsToTable, Be= longsToItem, Corrected from %s diff --git a/BaseTools/Source/Python/TargetTool/TargetTool.py b/BaseTools/S= ource/Python/TargetTool/TargetTool.py index ecac316b7a3a..113ef11f91ba 100644 --- a/BaseTools/Source/Python/TargetTool/TargetTool.py +++ b/BaseTools/Source/Python/TargetTool/TargetTool.py @@ -85,13 +85,13 @@ class TargetTool(): if type(self.TargetTxtDictionary[Key]) =3D=3D type([]): print "%-30s =3D %s" % (Key, ''.join(elem + ' ' for elem i= n self.TargetTxtDictionary[Key])) elif self.TargetTxtDictionary[Key] is None: - errMsg +=3D " Missing %s configuration information, pleas= e use TargetTool to set value!" % Key + os.linesep=20 + errMsg +=3D " Missing %s configuration information, pleas= e use TargetTool to set value!" % Key + os.linesep else: print "%-30s =3D %s" % (Key, self.TargetTxtDictionary[Key]) - =20 + if errMsg !=3D '': print os.linesep + 'Warning:' + os.linesep + errMsg - =20 + def RWFile(self, CommentCharacter, KeySplitCharacter, Num): try: fr =3D open(self.FileName, 'r') @@ -110,7 +110,7 @@ class TargetTool(): existKeys.append(Key) else: print "Warning: Found duplicate key item i= n original configuration files!" - =20 + if Num =3D=3D 0: Line =3D "%-30s =3D \n" % Key else: @@ -125,12 +125,12 @@ class TargetTool(): if Line is None: Line =3D "%-30s =3D " % key fw.write(Line) - =20 + fr.close() fw.close() os.remove(self.FileName) os.rename(os.path.normpath(os.path.join(self.WorkSpace, 'Conf\= \targetnew.txt')), self.FileName) - =20 + except: last_type, last_value, last_tb =3D sys.exc_info() traceback.print_exception(last_type, last_value, last_tb) @@ -142,20 +142,20 @@ def GetConfigureKeyValue(self, Key): if os.path.exists(dscFullPath): Line =3D "%-30s =3D %s\n" % (Key, self.Opt.DSCFILE) else: - EdkLogger.error("TagetTool", BuildToolError.FILE_NOT_FOUND,=20 + EdkLogger.error("TagetTool", BuildToolError.FILE_NOT_FOUND, "DSC file %s does not exist!" % self.Opt.DSCFI= LE, RaiseError=3DFalse) elif Key =3D=3D TAB_TAT_DEFINES_TOOL_CHAIN_CONF and self.Opt.TOOL_DEFI= NITION_FILE is not None: tooldefFullPath =3D os.path.join(self.WorkSpace, self.Opt.TOOL_DEF= INITION_FILE) if os.path.exists(tooldefFullPath): Line =3D "%-30s =3D %s\n" % (Key, self.Opt.TOOL_DEFINITION_FIL= E) else: - EdkLogger.error("TagetTool", BuildToolError.FILE_NOT_FOUND,=20 + EdkLogger.error("TagetTool", BuildToolError.FILE_NOT_FOUND, "Tooldef file %s does not exist!" % self.Opt.T= OOL_DEFINITION_FILE, RaiseError=3DFalse) =20 elif self.Opt.NUM >=3D 2: Line =3D "%-30s =3D %s\n" % (Key, 'Enable') elif self.Opt.NUM <=3D 1: - Line =3D "%-30s =3D %s\n" % (Key, 'Disable') =20 + Line =3D "%-30s =3D %s\n" % (Key, 'Disable') elif Key =3D=3D TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER and self.= Opt.NUM is not None: Line =3D "%-30s =3D %s\n" % (Key, str(self.Opt.NUM)) elif Key =3D=3D TAB_TAT_DEFINES_TARGET and self.Opt.TARGET is not None: @@ -169,7 +169,7 @@ def GetConfigureKeyValue(self, Key): if os.path.exists(buildruleFullPath): Line =3D "%-30s =3D %s\n" % (Key, self.Opt.BUILD_RULE_FILE) else: - EdkLogger.error("TagetTool", BuildToolError.FILE_NOT_FOUND,=20 + EdkLogger.error("TagetTool", BuildToolError.FILE_NOT_FOUND, "Build rule file %s does not exist!" % self.Op= t.BUILD_RULE_FILE, RaiseError=3DFalse) return Line =20 @@ -199,7 +199,7 @@ def RangeCheckCallback(option, opt_str, value, parser): setattr(parser.values, option.dest, value) else: parser.error("Option %s only allows one instance in command line!"= % option) - =20 + def MyOptionParser(): parser =3D OptionParser(version=3D__version__,prog=3D"TargetTool.exe",= usage=3D__usage__,description=3D__copyright__) parser.add_option("-a", "--arch", action=3D"append", type=3D"choice", = choices=3D['IA32','X64','IPF','EBC', 'ARM', 'AARCH64','0'], dest=3D"TARGET_= ARCH", @@ -225,7 +225,7 @@ if __name__ =3D=3D '__main__': if os.getenv('WORKSPACE') is None: print "ERROR: WORKSPACE should be specified or edksetup script sho= uld be executed before run TargetTool" sys.exit(1) - =20 + (opt, args) =3D MyOptionParser() if len(args) !=3D 1 or (args[0].lower() !=3D 'print' and args[0].lower= () !=3D 'clean' and args[0].lower() !=3D 'set'): print "The number of args isn't 1 or the value of args is invalid." diff --git a/BaseTools/Source/Python/Trim/Trim.py b/BaseTools/Source/Python= /Trim/Trim.py index 3eb7fa39209d..2b3786d78cb4 100644 --- a/BaseTools/Source/Python/Trim/Trim.py +++ b/BaseTools/Source/Python/Trim/Trim.py @@ -258,7 +258,7 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, Tr= imLong): # def TrimPreprocessedVfr(Source, Target): CreateDirectory(os.path.dirname(Target)) - =20 + try: f =3D open (Source,'r') except: @@ -335,7 +335,7 @@ def DoInclude(Source, Indent=3D'', IncludePathList=3D[]= , LocalSearchPath=3DNone): SearchPathList =3D [LocalSearchPath] + IncludePathList else: SearchPathList =3D IncludePathList - =20 + for IncludePath in SearchPathList: IncludeFile =3D os.path.join(IncludePath, Source) if os.path.isfile(IncludeFile): @@ -346,7 +346,7 @@ def DoInclude(Source, Indent=3D'', IncludePathList=3D[]= , LocalSearchPath=3DNone): except: EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=3DSource) =20 - =20 + # avoid A "include" B and B "include" A IncludeFile =3D os.path.abspath(os.path.normpath(IncludeFile)) if IncludeFile in gIncludedAslFile: @@ -354,7 +354,7 @@ def DoInclude(Source, Indent=3D'', IncludePathList=3D[]= , LocalSearchPath=3DNone): ExtraData=3D "%s -> %s" % (" -> ".join(gIncludedAsl= File), IncludeFile)) return [] gIncludedAslFile.append(IncludeFile) - =20 + for Line in F: LocalSearchPath =3D None Result =3D gAslIncludePattern.findall(Line) @@ -364,7 +364,7 @@ def DoInclude(Source, Indent=3D'', IncludePathList=3D[]= , LocalSearchPath=3DNone): NewFileContent.append("%s%s" % (Indent, Line)) continue # - # We should first search the local directory if current file a= re using pattern #include "XXX"=20 + # We should first search the local directory if current file a= re using pattern #include "XXX" # if Result[0][2] =3D=3D '"': LocalSearchPath =3D os.path.dirname(IncludeFile) @@ -385,20 +385,20 @@ def DoInclude(Source, Indent=3D'', IncludePathList=3D= [], LocalSearchPath=3DNone): # # @param Source File to be trimmed # @param Target File to store the trimmed content -# @param IncludePathFile The file to log the external include path=20 +# @param IncludePathFile The file to log the external include path # def TrimAslFile(Source, Target, IncludePathFile): CreateDirectory(os.path.dirname(Target)) - =20 + SourceDir =3D os.path.dirname(Source) if SourceDir =3D=3D '': SourceDir =3D '.' - =20 + # # Add source directory as the first search directory # IncludePathList =3D [SourceDir] - =20 + # # If additional include path file is specified, append them all # to the search directory list. @@ -669,7 +669,7 @@ def Main(): EdkLogger.SetLevel(CommandOptions.LogLevel) except FatalError, X: return 1 - =20 + try: if CommandOptions.FileType =3D=3D "Vfr": if CommandOptions.OutputFile is None: diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 13a1ed886cc4..48690aa357f7 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1059,7 +1059,7 @@ class DscBuildData(PlatformBuildClassObject): return PcdValue try: PcdValue =3D ValueExpressionEx(PcdValue[1:], PcdDatumType,= GuidDict)(True) - except BadExpression, Value: =20 + except BadExpression, Value: EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s] Val= ue "%s", %s' % (TokenSpaceGuidCName, TokenCName, PcdValue= , Value)) elif PcdValue.startswith("L'") or PcdValue.startswith("'"): diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTool= s/Source/Python/Workspace/MetaFileParser.py index 550359f9abb2..2226f707c7aa 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -371,7 +371,7 @@ class MetaFileParser(object): # Sometimes, we need to make differences between EDK and EDK2 modu= les=20 if Name =3D=3D 'INF_VERSION': if hexVersionPattern.match(Value): - self._Version =3D int(Value, 0) =20 + self._Version =3D int(Value, 0) elif decVersionPattern.match(Value): ValueList =3D Value.split('.') Major =3D '%04o' % int(ValueList[0], 0) diff --git a/BaseTools/Source/Python/Workspace/MetaFileTable.py b/BaseTools= /Source/Python/Workspace/MetaFileTable.py index 3c8dae0e622f..5aa5d67b8239 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileTable.py +++ b/BaseTools/Source/Python/Workspace/MetaFileTable.py @@ -56,7 +56,7 @@ class MetaFileTable(Table): Result =3D self.Cur.execute("select ID from %s where ID<0" % (= self.Table)).fetchall() if not Result: # update the timestamp in database - self._FileIndexTable.SetFileTimeStamp(self.IdBase, TimeSta= mp) =20 + self._FileIndexTable.SetFileTimeStamp(self.IdBase, TimeSta= mp) return False =20 if TimeStamp !=3D self._FileIndexTable.GetFileTimeStamp(self.I= dBase): @@ -113,28 +113,28 @@ class ModuleTable(MetaFileTable): BelongsToItem=3D-1, StartLine=3D-1, StartColumn=3D-1, EndLi= ne=3D-1, EndColumn=3D-1, Enabled=3D0): (Value1, Value2, Value3, Scope1, Scope2) =3D ConvertToSqlString((V= alue1, Value2, Value3, Scope1, Scope2)) return Table.Insert( - self,=20 - Model,=20 - Value1,=20 - Value2,=20 - Value3,=20 - Scope1,=20 + self, + Model, + Value1, + Value2, + Value3, + Scope1, Scope2, - BelongsToItem,=20 - StartLine,=20 - StartColumn,=20 - EndLine,=20 - EndColumn,=20 + BelongsToItem, + StartLine, + StartColumn, + EndLine, + EndColumn, Enabled ) =20 ## Query table # - # @param Model: The Model of Record=20 - # @param Arch: The Arch attribute of Record=20 - # @param Platform The Platform attribute of Record=20 + # @param Model: The Model of Record + # @param Arch: The Arch attribute of Record + # @param Platform The Platform attribute of Record # - # @retval: A recordSet of all found records=20 + # @retval: A recordSet of all found records # def Query(self, Model, Arch=3DNone, Platform=3DNone, BelongsToItem=3DN= one): ConditionString =3D "Model=3D%s AND Enabled>=3D0" % Model @@ -195,27 +195,27 @@ class PackageTable(MetaFileTable): BelongsToItem=3D-1, StartLine=3D-1, StartColumn=3D-1, EndLi= ne=3D-1, EndColumn=3D-1, Enabled=3D0): (Value1, Value2, Value3, Scope1, Scope2) =3D ConvertToSqlString((V= alue1, Value2, Value3, Scope1, Scope2)) return Table.Insert( - self,=20 - Model,=20 - Value1,=20 - Value2,=20 - Value3,=20 - Scope1,=20 + self, + Model, + Value1, + Value2, + Value3, + Scope1, Scope2, - BelongsToItem,=20 - StartLine,=20 - StartColumn,=20 - EndLine,=20 - EndColumn,=20 + BelongsToItem, + StartLine, + StartColumn, + EndLine, + EndColumn, Enabled ) =20 ## Query table # - # @param Model: The Model of Record=20 - # @param Arch: The Arch attribute of Record=20 + # @param Model: The Model of Record + # @param Arch: The Arch attribute of Record # - # @retval: A recordSet of all found records=20 + # @retval: A recordSet of all found records # def Query(self, Model, Arch=3DNone): ConditionString =3D "Model=3D%s AND Enabled>=3D0" % Model @@ -236,7 +236,7 @@ class PackageTable(MetaFileTable): try: for row in self.Cur: comment =3D row[0] - =20 + LineNum =3D row[1] comment =3D comment.strip("#") comment =3D comment.strip() @@ -310,32 +310,32 @@ class PlatformTable(MetaFileTable): FromItem=3D-1, StartLine=3D-1, StartColumn=3D-1, EndLine=3D= -1, EndColumn=3D-1, Enabled=3D1): (Value1, Value2, Value3, Scope1, Scope2,Scope3) =3D ConvertToSqlSt= ring((Value1, Value2, Value3, Scope1, Scope2,Scope3)) return Table.Insert( - self,=20 - Model,=20 - Value1,=20 - Value2,=20 - Value3,=20 - Scope1,=20 + self, + Model, + Value1, + Value2, + Value3, + Scope1, Scope2, Scope3, - BelongsToItem,=20 + BelongsToItem, FromItem, - StartLine,=20 - StartColumn,=20 - EndLine,=20 - EndColumn,=20 + StartLine, + StartColumn, + EndLine, + EndColumn, Enabled ) =20 ## Query table # - # @param Model: The Model of Record=20 + # @param Model: The Model of Record # @param Scope1: Arch of a Dsc item # @param Scope2: Module type of a Dsc item # @param BelongsToItem: The item belongs to which another item # @param FromItem: The item belongs to which dsc file # - # @retval: A recordSet of all found records=20 + # @retval: A recordSet of all found records # def Query(self, Model, Scope1=3DNone, Scope2=3DNone, BelongsToItem=3DN= one, FromItem=3DNone): ConditionString =3D "Model=3D%s AND Enabled>0" % Model diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py b/BaseT= ools/Source/Python/Workspace/WorkspaceDatabase.py index 14dcb1ae8136..fccd2ebfb8e8 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py @@ -114,8 +114,8 @@ class WorkspaceDatabase(object): =20 # get the parser ready for this file MetaFile =3D self._FILE_PARSER_[FileType]( - FilePath,=20 - FileType,=20 + FilePath, + FileType, Arch, MetaFileStorage(self.WorkspaceDb.Cur, File= Path, FileType) ) @@ -162,7 +162,7 @@ class WorkspaceDatabase(object): # remove db file in case inconsistency between db and file in = file system if self._CheckWhetherDbNeedRenew(RenewDb, DbPath): os.remove(DbPath) - =20 + # create db with optimized parameters self.Conn =3D sqlite3.connect(DbPath, isolation_level=3D'DEFERRED') self.Conn.execute("PRAGMA synchronous=3DOFF") @@ -199,11 +199,11 @@ class WorkspaceDatabase(object): def _CheckWhetherDbNeedRenew (self, force, DbPath): # if database does not exist, we need do nothing if not os.path.exists(DbPath): return False - =20 + # if user force to renew database, then not check whether database= is out of date if force: return True - =20 - # =20 + + # # Check the time of last modified source file or build.exe # if is newer than time of database, then database need to be re-c= reated. # @@ -217,15 +217,15 @@ class WorkspaceDatabase(object): if rootPath =3D=3D "" or rootPath is None: EdkLogger.verbose("\nFail to find the root path of build.e= xe or python sources, so can not \ determine whether database file is out of date!\n") - =20 + # walk the root path of source or build's binary to get the ti= me last modified. - =20 + for root, dirs, files in os.walk (rootPath): for dir in dirs: - # bypass source control folder=20 + # bypass source control folder if dir.lower() in [".svn", "_svn", "cvs"]: dirs.remove(dir) - =20 + for file in files: ext =3D os.path.splitext(file)[1] if ext.lower() =3D=3D ".py": # only check .= py files @@ -235,9 +235,9 @@ determine whether database file is out of date!\n") if timeOfToolModified > os.stat(DbPath).st_mtime: EdkLogger.verbose("\nWorkspace database is out of data!") return True - =20 + return False - =20 + ## Initialize build database def InitDatabase(self): EdkLogger.verbose("\nInitialize build database started ...") diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sourc= e/Python/build/BuildReport.py index c4647d068a6b..bcbe6f89b48b 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -235,7 +235,7 @@ def FindIncludeFiles(Source, IncludePathList, IncludeFi= les): =20 ## Split each lines in file # -# This method is used to split the lines in file to make the length of ea= ch line=20 +# This method is used to split the lines in file to make the length of ea= ch line # less than MaxLength. # # @param Content The content of file @@ -260,12 +260,12 @@ def FileLinesSplit(Content=3DNone, MaxLength=3DNone): NewContentList.append(Line) for NewLine in NewContentList: NewContent +=3D NewLine + TAB_LINE_BREAK - =20 + NewContent =3D NewContent.replace(TAB_LINE_BREAK, gEndOfLine).replace(= '\r\r\n', gEndOfLine) return NewContent - =20 - =20 - =20 + + + ## # Parse binary dependency expression section # @@ -295,10 +295,10 @@ class DepexParser(object): for Guid in Package.Guids: GuidValue =3D GuidStructureStringToGuidString(Package.= Guids[Guid]) self._GuidDb[GuidValue.upper()] =3D Guid - =20 + ## # Parse the binary dependency expression files. - #=20 + # # This function parses the binary dependency expression file and trans= late it # to the instruction list. # @@ -320,7 +320,7 @@ class DepexParser(object): OpCode =3D DepexFile.read(1) =20 return DepexStatement - =20 + ## # Reports library information # @@ -426,7 +426,7 @@ class DepexReport(object): =20 if ModuleType in ["SEC", "PEI_CORE", "DXE_CORE", "SMM_CORE", "MM_C= ORE_STANDALONE", "UEFI_APPLICATION"]: return - =20 + for Source in M.SourceFileList: if os.path.splitext(Source.Path)[1].lower() =3D=3D ".dxs": Match =3D gDxsDependencyPattern.search(open(Source.Path).r= ead()) @@ -472,7 +472,7 @@ class DepexReport(object): FileWrite(File, gSubSectionSep) except: EdkLogger.warn(None, "Dependency expression file is corrup= ted", self._DepexFileName) - =20 + FileWrite(File, "Dependency Expression (DEPEX) from %s" % self.Sou= rce) =20 if self.Source =3D=3D "INF": @@ -977,7 +977,7 @@ class PcdReport(object): EdkLogger.error('BuildReport', FORMAT_INVALID,= "PCD Value: %s, Type: %s" %(DscDefaultValue, Pcd.DatumType)) =20 InfDefaultValue =3D None - =20 + PcdValue =3D DecDefaultValue if DscDefaultValue: PcdValue =3D DscDefaultValue @@ -1519,7 +1519,7 @@ class PredictionReport(object): EotEndTime =3D time.time() EotDuration =3D time.strftime("%H:%M:%S", time.gmtime(int(roun= d(EotEndTime - EotStartTime)))) EdkLogger.quiet("EOT run time: %s\n" % EotDuration) - =20 + # # Parse the output of EOT tool # @@ -1717,7 +1717,7 @@ class FdRegionReport(object): PlatformPcds =3D {} # # Collect PCDs declared in DEC files. - # =20 + # for Pa in Wa.AutoGenObjectList: for Package in Pa.PackageList: for (TokenCName, TokenSpaceGuidCName, DecType) in Package.= Pcds: @@ -1998,7 +1998,7 @@ class PlatformReport(object): self.DepexParser =3D None if "DEPEX" in ReportType: self.DepexParser =3D DepexParser(Wa) - =20 + self.ModuleReportList =3D [] if MaList is not None: self._IsModuleBuild =3D True @@ -2073,7 +2073,7 @@ class PlatformReport(object): if not self._IsModuleBuild: if "PCD" in ReportType: self.PcdReport.GenerateReport(File, None) - =20 + if "FLASH" in ReportType: for FdReportListItem in self.FdReportList: FdReportListItem.GenerateReport(File) @@ -2107,7 +2107,7 @@ class BuildReport(object): if ReportFile: self.ReportList =3D [] self.ReportType =3D [] - if ReportType:=20 + if ReportType: for ReportTypeItem in ReportType: if ReportTypeItem not in self.ReportType: self.ReportType.append(ReportTypeItem) @@ -2153,7 +2153,7 @@ class BuildReport(object): EdkLogger.error("BuildReport", CODE_ERROR, "Unknown fatal = error when generating build report", ExtraData=3Dself.ReportFile, RaiseErro= r=3DFalse) EdkLogger.quiet("(Python %s on %s\n%s)" % (platform.python= _version(), sys.platform, traceback.format_exc())) File.close() - =20 + # This acts like the main() function for the script, unless it is 'import'= ed into another script. if __name__ =3D=3D '__main__': pass diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/build/build.py index 1c26e72feb6b..0ca78c1fa451 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -110,7 +110,7 @@ def CheckEnvVariable(): EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allowe= d in WORKSPACE path", ExtraData=3DWorkspaceDir) os.environ["WORKSPACE"] =3D WorkspaceDir - =20 + # set multiple workspace PackagesPath =3D os.getenv("PACKAGES_PATH") mws.setWs(WorkspaceDir, PackagesPath) @@ -200,7 +200,7 @@ def CheckEnvVariable(): GlobalData.gGlobalDefines["EDK_SOURCE"] =3D EdkSourceDir GlobalData.gGlobalDefines["ECP_SOURCE"] =3D EcpSourceDir GlobalData.gGlobalDefines["EDK_TOOLS_PATH"] =3D os.environ["EDK_TOOLS_= PATH"] - =20 + ## Get normalized file path # # Convert the path to be local format, and remove the WORKSPACE path at the @@ -265,7 +265,7 @@ def LaunchCommand(Command, WorkingDir): # if working directory doesn't exist, Popen() will raise an exception if not os.path.isdir(WorkingDir): EdkLogger.error("build", FILE_NOT_FOUND, ExtraData=3DWorkingDir) - =20 + # Command is used as the first Argument in following Popen(). # It could be a string or sequence. We find that if command is a strin= g in following Popen(), # ubuntu may fail with an error message that the command is not found. @@ -848,14 +848,14 @@ class Build(): # print current build environment and configuration EdkLogger.quiet("%-16s =3D %s" % ("WORKSPACE", os.environ["WORKSPA= CE"])) if "PACKAGES_PATH" in os.environ: - # WORKSPACE env has been converted before. Print the same path= style with WORKSPACE env.=20 + # WORKSPACE env has been converted before. Print the same path= style with WORKSPACE env. EdkLogger.quiet("%-16s =3D %s" % ("PACKAGES_PATH", os.path.nor= mcase(os.path.normpath(os.environ["PACKAGES_PATH"])))) EdkLogger.quiet("%-16s =3D %s" % ("ECP_SOURCE", os.environ["ECP_SO= URCE"])) EdkLogger.quiet("%-16s =3D %s" % ("EDK_SOURCE", os.environ["EDK_SO= URCE"])) EdkLogger.quiet("%-16s =3D %s" % ("EFI_SOURCE", os.environ["EFI_SO= URCE"])) EdkLogger.quiet("%-16s =3D %s" % ("EDK_TOOLS_PATH", os.environ["ED= K_TOOLS_PATH"])) if "EDK_TOOLS_BIN" in os.environ: - # Print the same path style with WORKSPACE env.=20 + # Print the same path style with WORKSPACE env. EdkLogger.quiet("%-16s =3D %s" % ("EDK_TOOLS_BIN", os.path.nor= mcase(os.path.normpath(os.environ["EDK_TOOLS_BIN"])))) EdkLogger.quiet("%-16s =3D %s" % ("CONF_PATH", GlobalData.gConfDir= ectory)) self.InitPreBuild() @@ -1961,7 +1961,7 @@ class Build(): self._SaveMapFile (MapBuffer, Wa) =20 def _GenFfsCmd(self): - # convert dictionary of Cmd:(Inf,Arch)=20 + # convert dictionary of Cmd:(Inf,Arch) # to a new dictionary of (Inf,Arch):Cmd,Cmd,Cmd... CmdSetDict =3D defaultdict(set) GenFfsDict =3D GenFds.GenFfsMakefile('', GlobalData.gFdfParser, se= lf, self.ArchList, GlobalData) @@ -2033,7 +2033,7 @@ class Build(): for Module in ModuleList: # Get ModuleAutoGen object to generate C code file= and makefile Ma =3D ModuleAutoGen(Wa, Module, BuildTarget, Tool= Chain, Arch, self.PlatformFile) - =20 + if Ma is None: continue if Ma.CanSkipbyHash(): diff --git a/BaseTools/Source/Python/sitecustomize.py b/BaseTools/Source/Py= thon/sitecustomize.py index 4ea84c512969..3afa90700e30 100644 --- a/BaseTools/Source/Python/sitecustomize.py +++ b/BaseTools/Source/Python/sitecustomize.py @@ -16,6 +16,6 @@ import locale if sys.platform =3D=3D "darwin": DefaultLocal =3D locale.getdefaultlocale()[1] if DefaultLocal is None: - DefaultLocal =3D 'UTF8' =20 + DefaultLocal =3D 'UTF8' sys.setdefaultencoding(DefaultLocal) =20 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868513988580.7589573153448; Fri, 27 Apr 2018 15:35:13 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 402B6207DF462; Fri, 27 Apr 2018 15:33:10 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 10C832034C8DD for ; Fri, 27 Apr 2018 15:33:03 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:33:01 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252871" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:47 -0700 Message-Id: <0c0ee4469616a05baf8f01294d22a5315b5069ba.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 33/42] BaseTools: AutoGen - add Opcode constants X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" add constants for dependency expression opcode strings use these new opcode string constants Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenDepex.py | 112 ++++++++++---------- BaseTools/Source/Python/Common/DataType.py | 12 +++ 2 files changed, 67 insertions(+), 57 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenDepex.py b/BaseTools/Source= /Python/AutoGen/GenDepex.py index 9acea8f6bfed..3dcbad5be666 100644 --- a/BaseTools/Source/Python/AutoGen/GenDepex.py +++ b/BaseTools/Source/Python/AutoGen/GenDepex.py @@ -1,7 +1,7 @@ ## @file # This file is used to generate DEPEX file for module's dependency express= ion # -# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BS= D License # which accompanies this distribution. The full text of the license may= be found at @@ -24,6 +24,7 @@ from Common.Misc import SaveFileOnChange from Common.Misc import GuidStructureStringToGuidString from Common import EdkLogger as EdkLogger from Common.BuildVersion import gBUILD_VERSION +from Common.DataType import * =20 ## Regular expression for matching "DEPENDENCY_START ... DEPENDENCY_END" gStartClosePattern =3D re.compile(".*DEPENDENCY_START(.+)DEPENDENCY_END.*"= , re.S) @@ -70,65 +71,62 @@ class DependencyExpression: ) =20 OpcodePriority =3D { - "AND" : 1, - "OR" : 1, - "NOT" : 2, - # "SOR" : 9, - # "BEFORE": 9, - # "AFTER" : 9, + DEPEX_OPCODE_AND : 1, + DEPEX_OPCODE_OR : 1, + DEPEX_OPCODE_NOT : 2, } =20 Opcode =3D { "PEI" : { - "PUSH" : 0x02, - "AND" : 0x03, - "OR" : 0x04, - "NOT" : 0x05, - "TRUE" : 0x06, - "FALSE" : 0x07, - "END" : 0x08 + DEPEX_OPCODE_PUSH : 0x02, + DEPEX_OPCODE_AND : 0x03, + DEPEX_OPCODE_OR : 0x04, + DEPEX_OPCODE_NOT : 0x05, + DEPEX_OPCODE_TRUE : 0x06, + DEPEX_OPCODE_FALSE : 0x07, + DEPEX_OPCODE_END : 0x08 }, =20 "DXE" : { - "BEFORE": 0x00, - "AFTER" : 0x01, - "PUSH" : 0x02, - "AND" : 0x03, - "OR" : 0x04, - "NOT" : 0x05, - "TRUE" : 0x06, - "FALSE" : 0x07, - "END" : 0x08, - "SOR" : 0x09 + DEPEX_OPCODE_BEFORE: 0x00, + DEPEX_OPCODE_AFTER : 0x01, + DEPEX_OPCODE_PUSH : 0x02, + DEPEX_OPCODE_AND : 0x03, + DEPEX_OPCODE_OR : 0x04, + DEPEX_OPCODE_NOT : 0x05, + DEPEX_OPCODE_TRUE : 0x06, + DEPEX_OPCODE_FALSE : 0x07, + DEPEX_OPCODE_END : 0x08, + DEPEX_OPCODE_SOR : 0x09 }, =20 "MM" : { - "BEFORE": 0x00, - "AFTER" : 0x01, - "PUSH" : 0x02, - "AND" : 0x03, - "OR" : 0x04, - "NOT" : 0x05, - "TRUE" : 0x06, - "FALSE" : 0x07, - "END" : 0x08, - "SOR" : 0x09 + DEPEX_OPCODE_BEFORE: 0x00, + DEPEX_OPCODE_AFTER : 0x01, + DEPEX_OPCODE_PUSH : 0x02, + DEPEX_OPCODE_AND : 0x03, + DEPEX_OPCODE_OR : 0x04, + DEPEX_OPCODE_NOT : 0x05, + DEPEX_OPCODE_TRUE : 0x06, + DEPEX_OPCODE_FALSE : 0x07, + DEPEX_OPCODE_END : 0x08, + DEPEX_OPCODE_SOR : 0x09 } } =20 # all supported op codes and operands - SupportedOpcode =3D ["BEFORE", "AFTER", "PUSH", "AND", "OR", "NOT", "E= ND", "SOR"] - SupportedOperand =3D ["TRUE", "FALSE"] + SupportedOpcode =3D [DEPEX_OPCODE_BEFORE, DEPEX_OPCODE_AFTER, DEPEX_OP= CODE_PUSH, DEPEX_OPCODE_AND, DEPEX_OPCODE_OR, DEPEX_OPCODE_NOT, DEPEX_OPCOD= E_END, DEPEX_OPCODE_SOR] + SupportedOperand =3D [DEPEX_OPCODE_TRUE, DEPEX_OPCODE_FALSE] =20 - OpcodeWithSingleOperand =3D ['NOT', 'BEFORE', 'AFTER'] - OpcodeWithTwoOperand =3D ['AND', 'OR'] + OpcodeWithSingleOperand =3D [DEPEX_OPCODE_NOT, DEPEX_OPCODE_BEFORE, DE= PEX_OPCODE_AFTER] + OpcodeWithTwoOperand =3D [DEPEX_OPCODE_AND, DEPEX_OPCODE_OR] =20 # op code that should not be the last one - NonEndingOpcode =3D ["AND", "OR", "NOT", 'SOR'] + NonEndingOpcode =3D [DEPEX_OPCODE_AND, DEPEX_OPCODE_OR, DEPEX_OPCODE_N= OT, DEPEX_OPCODE_SOR] # op code must not present at the same time - ExclusiveOpcode =3D ["BEFORE", "AFTER"] + ExclusiveOpcode =3D [DEPEX_OPCODE_BEFORE, DEPEX_OPCODE_AFTER] # op code that should be the first one if it presents - AboveAllOpcode =3D ["SOR", "BEFORE", "AFTER"] + AboveAllOpcode =3D [DEPEX_OPCODE_SOR, DEPEX_OPCODE_BEFORE, DEPEX_OPCOD= E_AFTER] =20 # # open and close brace must be taken as individual tokens @@ -200,7 +198,7 @@ class DependencyExpression: break self.PostfixNotation.append(Stack.pop()) elif Token in self.OpcodePriority: - if Token =3D=3D "NOT": + if Token =3D=3D DEPEX_OPCODE_NOT: if LastToken not in self.SupportedOpcode + ['(', '', N= one]: EdkLogger.error("GenDepex", PARSER_ERROR, "Invalid= dependency expression: missing operator before NOT", ExtraData=3D"Near %s" % LastToken) @@ -222,10 +220,10 @@ class DependencyExpression: ExtraData=3D"Near %s" % LastToken) if len(self.OpcodeList) =3D=3D 0 or self.OpcodeList[-1= ] not in self.ExclusiveOpcode: if Token not in self.SupportedOperand: - self.PostfixNotation.append("PUSH") + self.PostfixNotation.append(DEPEX_OPCODE_PUSH) # check if OP is valid in this phase elif Token in self.Opcode[self.Phase]: - if Token =3D=3D "END": + if Token =3D=3D DEPEX_OPCODE_END: break self.OpcodeList.append(Token) else: @@ -241,8 +239,8 @@ class DependencyExpression: ExtraData=3Dstr(self)) while len(Stack) > 0: self.PostfixNotation.append(Stack.pop()) - if self.PostfixNotation[-1] !=3D 'END': - self.PostfixNotation.append("END") + if self.PostfixNotation[-1] !=3D DEPEX_OPCODE_END: + self.PostfixNotation.append(DEPEX_OPCODE_END) =20 ## Validate the dependency expression def ValidateOpcode(self): @@ -262,20 +260,20 @@ class DependencyExpression: if len(self.PostfixNotation) < 3: EdkLogger.error("GenDepex", PARSER_ERROR, "Missing ope= rand for %s" % Op, ExtraData=3Dstr(self)) - if self.TokenList[-1] !=3D 'END' and self.TokenList[-1] in self.No= nEndingOpcode: + if self.TokenList[-1] !=3D DEPEX_OPCODE_END and self.TokenList[-1]= in self.NonEndingOpcode: EdkLogger.error("GenDepex", PARSER_ERROR, "Extra %s at the end= of the dependency expression" % self.TokenList[-1], ExtraData=3Dstr(self)) - if self.TokenList[-1] =3D=3D 'END' and self.TokenList[-2] in self.= NonEndingOpcode: + if self.TokenList[-1] =3D=3D DEPEX_OPCODE_END and self.TokenList[-= 2] in self.NonEndingOpcode: EdkLogger.error("GenDepex", PARSER_ERROR, "Extra %s at the end= of the dependency expression" % self.TokenList[-2], ExtraData=3Dstr(self)) - if "END" in self.TokenList and "END" !=3D self.TokenList[-1]: + if DEPEX_OPCODE_END in self.TokenList and DEPEX_OPCODE_END !=3D se= lf.TokenList[-1]: EdkLogger.error("GenDepex", PARSER_ERROR, "Extra expressions a= fter END", ExtraData=3Dstr(self)) =20 ## Simply optimize the dependency expression by removing duplicated op= erands def Optimize(self): ValidOpcode =3D list(set(self.OpcodeList)) - if len(ValidOpcode) !=3D 1 or ValidOpcode[0] not in ['AND', 'OR']: + if len(ValidOpcode) !=3D 1 or ValidOpcode[0] not in [DEPEX_OPCODE_= AND, DEPEX_OPCODE_OR]: return Op =3D ValidOpcode[0] NewOperand =3D [] @@ -284,14 +282,14 @@ class DependencyExpression: if Token in self.SupportedOpcode or Token in NewOperand: continue AllOperand.add(Token) - if Token =3D=3D 'TRUE': - if Op =3D=3D 'AND': + if Token =3D=3D DEPEX_OPCODE_TRUE: + if Op =3D=3D DEPEX_OPCODE_AND: continue else: NewOperand.append(Token) break - elif Token =3D=3D 'FALSE': - if Op =3D=3D 'OR': + elif Token =3D=3D DEPEX_OPCODE_FALSE: + if Op =3D=3D DEPEX_OPCODE_OR: continue else: NewOperand.append(Token) @@ -299,13 +297,13 @@ class DependencyExpression: NewOperand.append(Token) =20 # don't generate depex if only TRUE operand left - if self.ModuleType =3D=3D 'PEIM' and len(NewOperand) =3D=3D 1 and = NewOperand[0] =3D=3D 'TRUE': + if self.ModuleType =3D=3D 'PEIM' and len(NewOperand) =3D=3D 1 and = NewOperand[0] =3D=3D DEPEX_OPCODE_TRUE: self.PostfixNotation =3D [] return =20 # don't generate depex if all operands are architecture protocols if self.ModuleType in ['UEFI_DRIVER', 'DXE_DRIVER', 'DXE_RUNTIME_D= RIVER', 'DXE_SAL_DRIVER', 'DXE_SMM_DRIVER', 'MM_STANDALONE'] and \ - Op =3D=3D 'AND' and \ + Op =3D=3D DEPEX_OPCODE_AND and \ self.ArchProtocols =3D=3D set([GuidStructureStringToGuidString(= Guid) for Guid in AllOperand]): self.PostfixNotation =3D [] return @@ -371,7 +369,7 @@ class DependencyExpression: =20 versionNumber =3D ("0.04" + " " + gBUILD_VERSION) __version__ =3D "%prog Version " + versionNumber -__copyright__ =3D "Copyright (c) 2007-2010, Intel Corporation All rights = reserved." +__copyright__ =3D "Copyright (c) 2007-2018, Intel Corporation All rights = reserved." __usage__ =3D "%prog [options] [dependency_expression_file]" =20 ## Parse command line options diff --git a/BaseTools/Source/Python/Common/DataType.py b/BaseTools/Source/= Python/Common/DataType.py index 8af94354620c..48700ba82012 100644 --- a/BaseTools/Source/Python/Common/DataType.py +++ b/BaseTools/Source/Python/Common/DataType.py @@ -473,6 +473,18 @@ DATABASE_PATH =3D ":memory:" #"BuildDatabase.db" # used by ECC MODIFIER_LIST =3D ['IN', 'OUT', 'OPTIONAL', 'UNALIGNED', 'EFI_RUNTIMESERVI= CE', 'EFI_BOOTSERVICE', 'EFIAPI'] =20 +# Dependency Opcodes +DEPEX_OPCODE_BEFORE =3D "BEFORE" +DEPEX_OPCODE_AFTER =3D "AFTER" +DEPEX_OPCODE_PUSH =3D "PUSH" +DEPEX_OPCODE_AND =3D "AND" +DEPEX_OPCODE_OR =3D "OR" +DEPEX_OPCODE_NOT =3D "NOT" +DEPEX_OPCODE_END =3D "END" +DEPEX_OPCODE_SOR =3D "SOR" +DEPEX_OPCODE_TRUE =3D "TRUE" +DEPEX_OPCODE_FALSE =3D "FALSE" + # Dependency Expression DEPEX_SUPPORTED_OPCODE =3D ["BEFORE", "AFTER", "PUSH", "AND", "OR", "NOT",= "END", "SOR", "TRUE", "FALSE", '(', ')'] =20 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868495472286.8309395503561; Fri, 27 Apr 2018 15:34:55 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9D935207DF452; Fri, 27 Apr 2018 15:33:09 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D5B582034C8D3 for ; Fri, 27 Apr 2018 15:33:02 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:33:01 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252874" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:48 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 34/42] BaseTools: standardize GUID and pack size X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" currently GUID packing and pack size determination is spread throughout the code. This introduces a shared function and dict and routes all code paths through them. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenPcdDb.py | 45 ++--------= ------- BaseTools/Source/Python/AutoGen/GenVar.py | 25 +--------- BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py | 28 ++--------- BaseTools/Source/Python/Common/DataType.py | 11 +++++ BaseTools/Source/Python/Common/Misc.py | 51 ++++++++++= ++++------ BaseTools/Source/Python/GenFds/Fv.py | 22 ++------- BaseTools/Source/Python/build/BuildReport.py | 2 +- 7 files changed, 61 insertions(+), 123 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source= /Python/AutoGen/GenPcdDb.py index ef6647a15302..94f430897b98 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -21,7 +21,6 @@ from Common.VariableAttributes import VariableAttributes import copy from struct import unpack from Common.DataType import * -from GenVar import PackGUID =20 DATABASE_VERSION =3D 7 =20 @@ -290,22 +289,7 @@ class DbItemList: GuidString =3D GuidStructureStringToGuidString(GuidStructureVa= lue) return PackGUID(GuidString.split('-')) =20 - if self.ItemSize =3D=3D 8: - PackStr =3D "=3DQ" - elif self.ItemSize =3D=3D 4: - PackStr =3D "=3DL" - elif self.ItemSize =3D=3D 2: - PackStr =3D "=3DH" - elif self.ItemSize =3D=3D 1: - PackStr =3D "=3DB" - elif self.ItemSize =3D=3D 0: - PackStr =3D "=3DB" - elif self.ItemSize =3D=3D 16: - # pack Guid - PackStr =3D '' - else: - # should not reach here - assert(False) + PackStr =3D PACK_CODE_BY_SIZE[self.ItemSize] =20 Buffer =3D '' for Datas in self.RawDataList: @@ -379,18 +363,7 @@ class DbComItemList (DbItemList): return self.ListSize =20 def PackData(self): - if self.ItemSize =3D=3D 8: - PackStr =3D "=3DQ" - elif self.ItemSize =3D=3D 4: - PackStr =3D "=3DL" - elif self.ItemSize =3D=3D 2: - PackStr =3D "=3DH" - elif self.ItemSize =3D=3D 1: - PackStr =3D "=3DB" - elif self.ItemSize =3D=3D 0: - PackStr =3D "=3DB" - else: - assert(False) + PackStr =3D PACK_CODE_BY_SIZE[self.ItemSize] =20 Buffer =3D '' for DataList in self.RawDataList: @@ -818,19 +791,7 @@ def BuildExDataBase(Dict): # Construct the database buffer Guid =3D "{0x3c7d193c, 0x682c, 0x4c14, 0xa6, 0x8f, 0x55, 0x2d, 0xea, 0= x4f, 0x43, 0x7e}" Guid =3D StringArrayToList(Guid) - Buffer =3D pack('=3DLHHBBBBBBBB', - Guid[0], - Guid[1], - Guid[2], - Guid[3], - Guid[4], - Guid[5], - Guid[6], - Guid[7], - Guid[8], - Guid[9], - Guid[10], - ) + Buffer =3D PackByteFormatGUID(Guid) =20 b =3D pack("=3DL", DATABASE_VERSION) Buffer +=3D b diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/P= ython/AutoGen/GenVar.py index e3595bb62315..bc750bd72f37 100644 --- a/BaseTools/Source/Python/AutoGen/GenVar.py +++ b/BaseTools/Source/Python/AutoGen/GenVar.py @@ -26,22 +26,6 @@ var_info =3D collections.namedtuple("uefi_var", "pcdinde= x,pcdname,defaultstoragena NvStorageHeaderSize =3D 28 VariableHeaderSize =3D 32 =20 -def PackGUID(Guid): - GuidBuffer =3D pack('=3DLHHBBBBBBBB', - int(Guid[0], 16), - int(Guid[1], 16), - int(Guid[2], 16), - int(Guid[3][-4:-2], 16), - int(Guid[3][-2:], 16), - int(Guid[4][-12:-10], 16), - int(Guid[4][-10:-8], 16), - int(Guid[4][-8:-6], 16), - int(Guid[4][-6:-4], 16), - int(Guid[4][-4:-2], 16), - int(Guid[4][-2:], 16) - ) - return GuidBuffer - class VariableMgr(object): def __init__(self, DefaultStoreMap,SkuIdMap): self.VarInfo =3D [] @@ -87,14 +71,7 @@ class VariableMgr(object): data_type =3D item.data_type value_list =3D item.default_value.strip("{").strip("}").sp= lit(",") if data_type in DataType.TAB_PCD_NUMERIC_TYPES: - if data_type =3D=3D ["BOOLEAN", DataType.TAB_UINT8]: - data_flag =3D "=3DB" - elif data_type =3D=3D DataType.TAB_UINT16: - data_flag =3D "=3DH" - elif data_type =3D=3D DataType.TAB_UINT32: - data_flag =3D "=3DL" - elif data_type =3D=3D DataType.TAB_UINT64: - data_flag =3D "=3DQ" + data_flag =3D PACK_CODE_BY_SIZE[MAX_SIZE_TYPE[data_typ= e]] data =3D value_list[0] value_list =3D [] for data_byte in pack(data_flag,int(data,16) if data.u= pper().startswith('0X') else int(data)): diff --git a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py b/B= aseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py index f5b1574e4440..3ca113c25669 100644 --- a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py +++ b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py @@ -34,13 +34,6 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object): self.var_check_info.append(var_check_tab) =20 def dump(self, dest, Phase): - - FormatMap =3D {} - FormatMap[1] =3D "=3DB" - FormatMap[2] =3D "=3DH" - FormatMap[4] =3D "=3DL" - FormatMap[8] =3D "=3DQ" - if not os.path.isabs(dest): return if not os.path.exists(dest): @@ -106,19 +99,8 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object): realLength +=3D 4 =20 Guid =3D var_check_tab.Guid - b =3D pack('=3DLHHBBBBBBBB', - Guid[0], - Guid[1], - Guid[2], - Guid[3], - Guid[4], - Guid[5], - Guid[6], - Guid[7], - Guid[8], - Guid[9], - Guid[10], - ) + b =3D PackByteFormatGUID(Guid) + =20 Buffer +=3D b realLength +=3D 16 =20 @@ -156,14 +138,14 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object): realLength +=3D 1 for v_data in item.data: if type(v_data) in (int, long): - b =3D pack(FormatMap[item.StorageWidth], v_data) + b =3D pack(PACK_CODE_BY_SIZE[item.StorageWidth], v= _data) Buffer +=3D b realLength +=3D item.StorageWidth else: - b =3D pack(FormatMap[item.StorageWidth], v_data[0]) + b =3D pack(PACK_CODE_BY_SIZE[item.StorageWidth], v= _data[0]) Buffer +=3D b realLength +=3D item.StorageWidth - b =3D pack(FormatMap[item.StorageWidth], v_data[1]) + b =3D pack(PACK_CODE_BY_SIZE[item.StorageWidth], v= _data[1]) Buffer +=3D b realLength +=3D item.StorageWidth =20 diff --git a/BaseTools/Source/Python/Common/DataType.py b/BaseTools/Source/= Python/Common/DataType.py index 48700ba82012..c3058d751470 100644 --- a/BaseTools/Source/Python/Common/DataType.py +++ b/BaseTools/Source/Python/Common/DataType.py @@ -530,3 +530,14 @@ SECTIONS_HAVE_ITEM_AFTER_ARCH =3D [TAB_LIBRARY_CLASSES= .upper(), TAB_DEPEX.upper(), PCDS_DYNAMICEX_HII.upper(), TAB_BUILD_OPTIONS.upper(), TAB_INCLUDES.upper()] + +# +# pack codes as used in PcdDb and elsewhere +# +PACK_PATTERN_GUID =3D '=3DLHHBBBBBBBB' +PACK_CODE_BY_SIZE =3D {8:'=3DQ', + 4:'=3DL', + 2:'=3DH', + 1:'=3DB', + 0:'=3DB', + 16:""} diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Pyth= on/Common/Misc.py index f6ebaa60e23f..86c69808422c 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -2087,20 +2087,7 @@ class SkuClass(): # Pack a registry format GUID # def PackRegistryFormatGuid(Guid): - Guid =3D Guid.split('-') - return pack('=3DLHHBBBBBBBB', - int(Guid[0], 16), - int(Guid[1], 16), - int(Guid[2], 16), - int(Guid[3][-4:-2], 16), - int(Guid[3][-2:], 16), - int(Guid[4][-12:-10], 16), - int(Guid[4][-10:-8], 16), - int(Guid[4][-8:-6], 16), - int(Guid[4][-6:-4], 16), - int(Guid[4][-4:-2], 16), - int(Guid[4][-2:], 16) - ) + return PackGUID(Guid.split('-')) =20 ## Get the integer value from string like "14U" or integer like 2 # @@ -2126,6 +2113,42 @@ def GetIntegerValue(Input): else: return int(String) =20 +# +# Pack a GUID (registry format) list into a buffer and return it +# +def PackGUID(Guid): + return pack(PACK_PATTERN_GUID, + int(Guid[0], 16), + int(Guid[1], 16), + int(Guid[2], 16), + int(Guid[3][-4:-2], 16), + int(Guid[3][-2:], 16), + int(Guid[4][-12:-10], 16), + int(Guid[4][-10:-8], 16), + int(Guid[4][-8:-6], 16), + int(Guid[4][-6:-4], 16), + int(Guid[4][-4:-2], 16), + int(Guid[4][-2:], 16) + ) + +# +# Pack a GUID (byte) list into a buffer and return it +# +def PackByteFormatGUID(Guid): + return pack(PACK_PATTERN_GUID, + Guid[0], + Guid[1], + Guid[2], + Guid[3], + Guid[4], + Guid[5], + Guid[6], + Guid[7], + Guid[8], + Guid[9], + Guid[10], + ) + ## # # This acts like the main() function for the script, unless it is 'import'= ed into another diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python= /GenFds/Fv.py index 2e57c5e92365..40e8bcd5aa72 100644 --- a/BaseTools/Source/Python/GenFds/Fv.py +++ b/BaseTools/Source/Python/GenFds/Fv.py @@ -26,7 +26,7 @@ import FfsFileStatement from GenFdsGlobalVariable import GenFdsGlobalVariable from GenFds import GenFds from CommonDataClass.FdfClass import FvClassObject -from Common.Misc import SaveFileOnChange +from Common.Misc import SaveFileOnChange, PackGUID from Common.LongFilePathSupport import CopyLongFilePath from Common.LongFilePathSupport import OpenLongFilePath as open =20 @@ -366,10 +366,7 @@ class FV (FvClassObject): # FV UI name # Buffer +=3D (pack('HH', (FvUiLen + 16 + 4), 0x0002) - + pack('=3DLHHBBBBBBBB', int(Guid[0], 16), int(= Guid[1], 16), int(Guid[2], 16), - int(Guid[3][-4:-2], 16), int(Guid[3][-2:= ], 16), int(Guid[4][-12:-10], 16), - int(Guid[4][-10:-8], 16), int(Guid[4][-8= :-6], 16), int(Guid[4][-6:-4], 16), - int(Guid[4][-4:-2], 16), int(Guid[4][-2:= ], 16)) + + PackGUID(Guid) + self.UiFvName) =20 for Index in range (0, len(self.FvExtEntryType)): @@ -403,20 +400,7 @@ class FV (FvClassObject): Buffer +=3D pack('B', int(ByteList[Index1], 16)) =20 Guid =3D self.FvNameGuid.split('-') - Buffer =3D pack('=3DLHHBBBBBBBBL', - int(Guid[0], 16), - int(Guid[1], 16), - int(Guid[2], 16), - int(Guid[3][-4:-2], 16), - int(Guid[3][-2:], 16), - int(Guid[4][-12:-10], 16), - int(Guid[4][-10:-8], 16), - int(Guid[4][-8:-6], 16), - int(Guid[4][-6:-4], 16), - int(Guid[4][-4:-2], 16), - int(Guid[4][-2:], 16), - TotalSize - ) + Buffer + Buffer =3D PackGUID(Guid) + pack('=3DL', TotalSize) + Buffer =20 # # Generate FV extension header file if the total size is not z= ero diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sourc= e/Python/build/BuildReport.py index bcbe6f89b48b..505bbcd29e0a 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -313,7 +313,7 @@ class DepexParser(object): Statement =3D gOpCodeList[struct.unpack("B", OpCode)[0]] if Statement in ["BEFORE", "AFTER", "PUSH"]: GuidValue =3D "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02= X%02X" % \ - struct.unpack("=3DLHHBBBBBBBB", DepexFile.read= (16)) + struct.unpack(PACK_PATTERN_GUID, DepexFile.rea= d(16)) GuidString =3D self._GuidDb.get(GuidValue, GuidValue) Statement =3D "%s %s" % (Statement, GuidString) DepexStatement.append(Statement) --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868517922277.01043230088567; Fri, 27 Apr 2018 15:35:17 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 69F4F207DF467; Fri, 27 Apr 2018 15:33:10 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 312FF2034C8C8 for ; Fri, 27 Apr 2018 15:33:03 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:33:01 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252876" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:49 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 35/42] BaseTools: remove unused variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/Common/DataType.py | 1 - 1 file changed, 1 deletion(-) diff --git a/BaseTools/Source/Python/Common/DataType.py b/BaseTools/Source/= Python/Common/DataType.py index c3058d751470..62cc84b25f59 100644 --- a/BaseTools/Source/Python/Common/DataType.py +++ b/BaseTools/Source/Python/Common/DataType.py @@ -113,7 +113,6 @@ BINARY_FILE_TYPE_UI =3D 'UI' BINARY_FILE_TYPE_BIN =3D 'BIN' BINARY_FILE_TYPE_FV =3D 'FV' =20 -PLATFORM_COMPONENT_TYPE_LIBRARY =3D 'LIBRARY' PLATFORM_COMPONENT_TYPE_LIBRARY_CLASS =3D 'LIBRARY_CLASS' PLATFORM_COMPONENT_TYPE_MODULE =3D 'MODULE' =20 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868510097666.3516484939437; Fri, 27 Apr 2018 15:35:10 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1E845207DF45F; Fri, 27 Apr 2018 15:33:10 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0A85D2034C8D4 for ; Fri, 27 Apr 2018 15:33:03 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:33:01 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252879" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:50 -0700 Message-Id: <4b8f6ccd4f276d90f579a8e5d7ef5fb5bb1b445d.1524868035.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 36/42] BaseTools: GenFds - use existing shared string X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/GenFds/Fv.py | 34 ++++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python= /GenFds/Fv.py index 40e8bcd5aa72..188282a27cd2 100644 --- a/BaseTools/Source/Python/GenFds/Fv.py +++ b/BaseTools/Source/Python/GenFds/Fv.py @@ -29,8 +29,8 @@ from CommonDataClass.FdfClass import FvClassObject from Common.Misc import SaveFileOnChange, PackGUID from Common.LongFilePathSupport import CopyLongFilePath from Common.LongFilePathSupport import OpenLongFilePath as open +from Common.DataType import TAB_LINE_BREAK =20 -T_CHAR_LF =3D '\n' FV_UI_EXT_ENTY_GUID =3D 'A67DF1FA-8DE8-4E98-AF09-4BDF2EFFBC7C' =20 ## generate FV @@ -111,7 +111,7 @@ class FV (FvClassObject): if not Flag: self.FvInfFile.writelines("EFI_FILE_NAME =3D " + \ FileName + \ - T_CHAR_LF) + TAB_LINE_BREAK) =20 # Process Modules in FfsList for FfsFile in self.FfsList : @@ -125,7 +125,7 @@ class FV (FvClassObject): if not Flag: self.FvInfFile.writelines("EFI_FILE_NAME =3D " + \ FileName + \ - T_CHAR_LF) + TAB_LINE_BREAK) if not Flag: SaveFileOnChange(self.InfFileName, self.FvInfFile.getvalue(), = False) self.FvInfFile.close() @@ -270,36 +270,36 @@ class FV (FvClassObject): # # Add [Options] # - self.FvInfFile.writelines("[options]" + T_CHAR_LF) + self.FvInfFile.writelines("[options]" + TAB_LINE_BREAK) if BaseAddress is not None : self.FvInfFile.writelines("EFI_BASE_ADDRESS =3D " + \ BaseAddress + \ - T_CHAR_LF) + TAB_LINE_BREAK) =20 if BlockSize is not None: self.FvInfFile.writelines("EFI_BLOCK_SIZE =3D " + \ '0x%X' %BlockSize + \ - T_CHAR_LF) + TAB_LINE_BREAK) if BlockNum is not None: self.FvInfFile.writelines("EFI_NUM_BLOCKS =3D " + \ ' 0x%X' %BlockNum + \ - T_CHAR_LF) + TAB_LINE_BREAK) else: if self.BlockSizeList =3D=3D []: if not self._GetBlockSize(): #set default block size is 1 - self.FvInfFile.writelines("EFI_BLOCK_SIZE =3D 0x1" + = T_CHAR_LF) + self.FvInfFile.writelines("EFI_BLOCK_SIZE =3D 0x1" + = TAB_LINE_BREAK) =20 for BlockSize in self.BlockSizeList : if BlockSize[0] is not None: self.FvInfFile.writelines("EFI_BLOCK_SIZE =3D " + \ '0x%X' %BlockSize[0] + \ - T_CHAR_LF) + TAB_LINE_BREAK) =20 if BlockSize[1] is not None: self.FvInfFile.writelines("EFI_NUM_BLOCKS =3D " + \ ' 0x%X' %BlockSize[1] + \ - T_CHAR_LF) + TAB_LINE_BREAK) =20 if self.BsBaseAddress is not None: self.FvInfFile.writelines('EFI_BOOT_DRIVER_BASE_ADDRESS =3D ' = + \ @@ -310,11 +310,11 @@ class FV (FvClassObject): # # Add attribute # - self.FvInfFile.writelines("[attributes]" + T_CHAR_LF) + self.FvInfFile.writelines("[attributes]" + TAB_LINE_BREAK) =20 self.FvInfFile.writelines("EFI_ERASE_POLARITY =3D " + \ ' %s' %ErasePloarity + \ - T_CHAR_LF) + TAB_LINE_BREAK) if not (self.FvAttributeDict is None): for FvAttribute in self.FvAttributeDict.keys() : if FvAttribute =3D=3D "FvUsedSizeEnable": @@ -325,12 +325,12 @@ class FV (FvClassObject): FvAttribute + \ ' =3D ' + \ self.FvAttributeDict[FvAttribute= ] + \ - T_CHAR_LF ) + TAB_LINE_BREAK ) if self.FvAlignment is not None: self.FvInfFile.writelines("EFI_FVB2_ALIGNMENT_" + \ self.FvAlignment.strip() + \ " =3D TRUE" + \ - T_CHAR_LF) + TAB_LINE_BREAK) =20 # # Generate FV extension header file @@ -416,14 +416,14 @@ class FV (FvClassObject): os.remove (self.InfFileName) self.FvInfFile.writelines("EFI_FV_EXT_HEADER_FILE_NAME =3D= " + \ FvExtHeaderFileName = + \ - T_CHAR_LF) + TAB_LINE_BREAK) =20 =20 # # Add [Files] # - self.FvInfFile.writelines("[files]" + T_CHAR_LF) + self.FvInfFile.writelines("[files]" + TAB_LINE_BREAK) if VtfDict and self.UiFvName in VtfDict: self.FvInfFile.writelines("EFI_FILE_NAME =3D " = + \ VtfDict[self.UiFvName] = + \ - T_CHAR_LF) + TAB_LINE_BREAK) --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868521969574.3885062300752; Fri, 27 Apr 2018 15:35:21 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 93A6C207DF46B; Fri, 27 Apr 2018 15:33:10 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4D74F2279CF03 for ; Fri, 27 Apr 2018 15:33:03 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:33:01 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252882" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:51 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 37/42] BaseTools: missed a copyright update X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py b= /BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py index bf01de35a6e6..9572e2e3bb4c 100644 --- a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py +++ b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py @@ -31,7 +31,7 @@ from Common.LongFilePathSupport import OpenLongFilePath a= s open # Version and Copyright __version_number__ =3D ("0.10" + " " + gBUILD_VERSION) __version__ =3D "%prog Version " + __version_number__ -__copyright__ =3D "Copyright (c) 2008 - 2010, Intel Corporation. All right= s reserved." +__copyright__ =3D "Copyright (c) 2008 - 2018, Intel Corporation. All right= s reserved." =20 #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Internal Libraries =3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868526156448.8445525874955; Fri, 27 Apr 2018 15:35:26 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BD382207DF470; Fri, 27 Apr 2018 15:33:10 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 342F92034C8CF for ; Fri, 27 Apr 2018 15:33:03 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:02 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:33:01 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252886" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:52 -0700 Message-Id: <2f962780c2f35ab17f5a471a242e1b0d1656d669.1524868035.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 38/42] BaseTools: Remove lists form set construction X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" There is no need to make a list to make a set. remove lists that are only used in constructing sets. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenDepex.py | 7 +++---- BaseTools/Source/Python/Workspace/DscBuildData.py | 10 +++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenDepex.py b/BaseTools/Source= /Python/AutoGen/GenDepex.py index 3dcbad5be666..533447efe82e 100644 --- a/BaseTools/Source/Python/AutoGen/GenDepex.py +++ b/BaseTools/Source/Python/AutoGen/GenDepex.py @@ -54,7 +54,7 @@ gType2Phase =3D { # class DependencyExpression: =20 - ArchProtocols =3D set([ + ArchProtocols =3D { '665e3ff6-46cc-11d4-9a38-0090273fc14d', # 'g= EfiBdsArchProtocolGuid' '26baccb1-6f42-11d4-bce7-0080c73c8881', # 'g= EfiCpuArchProtocolGuid' '26baccb2-6f42-11d4-bce7-0080c73c8881', # 'g= EfiMetronomeArchProtocolGuid' @@ -67,8 +67,7 @@ class DependencyExpression: '6441f818-6362-4e44-b570-7dba31dd2453', # 'g= EfiVariableWriteArchProtocolGuid' '1e5668e2-8481-11d4-bcf1-0080c73c8881', # 'g= EfiVariableArchProtocolGuid' '665e3ff5-46cc-11d4-9a38-0090273fc14d' # 'g= EfiWatchdogTimerArchProtocolGuid' - ] - ) + } =20 OpcodePriority =3D { DEPEX_OPCODE_AND : 1, @@ -304,7 +303,7 @@ class DependencyExpression: # don't generate depex if all operands are architecture protocols if self.ModuleType in ['UEFI_DRIVER', 'DXE_DRIVER', 'DXE_RUNTIME_D= RIVER', 'DXE_SAL_DRIVER', 'DXE_SMM_DRIVER', 'MM_STANDALONE'] and \ Op =3D=3D DEPEX_OPCODE_AND and \ - self.ArchProtocols =3D=3D set([GuidStructureStringToGuidString(= Guid) for Guid in AllOperand]): + self.ArchProtocols =3D=3D set(GuidStructureStringToGuidString(G= uid) for Guid in AllOperand): self.PostfixNotation =3D [] return =20 diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 48690aa357f7..235392e1e4fb 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -942,7 +942,7 @@ class DscBuildData(PlatformBuildClassObject): for skuid in pcd.SkuInfoList: skuobj =3D pcd.SkuInfoList.get(skuid) if TAB_DEFAULT_STORES_DEFAULT not in skuobj.DefaultStoreDi= ct: - PcdDefaultStoreSet =3D set([defaultstorename for defa= ultstorename in skuobj.DefaultStoreDict]) + PcdDefaultStoreSet =3D set(defaultstorename for defau= ltstorename in skuobj.DefaultStoreDict) mindefaultstorename =3D DefaultStoreMgr.GetMin(PcdDefa= ultStoreSet) skuobj.DefaultStoreDict[TAB_DEFAULT_STORES_DEFAULT] = =3D copy.deepcopy(skuobj.DefaultStoreDict[mindefaultstorename]) return Pcds @@ -1360,7 +1360,7 @@ class DscBuildData(PlatformBuildClassObject): nextskuid =3D self.SkuIdMgr.GetNextSkuId(nexts= kuid) if NoDefault: continue - PcdDefaultStoreSet =3D set([defaultstorename for defa= ultstorename in stru_pcd.SkuOverrideValues[nextskuid]]) + PcdDefaultStoreSet =3D set(defaultstorename for defau= ltstorename in stru_pcd.SkuOverrideValues[nextskuid]) mindefaultstorename =3D DefaultStoreMgr.GetMin(PcdDefa= ultStoreSet) =20 for defaultstoreid in DefaultStores: @@ -1404,7 +1404,7 @@ class DscBuildData(PlatformBuildClassObject): if str_pcd_obj.Type not in [self._PCD_TYPE_STRING_[MODEL_P= CD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_D= YNAMIC_EX_HII]]: continue - PcdDefaultStoreSet =3D set([defaultstorename for skuobj i= n str_pcd_obj.SkuInfoList.values() for defaultstorename in skuobj.DefaultSt= oreDict]) + PcdDefaultStoreSet =3D set(defaultstorename for skuobj in = str_pcd_obj.SkuInfoList.values() for defaultstorename in skuobj.DefaultStor= eDict) DefaultStoreObj =3D DefaultStore(self._GetDefaultStores()) mindefaultstorename =3D DefaultStoreObj.GetMin(PcdDefaultS= toreSet) str_pcd_obj.SkuInfoList[self.SkuIdMgr.SystemSkuId].HiiDefa= ultValue =3D str_pcd_obj.SkuInfoList[self.SkuIdMgr.SystemSkuId].DefaultStor= eDict[mindefaultstorename] @@ -2308,7 +2308,7 @@ class DscBuildData(PlatformBuildClassObject): Pcds =3D {} DefaultStoreObj =3D DefaultStore(self._GetDefaultStores()) SkuIds =3D {skuname:skuid for skuname,skuid in self.SkuIdMgr.Avail= ableSkuIdSet.items() if skuname !=3D TAB_COMMON} - DefaultStores =3D set([storename for pcdobj in PcdSet.values() for= skuobj in pcdobj.SkuInfoList.values() for storename in skuobj.DefaultStore= Dict]) + DefaultStores =3D set(storename for pcdobj in PcdSet.values() for = skuobj in pcdobj.SkuInfoList.values() for storename in skuobj.DefaultStoreD= ict) for PcdCName, TokenSpaceGuid in PcdSet: PcdObj =3D PcdSet[(PcdCName, TokenSpaceGuid)] self.CopyDscRawValue(PcdObj) @@ -2498,7 +2498,7 @@ class DscBuildData(PlatformBuildClassObject): invalidhii =3D [] for pcdname in Pcds: pcd =3D Pcds[pcdname] - varnameset =3D set([sku.VariableName for (skuid,sku) in pcd.Sk= uInfoList.items()]) + varnameset =3D set(sku.VariableName for (skuid,sku) in pcd.Sku= InfoList.items()) if len(varnameset) > 1: invalidhii.append(".".join((pcdname[1],pcdname[0]))) if len(invalidhii): --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 15248685303891009.6572950781307; Fri, 27 Apr 2018 15:35:30 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E4649207DF474; Fri, 27 Apr 2018 15:33:10 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5C6BE2034C8D1 for ; Fri, 27 Apr 2018 15:33:03 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:03 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:33:01 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252888" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:53 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 39/42] BaseTools: refactor Depex optomization X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" No need to make a list from the set. just pop the item off. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenDepex.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenDepex.py b/BaseTools/Source= /Python/AutoGen/GenDepex.py index 533447efe82e..f415eaaa7723 100644 --- a/BaseTools/Source/Python/AutoGen/GenDepex.py +++ b/BaseTools/Source/Python/AutoGen/GenDepex.py @@ -271,10 +271,14 @@ class DependencyExpression: =20 ## Simply optimize the dependency expression by removing duplicated op= erands def Optimize(self): - ValidOpcode =3D list(set(self.OpcodeList)) - if len(ValidOpcode) !=3D 1 or ValidOpcode[0] not in [DEPEX_OPCODE_= AND, DEPEX_OPCODE_OR]: + OpcodeSet =3D set(self.OpcodeList) + # if there are isn't one in the set, return + if len(OpcodeSet) !=3D 1: + return + Op =3D OpcodeSet.pop() + #if Op isn't either OR or AND, return + if Op not in [DEPEX_OPCODE_AND, DEPEX_OPCODE_OR]: return - Op =3D ValidOpcode[0] NewOperand =3D [] AllOperand =3D set() for Token in self.PostfixNotation: --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868542199303.01583026121784; Fri, 27 Apr 2018 15:35:42 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 61E1C203B9243; Fri, 27 Apr 2018 15:33:11 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6CA792279CF05 for ; Fri, 27 Apr 2018 15:33:03 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:03 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:33:01 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252893" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:54 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 40/42] BaseTools: dont make iterator into list if not needed X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" functions (like join) can use the iterator just as easily. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 10 +++++-= ---- BaseTools/Source/Python/AutoGen/GenVar.py | 8 ++++--= -- BaseTools/Source/Python/Common/MigrationUtilities.py | 2 +- BaseTools/Source/Python/Common/Misc.py | 8 ++++--= -- BaseTools/Source/Python/Common/String.py | 12 ++++++= ------ BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py | 4 ++-- BaseTools/Source/Python/GenFds/GenFds.py | 2 +- BaseTools/Source/Python/Workspace/DscBuildData.py | 6 +++--- BaseTools/Source/Python/Workspace/InfBuildData.py | 12 ++++++= ------ BaseTools/Source/Python/Workspace/MetaDataTable.py | 4 ++-- BaseTools/Source/Python/build/build.py | 2 +- 11 files changed, 35 insertions(+), 35 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 39d5932a9a66..6cd54c2e9aa1 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -460,7 +460,7 @@ class WorkspaceAutoGen(AutoGen): 'build', FORMAT_INVALID, "Building modules from source INFs, following = PCD use %s and %s access method. It must be corrected to use only one acces= s method." % (i, j), - ExtraData=3D"%s" % '\n\t'.join([str(P[1]+'.'+P= [0]) for P in Intersections]) + ExtraData=3D"%s" % '\n\t'.join(str(P[1]+'.'+P[= 0]) for P in Intersections) ) =20 # @@ -2295,7 +2295,7 @@ class PlatformAutoGen(AutoGen): # for Item in LibraryList: if ConsumedByList[Item] !=3D [] and Item in Constructor and le= n(Constructor) > 1: - ErrorMessage =3D "\tconsumed by " + "\n\tconsumed by ".joi= n([str(L) for L in ConsumedByList[Item]]) + ErrorMessage =3D "\tconsumed by " + "\n\tconsumed by ".joi= n(str(L) for L in ConsumedByList[Item]) EdkLogger.error("build", BUILD_ERROR, 'Library [%s] with c= onstructors has a cycle' % str(Item), ExtraData=3DErrorMessage, File=3Dself.Meta= File) if Item not in SortedLibraryList: @@ -2415,7 +2415,7 @@ class PlatformAutoGen(AutoGen): if Sku.VariableGuid =3D=3D '': continue Sku.VariableGuidValue =3D GuidValue(Sku.VariableGuid, self= .PackageList, self.MetaFile.Path) if Sku.VariableGuidValue is None: - PackageList =3D "\n\t".join([str(P) for P in self.Pack= ageList]) + PackageList =3D "\n\t".join(str(P) for P in self.Packa= geList) EdkLogger.error( 'build', RESOURCE_NOT_AVAILABLE, @@ -3122,7 +3122,7 @@ class ModuleAutoGen(AutoGen): for Depex in DepexList: for key in Depex: DepexStr +=3D '[Depex.%s.%s]\n' % key - DepexStr +=3D '\n'.join(['# '+ val for val in Depex[ke= y]]) + DepexStr +=3D '\n'.join('# '+ val for val in Depex[key= ]) DepexStr +=3D '\n\n' if not DepexStr: return '[Depex.%s]\n' % self.Arch @@ -3136,7 +3136,7 @@ class ModuleAutoGen(AutoGen): DepexStr +=3D ' AND ' DepexStr +=3D '(' for D in Depex.values(): - DepexStr +=3D ' '.join([val for val in D]) + DepexStr +=3D ' '.join(val for val in D) Index =3D DepexStr.find('END') if Index > -1 and Index =3D=3D len(DepexStr) - 3: DepexStr =3D DepexStr[:-3] diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/P= ython/AutoGen/GenVar.py index bc750bd72f37..ffd490520dcc 100644 --- a/BaseTools/Source/Python/AutoGen/GenVar.py +++ b/BaseTools/Source/Python/AutoGen/GenVar.py @@ -80,7 +80,7 @@ class VariableMgr(object): try: newvaluestr =3D "{" + ",".join(VariableMgr.assemble_variab= le(newvalue)) +"}" except: - EdkLogger.error("build", AUTOGEN_ERROR, "Variable offset c= onflict in PCDs: %s \n" % (" and ".join([item.pcdname for item in sku_var_i= nfo_offset_list]))) + EdkLogger.error("build", AUTOGEN_ERROR, "Variable offset c= onflict in PCDs: %s \n" % (" and ".join(item.pcdname for item in sku_var_in= fo_offset_list))) n =3D sku_var_info_offset_list[0] indexedvarinfo[key] =3D [var_info(n.pcdindex,n.pcdname,n.defa= ultstoragename,n.skuname,n.var_name, n.var_guid, "0x00",n.var_attribute,new= valuestr , newvaluestr , DataType.TAB_VOID)] self.VarInfo =3D [item[0] for item in indexedvarinfo.values()] @@ -116,9 +116,9 @@ class VariableMgr(object): default_sku_default =3D indexedvarinfo[index].get((DataType.TA= B_DEFAULT,DataType.TAB_DEFAULT_STORES_DEFAULT)) =20 if default_sku_default.data_type not in DataType.TAB_PCD_NUMER= IC_TYPES: - var_max_len =3D max([len(var_item.default_value.split(",")= ) for var_item in sku_var_info.values()]) + var_max_len =3D max(len(var_item.default_value.split(","))= for var_item in sku_var_info.values()) if len(default_sku_default.default_value.split(",")) < var= _max_len: - tail =3D ",".join([ "0x00" for i in range(var_max_len-= len(default_sku_default.default_value.split(",")))]) + tail =3D ",".join("0x00" for i in range(var_max_len-le= n(default_sku_default.default_value.split(",")))) =20 default_data_buffer =3D VariableMgr.PACK_VARIABLES_DATA(defaul= t_sku_default.default_value,default_sku_default.data_type,tail) =20 @@ -136,7 +136,7 @@ class VariableMgr(object): =20 if default_sku_default.data_type not in DataType.TAB_PCD_N= UMERIC_TYPES: if len(other_sku_other.default_value.split(",")) < var= _max_len: - tail =3D ",".join([ "0x00" for i in range(var_max_= len-len(other_sku_other.default_value.split(",")))]) + tail =3D ",".join("0x00" for i in range(var_max_le= n-len(other_sku_other.default_value.split(",")))) =20 others_data_buffer =3D VariableMgr.PACK_VARIABLES_DATA(oth= er_sku_other.default_value,other_sku_other.data_type,tail) =20 diff --git a/BaseTools/Source/Python/Common/MigrationUtilities.py b/BaseToo= ls/Source/Python/Common/MigrationUtilities.py index 27d30a11b529..cc6bb4924dc3 100644 --- a/BaseTools/Source/Python/Common/MigrationUtilities.py +++ b/BaseTools/Source/Python/Common/MigrationUtilities.py @@ -506,7 +506,7 @@ def GetTextFileInfo(FileName, TagTuple): # def GetXmlFileInfo(FileName, TagTuple): XmlDom =3D XmlParseFile(FileName) - return tuple([XmlElement(XmlDom, XmlTag) for XmlTag in TagTuple]) + return tuple(XmlElement(XmlDom, XmlTag) for XmlTag in TagTuple) =20 =20 ## Parse migration command line options diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Pyth= on/Common/Misc.py index 86c69808422c..f01b4bd05b52 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -833,7 +833,7 @@ class TemplateString(object): def Append(self, AppendString, Dictionary=3DNone): if Dictionary: SectionList =3D self._Parse(AppendString) - self.String +=3D "".join([S.Instantiate(Dictionary) for S in S= ectionList]) + self.String +=3D "".join(S.Instantiate(Dictionary) for S in Se= ctionList) else: self.String +=3D AppendString =20 @@ -844,7 +844,7 @@ class TemplateString(object): # @retval str The string replaced with placeholder v= alues # def Replace(self, Dictionary=3DNone): - return "".join([S.Instantiate(Dictionary) for S in self._TemplateS= ectionList]) + return "".join(S.Instantiate(Dictionary) for S in self._TemplateSe= ctionList) =20 ## Progress indicator class # @@ -1926,7 +1926,7 @@ class DefaultStore(): if not self.DefaultStores or "0" in self.DefaultStores: return "0",TAB_DEFAULT_STORES_DEFAULT else: - minvalue =3D min([int(value_str) for value_str in self.Default= Stores]) + minvalue =3D min(int(value_str) for value_str in self.DefaultS= tores) return (str(minvalue), self.DefaultStores[str(minvalue)]) def GetMin(self,DefaultSIdList): if not DefaultSIdList: @@ -2023,7 +2023,7 @@ class SkuClass(): skuorderset.append(self.GetSkuChain(skuname)) =20 skuorder =3D [] - for index in range(max([len(item) for item in skuorderset])): + for index in range(max(len(item) for item in skuorderset)): for subset in skuorderset: if index > len(subset)-1: continue diff --git a/BaseTools/Source/Python/Common/String.py b/BaseTools/Source/Py= thon/Common/String.py index 389a3ca51d27..70784bcbbdaa 100644 --- a/BaseTools/Source/Python/Common/String.py +++ b/BaseTools/Source/Python/Common/String.py @@ -818,27 +818,27 @@ def StringToArray(String): if isinstance(String, unicode): if len(unicode) =3D=3D 0: return "{0x00,0x00}" - return "{%s,0x00,0x00}" % ",".join(["0x%02x,0x00" % ord(C) for C i= n String]) + return "{%s,0x00,0x00}" % ",".join("0x%02x,0x00" % ord(C) for C in= String) elif String.startswith('L"'): if String =3D=3D "L\"\"": return "{0x00,0x00}" else: - return "{%s,0x00,0x00}" % ",".join(["0x%02x,0x00" % ord(C) for= C in String[2:-1]]) + return "{%s,0x00,0x00}" % ",".join("0x%02x,0x00" % ord(C) for = C in String[2:-1]) elif String.startswith('"'): if String =3D=3D "\"\"": return "{0x00,0x00}" else: StringLen =3D len(String[1:-1]) if StringLen % 2: - return "{%s,0x00}" % ",".join(["0x%02x" % ord(C) for C in = String[1:-1]]) + return "{%s,0x00}" % ",".join("0x%02x" % ord(C) for C in S= tring[1:-1]) else: - return "{%s,0x00,0x00}" % ",".join(["0x%02x" % ord(C) for = C in String[1:-1]]) + return "{%s,0x00,0x00}" % ",".join("0x%02x" % ord(C) for C= in String[1:-1]) elif String.startswith('{'): StringLen =3D len(String.split(",")) if StringLen % 2: - return "{%s,0x00}" % ",".join([ C.strip() for C in String[1:-1= ].split(',')]) + return "{%s,0x00}" % ",".join(C.strip() for C in String[1:-1].= split(',')) else: - return "{%s}" % ",".join([ C.strip() for C in String[1:-1].spl= it(',')]) + return "{%s}" % ",".join(C.strip() for C in String[1:-1].split= (',')) =20 else: if len(String.split()) % 2: diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py= b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py index 6b980150f53e..760f88cc7294 100644 --- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py +++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py @@ -1,7 +1,7 @@ ## @file # This file is used to create/update/query/erase table for files # -# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BS= D License # which accompanies this distribution. The full text of the license may b= e found at @@ -73,7 +73,7 @@ class Table(object): self.ID =3D self.ID + self._ID_STEP_ if self.ID >=3D (self.IdBase + self._ID_MAX_): self.ID =3D self.IdBase + self._ID_STEP_ - Values =3D ", ".join([str(Arg) for Arg in Args]) + Values =3D ", ".join(str(Arg) for Arg in Args) SqlCommand =3D "insert into %s values(%s, %s)" % (self.Table, self= .ID, Values) EdkLogger.debug(EdkLogger.DEBUG_5, SqlCommand) self.Cur.execute(SqlCommand) diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Py= thon/GenFds/GenFds.py index 4b8c7913d2db..7e80575dd794 100644 --- a/BaseTools/Source/Python/GenFds/GenFds.py +++ b/BaseTools/Source/Python/GenFds/GenFds.py @@ -761,7 +761,7 @@ class GenFds : length =3D F.tell() F.seek(4) TmpStr =3D unpack('%dh' % ((length - 4= ) / 2), F.read()) - Name =3D ''.join([chr(c) for c in TmpS= tr[:-1]]) + Name =3D ''.join(chr(c) for c in TmpSt= r[:-1]) else: FileList =3D [] if 'fv.sec.txt' in MatchDict: diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 235392e1e4fb..3d3db61d851b 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1514,7 +1514,7 @@ class DscBuildData(PlatformBuildClassObject): return len(Value) - 2 return len(Value) =20 - return str(max([pcd_size for pcd_size in [get_length(item) for ite= m in sku_values]])) + return str(max(get_length(item) for item in sku_values)) =20 @staticmethod def ExecuteCommand (Command): @@ -2078,7 +2078,7 @@ class DscBuildData(PlatformBuildClassObject): SearchPathList =3D [] SearchPathList.append(os.path.normpath(mws.join(GlobalData.gWorksp= ace, "BaseTools/Source/C/Include"))) SearchPathList.append(os.path.normpath(mws.join(GlobalData.gWorksp= ace, "BaseTools/Source/C/Common"))) - SearchPathList.extend([str(item) for item in IncSearchList]) + SearchPathList.extend(str(item) for item in IncSearchList) IncFileList =3D GetDependencyList(IncludeFileFullPaths,SearchPathL= ist) for include_file in IncFileList: MakeApp +=3D "$(OBJECTS) : %s\n" % include_file @@ -2324,7 +2324,7 @@ class DscBuildData(PlatformBuildClassObject): if PcdType in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], = self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]: for skuid in PcdObj.SkuInfoList: skuobj =3D PcdObj.SkuInfoList[skuid] - mindefaultstorename =3D DefaultStoreObj.GetMin(set([de= faultstorename for defaultstorename in skuobj.DefaultStoreDict])) + mindefaultstorename =3D DefaultStoreObj.GetMin(set(def= aultstorename for defaultstorename in skuobj.DefaultStoreDict)) for defaultstorename in DefaultStores: if defaultstorename not in skuobj.DefaultStoreDict: skuobj.DefaultStoreDict[defaultstorename] =3D = copy.deepcopy(skuobj.DefaultStoreDict[mindefaultstorename]) diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/= Source/Python/Workspace/InfBuildData.py index a725a2a2a772..d21f38bc7f46 100644 --- a/BaseTools/Source/Python/Workspace/InfBuildData.py +++ b/BaseTools/Source/Python/Workspace/InfBuildData.py @@ -718,7 +718,7 @@ class InfBuildData(ModuleBuildClassObject): CName =3D Record[0] Value =3D ProtocolValue(CName, self.Packages, self.MetaFil= e.Path) if Value is None: - PackageList =3D "\n\t".join([str(P) for P in self.Pack= ages]) + PackageList =3D "\n\t".join(str(P) for P in self.Packa= ges) EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "Value of Protocol [%s] is not found u= nder [Protocols] section in" % CName, ExtraData=3DPackageList, File=3Dself.M= etaFile, Line=3DRecord[-1]) @@ -743,7 +743,7 @@ class InfBuildData(ModuleBuildClassObject): CName =3D Record[0] Value =3D PpiValue(CName, self.Packages, self.MetaFile.Pat= h) if Value is None: - PackageList =3D "\n\t".join([str(P) for P in self.Pack= ages]) + PackageList =3D "\n\t".join(str(P) for P in self.Packa= ges) EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "Value of PPI [%s] is not found under = [Ppis] section in " % CName, ExtraData=3DPackageList, File=3Dself.M= etaFile, Line=3DRecord[-1]) @@ -768,7 +768,7 @@ class InfBuildData(ModuleBuildClassObject): CName =3D Record[0] Value =3D GuidValue(CName, self.Packages, self.MetaFile.Pa= th) if Value is None: - PackageList =3D "\n\t".join([str(P) for P in self.Pack= ages]) + PackageList =3D "\n\t".join(str(P) for P in self.Packa= ges) EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "Value of Guid [%s] is not found under= [Guids] section in" % CName, ExtraData=3DPackageList, File=3Dself.M= etaFile, Line=3DRecord[-1]) @@ -938,7 +938,7 @@ class InfBuildData(ModuleBuildClassObject): if Value is None: Value =3D GuidValue(Token, self.Packages, = self.MetaFile.Path) if Value is None: - PackageList =3D "\n\t".join([str(P) for P in s= elf.Packages]) + PackageList =3D "\n\t".join(str(P) for P in se= lf.Packages) EdkLogger.error('build', RESOURCE_NOT_AVAILABL= E, "Value of [%s] is not found in= " % Token, ExtraData=3DPackageList, File= =3Dself.MetaFile, Line=3DRecord[-1]) @@ -981,7 +981,7 @@ class InfBuildData(ModuleBuildClassObject): if TokenSpaceGuid not in self.Guids: Value =3D GuidValue(TokenSpaceGuid, self.Packages, self.Me= taFile.Path) if Value is None: - PackageList =3D "\n\t".join([str(P) for P in self.Pack= ages]) + PackageList =3D "\n\t".join(str(P) for P in self.Packa= ges) EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "Value of Guid [%s] is not found under= [Guids] section in" % TokenSpaceGuid, ExtraData=3DPackageList, File=3Dself.M= etaFile, Line=3DLineNo) @@ -1151,7 +1151,7 @@ class InfBuildData(ModuleBuildClassObject): FORMAT_INVALID, "PCD [%s.%s] in [%s] is not found in dependent= packages:" % (TokenSpaceGuid, PcdRealName, self.MetaFile), File=3Dself.MetaFile, Line=3DLineNo, - ExtraData=3D"\t%s" % '\n\t'.join([str(P) for P= in self.Packages]) + ExtraData=3D"\t%s" % '\n\t'.join(str(P) for P = in self.Packages) ) Pcds[PcdCName, TokenSpaceGuid] =3D Pcd =20 diff --git a/BaseTools/Source/Python/Workspace/MetaDataTable.py b/BaseTools= /Source/Python/Workspace/MetaDataTable.py index 0cfec9023261..e37a10c82f8f 100644 --- a/BaseTools/Source/Python/Workspace/MetaDataTable.py +++ b/BaseTools/Source/Python/Workspace/MetaDataTable.py @@ -1,7 +1,7 @@ ## @file # This file is used to create/update/query/erase table for files # -# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BS= D License # which accompanies this distribution. The full text of the license may b= e found at @@ -73,7 +73,7 @@ class Table(object): self.ID =3D self.ID + self._ID_STEP_ if self.ID >=3D (self.IdBase + self._ID_MAX_): self.ID =3D self.IdBase + self._ID_STEP_ - Values =3D ", ".join([str(Arg) for Arg in Args]) + Values =3D ", ".join(str(Arg) for Arg in Args) SqlCommand =3D "insert into %s values(%s, %s)" % (self.Table, self= .ID, Values) EdkLogger.debug(EdkLogger.DEBUG_5, SqlCommand) self.Cur.execute(SqlCommand) diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/build/build.py index 0ca78c1fa451..6b01617c5c5f 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -545,7 +545,7 @@ class BuildTask: # while not BuildTask._ErrorFlag.isSet() and \ while len(BuildTask._RunningQueue) > 0: EdkLogger.verbose("Waiting for thread ending...(%d)" % len= (BuildTask._RunningQueue)) - EdkLogger.debug(EdkLogger.DEBUG_8, "Threads [%s]" % ", ".j= oin([Th.getName() for Th in threading.enumerate()])) + EdkLogger.debug(EdkLogger.DEBUG_8, "Threads [%s]" % ", ".j= oin(Th.getName() for Th in threading.enumerate())) # avoid tense loop time.sleep(0.1) except BaseException, X: --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868534550824.1740406665938; Fri, 27 Apr 2018 15:35:34 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 17AD0207DF47B; Fri, 27 Apr 2018 15:33:11 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6941F203B8C8D for ; Fri, 27 Apr 2018 15:33:03 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:03 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:33:01 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252896" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:55 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 41/42] BaseTools: create base expression class X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" this class has a fucntion to share between Exception and RangeExpression change both classes to call this function init in their init Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/Common/Expression.py | 29 ++++++++++++-------- BaseTools/Source/Python/Common/RangeExpression.py | 27 ++---------------- 2 files changed, 20 insertions(+), 36 deletions(-) diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Sourc= e/Python/Common/Expression.py index 53504c110d6d..b5f76d860773 100644 --- a/BaseTools/Source/Python/Common/Expression.py +++ b/BaseTools/Source/Python/Common/Expression.py @@ -201,7 +201,22 @@ def IntToStr(Value): =20 SupportedInMacroList =3D ['TARGET', 'TOOL_CHAIN_TAG', 'ARCH', 'FAMILY'] =20 -class ValueExpression(object): +class BaseExpression(object): + def __init__(self, *args, **kwargs): + super(BaseExpression, self).__init__() + + # Check if current token matches the operators given from parameter + def _IsOperator(self, OpSet): + Idx =3D self._Idx + self._GetOperator() + if self._Token in OpSet: + if self._Token in self.LogicalOperators: + self._Token =3D self.LogicalOperators[self._Token] + return True + self._Idx =3D Idx + return False + +class ValueExpression(BaseExpression): # Logical operator mapping LogicalOperators =3D { '&&' : 'and', '||' : 'or', @@ -307,6 +322,7 @@ class ValueExpression(object): return Val =20 def __init__(self, Expression, SymbolTable=3D{}): + super(ValueExpression, self).__init__(self, Expression, SymbolTabl= e) self._NoProcess =3D False if type(Expression) !=3D type(''): self._Expr =3D Expression @@ -780,17 +796,6 @@ class ValueExpression(object): self._Token =3D OpToken return OpToken =20 - # Check if current token matches the operators given from OpList - def _IsOperator(self, OpList): - Idx =3D self._Idx - self._GetOperator() - if self._Token in OpList: - if self._Token in self.LogicalOperators: - self._Token =3D self.LogicalOperators[self._Token] - return True - self._Idx =3D Idx - return False - class ValueExpressionEx(ValueExpression): def __init__(self, PcdValue, PcdType, SymbolTable=3D{}): ValueExpression.__init__(self, PcdValue, SymbolTable) diff --git a/BaseTools/Source/Python/Common/RangeExpression.py b/BaseTools/= Source/Python/Common/RangeExpression.py index 35b35e4893bc..a37d0ca70d87 100644 --- a/BaseTools/Source/Python/Common/RangeExpression.py +++ b/BaseTools/Source/Python/Common/RangeExpression.py @@ -16,7 +16,7 @@ from Common.GlobalData import * from CommonDataClass.Exceptions import BadExpression from CommonDataClass.Exceptions import WrnExpression import uuid -from Common.Expression import PcdPattern +from Common.Expression import PcdPattern,BaseExpression from Common.DataType import * =20 ERR_STRING_EXPR =3D 'This operator cannot be used in string expression: [%= s].' @@ -186,7 +186,7 @@ def GetOperatorObject(Operator): else: raise BadExpression("Bad Operator") =20 -class RangeExpression(object): +class RangeExpression(BaseExpression): # Logical operator mapping LogicalOperators =3D { '&&' : 'and', '||' : 'or', @@ -347,6 +347,7 @@ class RangeExpression(object): =20 =20 def __init__(self, Expression, PcdDataType, SymbolTable =3D {}): + super(RangeExpression, self).__init__(self, Expression, PcdDataTyp= e, SymbolTable) self._NoProcess =3D False if type(Expression) !=3D type(''): self._Expr =3D Expression @@ -693,25 +694,3 @@ class RangeExpression(object): raise BadExpression(ERR_OPERATOR_UNSUPPORT % OpToken) self._Token =3D OpToken return OpToken - - # Check if current token matches the operators given from OpList - def _IsOperator(self, OpList): - Idx =3D self._Idx - self._GetOperator() - if self._Token in OpList: - if self._Token in self.LogicalOperators: - self._Token =3D self.LogicalOperators[self._Token] - return True - self._Idx =3D Idx - return False - - - - - - - - - - -# UTRangeList() --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 01:29:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524868538416256.56312422532596; Fri, 27 Apr 2018 15:35:38 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3C900207DF47F; Fri, 27 Apr 2018 15:33:11 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7902A2279CF07 for ; Fri, 27 Apr 2018 15:33:03 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:03 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:33:01 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252898" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 27 Apr 2018 15:32:56 -0700 Message-Id: <7054250a55c4d83d0ca4962c37a83646170d495d.1524868035.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 42/42] BaseTools: use set instead of list X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" as we only do membership (in) testing for this, set is better Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/Common/Expression.py | 68 ++++++++++---------- BaseTools/Source/Python/Common/RangeExpression.py | 14 ++-- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Sourc= e/Python/Common/Expression.py index b5f76d860773..de691ccaa612 100644 --- a/BaseTools/Source/Python/Common/Expression.py +++ b/BaseTools/Source/Python/Common/Expression.py @@ -171,7 +171,7 @@ def ReplaceExprMacro(String, Macros, ExceptionList =3D = None): RetStr +=3D '0' elif not InQuote: Tklst =3D RetStr.split() - if Tklst and Tklst[-1] in ['IN', 'in'] and ExceptionList a= nd Macro not in ExceptionList: + if Tklst and Tklst[-1] in {'IN', 'in'} and ExceptionList a= nd Macro not in ExceptionList: raise BadExpression(ERR_IN_OPERAND) # Make sure the macro in exception list is encapsulated by= double quote # For example: DEFINE ARCH =3D IA32 X64 @@ -243,10 +243,10 @@ class ValueExpression(BaseExpression): def Eval(Operator, Oprand1, Oprand2 =3D None): WrnExp =3D None =20 - if Operator not in ["=3D=3D", "!=3D", ">=3D", "<=3D", ">", "<", "i= n", "not in"] and \ + if Operator not in {"=3D=3D", "!=3D", ">=3D", "<=3D", ">", "<", "i= n", "not in"} and \ (type(Oprand1) =3D=3D type('') or type(Oprand2) =3D=3D type(''= )): raise BadExpression(ERR_STRING_EXPR % Operator) - if Operator in ['in', 'not in']: + if Operator in {'in', 'not in'}: if type(Oprand1) !=3D type(''): Oprand1 =3D IntToStr(Oprand1) if type(Oprand2) !=3D type(''): @@ -259,19 +259,19 @@ class ValueExpression(BaseExpression): } =20 EvalStr =3D '' - if Operator in ["!", "NOT", "not"]: + if Operator in {"!", "NOT", "not"}: if type(Oprand1) =3D=3D type(''): raise BadExpression(ERR_STRING_EXPR % Operator) EvalStr =3D 'not Oprand1' - elif Operator in ["~"]: + elif Operator in {"~"}: if type(Oprand1) =3D=3D type(''): raise BadExpression(ERR_STRING_EXPR % Operator) EvalStr =3D '~ Oprand1' else: - if Operator in ["+", "-"] and (type(True) in [type(Oprand1), t= ype(Oprand2)]): + if Operator in {"+", "-"} and (type(True) in {type(Oprand1), t= ype(Oprand2)}): # Boolean in '+'/'-' will be evaluated but raise warning WrnExp =3D WrnExpression(WRN_BOOL_EXPR) - elif type('') in [type(Oprand1), type(Oprand2)] and type(Opran= d1)!=3D type(Oprand2): + elif type('') in {type(Oprand1), type(Oprand2)} and type(Opran= d1)!=3D type(Oprand2): # =3D=3D between string and number/boolean will always ret= urn False, !=3D return True if Operator =3D=3D "=3D=3D": WrnExp =3D WrnExpression(WRN_EQCMP_STR_OTHERS) @@ -284,10 +284,10 @@ class ValueExpression(BaseExpression): else: raise BadExpression(ERR_RELCMP_STR_OTHERS % Operator) elif TypeDict[type(Oprand1)] !=3D TypeDict[type(Oprand2)]: - if Operator in ["=3D=3D", "!=3D", ">=3D", "<=3D", ">", "<"= ] and set((TypeDict[type(Oprand1)], TypeDict[type(Oprand2)])) =3D=3D set((T= ypeDict[type(True)], TypeDict[type(0)])): + if Operator in {"=3D=3D", "!=3D", ">=3D", "<=3D", ">", "<"= } and set((TypeDict[type(Oprand1)], TypeDict[type(Oprand2)])) =3D=3D set((T= ypeDict[type(True)], TypeDict[type(0)])): # comparison between number and boolean is allowed pass - elif Operator in ['&', '|', '^', "and", "or"] and set((Typ= eDict[type(Oprand1)], TypeDict[type(Oprand2)])) =3D=3D set((TypeDict[type(T= rue)], TypeDict[type(0)])): + elif Operator in {'&', '|', '^', "and", "or"} and set((Typ= eDict[type(Oprand1)], TypeDict[type(Oprand2)])) =3D=3D set((TypeDict[type(T= rue)], TypeDict[type(0)])): # bitwise and logical operation between number and boo= lean is allowed pass else: @@ -310,7 +310,7 @@ class ValueExpression(BaseExpression): except Exception, Excpt: raise BadExpression(str(Excpt)) =20 - if Operator in ['and', 'or']: + if Operator in {'and', 'or'}: if Val: Val =3D True else: @@ -410,13 +410,13 @@ class ValueExpression(BaseExpression): =20 # Template function to parse binary operators which have same preceden= ce # Expr [Operator Expr]* - def _ExprFuncTemplate(self, EvalFunc, OpLst): + def _ExprFuncTemplate(self, EvalFunc, OpSet): Val =3D EvalFunc() - while self._IsOperator(OpLst): + while self._IsOperator(OpSet): Op =3D self._Token if Op =3D=3D '?': Val2 =3D EvalFunc() - if self._IsOperator(':'): + if self._IsOperator({':'}): Val3 =3D EvalFunc() if Val: Val =3D Val2 @@ -431,35 +431,35 @@ class ValueExpression(BaseExpression): return Val # A [? B]* def _ConExpr(self): - return self._ExprFuncTemplate(self._OrExpr, ['?', ':']) + return self._ExprFuncTemplate(self._OrExpr, {'?', ':'}) =20 # A [|| B]* def _OrExpr(self): - return self._ExprFuncTemplate(self._AndExpr, ["OR", "or", "||"]) + return self._ExprFuncTemplate(self._AndExpr, {"OR", "or", "||"}) =20 # A [&& B]* def _AndExpr(self): - return self._ExprFuncTemplate(self._BitOr, ["AND", "and", "&&"]) + return self._ExprFuncTemplate(self._BitOr, {"AND", "and", "&&"}) =20 # A [ | B]* def _BitOr(self): - return self._ExprFuncTemplate(self._BitXor, ["|"]) + return self._ExprFuncTemplate(self._BitXor, {"|"}) =20 # A [ ^ B]* def _BitXor(self): - return self._ExprFuncTemplate(self._BitAnd, ["XOR", "xor", "^"]) + return self._ExprFuncTemplate(self._BitAnd, {"XOR", "xor", "^"}) =20 # A [ & B]* def _BitAnd(self): - return self._ExprFuncTemplate(self._EqExpr, ["&"]) + return self._ExprFuncTemplate(self._EqExpr, {"&"}) =20 # A [ =3D=3D B]* def _EqExpr(self): Val =3D self._RelExpr() - while self._IsOperator(["=3D=3D", "!=3D", "EQ", "NE", "IN", "in", = "!", "NOT", "not"]): + while self._IsOperator({"=3D=3D", "!=3D", "EQ", "NE", "IN", "in", = "!", "NOT", "not"}): Op =3D self._Token - if Op in ["!", "NOT", "not"]: - if not self._IsOperator(["IN", "in"]): + if Op in {"!", "NOT", "not"}: + if not self._IsOperator({"IN", "in"}): raise BadExpression(ERR_REL_NOT_IN) Op +=3D ' ' + self._Token try: @@ -471,29 +471,29 @@ class ValueExpression(BaseExpression): =20 # A [ > B]* def _RelExpr(self): - return self._ExprFuncTemplate(self._ShiftExpr, ["<=3D", ">=3D", "<= ", ">", "LE", "GE", "LT", "GT"]) + return self._ExprFuncTemplate(self._ShiftExpr, {"<=3D", ">=3D", "<= ", ">", "LE", "GE", "LT", "GT"}) =20 def _ShiftExpr(self): - return self._ExprFuncTemplate(self._AddExpr, ["<<", ">>"]) + return self._ExprFuncTemplate(self._AddExpr, {"<<", ">>"}) =20 # A [ + B]* def _AddExpr(self): - return self._ExprFuncTemplate(self._MulExpr, ["+", "-"]) + return self._ExprFuncTemplate(self._MulExpr, {"+", "-"}) =20 # A [ * B]* def _MulExpr(self): - return self._ExprFuncTemplate(self._UnaryExpr, ["*", "/", "%"]) + return self._ExprFuncTemplate(self._UnaryExpr, {"*", "/", "%"}) =20 # [!]*A def _UnaryExpr(self): - if self._IsOperator(["!", "NOT", "not"]): + if self._IsOperator({"!", "NOT", "not"}): Val =3D self._UnaryExpr() try: return self.Eval('not', Val) except WrnExpression, Warn: self._WarnExcept =3D Warn return Warn.result - if self._IsOperator(["~"]): + if self._IsOperator({"~"}): Val =3D self._UnaryExpr() try: return self.Eval('~', Val) @@ -531,7 +531,7 @@ class ValueExpression(BaseExpression): if self._Token.startswith('"') or self._Token.startswith('L"'): Flag =3D 0 for Index in range(len(self._Token)): - if self._Token[Index] in ['"']: + if self._Token[Index] in {'"'}: if self._Token[Index - 1] =3D=3D '\\': continue Flag +=3D 1 @@ -540,7 +540,7 @@ class ValueExpression(BaseExpression): if self._Token.startswith("'") or self._Token.startswith("L'"): Flag =3D 0 for Index in range(len(self._Token)): - if self._Token[Index] in ["'"]: + if self._Token[Index] in {"'"}: if self._Token[Index - 1] =3D=3D '\\': continue Flag +=3D 1 @@ -645,9 +645,9 @@ class ValueExpression(BaseExpression): =20 if self._Token.startswith('"'): self._Token =3D self._Token[1:-1] - elif self._Token in ["FALSE", "false", "False"]: + elif self._Token in {"FALSE", "false", "False"}: self._Token =3D False - elif self._Token in ["TRUE", "true", "True"]: + elif self._Token in {"TRUE", "true", "True"}: self._Token =3D True else: self.__IsNumberToken() @@ -841,7 +841,7 @@ class ValueExpressionEx(ValueExpression): elif Item.startswith(TAB_UINT64): ItemSize =3D 8 ValueType =3D TAB_UINT64 - elif Item[0] in ['"',"'",'L']: + elif Item[0] in {'"',"'",'L'}: ItemSize =3D 0 ValueType =3D TAB_VOID else: @@ -998,7 +998,7 @@ class ValueExpressionEx(ValueExpression): Item =3D '0x%x' % TmpValue if type(TmpValu= e) !=3D type('') else TmpValue if ItemSize =3D=3D 0: ItemValue, ItemSize =3D ParseFieldValu= e(Item) - if Item[0] not in ['"','L','{'] and It= emSize > 1: + if Item[0] not in {'"','L','{'} and It= emSize > 1: raise BadExpression("Byte array n= umber %s should less than 0xFF." % Item) else: ItemValue =3D ParseFieldValue(Item)[0] diff --git a/BaseTools/Source/Python/Common/RangeExpression.py b/BaseTools/= Source/Python/Common/RangeExpression.py index a37d0ca70d87..53bb11b8cc9b 100644 --- a/BaseTools/Source/Python/Common/RangeExpression.py +++ b/BaseTools/Source/Python/Common/RangeExpression.py @@ -416,9 +416,9 @@ class RangeExpression(BaseExpression): =20 # Template function to parse binary operators which have same preceden= ce # Expr [Operator Expr]* - def _ExprFuncTemplate(self, EvalFunc, OpLst): + def _ExprFuncTemplate(self, EvalFunc, OpSet): Val =3D EvalFunc() - while self._IsOperator(OpLst): + while self._IsOperator(OpSet): Op =3D self._Token try: Val =3D self.Eval(Op, Val, EvalFunc()) @@ -429,18 +429,18 @@ class RangeExpression(BaseExpression): =20 # A [|| B]* def _OrExpr(self): - return self._ExprFuncTemplate(self._AndExpr, ["OR", "or"]) + return self._ExprFuncTemplate(self._AndExpr, {"OR", "or"}) =20 # A [&& B]* def _AndExpr(self): - return self._ExprFuncTemplate(self._NeExpr, ["AND", "and"]) + return self._ExprFuncTemplate(self._NeExpr, {"AND", "and"}) =20 def _NeExpr(self): Val =3D self._RelExpr() - while self._IsOperator([ "!=3D", "NOT", "not"]): + while self._IsOperator({"!=3D", "NOT", "not"}): Op =3D self._Token if Op in ["!", "NOT", "not"]: - if not self._IsOperator(["IN", "in"]): + if not self._IsOperator({"IN", "in"}): raise BadExpression(ERR_REL_NOT_IN) Op +=3D ' ' + self._Token try: @@ -452,7 +452,7 @@ class RangeExpression(BaseExpression): =20 # [!]*A def _RelExpr(self): - if self._IsOperator(["NOT" , "LE", "GE", "LT", "GT", "EQ", "XOR"]): + if self._IsOperator({"NOT" , "LE", "GE", "LT", "GT", "EQ", "XOR"}): Token =3D self._Token Val =3D self._NeExpr() try: --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel